Skip navigation
Future CSS Tip! 📜 You can create these landing page effects with CSS scroll-driven animations and…
0:00 / 0:56

Future CSS Tip! 📜 You can create these landing page effects with CSS scroll-driven animations and…

jhey ʕ•ᴥ•ʔ

@jh3yy149K followers

Visit on X
2,635 likesDownloadOriginal post

427,025 views

Future CSS Tip! 📜 You can create these landing page effects with CSS scroll-driven animations and zero JavaScript 🔥 Blurred text on exit? 👀 @​keyframes fade { to { opacity: 0; filter: blur(2rem); } } h2 { animation: fade; animation-timeline: view(); animation-range: cover 40% cover 85%; } Lots of treats in this one! ✨ How about the circular shape on scroll? That's an animated clip-path 😮 @​keyframes unclip { to { clip-path: ellipse(220% 200% at 50% 175%); } } Create a clip-path with a large size that's offset vertically. On scroll, animate it in ⭐️ .content { clip-path: ellipse(220% 200% at 50% 300%); animation: unclip both linear; animation-timeline: --article; animation-range: entry; } That second section combines unclipping with scaling down an image at the same time 🤓 Using the same animation-timeline 🫶 @​keyframes scale-down { 0% { scale: 5; } } img { animation: scale-down; animation-timeline: --article; 👈 animation-range: entry; } Every section gets a scoped view-timeline of --article. That's scoped so we can reuse it for all the animations we need 🙌 article { view-timeline-name: --article; } Honestly, the more you play with this stuff, the more tricks you will find 💯 And it also makes you think "Wow! CSS can do this!" As always, CodePen.IO link below! 👇

9 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's that @CodePen link! 🚀 You need to be in Chrome to see this in action 🥲 Will aim to create a polyfilled version using GSAP ScrollTrigger. Threw this together pretty quick/rough 😅

    71 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Will probably need to break this one down into mini posts for the different techniques going on here 🤔 It's mainly tricks with position: fixed and scoped view-timeline ⭐️

    16 likes

  • Billy191 🔴✨'s profile picture

    @billy191

    Any implementation with @tailwindcss “

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    @tailwindcss Could totally throw one together. Will require some configured classes for the animation-timeline related properties, etc. Perhaps doing it in Tailwind play would be a good option 🤙

    2 likes

  • THIRDOCTAV's profile picture

    @THIRDOCTAV

    Make a video of this. Its 🔥🔥🔥

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Will do! This is the push I needed 🙏 Will do a walkthrough of how the different pieces work

    4 likes

  • Nine's profile picture

    @ninecodes_

    When can we expect a lot of these features to be stable in the future? Is it rather far away or let's say 1-2 years

    1 like

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    @abuzackariyya It shouldn't be too far away, there is intent from other browser engines 🙌 But, I'll update the demo so it can be used with GreenSock too 🤙

    1 like

  • busta's profile picture

    @design_factory

    looks amazing. when can stuff like this be available in Safari u think?

    1 like