fix(carousel): eliminate banner "blink" on crossfade switch (#1010)#1318
Merged
Conversation
The hero/banner carousel used a symmetric opacity crossfade: on switch the outgoing slide faded 1->0 while the incoming faded 0->1 at the same time. Each slide is an opaque unit (black bg + cover image), so while both are semi-transparent mid-transition, up to ~25% of #main-carousel's bright magenta gradient backdrop bleeds through at the midpoint -- a visible pink/magenta "blink" when banners switch. Make the crossfade dip-free by splitting the transition: the incoming slide fades in over a still-opaque outgoing slide, which only snaps to 0 (0s change, delayed by the fade duration) after it's fully covered. An opaque slide always covers the backdrop, so there is zero bleed-through, while the 0.6s crossfade look is preserved. Reduced-motion still gets an instant cut. This is the residual half of #1010: the original 2022 report predated the Bootstrap->vanilla rewrite (#1288). The decode-lag trigger (huge undecoded images) was already fixed by server-side thumbnailing; this addresses the crossfade backdrop-bleed that the rewrite carried over. Verified with a headless-browser A/B at the transition midpoint: the old symmetric fade shows a magenta wash (mean RGB blue channel spikes ~+45); the new asymmetric fade shows a clean photo-to-photo blend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Fixes #1010 — the hero/banner carousel "blinks" (a pink/magenta flash) when switching between banners on multi-banner pages.
Root cause. The crossfade was symmetric: on switch, the outgoing slide faded
1→0while the incoming faded0→1simultaneously. Each slide is an opaque unit (black bg + cover image), so while both are semi-transparent mid-transition, up to ~25% of#main-carousel's bright magenta gradient backdrop bleeds through at the midpoint — the visible blink.Fix. Make the crossfade dip-free by splitting the transition (CSS only,
carousel_fade.css): the incoming slide fades in over a still-opaque outgoing slide, which only snaps to 0 (0schange, delayed by the fade duration) once it's fully covered. An opaque slide always covers the backdrop → zero bleed-through, while the 0.6s crossfade look is preserved. Reduced-motion still gets an instant cut.Context on #1010
The original 2022 report predates the Bootstrap→vanilla carousel rewrite (#1288). That rewrite already fixed the decode-lag trigger (huge undecoded images) via server-side thumbnailing; this PR addresses the crossfade backdrop-bleed that the rewrite carried over. So #1010 is now fully resolved.
Verification
Drove the real page (
/project/handsight, 3 banners) in a headless browser, slowed the crossfade to 2s, and screenshotted the exact transition midpoint under both the old and new CSS:(126, 92, 120)— blue channel spikes ~+45(120, 93, 75)— natural warm blendBefore / after (midpoint of the same banner switch)
Before (blink): attach
issue1010_before_blink.pngAfter (fixed): attach
issue1010_after_fixed.pngScope / risk
prefers-reduced-motionpath preserved (instant cut, no crossfade).carousel-fadecarousel (home, project gallery, project pages) — all benefit identically.Testing notes
I visually verified this works but not taking a video.