Glass UI Test code

Creating a Liquid Glass UI with HTML and CSS

This time, I created a Liquid Glass style UI demo using only HTML and CSS. The design was inspired by Apple-like translucent interface elements, where panels appear to float above a soft background with blur, reflection, and subtle distortion.

The demo contains several interface components, including a music player, quick navigation menu, search button, search pill, and a dock-style icon area. The main visual effect is created by stacking multiple layers inside each glass component: a blur layer, a semi-transparent overlay, and a highlight layer.

I also used an SVG filter to add a slight lens-like distortion, which helps the glass panels feel more dynamic and realistic. The result is a soft, glossy interface that reacts nicely to hover and active states.

Features

  • Pure HTML and CSS implementation
  • No JavaScript required for the UI effect
  • Liquid glass effect with CSS blur and transparency
  • SVG filter for lens distortion
  • Responsive design for mobile and desktop
  • Hover animations for buttons and dock icons
  • Music player card, navigation menu, search pill, and dock layout
  • External image assets for the background and icons

Implementation Notes

The glass effect is built by combining several visual layers. The backdrop-filter property creates the frosted blur, while translucent overlays and inset shadows add brightness and depth. The SVG filter adds an additional distortion effect, giving the UI a more liquid-like appearance.

Because this demo uses modern CSS properties, it works best in updated browsers such as Chrome, Edge, and Safari.

Live Demo

Album cover

All Of Me

Nao
Search

Test Code

Below is the test code used for this implementation. The HTML and CSS are separated so they can be copied individually.

HTML Code expand / collapse
CSS Code expand / collapse

Popular posts from this blog

White Goat's Farm Adventure with Gemini Image Gen.

Meta's VideoJam: The Future of AI Video Generation

Grok 3 Release Date