Navigation überspringen
SVG filters provide a basic lighting system you can sync with a little JavaScript and use in your…
0:00 / 0:31

SVG filters provide a basic lighting system you can sync with a little JavaScript and use in your…

jhey ʕ•ᴥ•ʔ

@jh3yy148.621 Follower

Auf X besuchen
3.576 LikesHerunterladenOriginalbeitrag

315.959 Aufrufe

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

11 Kommentare

Kommentare aus dem Originalbeitrag auf X (Twitter)

  • Profilbild von jhey ʕ•ᴥ•ʔ

    @jh3yy

    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 👇

    84 Likes

  • Profilbild von Mo

    @MouddX

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

    30 Likes

  • Profilbild von Renato Ribeiro

    @renatoribz

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

    11 Likes

  • Profilbild von jhey ʕ•ᴥ•ʔ

    @jh3yy

    haha - don't show them plz 🙏

  • Profilbild von Venil Designer

    @Venildesigner

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

    7 Likes

  • Profilbild von cubiq

    @CubiqNation

    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 😅

    6 Likes

  • Profilbild von jhey ʕ•ᴥ•ʔ

    @jh3yy

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

    1 Like

  • Profilbild von Ryan Vogel

    @ryandavogel

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

    4 Likes

  • Profilbild von jhey ʕ•ᴥ•ʔ

    @jh3yy

    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 ✅

    4 Likes

  • Profilbild von Marc Seitz — oss/acc

    @mfts0

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

    4 Likes

  • Profilbild von jhey ʕ•ᴥ•ʔ

    @jh3yy

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

    2 Likes