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

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

На главную

Scroll velocity CSS text-shadow 📜 1. Animate 2 custom properties on scroll 2. Transition one of the property values 3. Use the diff (velocity) for the text-shadow position 🤙 A CSS take on it.

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

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

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

the gist 👇

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

Hmm 🤔

Фото профиля Nir Galon
Nir Galon2 лет назад

😳 I didn’t decide yet if it’s beautiful or cringe, but I’m at 🤤 state in front of this post..

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

Ha - Yeah, it was just a mess around to see if it would work 😅

Фото профиля 👻 Darío Gutiérrez 🎃
👻 Darío Gutiérrez 🎃2 лет назад

Kwel effect!! Thanks for the gist.

Фото профиля Mick Coelho
Mick Coelho2 лет назад

Wondering what that'd look like to create motion blur.

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

That's a good idea 💡 Perhaps with a filter intensity that gets applied 🤔

Фото профиля sanket
sanket2 лет назад

wow

Фото профиля EIO
EIO2 лет назад

Could you add svg filters to complete that effect?

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

Yeah - Wonder if splitting to multiple elements, using translate, and then applying a filter could be a move 🤔

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

CSS Tip! 🍬 You can create a CSS-only sticky CTA using position: sticky or scroll-driven animations 🤙 .cta { position: sticky; margin-top: 110vh; bottom: 2rem; /* 👈 Stick! */ } This is one way 👀 This first way relies on you setting a layout on the body and putting the CTA in a zero-space part of the layout body { display: grid; grid-template-columns: auto 0; } The children of the body are an element with your content and then the CTA. You could also use display:flex too. .content { flex: 1 0 100%; } .cta { place-self: end; } As you scroll the body, the CTA comes into view and sticks in position 🙌 That's one way. If you want to take it further and do something like flip between showing or not, maybe scale it up, or add some special easing, etc. an animation is another way 📜 First, change the styles for your CTA. Note the translate property that's powered by a custom property .cta { position: fixed; bottom: 2rem; right: 2rem; translate: 0 calc(20vh - (var(--show) * 20vh)); transition: translate 0.875s var(--elastic); } Next you need a custom property that you're going to animate @​property --show { inherits: true; initial-value: 0; syntax: ' '; } Lastly, you animate this value on the body. As the property value changes, the value will trickle down to the CTA @​supports (animation-timeline: scroll()) { body { animation: show-cta both steps(1); animation-timeline: scroll(root); animation-range: 0 10vh; } @​keyframes show-cta { to { --show: 1; } } } Using @​supports you can use this as a progressive enhancement. If scroll-driven animations are supported, use them. Otherwise fallback to using position: sticky 🤙 That's it! As always, any questions or requests, hit me up! 🙏 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

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