Crystal Cells
Web (React)
A faceted crystal lens refracting a shifting Voronoi cell field.
A moving Voronoi cell pattern seen through a hexagonal faceted crystal with dispersion, framed by a vignette. It fills its positioned parent and freezes its animation when the user prefers reduced motion. Built on the shaders library (MIT) and rendered with WebGPU.
Crystal Cells
Installation
CLI
npx @modus-ui/cli add crystal-cellsManual
- Install
shaderswithnpm install shaders. - Copy the code from the component tab.
- Create a file at
components/ui/crystal-cells.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
colorA | string | "#0f172a" | Cell centre colour. |
colorB | string | "#6366f1" | Cell edge colour. |
borderColor | string | "#e0e7ff" | Colour of the cell borders. |
speed | number | 0.5 | Cell animation speed. |
scale | number | 6 | Number of cells. |
facets | number | 5 | Number of crystal facets. |
refraction | number | 0.5 | Refraction strength. |
dispersion | number | 0.5 | Rainbow dispersion strength. |
radius | number | 0.32 | Size of the crystal. |
Comments