Skip navigation
Future CSS Tip! 🔮 You can power micro-interactions with scroll driven animations 😎 Define a range…
0:00 / 0:23

Future CSS Tip! 🔮 You can power micro-interactions with scroll driven animations 😎 Define a range…

jhey ʕ•ᴥ•ʔ

@jh3yy149K followers

Visit on X
1,329 likesDownloadOriginal post

147,116 views

Future CSS Tip! 🔮 You can power micro-interactions with scroll driven animations 😎 Define a range with custom props and hook up to body scroll 📜 .avatar{ animation:shrink; animation-timeline:scroll(root); animation-range:calc(var(--head)*0.9) ...; } CodePen.IO link below! 👇

10 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's that @CodePen link! 🚀 Remember. Only in Chrome Canary for now 🥲 Some of that calc above is obfuscated. If you have an idea of the size of things in your header, it's not too bad working out when things should start moving ✨

    43 likes

  • Florin Pop 👨🏻‍💻's profile picture

    @florinpop1705

    @CodePen Just wondering… how many projects do you pop out a day? 😆 You’re on fire my friend!

    3 likes

  • ishmam's profile picture

    @ishmamx

    @CodePen epic! this site’s header button hover effect is pretty cool. in case you ever make a pen for it 🥺

    3 likes

  • Marc Boschma's profile picture

    @boschma

    @CodePen It would be really cool if your avatar turned to face the read as it recedes 🤓

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    @CodePen What a great idea! Can totally do that too! Thanks Marc 🙏

    1 like

  • Softserve Digital Development's profile picture

    @SoftserveZa

    @CodePen @mr_papoutsis

    1 like

  • Fajar Siddiq's profile picture

    @fajarsiddiqFS

    @CodePen this is cool @joshmanders

    1 like

  • Artur Bień's profile picture

    @artur_bien

    @CodePen Its not smooth tho. Kinda jumps in a weird way 🤔

    1 like

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    @CodePen Yeah, this is one of my current gripes with the API 😕 Smooth scrubbing is basically limited to a trackpad. Using an input device like a mouse is really hard to get smooth. I'll still be reaching for GreenSock in most cases unless things like that are improved 💯

    2 likes

  • kehinde.code's profile picture

    @thisKehinde

    @CodePen Future is here.