Glass Lens
A pane of glass you can pick up, drawn in WebGL.
$149 once · every Pro piece
It magnifies what is under it, folds the scene in from beyond its rim and splits colour at the edge, with a lit edge toward the light, a Fresnel sheen, a soft contact shadow and a faint accent caustic that shifts as the glass moves. Drag it, throw it, or tap where it should go: it squashes with speed and springs as it lands. It can also follow the pointer, and arrow keys move it. Disc, pill or rounded square, with props for size, refraction, dispersion and magnification. The lens refracts a canvas you paint (or an image), not live DOM; without WebGL it falls back to a CSS backdrop-filter lens over the same scene.
Install
npx shadcn@latest add @obsyde/glass-lensNeeds your licence key · Get Pro
Usage
Import it from where the CLI puts it, or copy the files below by hand.
import { GlassLens } from '@/components/obsyde/ember/glass-lens/GlassLens';
export function Example() {
return (
<GlassLens />
);
}
Files
What you get with Pro: plain React, TypeScript and CSS, with no dependencies.
ember/glass-lens/GlassLens.tsxcomponentember/glass-lens/glass-lens-demo.cssstylesember/glass-lens/glass-lens.cssstylesember/glass-lens/GlassLensDemo.tsxdemoember/fire-kit/gl.tssharedember/shared/accent.tssharedember/shared/spring.tssharedember/shared/ember.cssshared
API
| Prop | Type | Default |
|---|---|---|
accentAccent | 'ember' | 'volt' | 'arc' | 'ember' |
shapeShape | 'disc' | 'pill' | 'square' | 'disc' |
sizeSize (px) | number | 220 |
refractionRefraction | number | 0.6 |
dispersionDispersion | number | 0.5 |
magnifyMagnify | number | 1.5 |
followFollow pointer | boolean | false |
sceneScene | 'specimen' | 'data' | 'specimen' |
webglWebGL | boolean | true |