Hero: slow zoom on the first photo without replacing the plain HTML
Continuous Integration / check (pull_request) Successful in 1m57s
Continuous Integration / build-test (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m0s
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / check (pull_request) Successful in 1m57s
Continuous Integration / build-test (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m0s
Continuous Integration / deploy-production (pull_request) Skipped
The plain HTML is painted at scale 1.06 and the slider zooms it out to 1 after hydration, like the other photos: same first frame (no CLS), and the LCP does not wait for hydration. Assumptions 15 and 16 recorded. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -164,11 +164,17 @@ function HeroFrame({ content, socials, regionHtml, hydrated }: FrameProps) {
|
||||
}, [firstPainted]);
|
||||
|
||||
// The first photo is hidden from screen readers while another one is on
|
||||
// top of it
|
||||
// top of it, and it zooms (data-zoom, see .cms-hero-image) while it is the
|
||||
// active one
|
||||
useEffect(() => {
|
||||
const picture = section.current?.querySelector('.cms-hero-picture');
|
||||
if (active === 0) picture?.removeAttribute('aria-hidden');
|
||||
else picture?.setAttribute('aria-hidden', 'true');
|
||||
if (active === 0) {
|
||||
picture?.removeAttribute('aria-hidden');
|
||||
picture?.setAttribute('data-zoom', '');
|
||||
} else {
|
||||
picture?.setAttribute('aria-hidden', 'true');
|
||||
picture?.removeAttribute('data-zoom');
|
||||
}
|
||||
}, [active]);
|
||||
|
||||
const loaded = firstPainted ? slidesToLoad(active, shown.length) : [active];
|
||||
|
||||
Reference in New Issue
Block a user