Hover· 10 sites
Reference: Materials: Liquid Glass (Human Interface Guidelines), Apple
How it works
A floating dock that bends the page behind it like a lens, with a lit rim and macOS-style magnification.In 6 steps.
Apple's Liquid Glass refracts instead of scattering: content behind a control bends at its rim, as if through a thick lens, and a bright edge catches the light. On the web, Chromium can do the bending for real, by pointing backdrop-filter at an SVG displacement map drawn for the surface's exact shape. Other browsers keep a frosted blur. Pinned to the bottom as a dock, with icons that swell under the pointer, it becomes the floating navigation several sites in the library use.
- 01
Draw a lens for the shape
For every pixel of the dock, find its distance to the rounded edge and the edge's direction. Inside a bezel of about 20 px, store an offset that grows towards the rim, following a circular profile: flat in the middle, steep at the edge. Red holds x, green holds y, 128 means none.
- 02
Refract the backdrop with it
An SVG filter blurs the backdrop slightly (feGaussianBlur), then moves each pixel by the map (feDisplacementMap with the map in an feImage). backdrop-filter: url(#glass) saturate(1.6) applies it behind the dock. Redraw the map only when the dock's size changes.
- 03
Light the rim
Two inset shadows (a 1 px white line at the top, a faint dark one at the bottom) and a diagonal highlight in soft-light read as a thick, curved edge.
- 04
Fall back to frost
Safari and Firefox ignore url() in backdrop-filter; give them blur() with more saturation. Under prefers-reduced-transparency, make the surface solid.
- 05
Magnify under the pointer
Each icon's target scale falls off with a quarter cosine of its distance to the pointer (up to about 150 px). Every frame, each scale eases towards its target, so a jumping pointer still gives a smooth wave. Scale from the bottom, and lift the icon a little as it grows.
- 06
Touch
A finger sliding along the dock magnifies the same way; lifting it lets the icons settle.