Skip to content

Commit 210939d

Browse files
committed
@ Banner: drop transition:name to stop alpha bleed mid cross-fade
Pinned-state nav still flashed the list items through the banner for a moment. Cause: banner-wrap had transition:name="banner", which lifts it out of the root view-transition snapshot. The root pseudo then captures the banner-region with whatever sat *behind* the banner in DOM order — the list items. During the cross-fade both pseudos hit ~50% alpha together; you see the half-transparent banner over the half-transparent list items, exposing what the opaque banner normally hides. Removing the name keeps banner inside root, so the snapshot is a flat raster of the actual stacking (banner on top of list, header on top of banner). The whole image fades as one unit — no layered half-alphas overlap, no bleed-through. The original reason for the name was to dodge the column morph, but that was already neutralized by removing transition:name from .column. Stage keeps its name (canvas continuity).
1 parent 263f875 commit 210939d

1 file changed

Lines changed: 19 additions & 23 deletions

File tree

src/pages/index.astro

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,25 @@ const BANNER_H = 120;
6262
<p class="sub enter" style="--i: 1;">SUNKEN KEEP / 保持沉没</p>
6363
</header>
6464

65-
{/* No `.enter` class on the banner-wrap. The fade-in is purely
66-
cosmetic and its `animation-fill-mode: both` initial frame
67-
(opacity: 0) can strand the banner invisible if the timeline
68-
ever gets paused or stalls — view transitions on SPA nav back
69-
from a sketch can do that intermittently, even after init's
70-
classList.remove('enter') would normally fire. Skipping the
71-
animation entirely on the banner removes the race; h1 / .sub /
72-
list items still get their .enter staggered reveal.
73-
74-
transition:name lifts the banner out of the column's view
75-
transition. The column has its own name and morphs between
76-
OLD/NEW bboxes — when scrolled, OLD column is much taller than
77-
NEW (sketch pages have less content), so its descendants get
78-
positioned by *relative offset* during the morph. A pinned
79-
banner at scrollY=1000 lives at ~21% down the OLD column;
80-
scaled into NEW's ~1500px column it lands at viewport y=315 —
81-
the "big downward drop + fade" the user saw on nav. With its
82-
own transition name the banner gets an independent pseudo
83-
anchored to its current bbox, so it just fades from where it
84-
sits. The further scrolled (= higher % in OLD column), the
85-
bigger the drop without this — explains why amplitude tracks
86-
scroll position. */}
87-
<div class="banner-wrap" style={`--banner-h: ${BANNER_H}px;`} transition:name="banner">
65+
{/* No `.enter` class on the banner-wrap. The fade-in's initial
66+
keyframe (opacity: 0 with animation-fill-mode: both) can strand
67+
the banner invisible if the timeline ever pauses or stalls —
68+
view transitions on SPA nav back from a sketch can do that
69+
intermittently, even with init's classList.remove('enter')
70+
firing synchronously. Dropping the class entirely removes the
71+
race; h1 / .sub / list items still get their staggered reveal.
72+
73+
Also no transition:name on banner-wrap. With a name, the
74+
banner becomes its own view-transition pseudo, lifted out of
75+
the root snapshot. During the cross-fade that means the
76+
banner's pseudo (50% alpha mid-fade) and the root pseudo (also
77+
50%, with the banner-region now showing list items beneath
78+
because banner was extracted) overlap — you see the list
79+
items through the half-transparent banner. Keeping the banner
80+
in the root snapshot bakes the layering into a single flat
81+
image, so banner / header text / list pixels fade together
82+
as one unit and nothing peeks through. */}
83+
<div class="banner-wrap" style={`--banner-h: ${BANNER_H}px;`}>
8884
<CineBanner
8985
sources={["/banner/lobby/lamp.mp4"]}
9086
height={BANNER_H}

0 commit comments

Comments
 (0)