Loading video...
Video Failed to Load
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 {... show more
232,131 views โข 2 years ago โขvia X (Twitter)
11 Comments

Here's that @CodePen link! ๐ You need to be in Chrome to see this in action ๐ But, how cool? CSS only list animations that could work as a progressive enhancement โจ If they aren't supported, your user still gets a good experience ๐

And here's the original piece of UI from the iPhone 15 Pro page ๐ค The CodePen demo isn't quite as "polished". But, it's proving the concept of what we can achieve ๐ฅ The iPhone page uses JavaScript to update the transform matrix of the images via inline styles as you scroll. Think if you mess with the timing a little, it could be spot-on in the CSS-only version ๐ฏ Maybe using some of the linear() stuff from recent weeks ๐ค

This guy makes me feel I didnโt learn CSS ๐

Haha โ You now CSS ๐ But, it's constantly evolving.

๐๐ผ๐๐ผ๐๐ผ

Thanks Oscar ๐

CSS scroll snap is insanely powerful

The undercover goat ๐๐

๐คฏ

Sick! Would there be any possibility to start them from display none as well? Could create a โlazy loaderโ purely with CSS, as I recall the browser doesnโt load resources such as images when itโs set to display: none. Maybe in combination with :has and :visible.

I need to revisit this demo today ๐ค Wanted to add an intro animation to it too. One trick here is that it's all the same image for this purpose but cropped with object-view-box. Perhaps, animating stepped with display and using a preload perhaps ๐คThat's off the top of my head
