fix(story): nav title cross-fades scroll-driven as hero content exits viewport

Replaced IntersectionObserver (discrete threshold) with a scroll RAF loop
using getBoundingClientRect. Opacity is computed from the fraction of
.story-hero__content still visible above the viewport top — so the nav title
fades in gradually as the hero title slides off the top edge, reaching full
opacity only when the element is completely gone.

Removed CSS transition (no longer needed; per-frame JS update is smooth).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
2026-06-20 11:28:12 +02:00
parent f4ee63282b
commit cc341cc944
2 changed files with 25 additions and 10 deletions
-2
View File
@@ -1210,10 +1210,8 @@ body::after {
overflow: hidden;
text-overflow: ellipsis;
opacity: 0;
transition: opacity 0.35s ease;
pointer-events: none;
}
.story-nav-title.is-visible { opacity: 1; }
@media (max-width: 640px) { .story-nav-title { display: none; } }
/* ── Back to top pill ─────────────────────────────────────── */