Загрузка видео...

Не удалось загрузить видео

На главную

those little details™ Scale up and down on scroll with CSS 📜✨ a { animation: scale, scale; animation-direction: normal, reverse; animation-timeline: view(inline); animation-range: entry, exit; } @​keyframes scale { 0% { scale: 0; } }

246,038 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля jhey ▲🐻🎈
jhey ▲🐻🎈2 лет назад

Here's that @CodePen link! 🚀 Wanted to make sure there was a "JavaScript fallback" if you wanted to try it out in other browsers 🤙

Фото профиля Simon Vrachliotis
Simon Vrachliotis2 лет назад

Amazing - only ever considered the vertical scroll animations but this is a great use case!

Фото профиля jhey ▲🐻🎈
jhey ▲🐻🎈2 лет назад

Definitely some other fun ones to throw together 😁 Been having to explore the depths of the web 😅

Фото профиля Fahir
Fahir2 лет назад

wow This is so smooth. Tnx for sharing!

Фото профиля RobotJason
RobotJason2 лет назад

Looks like the Starbucks and Reddit logos are “negatives”. Love what you’ve done here! 👌

Фото профиля jhey ▲🐻🎈
jhey ▲🐻🎈2 лет назад

You're totally right! Whipped these from 👇

Фото профиля Sick Bard
Sick Bard2 лет назад

Impressive codepen as always... Are you making these on coffee breaks? How do you find the time!

Фото профиля Kai | herostuff.com
Kai | herostuff.com2 лет назад

YUM

Фото профиля altskin
altskin2 лет назад

Nice. Can they blur and fade in/out at the edges?

Фото профиля Fredrik Tibbling
Fredrik Tibbling2 лет назад

Great stuff! ✨

Похожие видео

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,270 просмотров • 2 лет назад