Loading video...

Video Failed to Load

Go Home

Future CSS Tip! ๐Ÿ You can create that Apple style blow out text effect with CSS scroll-driven animations โšก๏ธ No JavaScript! The trick is to animate SVG text along the z-axis using 3D transforms ๐Ÿ‘€ .word { animation: blow-out both ease-in; animation-timeline: --section; ๐Ÿ‘ˆ animation-range: exit-crossing 10% exit 0%;...

348,255 views โ€ข 2 years ago โ€ขvia X (Twitter)

10 Comments

jhey โ–ฒ๐Ÿป๐ŸŽˆ's profile picture
jhey โ–ฒ๐Ÿป๐ŸŽˆ2 years ago

Here's that @CodePen link! ๐Ÿš€ Remember, you'll need to be in Chrome to see this in action ๐Ÿค™ But, I can totally put together a GSAP ScrollTrigger version for you if you need it โœจ

erikyo's profile picture
erikyo2 years ago

@jhey, how about this one, do you like it? (1,2,3 counter version)

jhey โ–ฒ๐Ÿป๐ŸŽˆ's profile picture
jhey โ–ฒ๐Ÿป๐ŸŽˆ2 years ago

@jhey Nice! ๐Ÿค™

Tracy King's profile picture
Tracy King2 years ago

Super cool! Thank you ๐Ÿ‘

jhey โ–ฒ๐Ÿป๐ŸŽˆ's profile picture
jhey โ–ฒ๐Ÿป๐ŸŽˆ2 years ago

No worries Tracy! ๐Ÿค™

Simon Ramsay ๐Ÿš€ ๐Ÿงžโ€โ™‚๏ธ ๐•ฉ's profile picture
Simon Ramsay ๐Ÿš€ ๐Ÿงžโ€โ™‚๏ธ ๐•ฉ2 years ago

As cool as this is, this is way off? Safari and mobile Safari, 20% + and sight of implementation on Can I use. Gotta start playing around all the same.

jhey โ–ฒ๐Ÿป๐ŸŽˆ's profile picture
jhey โ–ฒ๐Ÿป๐ŸŽˆ2 years ago

Chicken and Egg right there ๐Ÿฃ

Erique Rocha's profile picture
Erique Rocha2 years ago

@dev_andressa

Kelvin Ohemeng's profile picture
Kelvin Ohemeng2 years ago

You are a css god at this point, my question is why not use gsap?๐Ÿค”, it'd be easier don't you think .๐Ÿ˜…

jhey โ–ฒ๐Ÿป๐ŸŽˆ's profile picture
jhey โ–ฒ๐Ÿป๐ŸŽˆ2 years ago

@K_DesignBox Haha โ€“ I wouldn't go that far. Erm, personally I think this way is easier. I could bring in ScrollTrigger to do it. But, then I need to add a JavaScript dependency. The only thing missing in the CSS only approach is the `scrub` property which is very useful ๐Ÿ’ฏ

Related Videos

CSS Tip! ๐Ÿณ You can add little details like this scale down on scroll effect with scroll-driven animations and some sticky positioning ๐Ÿค™ section { animation: scale-down; animation-timeline: view(); animation-range: exit; } @โ€‹keyframes scale-down { to { scale 0.8; } ] In this smaller example, you can lean into using the position to drive an animation that scales itself down as it leaves the viewport (Seen on the Apple Vision Pro site ๐Ÿ) The nice thing here is that if you don't have scroll-driven animations, the user still gets a good experience โœจ So how do you do it? There isn't much to it header { transform-origin: 50% 0%; animation: scale-down both ease-in; animation-timeline: view(); animation-range: exit; view-timeline: --header; } @โ€‹keyframes scale-down { to { scale: 0.8 0.8; } } That's it. The layout makes use of position: sticky so that the element stays in the shot whilst you scroll the page. As it leaves the page, it scales down inside the ๐Ÿซถ The other smol animation here is fading the overlay on the video out ๐Ÿ˜Ž Real easy. You may notice the view-timeline you defined above for the ๐Ÿ‘€ header { view-timeline: --header; } You have a pseudoelement on the text content of the header that lives inside a header > section::before { background: hsl(0 0% 0% / 0.75); opacity: 1; animation: fade both linear; animation-timeline: --header; animation-range: exit-crossing 0% exit 0%; } @โ€‹keyframes fade { to { opacity: 0; } } You use a slightly smaller range on this with exit-crossing to fade it out before you start the scale down animation ๐Ÿค That's it! Thought this smaller example would be easier to grok for people ๐Ÿ™ It's also covered with JavaScript if you really want it for your sites ๐Ÿค™ CodePen.IO link below ๐Ÿ‘‡

jhey ส•โ€ขแดฅโ€ขส”

146,064 views โ€ข 2 years ago

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 ส•โ€ขแดฅโ€ขส”

232,131 views โ€ข 2 years ago