Skip to content

feat(ADBLABS-182): Chromatic effect on hover - #127

Open
luisSilvaEs wants to merge 2 commits into
mainfrom
feat/chromatic-effect-on-hover
Open

luisSilvaEs wants to merge 2 commits into
mainfrom
feat/chromatic-effect-on-hover

Conversation

@luisSilvaEs

Copy link
Copy Markdown
Collaborator

Summary of changes

  • Add a cursor-driven chromatic aberration effect on hero and grid-item hover, ported from Randy's CodePen demo approved by Clement
  • Add lazy WebGL mount/unmount via IntersectionObserver so a long content grid never holds more live WebGL contexts than are near the viewport
  • Add a fine-pointer + WebGL feature gate so the effect never runs on touch/mobile devices and degrades to the plain image when unsupported (progressive enhancement)
  • Add a decorative canvas that crossfades over the real <img> on hover instead of replacing it, so alt text and the accessibility tree stay untouched
  • Apply the effect to video cards as well as standard cards; the existing play-icon z-index already keeps it above the canvas, so no extra layout work was needed

Relevant Links

Test URLs:

Checklist

  • This PR has visual changes, and has been reviewed by a designer.
  • This PR has code changes, and our linters still pass.
  • This PR has new code, so new tests were added or updated, and they pass.
  • This PR affects production code, so it was browser tested (see below).

Validation

  1. Make sure all PR checks have passed.
  2. Pull down the branch and run locally or view on the PR testing link.
  3. Verify the implementation against the design and story requirements.

Validation steps

  • When hovering over a hero block or grid item, the image has a chromatic distortion that follows the cursor.
  • The chromatic distortion is not loaded if the device doesn't have a pointer.
  • Performance with a full grid of items has been tested.
  • Never runs on mobile.
  • Browser support investigated and considered. Should be considered a progressive enhancement and grid functions without the effect if it is not supported.
  • Content grid items maintain their accessibility and semantics, including how they appear in the accessibility tree.
  • Video cards (play-icon overlay) still show the play icon clearly above the hover effect.
  • Effect respects prefers-reduced-motion (dampened, not fully disabled) — confirm this matches expectations.
  • Effect intensity on low-detail/smooth thumbnails reads as acceptable (it's noticeably subtler there than on high-contrast images).

Browser Testing

We should aim to support the latest version of the listed browsers. For older versions or other browsers not on the list, content should be accessible, even if it doesn't completely match the designs.

Developers should test as they work in the browsers available on their machines. If they have access to other devices to test other browser/OS combinations, they should do that when possible.

Blocks and pages should undergo comprehensive testing to ensure they work as expected in real-use scenarios. Standard testing during pre-production should include at least these browsers.

  • Firefox
  • Chrome
  • Safari

Dark mode and light mode

Most pages support both dark and light mode, based on prefers-color-scheme.
Changes that affect the frontend should support both color schemes.

  • Frontend changes have been tested in both light mode and dark mode.

… hover, using a lazily-mounted WebGL canvas gated to fine-pointer devices for progressive enhancement and performance.
…unted WebGL canvas gated to fine-pointer devices.
@aem-code-sync

aem-code-sync Bot commented Oct 2, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Oct 2, 2026

Copy link
Copy Markdown
Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

This branch was successfully deployed

1 active deployment
feat/chromatic-effect-on-hover — 28193c6e Deployed Oct 2, 2026 by aem-code-sync[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant