Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 11 Monaten •via X (Twitter)

26 Kommentare

Profilbild von '); DROP Ţ̸͓̠̼͖̖̆ͫ̑̒̿ͪ͞A̐͏̠̫͔̰̖ͅͅB̉͌͒̈LE name; --
'); DROP Ţ̸͓̠̼͖̖̆ͫ̑̒̿ͪ͞A̐͏̠̫͔̰̖ͅͅB̉͌͒̈LE name; --vor 11 Monaten

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 11 Monaten

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

Profilbild von 紫苏子ACG
紫苏子ACGvor 11 Monaten

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

Profilbild von Josh
Joshvor 11 Monaten

lit! is this on a public GitHub somewhere?

Profilbild von Rajesh
Rajeshvor 11 Monaten

Jhey is so back

Profilbild von Timileyin Olaifa UX 🦄
Timileyin Olaifa UX 🦄vor 11 Monaten

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

Profilbild von Evert Junior
Evert Juniorvor 11 Monaten

@nicolettiFPS

Profilbild von Yashjit
Yashjitvor 11 Monaten

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

Profilbild von Jacbita.eth🟠
Jacbita.eth🟠vor 11 Monaten

細節控狂喜

Profilbild von 0xMira.ETH
0xMira.ETHvor 11 Monaten

gerçek sahne gibi

Profilbild von Slavi
Slavivor 11 Monaten

This is some grand master level of css here 🔥

Profilbild von hazim
hazimvor 11 Monaten

King of css

Profilbild von Stephen Way
Stephen Wayvor 11 Monaten

My monitor flickered just reading this 🔆

Profilbild von Davies
Daviesvor 11 Monaten

What's the code for the wiggly pull string

Profilbild von Unbiased Dev
Unbiased Devvor 11 Monaten

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 11 Monaten

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 11 Monaten

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

Profilbild von Unbiased Dev
Unbiased Devvor 11 Monaten

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.

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 11 Monaten

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 😅

Profilbild von Unbiased Dev
Unbiased Devvor 11 Monaten

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

Profilbild von Hussain Poonawala
Hussain Poonawalavor 11 Monaten

wow pretry sick!

Profilbild von Pochi
Pochivor 11 Monaten

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?

Profilbild von Aimann Shaik
Aimann Shaikvor 11 Monaten

This is so cool. Love it 💡

Profilbild von Chintan N
Chintan Nvor 11 Monaten

Skeuomorphism goes hard!

Profilbild von Jacob
Jacobvor 11 Monaten

Source?

Profilbild von Justin
Justinvor 11 Monaten

Love the flicker effect, simple but elegant!

Ähnliche Videos

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 Aufrufe • vor 2 Jahren