正在加载视频...

视频加载失败

img { animation: reveal; animation-timeline: view(); 👈 animation-range: entry 0% entry 150%; 👈 } @​keyframes reveal { 0% { opacity: 0; filter: brightness(2); scale: 0.9; } }

118,144 次观看 • 2 年前 •via X (Twitter)

11 条评论

🜲 Nate van der Vis 🜲 的头像
🜲 Nate van der Vis 🜲2 年前

C'mon Safari-Fox

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

Yeah, I'll put some fallbacks into the demo 🤙

Adam Argyle 的头像
Adam Argyle2 年前

💀🤘

ᄃΛMDΣП (offboarding) 的头像
ᄃΛMDΣП (offboarding)2 年前

Not a frontend guy myself, but followed 🤝

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

Thanks! 🙏

LukΞ Mulks 🦁⟁◎⟁ 的头像
LukΞ Mulks 🦁⟁◎⟁2 年前

♥️🦁 nice browser selection.

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

Born in August, Leo, it's meant to be 😅

Bjornfree 的头像
Bjornfree2 年前

@jh3yy I would be honored to have you in one of our spaces one evening to speak about creativity in design. Your work is amazing

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

My schedule should free up soon 🤙

Evgeny Kalashnikov 的头像
Evgeny Kalashnikov2 年前

Where can I get that configuration thing to play around???

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

It's "Tweakpane" 🤙

相关视频

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,561 次观看 • 2 年前

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 年前