Video yükleniyor...
Video Yüklenemedi
CSS text reveal on scroll 📜 <span style="--start: 210; --end: 280;">details</span> span { animation: reveal; animation-timeline: --section; animation-range: contain calc(var(--start) * 1px) contain calc(var(--end) * 1px); } @keyframes reveal { 0% { opacity: 0.2; }}
165,462 görüntüleme • 2 yıl önce •via X (Twitter)
10 Yorum

The trick here is using some JavaScript to calculate the "Pixels per character" for the scroll animation 😎 You could do that in a server component or at build time by splitting the text and setting a "Pixels per character" value 🤙

The neat trick here is making the "Pixels per character" part dynamic and inlining that as a custom property too. Then you could update it for different size viewports 🚀

@GianPaneto

Wondow what @adamsilverhq would make of this 🤔

@adamsilverhq For motion prefs, I'd strip out the animation and sticky part. The text has to be split into separate words but is aria-hidden. Then you can duplicate the text with a screenreader version. Main thing here was to show how to build it as per request 🤙

Great

Looks great

Where is the code?

nice 🔥

its cool
