Pixel UI/3D & Shaders/Glass keycap

Glass keycap

A solid-glass keycap, turning in the dark, splitting light into colour.

<piix-fx>WebGL
Colours
Background

Raymarched glass with real refraction, each colour bending by a slightly different amount, so the edges break into rainbows. It floats, turns, and tilts toward the pointer. Made for product heroes on black.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-fx kind="glass" height="480px"></piix-fx>

Examples

As a hero

Give Hero an fx and your content sits on top.

New

Make it real

Smooth, realistic shaders behind your words.

Get started

Floating on your page

With bg="none" only the object is drawn, so it floats on whatever is behind it.

In your colours

API reference

AttributeWhat it doesDefault
kindbeam disc flame blob glass podium ink aura reeded orb silk morph terrain tunnel waves clouds caustics gradient swarmblob
palettetint it: a palette name or your own colours, dark to lightthe kind's own
bgnone: just the object (blob, glass, disc, orb, morph, swarm)–
quality1 is full resolution; lower is faster.75
grainfilm grain, 0 to 1.35
speed1 is normal, 0 holds still1
heightwhen not filling: px or any CSS length480px
fillsit behind the content of the parent element–

Accessibility