正在加载视频...

视频加载失败

SVG filters provide a basic lighting system you can sync with a little JavaScript and use in your web apps 💡 ... not as powerful but pretty cool

315,203 次观看 • 11 个月前 •via X (Twitter)

11 条评论

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

alternative approach here is a masked pseudoelement that uses CSS backdrop-filter: blur() + contrast() + brightness() combos ⚡ fun to try out the SVG version though – you can read more about <feSpecularLighting> here 👇

Mo 的头像
Mo11 个月前

Only a matter of time before we get liquid-glass.js

Renato Ribeiro 的头像
Renato Ribeiro11 个月前

guys stop retweeting this before it reaches my team's designer

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

haha - don't show them plz 🙏

Venil Designer 的头像
Venil Designer11 个月前

This is actually really cool, you are the dev every designer needs lol

cubiq 的头像
cubiq11 个月前

you can achieve similar effect without having to sync it with js just by ramping up brightness and saturation for the backdrop filter the effect is not as pretty but it's an approach without any js 😅

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

did mention that approach - as you say, it can be "similar" 🤏 but it lacks "control" and you have to rely on the light being in the backdrop or duplicating the light source to make sure there is one in the backdrop (got a follow up with "extras" 🤙)

Ryan Vogel 的头像
Ryan Vogel11 个月前

maybe thin the border and add a radial gradient to show "rounding"?

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

went with the border like that for video compression 😅 you don't have control over "rounding", it's specular lighting based on the phong lighting model – you jus' get control over intensity, height, position, etc. alternative is masked backdrop-filter blur + contrast ✅

Marc Seitz — oss/acc 的头像
Marc Seitz — oss/acc11 个月前

Where does the light come from? Are the app icons the light source?

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

mapping the icon positions to fePointLight positions relative to the surface position the caveat is that light sources are single color

相关视频