zerowing.in
PRISM 9 SMOKED OPTICAL GLASS INTERACTIONS

9 liquid-glass interactions built in live SDF math.

Zero frameworks, zero video embeds. Every component runs a live 2D signed-distance-field (smin) vector contour tracer and spring physics at 60 FPS. Click, hold, or drag any interaction, copy standalone code, or grab the full pack.

Click the glass pill to split & copy

All 9 interactions

Interactive right inside each card. Every download is a self-contained single-file demo that works offline.

01 copy.js · Click · Mitosis Split

Liquid Copy

Stretches straight upward into a refractive hourglass neck with a glowing violet prism pinch, then snaps cleanly into two floating optical lenses.

Download .html
Inspect SDF physics & prompt
copy.js 60 fps · sdf
1// Vertical liquid-glass mitosis split
2const pull = ease.inOutCubic(seg(t, 0.05, 0.70));
3const snap = ease.outBack(seg(t, 0.52, 1.16));
4const chipY = lerp(PILL_Y, PILL_Y - 54, pull) - 34 * snap;
5const k = lerp(40, 9, smoothstep(seg(t, 0.42, 0.78)));
6
7const sdf = (px, py) => {
8 const base = sdCapsuleH(px, py, CX, PILL_Y, w, h);
9 const chip = sdRoundBox(px, py, CX, chipY, cw, ch, ch);
10 return smin(base, chip, k);
11};
12this.applyGlass(sdf, bounds);
Build a Smoked Optical Glass 'Liquid Copy' micro-interaction in pure HTML/CSS/JS (zero frameworks) using a 60 FPS 2D signed-distance-field (cubic smin + sub-pixel Marching Squares SVG contour). Clicking the dark smoked-glass URL capsule stretches a cloned URL chip vertically out of the top through an hourglass glass neck with an internal violet caustic pinch, snaps it free into two floating optical lenses with a diagonal light glint, and wipes the parent pill into a compact smoked-indigo 'Copied' state.
02 hold.js · Press & Hold · Caustic Fill

Hold to Delete

Molten ruby caustic light floods left-to-right inside the smoked glass with a bulging refractive meniscus and rising micro-tremor before collapsing into Deleted.

Download .html
Inspect SDF physics & prompt
hold.js 60 fps · sdf
1// Molten ruby caustic meniscus & micro-tremor
2const p = clamp(this.progSpr.step(dt));
3const amp = ease.inCubic((p - 0.52) / 0.48) * 2.1;
4const frontX = (CX - w * 0.5) + w * p;
5const bump = Math.sin(p * Math.PI) * 5.8;
6
7const sdf = (px, py) => {
8 const pill = sdCapsuleH(px, py, CX, CY, w, h);
9 const wave = sdCircle(px, py, frontX, CY, r + bump);
10 return smin(pill, wave, 22);
11};
12this.applyGlass(sdf, bounds);
Build a Smoked Optical Glass 'Hold to Delete' Web Component using a real-time 2D SDF contour tracer at 60 FPS. Pressing and holding for 1.18s floods molten ruby optical fluid left-to-right inside the dark glass capsule, bulging the outer glass silhouette around the moving refractive meniscus via smin(sdCapsuleH, sdCircle, 22) while ramping micro-tremor above 52% progress, then collapsing smoothly into a compact smoked-ruby 'Deleted' lens. Releasing early springs back cleanly.
03 slide.js · Drag · Crystal Puck

Slide to Pay

A sculpted frosted crystal thumb puck glides along a smoked glass channel while the outer glass swells organically around it, leaving an emerald caustic wake.

Download .html
Inspect SDF physics & prompt
slide.js 60 fps · sdf
1// Crystal lens puck & emerald caustic wake
2const px = this.puckX.step(dt);
3const frac = clamp((px - TRACK_MIN) / TRACK_SPAN);
4const swell = Math.sin(frac * Math.PI) * 5.8;
5
6const sdf = (x, y) => {
7 const track = sdCapsuleH(x, y, CX, CY, w, BASE_H);
8 const puck = sdCircle(x, y, px, CY, 25 + swell);
9 return smin(track, puck, 24);
10};
11this.applyGlass(sdf, bounds);
12trail.setAttribute('width', Math.max(0, px - left + 4));
Build a Smoked Optical Glass 'Slide to Pay' Web Component in pure JS using 2D SDF smooth-minimum blending at 60 FPS. Dragging a frosted crystal lens thumb puck across the dark glass track swells the outer capsule contour dynamically around the puck position, paints a clipped emerald caustic fluid wake stopping flush at the puck center, crossfades 'Slide to pay · $48' into 'Release to confirm', and compacts into an emerald 'Paid · $48' confirmation lens.
04 voice.js · Click · Breathing Chamber

Voice Note

Starts as a circular smoked-glass mic lens, blooms into an acoustic chamber with 13 glowing coral filaments whose peak energy ripples the outer glass contour live.

Download .html
Inspect SDF physics & prompt
voice.js 60 fps · sdf
1// Audio-reactive breathing acoustic chamber
2const env = 0.55 + 0.45 * Math.sin(t * 2.8);
3const wave = 0.5 + 0.32 * Math.sin(t * 9.5 + i * 0.85);
4const bh = clamp(6 + wave * bell * 26 * env, 5, 32);
5const breathe = clamp((peakEnergy - 10) * 0.38, 0, 8.5);
6
7const sdf = (px, py) => {
8 const body = sdCapsuleH(px, py, CX, CY, w, h);
9 const pulse = sdCircle(px, py, peakX, CY, 25 + breathe);
10 return smin(body, pulse, 28);
11};
12this.applyGlass(sdf, bounds);
Build a Smoked Optical Glass 'Voice Note' Web Component in vanilla JS with 60 FPS 2D SDF contour tracing. Start as a 58x58 circular smoked-glass microphone orb; clicking springs it wide into a dark acoustic chamber containing 13 glowing coral-rose equalizer filaments and a live timer. Track peak bar energy and feed it into smin(sdCapsuleH, sdCircle(peakX), 28) so the glass casing physically breathes with the audio, then collapse to 'Sent · 0:02'.
05 volume.js · Drag · Rubber-Band Stretch

Elastic Volume

Drag past 0% or 100% and the entire smoked-glass bar physically elongates and thins with volume-conserving tanh rubber-band tension and a sapphire liquid meniscus.

Download .html
Inspect SDF physics & prompt
volume.js 60 fps · sdf
1// Volume-conserving rubber-band overstretch
2const over = this.overSpr.step(dt);
3const abs = Math.abs(over);
4
5const w = BASE_W + abs * 30;
6const h = BASE_H - abs * 9.5;
7const cx = CX + over * 18;
8
9const sdf = (px, py) => sdCapsuleH(px, py, cx, CY, w, h);
10this.applyGlass(sdf, bounds);
11fillClip.setAttribute('width', (w + 8) * v);
12meniscus.setAttribute('transform', `translate(${fx},0)`);
Build a Smoked Optical Glass 'Elastic Volume' slider Web Component in pure JS at 60 FPS. Dragging horizontally adjusts sapphire optical fluid fill (with dynamic speaker sound arcs and a glowing meniscus edge). Dragging past 0% or 100% engages tanh rubber-band overstretch that elongates the glass width while thinning its height (volume conservation) and shifting center offset, snapping back with a damped spring and sparkle burst on release.
06 share.js · Click · Radial Satellites

Share Bloom

Four circular smoked-crystal satellite lenses bud radially out of the main glass pill along liquid bridges, lift on hover, and re-absorb with a splash on selection.

Download .html
Inspect SDF physics & prompt
share.js 60 fps · sdf
1// Radial optical satellite lenses budding out
2const ox = lerp(CX, orb.ax, p);
3const oy = lerp(PILL_Y, orb.ay + hoverLift, p);
4const k = lerp(34, 10, smoothstep(seg(p, 0.45, 0.85)));
5
6const sdf = (px, py) => {
7 let d = sdCapsuleH(px, py, CX, PILL_Y, w, BASE_H);
8 for (const o of orbs) if (o.p > 0.03)
9 d = smin(d, sdCircle(px, py, o.ox, o.oy, o.r), o.k);
10 return d;
11};
12this.applyGlass(sdf, bounds);
Build a Smoked Optical Glass 'Share Bloom' Web Component in pure JS using 60 FPS 2D SDF smooth-minimum blending. Clicking 'Share' blooms 4 circular smoked-crystal satellite lenses (AirDrop, Mail, Send, Message) radially out of the capsule with staggered spring delays while dynamically tightening smin blend radius k from 34 to 10 so liquid bridges pinch cleanly off. Hovering lifts each lens with a colored caustic glow; clicking absorbs all orbs back into the pill with a liquid splash.
08 cart.js · Tap − / + · Directional Kick

Cart Stepper

Expands into a 3-chamber optical stepper with directional SDF cap bulges, amber caustic flares, rolling numeric odometer blur, and floating +1 / −1 badges.

Download .html
Inspect SDF physics & prompt
cart.js 60 fps · sdf
1// 3-chamber stepper with directional cap kick
2const nudge = this.nudgeSpr.step(dt);
3const shiftX = nudge * 6.5;
4const capX = CX + shiftX + side * (w * 0.5 - 22 + abs * 14);
5
6const sdf = (px, py) => {
7 const body = sdCapsuleH(px, py, CX + shiftX, CY, w, h);
8 const cap = sdCircle(px, py, capX, CY, 24 + abs * 5.5);
9 return smin(body, cap, 24);
10};
11this.applyGlass(sdf, bounds);
12numCurr.setAttribute('y', CY + 5 + (1 - rp) * 18 * dir);
Build a Smoked Optical Glass 'Cart Stepper' Web Component in vanilla JS using 60 FPS 2D SDF contours. Clicking 'Add · $24' expands into a 3-chamber smoked-glass stepper (− | count · price | +). Each tap imparts a directional spring impulse that bulges the tapped cap outward via smin(sdCapsuleH, sdCircle(capX), 24), fires an amber caustic flare inside that cap, rolls the odometer digits vertically with subtle motion blur, and floats a +1/−1 badge.
09 mode.js · Click / Drag · Velocity Morph

Theme Switch

A velocity-stretched liquid crystal orb glides across the smoked glass housing, morphing smoothly from Solar Quartz rays into a Lunar Eclipse crescent & starfield.

Download .html
Inspect SDF physics & prompt
mode.js 60 fps · sdf
1// Velocity-stretched liquid crystal eclipse switch
2const p = clamp(this.posSpr.step(dt));
3const vel = Math.abs(this.posSpr.vel);
4const stretch = clamp(vel * 0.65, 0, 5.5);
5
6const sdf = (px, py) =>
7 sdCapsuleH(px, py, CX, CY, W + stretch, H - stretch * 0.2);
8this.applyGlass(sdf, bounds);
9
10const mercuryW = 52 + clamp(vel * 3.4, 0, 22);
11const mercuryH = 52 - clamp(vel * 0.65, 0, 4.5);
12celestial.setAttribute('rotate', lerp(0, -135, p));
Build a Smoked Optical Glass 'Theme Switch' Web Component in pure JS at 60 FPS. Clicking or dragging the optical thumb stretches both the outer smoked-glass capsule and the inner crystal thumb proportionally to spring velocity (liquid mercury effect), crossfades warm Solar Quartz and deep Lunar Cobalt internal caustics, and smoothly morphs a rotating sun-with-rays SVG emblem into an eclipsed crescent moon with twinkling stars.