Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

11 Kommentare

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 1 Jahr

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 👇

Profilbild von Mo
Movor 1 Jahr

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

Profilbild von Renato Ribeiro
Renato Ribeirovor 1 Jahr

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 1 Jahr

haha - don't show them plz 🙏

Profilbild von Venil Designer
Venil Designervor 1 Jahr

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

Profilbild von cubiq
cubiqvor 1 Jahr

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 😅

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 1 Jahr

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" 🤙)

Profilbild von Ryan Vogel
Ryan Vogelvor 1 Jahr

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 1 Jahr

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 ✅

Profilbild von Marc Seitz — oss/acc
Marc Seitz — oss/accvor 1 Jahr

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

Profilbild von jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔvor 1 Jahr

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

Ähnliche Videos