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

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

На главную

Future CSS Tip! 🍏 You can combine scroll-driven animations with background-clip to create gradient text reveals 😍 p { animation-name: move-bg, fade-in; animation-fill-mode: both; animation-timing-function: linear; animation-timeline: scroll(root); animation-range: 0 100vh, 40vh 100vh; } /* Multiple animations with shared timeline and different ranges 👀 */ keyframes move-bg { to...

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

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

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

Here's that @CodePen link! 🤙 Remember you need to be in Chrome 115+ to see this working ✨ Got a cool one for ya tomorrow! Now gonna go celebrate with my new wife 😍

Фото профиля Moescape AI
Moescape AI1 год назад

Sign up & create wholesome anime art on Moescape AI now!

Фото профиля Jacek Smolak
Jacek Smolak2 лет назад

You should create an index of all of your creations, tagged, with easy searchability features. Unless you already have ;)

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

Kinda got something in the works for this. It would be cool if there was some kind of @CodePen API. I'd love to be able to say "Grab all pens from jh3yy with the tag for-blog" or something 🙏 I have been adding the "popular" posts to my "Highlights" tab as I go but need to remember to do it. Also, got articles coming on some of these that have been shared recently! ✍️

Фото профиля Brian Poblete
Brian Poblete2 лет назад

Hi jhey! This looks amazing! Would it be alright for me to try and put this implementation into a package/ library that can be easily imported and customized? I'll include credit of course.

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

Hey Brian 🤙 That sounds cool. How would you see that working? I do have a little thing that I've been piecing together that leans into custom properties. But, as it's wedding week I haven't had as much time as usual 😅 I'm merely here to share my thought process and ideas. If that inspires you to try something out or make something, that's awesome 🙏

Фото профиля Ξdziu
Ξdziu2 лет назад

I’m thankful for you man. I’ve been looking for a good explanation on how to achieve this effect. 🔥

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

You're more than welcome Ed! 🙏 I'm always open to requests as well 🤙 This is a nice effect. Think there's likely some other ways to approach it too ✨

Фото профиля Naman
Naman2 лет назад

@oleg008 I love scroll timelines but this particular animation can be achieved with masking and sticky position without needing scroll timelines!

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

@oleg008 Your demo isn't working in Chrome as a heads up

Фото профиля Cyrus Zei
Cyrus Zei2 лет назад

oh that is nice !!!

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

Apple jus' keep giving us scroll designs 😅

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

One of my favorite GIFs, hands down 💯😅

Фото профиля freddie
freddie2 лет назад

wow that’s incredible! 2023 is surely the year of css. Cannot wait for mainstream support

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

@fredoiq Right?! Definitely a game changer API 💯

Фото профиля Artem Korenevych
Artem Korenevych2 лет назад

Does it works with current major version of Chrome, FF, or Safari? Or just an experiment mode in Canary?

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

Stable Chrome since 115 🤙

Фото профиля Danny Moerkerke
Danny Moerkerke2 лет назад

Dude, you’re killing it, amazing! 👏👏👏

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

Doing what I can to share my thought process 🙏 Thanks Danny! 🤙

Фото профиля ❮λ❯ Elefunc 🌐
❮λ❯ Elefunc 🌐2 лет назад

👋🏻 You are all hereby invited to 🎁 build better with ↓ ⚡️ see your changes in real-time ⌨️ adjust numbers with ↑↓ keys ⋯ no waits/no reloads Swap codepen .io /⋯/pen/⋯ with ↓

Фото профиля Michelle Bakels
Michelle Bakels2 лет назад

this is sick 🔥

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

Almost Inter Miami colors 👀😅 Thanks Michelle 🙏

Фото профиля Jason Kwok
Jason Kwok2 лет назад

Please, I just wanna read the info 😭. I don't wanna play a maze game.

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

Tell Apple Jason 😅

Фото профиля mrtksn
mrtksn2 лет назад

The irony of imitating Apple's design to work only on Chrome. Welcome to the era of neo-Internet Explorer where you need to download a specific browser to have the website display correctly.

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

It's an official CSSWG spec, it'll be in Safari sooner or later 🤙

Фото профиля Seppe Beelprez
Seppe Beelprez2 лет назад

@SaveToNotion

Фото профиля Rykelabs
Rykelabs2 лет назад

Wicked cool

Фото профиля Kelvin Ohemeng
Kelvin Ohemeng2 лет назад

At this point we need a course on how you make these CSS based scroll animations. 🙏

Фото профиля Jens Mourinho
Jens Mourinho2 лет назад

Hello, How would this be done with JS (react). Do you have an example?

Фото профиля Ben Warner
Ben Warner2 лет назад

@uxlinks @SaveToNotion

Фото профиля Ricardo Pimentel
Ricardo Pimentel2 лет назад

I might use this, looks awesome.

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

CSS Trick! ⚡️ You can use scroll-driven animation with background-attachment to create a dynamic glowing card scroller without JS 🔥 section { animation:vibe; animation-timeline:--list; } @​keyframes vibe { to{--hue:320;}} .glow {background: hsl(var(--hue) 80% 50%);} Here's how! 🤙 You can use the background-attachment trick used in other glow card demos 😎 article { background-attachment: fixed; } The difference here is that you aren't going to update the fixed background position with your pointer this time. It can remain fixed. The magic part is that as you scroll, the background will leave the card that's leaving and enter the card that's entering ✨ For the extra background glow, you can use a fixed pseudo element on the list container itself 💪 Once that's in place, you're only task is to change the color of the background as you scroll 🤔 Create a custom property declaration for the --hue @​property --base { inherits: true; syntax: ' '; initial-value: 0; } Then create an animation that updates this value @​keyframes accent { to { --hue: 320; }} The last piece is hooking it up to scroll and there is a little trick in here 👀 First, you need an inline scroll-timeline on the list ul { scroll-timeline: --list inline; } Then you can use timeline-scope to hoist that scroll-timeline up so a parent can use it. You then animate the custom property on this element and let the value cascade down to the places that need it 🔥 section { timeline-scope: --list; animation: accent both linear; animation-timeline: --list; } For example, the glow uses the --hue this way [data-glow] { background-image: radial-gradient( 150px 150px at 50% 50%, hsl(var(--hue) 100% 70% / 0.25), transparent ); } Lastly, scroll-snap is optional of course but plays nice with the scroll-driven animation demos ✨ The key for that is ul { scroll-snap-type: x mandatory; } li { scroll-snap-align: center; } That's it! Pretty fun trick to play with! 🤓 Any questions, let me know! Should we add it to the video walkthrough list? CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

116,462 просмотров • 2 лет назад

CSS Trick! 🤙 You can create gradient borders on translucent elements using mask-clip and mask-composite with a pseudo-element 🔥 .gradient-border::after { mask-clip: padding-box, border-box; mask-composite: intersect; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); } It's the same "Transparent border trick" from before. But, now you apply it to a pseudo-element 😎 The trick is to create a pseudo-element with a gradient background and then mask it so we only see the part we want, the border ✨ mask-clip defines the area affected by a mask. Similar to how you can define background-size. Using padding-box and border-box constrains the two masks. mask-composite is the magic part ✨ It defines a compositing operation for stacked mask layers. Using intersect means that the parts that overlap get replaced. And this seems to work in all browsers 🙌 As for the rest of the styles... – Make sure you set pointer-events: none on the pseudo-element – Make sure it fills the parent element. You can use position: absolute and inset: 0 – Make sure the background fills the space including the border-width. You can use calc to achieve that: --bg-size: calc(100% + (2px * var(--border))); background: var(--gradient) center center / var(--bg-size) var(--bg-size); That's it! 🚀 Gradient borders on translucent elements. You can set all the backdrop-filter: blur() you like! 😅 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

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

CSS Tip! 💫 You can create this responsive perspective warp animation with 3D CSS and container queries ✨ (Video reveals trick 👀) .warp { container-type: size; perspective: 100px; transform-style: preserve-3d; resize: both; overflow: hidden; } Couple of tricks in this one 🤓 The main idea is to create a tunnel (an open-ended cube). On each side of the tunnel, use linear-gradient to create the grid lines ✨ .side { background: linear-gradient(#​fff 0 1px, transparent 1px 5%) 50% 0 / 5% 5%, linear-gradient(90deg, #​fff 0 1px, transparent 1px 5%) 50% 50% / 5% 5%; } To position each side, you rotate on the x-axis by 90deg. Each side would become invisible at this point. So you give the scene perspective 😉 .warp__side--top { width: 100cqi; height: 100cqmax; transform-origin: 50% 0%; transform: rotateX(-90deg); } The cool part here is that you want to make each side the same height. But the container is responsive. So you can use a container query and make sure each side is 100cqmax tall 🫶 Then the "beams". Each side contains "beams". They have different colors, sizes, and positions, and move at different speeds ⚡️ We can control that through scoped custom properties. .beam { width: 5%; position: absolute; top: 0; left: calc(var(--x, 0) * 5%); aspect-ratio: 1 / 2; background: linear-gradient( hsl(var(--hue) 80% 60%), transparent ); translate: 0 100%; animation: warp calc(var(--speed, 0) * 1s) calc(var(--delay, 0) * -1s) infinite linear; } The magic here is though that a beam's animation is as basic as translating it from the top of the side to the bottom. And you can get that distance with a container query again 🔥 @​keyframes warp { 0% { translate: -50% 100cqmax; } 100% { translate: -50% -100%; } } And that is pretty much it! A cool warp animation effect using 3D CSS and container queries ⚡️ If you have any questions, let me know ᵔᴥᵔ CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

187,474 просмотров • 2 лет назад