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

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

На главную

View Transitions with CSS linear() to create a light flicker effect on theme change 💡 [data-theme='light']::view-transition-group(root) { animation-timing-function: var(--flicker); } jus' set a custom timing function on the default animation 👨‍🍳 bonus: drag switch ✨

113,597 просмотров • 11 месяцев назад •via X (Twitter)

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

Фото профиля '); DROP Ţ̸͓̠̼͖̖̆ͫ̑̒̿ͪ͞A̐͏̠̫͔̰̖ͅͅB̉͌͒̈LE name; --
'); DROP Ţ̸͓̠̼͖̖̆ͫ̑̒̿ͪ͞A̐͏̠̫͔̰̖ͅͅB̉͌͒̈LE name; --11 месяцев назад

when my kids ask me what a wizard is I’m going to send them to you

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

we've still got plenty of candy tonight too for "Trick or Treat" 🍬😅

Фото профиля 紫苏子ACG
紫苏子ACG11 месяцев назад

Taking yours as a reference, I have now created my own version.

Фото профиля Josh
Josh11 месяцев назад

lit! is this on a public GitHub somewhere?

Фото профиля Rajesh
Rajesh11 месяцев назад

Jhey is so back

Фото профиля Timileyin Olaifa UX 🦄
Timileyin Olaifa UX 🦄11 месяцев назад

This is fun! 😂 Drop a link, I wanna play

Фото профиля Evert Junior
Evert Junior11 месяцев назад

@nicolettiFPS

Фото профиля Yashjit
Yashjit11 месяцев назад

I wish you shared the code for it lol I'm obsessed with it

Фото профиля Jacbita.eth🟠
Jacbita.eth🟠11 месяцев назад

細節控狂喜

Фото профиля 0xMira.ETH
0xMira.ETH11 месяцев назад

gerçek sahne gibi

Фото профиля Slavi
Slavi11 месяцев назад

This is some grand master level of css here 🔥

Фото профиля hazim
hazim11 месяцев назад

King of css

Фото профиля Stephen Way
Stephen Way11 месяцев назад

My monitor flickered just reading this 🔆

Фото профиля Davies
Davies11 месяцев назад

What's the code for the wiggly pull string

Фото профиля Unbiased Dev
Unbiased Dev11 месяцев назад

Small "umm actually" for a lightbulb to flicker it would need to be a fluorescent bulb, the light in your demo is incandescent :)

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

ummm akshually, how do you know? it's my bulb 😉

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

p.s incandescent flicker can also be a thing, i've been through this on here before

Фото профиля Unbiased Dev
Unbiased Dev11 месяцев назад

Fair enough, I guess, in theory, yes but it's more of an electrical issue than a bulb one. It's just usually known for the gas ones to flicker because of the starter.

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

yeah 💯 thing is, designing this as a fluorescent loses the charm and leaves it a little "dead" looking 😅 incandescent flicker often occurs with power mismatch or a bulb that's on the way out/loose. good proof, plug into a dimmer switch where it's incompatible 😅

Фото профиля Unbiased Dev
Unbiased Dev11 месяцев назад

Oh yeah I agree. When I think of a light bulb I think of an incadescent one flicker be damned 👌

Фото профиля Hussain Poonawala
Hussain Poonawala11 месяцев назад

wow pretry sick!

Фото профиля Pochi
Pochi11 месяцев назад

This is a really clever use of linear(). I love how it adds a bit of analog realism to the theme switch. Curious if you've experimented with combining this with other view transition types, like for individual elements, to create even more complex effects?

Фото профиля Aimann Shaik
Aimann Shaik11 месяцев назад

This is so cool. Love it 💡

Фото профиля Chintan N
Chintan N11 месяцев назад

Skeuomorphism goes hard!

Фото профиля Jacob
Jacob11 месяцев назад

Source?

Фото профиля Justin
Justin11 месяцев назад

Love the flicker effect, simple but elegant!

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

CSS Trick 🍏 You can create that Apple-style blowout text effect with CSS scroll animations and fixed positioning ⚡️ .word { animation: blowout; animation-timeline: --section; } @​keyframes blowout { 0%, 95% { background: transparent; } to { transform: translateZ(99vh); background: #000; } } The trick here is to fix the position of some things in your layout and then animate them based on their non-fixed containers ⭐️ The .word is position: fixed within a that has a height of 200vh section { view-timeline: --section; } section:first-of-type { height: 200vh; } Every section has a view-timeline: --section that creates a scoped ViewTimeline for each section's children 🤙 As that first section scrolls out of view, you increase its opacity and move it on the z-axis towards you. That gives it the impression of scaling up 🆙 .word { animation: blowout, fade-in; animation-timing-function: ease-in; animation-fill-mode: both; animation-timeline: --section; animation-range: exit-crossing 10% exit 0%; } You can use the exit-crossing range combined with the exit range to get a timing you like ✨ Definitely experiment with these ranges to see how they play. The timing function creates interesting effects too! At the same time as the text scales up, you need to fade in the video and the text that goes with it. Again, you can use the parent container's ViewTimeline --section p, video { animation: fade-in, fade-out; animation-timing-function: ease-in; animation-fill-mode: both; animation-timeline: --section; } p { animation-range: entry 10% entry 35%, exit 0% exit 25%; } video { animation-range: entry 0% entry 25%, exit 10% exit 35%; } The timings are slightly different here. Again, you can play with them to get something that feels right for you! @​keyframes fade-in { to { opacity: 1; }} @​keyframes fade-out { to { opacity: 0; }} Theoretically, you should be able to do something with animation-direction: reverse/alternate like yesterday's demo video { animation: fade 2 both linear alternate-reverse; } The trick with this effect is all about timing and creating containers that are bigger than the content and using them to drive the animations 🏎️ The scroll-driven signature is a bonus! ✍️ Perhaps a follow-up on that one 🤙 As always, any questions, requests, etc. Hit me up! With this demo, the GreenSock ScrollTrigger code is included where the CSS scroll-driven animations API is not supported 🙌 That means you could use this demo today! CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

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

CSS Tip! 🤯 You can create a CSS-only version of this balance slider using a scroll animation on the underlying input[type=range] 🚀 ::-webkit-slider-thumb { view-timeline: --thumb inline; } Scroll animation driven by the slider thumb animates a number between the "min" and "max" of the range 😅 @​property --value { inherits: true; initial-value: 0; syntax: ' '; } @​keyframes sync { to { --value: 100; }} Tie that up to the contain animation-range ⚡️ .control { animation: sync both linear reverse; animation-timeline: --thumb; animation-range: contain; } Hoist the view timeline so all the parts of the control can use it! .control { timeline-scope: --thumb; } Use that value in a counter which is used for the labels. Create a low and a high for each side 😇 .control__label { counter-reset: low var(--value) high calc(100 - var(--value)); } .control__label::before { content: "COFFEE " counter(low) "%"; } .control__label::after { content: counter(high) "% MILK"; } That's the magic of updating the label values ✨ For the big track, it's a fake track. You can make use of the same --value property and do some calc() to work out the width of each part. .control__track::before { width: calc(var(--value) * 1% - 0.5rem); background: var(--coffee); border-radius: 4px; transition: width 0.1s; } The width leaves a little gap for the indicator piece 🤙 The color calculation for --coffee isn't too wild but again you can use the same --value .control__track { --coffee: hsl(24 74% calc( 24% + (30% * ((100 - var(--value, 0)) / 100)) / 1 ) / 0.4); } Now for the last piece. Making the track change height. You could set up another custom property and animate its value using the --thumb timeline too 🔥 @​property --shift { initial-value: 0; inherits: true; syntax: ' '; } @​keyframes shift { 0%, 31%, 61%, 100% { --shift: 0; } 32%, 60% { --shift: 1; } } Then use that --shift to update the translation of the label and height of the track 🤓 .label { transform: translateY(calc(var(--shift) * 50%)); transition: transform var(--speed) var(--timing); } Cool part here is that you can use the control to work out the @​keyframes percentages 😅 Oh. And the timing for that little bounce? Use the linear() function 😎 :root { --timing: linear( 0, 0.5007 7.21%, 0.7803 12.29%, 0.8883 14.93%, 0.9724 17.63%, 1.0343 20.44%, 1.0754 23.44%, 1.0898 25.22%, 1.0984 27.11%, 1.1014 29.15%, 1.0989 31.4%, 1.0854 35.23%, 1.0196 48.86%, 1.0043 54.06%, 0.9956 59.6%, 0.9925 68.11%, 1 ); } Should probably do a video on this one. Lots of little custom property tricks for sure! 💯 It's not too far off the range slider with the tooltip that came up previously As always, any questions, let me know! Also, this one only works in Chrome currently ✅🥲 This one's a bit rocket science ha 🚀 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

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