Loading video...

Video Failed to Load

Go Home

curved scrollbar: completed it ✅ CSS + SVG to animate stroke-dashoffset combined with scroll-snap

229,909 views • 1 year ago •via X (Twitter)

12 Comments

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

p.s completed it last year 💀 but yesterday's gave it a little polish and some extra configuration options plus, a new trick where you animate the scroll-snap value which works surprisingly well

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

p.p.s the curved scrollbar concept isn't a new one first time seeing it was this great piece from @RoberaGeleta 👏

Anima's profile picture
Anima2 years ago

📢It is live! @figma design to @MUI_hq or @AntDesignUI "Whether your design is well organized or a bit chaotic, using standard components or none, Anima takes it all and translates it into high-quality #MUI or #AntDesign code."-->

dru's profile picture
dru1 year ago

Man, I love the twitter community. Looks awesome!

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

inspired me to give it a "glow up" ✨🙏

Aleks's profile picture
Aleks1 year ago

insane 🔥

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

whether we can find a practical use case or not for it is another matter 💀

Sab's profile picture
Sab1 year ago

Would you please what is this tool you are using!? (The window which has title: config)

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

tweakpane v4.0.4

Shahriar Shafin 𝕏's profile picture
Shahriar Shafin 𝕏1 year ago

Awesome 🌟. is it open source?

Jett's profile picture
Jett1 year ago

haven’t seen you on my TL for a min. Still the goat 🐐

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

trying to stay present – working on things in the background 👀

Related Videos

Future CSS Tip! 🍏 You can create this Apple-style photo scroller by combining CSS scroll-driven animations and CSS scroll-snap 😍 Peep those changing captions 👀 No JS! img { animation: highlight both linear; animation-timeline: view(inline); 👈 Horizontal animation-range: cover 0% cover 50%; 👈 Finish } @ keyframes highlight { 50% { translate: 0 0; scale: var(--starting-scale); 👈 props opacity: var(--starting-opacity); 👈 } 100% { translate: 0 0; scale: 1; opacity: 1; } } Without the animation support, you get a standard unordered list containing some s 🤙 How do we swap the captions though? The "trick" is to use position: absolute on the figcaption and animate their opacity based on the ViewTimeline of their parent list item 😎 figcaption { animation: show both linear; animation-timeline: --list-item; } @ keyframes show { 0%, 45%, 55%, 100% { opacity: 0; } 50% { opacity: 1; } } li { view-timeline-name: --list-item; view-timeline-axis: inline; 👈 important! } The parent of the scroll track uses position: relative so all the captions sit in the middle even though they are in the right place for the markup 🙌 The last bit is the scroll-snap 🤙 Not much to it at all. Wrap the list and make it scrollable. Then add scroll-snap-type .wrapper { scroll-snap-type: x mandatory; overflow-x: scroll; } Then make sure each list item has scroll-snap-align set on it li { scroll-snap-align: center; } That's it! Pretty cool demo to put together and see how to do this stuff with these APIs 🤓 A lot of cool little tricks to pick up for writing your CSS! ⭐️ CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

234,583 views • 3 years ago