正在加载视频...
视频加载失败
cross-browser liquid toggle 👨🔬 CSS + SVG filter + drag mechanics 🧑🍳 (exploding view 👇)
50 条评论

Cool effect, but horrible UX. Nobody clicks and drags a toggle switch.

that is literally the behavior on iOS — i'm jus' recreating it, not telling people to put it on their websites...

@kuraken20XX i mean you can also just click it on ios

@kuraken20XX and you can just literally click it in this demo 🤷♂️

@kuraken20XX oh okay 😭 in that case good demo

@kuraken20XX ha 😅 all i tried to do was match it closest i could tolerate spending time on click, drag, long press, etc. 🤙

@kuraken20XX it looks really good… i was wondering how well the effect generalises to other shapes… are you using a pre baked map for that specific pill shape?

@kuraken20XX it's a trick with blurring a box-shadow with a pill shape, you could use it with other shapes/radius but as soon as you need backdrop-filter, it's quickly limited to Chrome

This is the best implementation I’ve seen of Liquid Glass in CSS! Looks super polished

think i can tighten the transitions a bit more but figured i'd post it before i forget about it 😅

omg - you're doing the refractions *manually* and blending them (goo-ing?) with the svg blur + contrast "trick"? That's an approach I'd have *never* considered! I guess the downside is that it's extremely situation-specific?

yeah – this is a very much "only going to work with the toggle and slider" 😅 but it was more of a challenge to myself to make a cross-browser version

I mentioned Remix Themes right?

Remix Themes lfg 😎 (you know where to Slack me 🤙)

You’re like a CSS MacGyver

Holy crap

Where do you learn about SVG filters? Looks like it can do a lot. Amazing work, as always

a lot of "prodding" until i can understand what they do

Crazzzzzy 🤌

Desperately need codepen for this one :)

Great work! 👏🏾👏🏾👏🏾

damn!

every one of your posts is literally gold. really inspiring me to go build fun things again.

love that - thanks for sharing! 🫶 honestly, follow the things you enjoy and make fun things 💯 it will always come in useful in one way or another

Wow….

@C_A_DOT_IO 🙏🙏

Insane 🥹

🙏

Nailed it as always 👌🏻💪🏻

🙏

It's actually a very smart solution

wow

So good

crazy good

any chance you could speed it up?

yep – it's slowed down to exaggerate things here

Damn

🪡

The goat chap 2...

Damn cool trick

Liquid glass with css🤐 Damn, your stuff are great as always

wheres a demo to test it?

share the code?

Are you from Gryffindor man?

Great work 🫶 it's hard to replicate.

That’s so cool, which is this tool?

This is a fantastic demonstration of what's possible with modern CSS and SVG. It's the kind of creative coding that inspires you to push the boundaries. The exploding view is a great touch for showing the mechanics!

Please can you share the code

Can I have the code

Very interesting 🤔
