Skip navigation
Future CSS Tip! 🔮 You can create sweet scroll-driven micro-interactions using CSS scroll-driven…
0:00 / 0:41

Future CSS Tip! 🔮 You can create sweet scroll-driven micro-interactions using CSS scroll-driven…

jhey ʕ•ᴥ•ʔ

@jh3yy148K followers

Visit on X
5,763 likesDownloadOriginal post

685,968 views

Future CSS Tip! 🔮 You can create sweet scroll-driven micro-interactions using CSS scroll-driven animations 😎 .avatar { animation: scale-down; animation-timeline: scroll(); animation-range: var(--header-range); } @ keyframes scale-down { to { scale: 0.3; } } What's happening in this one? 👀 1. Avatar moves and scales down as the header sticks 2. Name changes color and slides over 3. Header darkens to give the text contrast 4. Header gets a shadow 5. Notice the avatar scrub too! 👀 It's scroll-driving the sprite animation technique we went over earlier in the week ✨ So much fun! ✨ Could even tie in the new easings from earlier too! CodePen.IO link below! 👇

10 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's that @CodePen link! 🚀 Hop into Chrome 115+ and take it for a spin 🤙

    180 likes

  • Taeho's profile picture

    @mcwhopper63

    Did you come up with this? This is mind blowing since I’m just getting used to parent child relationships. Def gonna try this out!

    7 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Yeah, it's a combination of a couple of demos I built last year for speaking at conferences ✨ Fun part was filming myself for the image 😅

    11 likes

  • Alex Hall's profile picture

    @ahallicks

    This looks so cool! I've got a slight issue on Chrome Android where the background image is halfway across the page. Definitely going to be having a play with this!

    4 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Ahh – Thanks for pointing this out Alex 🙏 I think I've fixed it 🤞 Needed to set some max-widths, etc. Glad you like it!

    7 likes

  • Rob DiMarzo's profile picture

    @robdimarzo

    I'm out here lookin at your css like

    4 likes

  • Jesse Schoberg's profile picture

    @JesseSchoberg

    Well done 🫡

    3 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Thanks Jesse 🙏

    2 likes

  • Art San Diego's profile picture

    @_artsandiego

    Nooice 🔥

    3 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    @artsnux 🙏🙏

    1 like