正在加载视频...

视频加载失败

context-aware css card glow/shine effect 👨‍🍳 the trick: duplicate and scale the icon. translate it on pointermove. apply feGaussianBlur 🤙 check it 👇

843,675 次观看 • 11 个月前 •via X (Twitter)

37 条评论

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ11 个月前

s/o to @steve_hayes who sniped me in Slack with a prompt that i felt obliged to explore/prototype quick 😁 it's a play on the glow cards we did a year or so back — you can play with all the controls in this @CodePen 🤙

gandan 的头像
gandan11 个月前

remember this?

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ11 个月前

sure do!

Nikita 的头像
Nikita11 个月前

Please share the code to this, this would be so cool in a shadcn registry

Chief Twat 的头像
Chief Twat11 个月前

Nice, what about shining thru? :)

Steve Hayes 的头像
Steve Hayes11 个月前

Appreciate the work on this, amazing execution 🙌

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ11 个月前

appreciate you pinging/sniping me! 🙏 can't resist having a go at putting things like this together 😁 hopefully it helps get this feature in the right direction or stirs another idea for us! 💡

Steve Hayes 的头像
Steve Hayes11 个月前

Hoping we can implement some flavor of this when this work ships! I’ll keep ya updated. There was also some interest from another designer for using this pattern in dev docs 👀

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ11 个月前

keep me posted 👀 always happy to iterate and riff on other ideas 👨‍🍳

Prince Zoho 的头像
Prince Zoho11 个月前

Thanks guys @jh3yy and @steve_hayes for this inspiration. Very fun stuff

dom 的头像
dom11 个月前

This is genius. I need to find a reason to use it now!!

OPM 的头像
OPM11 个月前

that's genius

David Fernandes 的头像
David Fernandes11 个月前

love to see these type of experimental work! amazing @jh3yy 🙌

Mykhailo Sorochuk 的头像
Mykhailo Sorochuk11 个月前

Nice effect! Makes the icons pop. Any chance of sharing the code too?

Andrew Krippner 的头像
Andrew Krippner11 个月前

this is both beautiful and functional, great work

Mukul 的头像
Mukul11 个月前

🤔This glow effect is super cool! The duplicate-and-scale trick is clever for that dynamic feel. Wondering if it could be adapted for a hover effect on cards with images too? 🤔

Yuma Tanaka 的头像
Yuma Tanaka11 个月前

@designgurra

Naiza 的头像
Naiza11 个月前

so cool effect

Vishal G. 的头像
Vishal G.11 个月前

@timvandaats

Amol Kelkar 的头像
Amol Kelkar11 个月前

Loved it!

Jon raRaRa 的头像
Jon raRaRa11 个月前

What about the border?

Jose 的头像
Jose11 个月前

It’s beautiful, I’ll implementing in my next landing

Danny Williams 的头像
Danny Williams11 个月前

Brilliant 👌

D-lan 的头像
D-lan11 个月前

Wait thats smart af When course drop?

cris 的头像
cris11 个月前

looks clean

Dreh 的头像
Dreh11 个月前

such a brilliant way of doing this 😁

Keith Harvey 的头像
Keith Harvey11 个月前

🤯

Francesco Piccoli 的头像
Francesco Piccoli11 个月前

cc @benmoha

Stephen Parker 的头像
Stephen Parker11 个月前

Very cool! 🤙

Dhinesh 的头像
Dhinesh11 个月前

The effect is magical. And you did reveal it like "The Prestige" movie.

Jordan Dingle 的头像
Jordan Dingle11 个月前

Nutty 🤙

César Couto 的头像
César Couto10 个月前

Love it.

origami 的头像
origami11 个月前

Stealing this

Lúcás 的头像
Lúcás11 个月前

Thats really goo, I like it! , Would be interesting on input fields

Theo Vararu 的头像
Theo Vararu11 个月前

@Saadeghi you did something similar with hover-3d recently

Josh Johnson 的头像
Josh Johnson11 个月前

Geeeeeeeze. That is so dang clever.

stevie 的头像
stevie11 个月前

@grok what would the html and css look like to make this

相关视频

CSS Tip! 🤙 You can use mask-composite and some JavaScript to create this pointer proximity following glow border ✨ .glow { mask-composite: intersect; mask-clip: padding-box, border-box; mask: linear-gradient(#0000, #0000), conic-gradient(#0000 0deg, #​fff, #0000 45deg); } The trick is to mask a background-image with a combination of mask layers. mask-composite: intersect; means the mask used will be the intersection of the layers 🔥 use source-in, xor; in browsers that don't support intersect; In this demo, you can use pseudoelements and rely on scoped custom properties to do a lot of the heavy lifting for you 🙌 Once you've masked the background, you need to update the starting angle of the conic-gradient on pointermove 👆 You can work that out by getting the center point of each card and then calculating the angle between that and the pointer with Math.atan2 🤓 let ANGLE = Math.atan2( event?.y - CARD_CENTER[1], event?.x - CARD_CENTER[0] ) * 180 / Math.PI ANGLE = ANGLE < 0 ? ANGLE + 360 : ANGLE; CARD.​style.setProperty('--start', ANGLE + 90) You plug that into your conic-gradient mask as a custom property accounting for --spread ⚡️ conic-gradient(from calc((var(--angle) - (var(--spread) * 0.5)) * 1deg), #000 0deg, #​fff, #0000 calc(var(--spread) * 1deg)); To get the blur, you apply a blur to the glow container on each card 🤙 .glows { filter: blur(calc(var(--blur) * 1px); } That's it! Layers of masks that are clipped and composited before being blurred 😎 The added trick is to fade each one in when the pointer is in the defined proximity of the card. For example, don't show unless within 100px of a card. You can see that in the video. Check out the JavaScript code for that 🫶 Couldn't resist making this one 😁 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

1,180,849 次观看 • 2 年前