Get the latest tech news

Liquid Glass in the Browser: Refraction with CSS and SVG


Explore how to recreate Apple's stunning Liquid Glass effect using CSS, SVG Displacement Maps, and refraction calculations.

Easier than the squircle, but the transition to the flat interior is harsher, producing sharper refraction edges—more noticeable when the shape is stretched away from a true circle. The following visualization demonstrates how light rays behave differently as they pass through each surface type, helping us understand the practical implications of our mathematical choices. This playground applies the SVG displacement filter to a simple scene and lets you tweak surface shape, bezel width, glass thickness, and effect scale.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of browser

browser

Photo of css

css

Photo of SVG

SVG

Related news:

News photo

Processing Piano Tutorial Videos in the Browser

News photo

VirusTotal finds hidden malware phishing campaign in SVG files

News photo

Sextortion with a twist: Spyware takes webcam pics of users watching porn | Spyware monitors the infected user's browser for NSFW content before activating itself.