Skip navigation
the little details™ Use trigonometric functions in CSS to create a smooth staggered transition delay…
0:00 / 0:35

the little details™ Use trigonometric functions in CSS to create a smooth staggered transition delay…

jhey ʕ•ᴥ•ʔ

@jh3yy148K followers

Visit on X
5,400 likesDownloadOriginal post

540,033 views

the little details™ Use trigonometric functions in CSS to create a smooth staggered transition delay 🎬 .character { transition-delay: calc(sin((var(--index) / 12) * 45deg) * 0.475s); }

10 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's the @CodePen link if you want to check it out! 🤙 Thrown together in some React for convenience 🤓 Should extract into a <CodeReveal/> component 💯🧱

    47 likes

  • Charlotte 🦄🧚‍♀️'s profile picture

    @char_bone

    I'm going to just secretly put this into the app I'm working on and see if they notice 😄

    6 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Put it in the footer, no one looks there 👀😅

    2 likes

  • Gabe's profile picture

    @gauelcom

    Yeah, how do you get the —index variable? Thats the true magic here i cannot fanthom… cuz normally that would all be part of a javascript loop

    6 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Style it inline on the HTML <span class="digit" style="--index: 0;">1</span> <span class="digit" style="--index: 1;">9</span>

  • Charles Anim's profile picture

    @charlesanim499

    Show us the code

    3 likes

  • We Buy Once's profile picture

    @webuyonce

    Amazing stuff!

    3 likes

  • Roxana Muntian's profile picture

    @roxanamuntian

    Those animations are so cool! At some point, it almost felt like the eye blinked. 😊 I might add this animation to the app that I am working on. It's the next level for CSS!

    3 likes

  • SM Irving's profile picture

    @metric_dev

    Very smooth! I wrote something similar in Sass as a function that lets you call a bunch of different CSS custom timing-functions from different keywords, Penner equations and Trig stuff. This makes me want to modify or write a separate function that returns calc equations instead

    3 likes

  • Fonzy's profile picture

    @0xFonzy

    goated animations

    2 likes