Lenis smooth scroll wrapper + scroll-progress CSS var binding for marketing pages
⚠️ Marketing pages only
<SmoothScroll> wraps your page content
with Lenis momentum scrolling. It is automatically disabled on:
+page.svelte (marketing route)
<script>
import SmoothScroll from '$lib/showcase/scroll/SmoothScroll.svelte';
</script>
<SmoothScroll>
<HeroSection />
<FeatureSection />
<PricingSection />
</SmoothScroll>
Bind --scroll-progress (0–1) to any element and
drive progress bars, parallax depth, or opacity fades. Uses native ScrollTimeline when available (compositor thread),
falling back to motion scroll().
The blue bar at the top is driven by calc(var(--scroll-progress, 0) * 100%) — no JS in the style binding.
scrollProgress is a no-op under prefers-reduced-motion: reduce — the CSS var
stays at its initial value and no scroll listeners are attached.