Skip navigation
Not many lines for a CSS parallax effect either 🤙
0:00 / 0:43

Not many lines for a CSS parallax effect either 🤙

jhey ʕ•ᴥ•ʔ

@jh3yy148K followers

Visit on X
2,715 likesDownloadOriginal post

275,024 views

Not many lines for a CSS parallax effect either 🤙 ul { scroll-padding-inline: calc(50% - var(-card) * 0.5); } img { animation: para; animation-timeline: --item; } @​keyframes para { cover 100% { translate: calc(100% - var(--card)) -50%; }}

11 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Love a little challenge like these when they pop up on the timeline 🤓 Of course, a few more lines are needed in total but these are the main parts of getting it working 🤙 --item is an inline view timeline on the parent li { view-timeline: --item inline; }

    19 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's the @CodePen link! 🚀 Chrome for now but I can add a little GSAP to cover if you need it 🤙 Big fan of this scroll-padding-inline trick though 🏅

    78 likes

  • Prince's profile picture

    @PHojiwala

    not working, can you send full codepen link?

    4 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Yeah, I'll ping it in. Giving it a little update 🤙

    2 likes

  • Bimbi.sol ☥'s profile picture

    @sebasbimbi

    Brother your css skills are next level 🤯🤯🤯 learninng everyday with your content, huge thanks

    3 likes

  • Mr Bird's profile picture

    @mrbirddev

    This is gorgeous

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Thanks! Tonight's Sudoku 😄

    1 like

  • David ▲● ◻️⁾⁾⁾'s profile picture

    @dmerms

    I feel like a successful YouTube channel could be doing the same UI in CSS Swift UI and Jetpack Compose UI.

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Yeah – I need to invest some time in the YouTube channel again 💯

    1 like

  • Rohit Gupta's profile picture

    @whyrohitwhy

    This one looks super cool! Not less, not too much. Thanks for sharing sir 🫡🙌

    2 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Thanks Rohit 🤙

    1 like