Animations110 / 118
Holo Coins
A carousel of black-chrome coins with holographic reeded edges, each bearing your emblem. The coin coming to the centre flips to face you, its emblem turns holographic, and it lands with the settling wobble of a dropped coin; tilt it with your cursor, drag the row, or click to flip it twice.
three.jsthree.jsCarouselCarouselChromeChromeIridescenceIridescenceSpringsSpringsGSAPGSAP
Tilt the coin, drag to scrollClick the coin to flip it
Tweak
LIVELIVECoins
1.00
Motion
3.2s
Usage
Follows your tweaks.
usage.tsx
import { HoloCoins } from "@/components/inreact/holo-coins";
// one coin per emblem: SVG path data in a 100 x 100 box (your logos, features, partners)
const emblems = [
"M14 80 L44 22 L58 48 L68 32 L88 80 Z",
"M50 12 L82 44 L50 88 L18 44 Z",
// ...
];
export function Showcase() {
return (
<section className="h-[520px] bg-black">
<HoloCoins emblems={emblems} interval={3.2} holo={1} onChange={(i) => console.log(i)} />
</section>
);
}Install with the CLI
TS + Tailwind
npx shadcn@latest add https://inreact.vercel.app/r/holo-coins.jsonOr copy the source
Install the dependencies, then save this as components/inreact/holo-coins.tsx.
terminal
npm install gsap threecomponents/inreact/holo-coins.tsx
"use client";
import { gsap } from "gsap";
import { useEffect, useRef } from "react";
import * as THREE from "three";
import { SVGLoader } from "three/addons/loaders/SVGLoader.js";
/**
* Holo Coins: a carousel of black-chrome coins with holographic reeded edges, rendered live in
* three.js. Show your products, features or partners as emblems on real, flipping coins.
*
* - Each coin is real geometry: a chrome body, a reeded edge that flashes rainbow as it turns,
* a ring of dashes round the face, and your emblem raised from it.
* - The row advances on its own: the coin coming to the centre flips to face you, its emblem
* turns holographic, and it lands with the settling wobble of a dropped coin.
* - The centre coin tilts toward the cursor, sweeping the rainbow across its edge and emblem.
* - Drag to scroll the row (it coasts and snaps, with overshoot); arrow keys step through.
* - Click (or Enter / Space): the centre coin dips, flips twice and lands with a wobble.
*
* Emblems are SVG path strings drawn in a 100 x 100 box.
*
* <div className="h-[520px] bg-black"><HoloCoins /></div>
*/
export type HoloCoinsProps = {
/** SVG path data for each coin's emblem (100 x 100 box). One coin per emblem. */
emblems?: string[];
/** Seconds between automatic steps (0 = no autoplay). */
interval?: number;
/** Strength of the rainbow on edges and emblems, 0 to 1.5. */
holo?: number;
/** Background colour. */
background?: string;
/** Called with the index of the coin that comes to the centre. */
onChange?: (index: number) => void;
className?: string;
};
// original geometric emblems
export const DEFAULT_EMBLEMS = [
"M14 80 L44 22 L58 48 L68 32 L88 80 Z", // peaks
"M50 12 L82 44 L50 88 L18 44 Z M50 26 L34 44 L50 70 L66 44 Z", // gem
"M50 10 L59 41 L90 50 L59 59 L50 90 L41 59 L10 50 L41 41 Z", // spark
"M56 8 L22 56 L46 56 L38 92 L78 40 L54 40 Z", // bolt
"M50 12 L83 31 L83 69 L50 88 L17 69 L17 31 Z M50 28 L69 39 L69 61 L50 72 L31 61 L31 39 Z", // hex
"M18 70 L50 18 L82 70 Z M50 44 L64 70 L36 70 Z", // delta
];
const reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
function emblemGeometry(d: string) {
const loader = new SVGLoader();
const data = loader.parse(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="${d}"/></svg>`);
const shapes = data.paths.flatMap((p) => p.toShapes());
const g = new THREE.ExtrudeGeometry(shapes, { depth: 3, bevelEnabled: true, bevelThickness: 1.2, bevelSize: 1.4, bevelSegments: 3, curveSegments: 16 });
g.translate(-50, -50, 0);
g.scale(0.0105, -0.0105, -0.0105); // SVG y runs down; mirror z too so the faces keep their winding
g.translate(0, 0, 0.0445); // its back now sits at z = 0
g.computeVertexNormals();
return g;
}
export function HoloCoins({ emblems = DEFAULT_EMBLEMS, interval = 3.2, holo = 1, background = "#000000", onChange, className }: HoloCoinsProps) {
const rootRef = useRef<HTMLDivElement>(null);
const live = useRef({ interval, holo, onChange });
live.current = { interval, holo, onChange };
const key = emblems.join("|");
useEffect(() => {
const root = rootRef.current;
if (!root) return;
const still = reduced();
const list = emblems.length ? emblems : DEFAULT_EMBLEMS;
const N = list.length;
const canvas = document.createElement("canvas");
canvas.style.cssText = "position:absolute;inset:0;width:100%;height:100%;display:block;";
root.appendChild(canvas);
let renderer: THREE.WebGLRenderer;
try {
renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: false, powerPreference: "high-performance" });
} catch {
canvas.remove();
return;
}
const dpr = Math.min(2, Math.max(1.25, window.devicePixelRatio || 1));
renderer.setPixelRatio(dpr);
renderer.setClearColor(new THREE.Color(background), 1);
renderer.toneMapping = THREE.NeutralToneMapping;
renderer.toneMappingExposure = 1.25;
renderer.outputColorSpace = THREE.SRGBColorSpace;
const scene = new THREE.Scene();
scene.fog = new THREE.Fog(new THREE.Color(background), 5.5, 10.5); // the outer coins fall away into the dark
// a dark studio of thin strip lights: chrome reads as crisp bright lines on black
const pmrem = new THREE.PMREMGenerator(renderer);
const studio = new THREE.Scene();
const envMat = new THREE.ShaderMaterial({
side: THREE.BackSide,
vertexShader: "varying vec3 vD;\nvoid main(){ vD = position; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }",
fragmentShader: `
varying vec3 vD;
float strip(float a, float c, float w){ return smoothstep(w, w * 0.4, abs(a - c)); }
void main(){
vec3 d = normalize(vD);
vec3 c = vec3(0.004);
float az = atan(d.x, d.z), el = asin(clamp(d.y, -1.0, 1.0));
// soft boxes: a broad one in front (it lights the chrome lips), a big key to the upper left, a long band, a cool fill below
c += vec3(1.0) * smoothstep(1.75, 1.2, abs(az + 0.1)) * smoothstep(0.66, 0.4, abs(el - 0.12)) * 3.0;
c += vec3(1.0) * smoothstep(0.42, 0.3, abs(az + 0.55)) * smoothstep(0.32, 0.2, abs(el - 0.35)) * 3.2;
c += vec3(0.95, 0.97, 1.0) * smoothstep(0.9, 0.6, abs(az)) * smoothstep(0.12, 0.05, abs(el - 0.05)) * 1.6;
c += vec3(0.7, 0.8, 1.0) * smoothstep(0.5, 0.3, abs(az - 0.6)) * smoothstep(0.2, 0.1, abs(el + 0.45)) * 1.2;
c += vec3(1.0) * strip(az, -0.7, 0.05) * smoothstep(0.9, 0.2, abs(el)) * 4.0;
c += vec3(1.0) * strip(az, 0.9, 0.035) * smoothstep(0.9, 0.2, abs(el)) * 3.0;
c += vec3(1.0) * strip(el, 0.75, 0.04) * 2.5;
c += vec3(0.85, 0.9, 1.0) * strip(el, -0.5, 0.05) * smoothstep(1.4, 0.4, abs(az)) * 1.6;
c += vec3(0.75, 0.85, 0.9) * strip(az, 2.4, 0.08) * smoothstep(0.5, 0.2, abs(el - 0.3)) * 0.6;
c += vec3(0.85, 0.75, 0.85) * strip(az, -2.3, 0.08) * smoothstep(0.5, 0.2, abs(el + 0.3)) * 0.5;
c += vec3(1.0) * smoothstep(0.985, 0.995, dot(d, normalize(vec3(-0.4, 0.5, 0.8)))) * 8.0;
gl_FragColor = vec4(c, 1.0);
}`,
});
const envSphere = new THREE.Mesh(new THREE.SphereGeometry(10, 96, 48), envMat);
studio.add(envSphere);
const env = pmrem.fromScene(studio, 0.01).texture;
envSphere.geometry.dispose();
envMat.dispose();
scene.environment = env;
// ---- shared coin parts ----
// a thick coin: a bright chrome lip round a recessed smoked-glass face, and a reeded edge band
const R = 1, HT = 0.15, FZ = 0.1, FR = 0.8;
const rimProf = [
new THREE.Vector2(FR, -FZ),
new THREE.Vector2(FR + 0.035, -HT + 0.008),
new THREE.Vector2(FR + 0.06, -HT),
new THREE.Vector2(R - 0.05, -HT),
new THREE.Vector2(R - 0.012, -HT + 0.012),
new THREE.Vector2(R, -HT + 0.05),
new THREE.Vector2(R, HT - 0.05),
new THREE.Vector2(R - 0.012, HT - 0.012),
new THREE.Vector2(R - 0.05, HT),
new THREE.Vector2(FR + 0.06, HT),
new THREE.Vector2(FR + 0.035, HT - 0.008),
new THREE.Vector2(FR, FZ),
];
const rimGeo = new THREE.LatheGeometry(rimProf, 160);
rimGeo.rotateX(Math.PI / 2); // axis along z: faces toward the camera
rimGeo.computeVertexNormals();
const faceGeo = new THREE.CircleGeometry(FR + 0.002, 96);
// the reeded edge: a band of fine ridges round the rim
const RIDGES = 150;
const edgeGeo = new THREE.CylinderGeometry(1, 1, (HT - 0.05) * 2, RIDGES * 4, 1, true);
{
const p = edgeGeo.attributes.position as THREE.BufferAttribute;
for (let i = 0; i < p.count; i++) {
const a = Math.atan2(p.getZ(i), p.getX(i));
const f = (((a / (Math.PI * 2)) * RIDGES) % 1 + 1) % 1;
const r = R + 0.003 + (Math.abs(f - 0.5) < 0.25 ? 0.009 : 0);
p.setX(i, Math.cos(a) * r);
p.setZ(i, Math.sin(a) * r);
}
edgeGeo.rotateX(Math.PI / 2);
edgeGeo.computeVertexNormals();
}
// a ring of dashes round the face, on both sides
const dashGeo = new THREE.BoxGeometry(0.05, 0.011, 0.006);
const DASHES = 48;
const chrome = new THREE.MeshPhysicalMaterial({ color: 0xf6f7fa, metalness: 1, roughness: 0.13, envMapIntensity: 2.1 });
const face = new THREE.MeshPhysicalMaterial({ color: 0x000000, metalness: 0, roughness: 0.06, specularIntensity: 0.6, envMapIntensity: 0.35 });
const holoMat = (strength: number, color: number) =>
new THREE.MeshPhysicalMaterial({
color,
metalness: 1,
roughness: 0.12,
iridescence: strength,
iridescenceIOR: 2.0,
iridescenceThicknessMinimum: 150,
iridescenceThicknessMaximum: 1000,
envMapIntensity: 1.6,
});
// the holographic film: whatever light the metal reflects is split into a spectrum that slides
// with the surface's angle to you, so the rainbow sweeps across the edge as the coin turns
const timeU = { value: 0 };
const holoFilm = (m: THREE.MeshPhysicalMaterial, amount: { value: number }) => {
m.iridescence = 0;
m.onBeforeCompile = (sh) => {
sh.uniforms.uHolo = amount;
sh.uniforms.uTime = timeU;
sh.fragmentShader = sh.fragmentShader
.replace(
"#include <common>",
`#include <common>
uniform float uHolo; uniform float uTime;
vec3 spectrum(float h){ return clamp(abs(mod(h * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0); }`,
)
.replace(
"#include <dithering_fragment>",
`#include <dithering_fragment>
{
vec3 n = normalize(normal);
float f = dot(n, normalize(vViewPosition));
vec3 sp = spectrum(fract(f * 1.4 + n.y * 0.7 + n.x * 0.5 + uTime * 0.04));
float l = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
// only the highlights split into colour: the dark metal stays dark, like real holographic foil
float hot = smoothstep(0.12, 0.85, l);
gl_FragColor.rgb = mix(gl_FragColor.rgb, (sp * 0.8 + 0.2) * l * 1.55, clamp(uHolo, 0.0, 1.0) * 0.85 * hot);
}`,
);
};
m.customProgramCacheKey = () => "holo-film";
return m;
};
const edgeHolo = { value: 1 };
const edgeMat = holoFilm(holoMat(0, 0x6a6a72), edgeHolo);
const dashMat = holoMat(0.8, 0x9a9aa2);
type Coin = { g: THREE.Group; spin: THREE.Group; wob: THREE.Group; emblemMat: THREE.MeshPhysicalMaterial; emHolo: { value: number }; emGeo: THREE.BufferGeometry; flip: { x: number; v: number; t: number }; glow: number; wobT: number; wobA: number };
const coins: Coin[] = [];
const scene3 = new THREE.Group();
scene.add(scene3);
list.forEach((d) => {
const g = new THREE.Group(); // carousel slot
const wob = new THREE.Group(); // settling wobble
const spin = new THREE.Group(); // flips
g.add(wob);
wob.add(spin);
spin.add(new THREE.Mesh(rimGeo, chrome), new THREE.Mesh(edgeGeo, edgeMat));
const f1 = new THREE.Mesh(faceGeo, face);
f1.position.z = FZ;
const f2 = new THREE.Mesh(faceGeo, face);
f2.position.z = -FZ;
f2.rotation.y = Math.PI;
spin.add(f1, f2);
const dashes = new THREE.InstancedMesh(dashGeo, dashMat, DASHES * 2);
const m = new THREE.Matrix4(), q = new THREE.Quaternion(), s = new THREE.Vector3(1, 1, 1), pz = new THREE.Vector3(), zAx = new THREE.Vector3(0, 0, 1);
for (let i = 0; i < DASHES * 2; i++) {
const a = ((i % DASHES) / DASHES) * Math.PI * 2;
const side = i < DASHES ? 1 : -1;
q.setFromAxisAngle(zAx, a + Math.PI / 2);
pz.set(Math.cos(a) * 0.74, Math.sin(a) * 0.74, side * (FZ + 0.003));
m.compose(pz, q, s);
dashes.setMatrixAt(i, m);
}
spin.add(dashes);
const emGeo = emblemGeometry(d);
const emHolo = { value: 0 };
const emblemMat = holoFilm(holoMat(0, 0x2a2a30), emHolo);
emblemMat.roughness = 0.32; // satin, so the raised emblem catches the broad lights
const em = new THREE.Mesh(emGeo, emblemMat);
em.position.z = FZ - 0.004;
const emBack = new THREE.Mesh(emGeo, emblemMat);
emBack.position.z = -FZ + 0.004;
emBack.rotation.y = Math.PI;
spin.add(em, emBack);
scene3.add(g);
coins.push({ g, spin, wob, emblemMat, emHolo, emGeo, flip: { x: 0, v: 0, t: 0 }, glow: 0, wobT: 9, wobA: 0 });
});
const camera = new THREE.PerspectiveCamera(28, 1, 0.1, 50);
let W = 0, H = 0;
const resize = () => {
const w = root.clientWidth, h = root.clientHeight;
if (w < 2 || h < 2 || (w === W && h === H)) return;
W = w;
H = h;
renderer.setSize(W, H, false);
camera.aspect = W / H;
const t = Math.tan(THREE.MathUtils.degToRad(14));
// keep the centre coin (with room to tilt) and a glimpse of its neighbours in view
camera.position.set(0, 0, Math.max(3.1 / (2 * t), 4.4 / (2 * t * camera.aspect)));
camera.lookAt(0, 0, 0);
camera.updateProjectionMatrix();
};
resize();
const ro = new ResizeObserver(resize);
ro.observe(root);
// ---- motion ----
type Spring = { x: number; v: number; t: number; k: number; c: number };
const sp = (x: number, k: number, c: number): Spring => ({ x, v: 0, t: x, k, c });
const step = (s: { x: number; v: number; t: number }, k: number, c: number, dt: number) => {
const h = dt / 2;
for (let i = 0; i < 2; i++) {
s.v += (k * (s.t - s.x) - c * s.v) * h;
s.x += s.v * h;
}
};
const idx = sp(0, 55, 10.5); // the row glides and settles with a touch of overshoot
const tiltX = sp(0, 40, 8), tiltY = sp(0, 40, 8);
const dip = sp(1, 180, 9);
let current = 0;
let lastInteract = -9;
let autoAt = 1.2;
let pointer: { x: number; y: number } | null = null;
let drag: { x: number; t: number; v: number; sx: number; sy: number; t0: number; id: number } | null = null;
const calls: gsap.core.Tween[] = [];
let t = 0;
const wrap = (i: number) => ((i % N) + N) % N;
const arrive = (i: number) => {
const c = coins[wrap(i)];
if (still) return;
// the coin coming to the centre flips round to face you, then settles with a wobble
c.flip.t = Math.round(c.flip.t / (Math.PI * 2)) * Math.PI * 2 + Math.PI * 2;
c.wobT = -0.55;
c.wobA = 0.22;
};
const goTo = (target: number) => {
idx.t = target;
const w = wrap(Math.round(target));
if (w !== current) {
current = w;
live.current.onChange?.(w);
arrive(Math.round(target));
}
};
const flick = () => {
const c = coins[current];
if (still) return;
dip.t = 0.9; // anticipation
calls.push(
gsap.delayedCall(0.12, () => {
dip.t = 1;
dip.v += 2.2;
c.flip.t += Math.PI * 4;
c.wobT = -0.75;
c.wobA = 0.28;
}),
);
};
if (!still) arrive(0);
let visible = true;
const io = new IntersectionObserver(([e]) => (visible = e.isIntersecting), { rootMargin: "80px" });
io.observe(root);
const tick = (_time: number, dms: number) => {
const dt = Math.min(0.05, Math.max(0.001, dms / 1000));
t += dt;
const L2 = live.current;
// autoplay, paused while someone is interacting
if (!still && L2.interval > 0 && !drag && t > autoAt && t - lastInteract > 2.2) {
goTo(Math.round(idx.t) + 1);
autoAt = t + L2.interval;
}
if (!drag) step(idx, idx.k, idx.c, dt);
const px = pointer ? (pointer.x / W) * 2 - 1 : 0;
const py = pointer ? -((pointer.y / H) * 2 - 1) : 0;
tiltX.t = still ? 0 : -py * 0.45;
tiltY.t = still ? 0 : px * 0.6;
[tiltX, tiltY, dip].forEach((s) => step(s, s.k, s.c, dt));
coins.forEach((c, i) => {
// place each coin on a shallow arc, nearest-wrap to the centre
let o = i - idx.x;
o = o - Math.round(o / N) * N;
const ao = Math.abs(o);
c.g.position.set(o * 2.05, 0, -Math.pow(ao, 1.25) * 1.3);
const s = (1 - 0.2 * Math.min(ao, 2)) * (ao < 0.5 ? Math.max(0.7, dip.x) : 1);
c.g.scale.setScalar(s);
// side coins turn toward the centre, like the pages of a fanned book
const focus = Math.max(0, 1 - ao);
// the centre coin sways slowly so its reeded edge keeps catching the light
const sway = still ? 0.55 : Math.sin(t * 0.55) * 0.5 + 0.35;
c.g.rotation.set(tiltX.x * focus, -o * 0.55 + (tiltY.x + sway) * focus, 0);
step(c.flip, 34, 6.2, dt);
c.spin.rotation.y = c.flip.x;
// the settling wobble of a dropped coin: a precession that dies away
c.wobT += dt;
if (c.wobT > 0) {
const a = c.wobA * Math.exp(-c.wobT * 2.4);
c.wob.rotation.set(Math.sin(c.wobT * 13) * a, 0, Math.cos(c.wobT * 13) * a * 0.6);
} else c.wob.rotation.set(0, 0, 0);
// the emblem on the centre coin turns holographic
c.glow += (focus - c.glow) * (1 - Math.exp(-dt * 6));
c.emHolo.value = c.glow * L2.holo;
c.emblemMat.color.setRGB(0.16 + 0.84 * c.glow, 0.16 + 0.84 * c.glow, 0.19 + 0.81 * c.glow);
});
edgeHolo.value = L2.holo;
timeU.value = t;
dashMat.iridescence = Math.min(1.5, L2.holo * 0.8);
if (visible && W) renderer.render(scene, camera);
};
gsap.ticker.add(tick);
// ---- input ----
const local = (e: PointerEvent) => {
const r = root.getBoundingClientRect();
return { x: e.clientX - r.left, y: e.clientY - r.top };
};
const unitPx = () => (W / (2 * Math.tan(THREE.MathUtils.degToRad(14)) * camera.aspect * camera.position.z)) * 2.05;
const onMove = (e: PointerEvent) => {
pointer = local(e);
if (!drag) return;
const now = performance.now();
const dx = e.clientX - drag.x;
const ddt = Math.max(8, now - drag.t) / 1000;
idx.x -= dx / unitPx();
drag.v = THREE.MathUtils.lerp(drag.v, -dx / unitPx() / ddt, 0.5);
drag.x = e.clientX;
drag.t = now;
lastInteract = t;
};
const onDown = (e: PointerEvent) => {
if (e.button !== 0) return;
const now = performance.now();
drag = { x: e.clientX, t: now, v: 0, sx: e.clientX, sy: e.clientY, t0: now, id: e.pointerId };
idx.v = 0;
lastInteract = t;
try {
root.setPointerCapture(e.pointerId);
} catch {
/* synthetic pointers can't be captured */
}
};
const onUp = (e: PointerEvent) => {
if (!drag) return;
const moved = Math.hypot(e.clientX - drag.sx, e.clientY - drag.sy);
const quick = performance.now() - drag.t0 < 450;
try {
root.releasePointerCapture(drag.id);
} catch {
/* not captured */
}
const v = drag.v;
drag = null;
lastInteract = t;
autoAt = t + live.current.interval;
if (moved < 7 && quick) {
// a click on a side coin brings it to the centre; on the centre coin, it flips
const p = local(e);
const side = (p.x - W / 2) / unitPx();
if (Math.abs(side) > 0.6) goTo(Math.round(idx.x) + Math.sign(side));
else flick();
} else {
// let go: it coasts with your throw and snaps to the nearest coin
idx.v = v;
goTo(Math.round(idx.x + v * 0.25));
}
};
const onLeave = () => {
if (!drag) pointer = null;
};
const onKey = (e: KeyboardEvent) => {
if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
e.preventDefault();
lastInteract = t;
autoAt = t + live.current.interval;
goTo(Math.round(idx.t) + (e.key === "ArrowRight" ? 1 : -1));
} else if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
flick();
}
};
root.addEventListener("pointermove", onMove);
root.addEventListener("pointerdown", onDown);
root.addEventListener("pointerup", onUp);
root.addEventListener("pointercancel", onUp);
root.addEventListener("pointerleave", onLeave);
root.addEventListener("keydown", onKey);
return () => {
gsap.ticker.remove(tick);
calls.forEach((c) => c.kill());
io.disconnect();
ro.disconnect();
root.removeEventListener("pointermove", onMove);
root.removeEventListener("pointerdown", onDown);
root.removeEventListener("pointerup", onUp);
root.removeEventListener("pointercancel", onUp);
root.removeEventListener("pointerleave", onLeave);
root.removeEventListener("keydown", onKey);
coins.forEach((c) => {
c.emGeo.dispose();
c.emblemMat.dispose();
});
[rimGeo, faceGeo, edgeGeo, dashGeo].forEach((g) => g.dispose());
[chrome, face, edgeMat, dashMat].forEach((m) => m.dispose());
env.dispose();
pmrem.dispose();
renderer.dispose();
canvas.remove();
};
}, [key, background]); // eslint-disable-line react-hooks/exhaustive-deps
return (
<div
ref={rootRef}
tabIndex={0}
role="region"
aria-roledescription="carousel"
aria-label="Coins. Drag or use the arrow keys to browse, press Enter to flip."
className={["relative h-full min-h-[260px] w-full cursor-grab touch-none overflow-hidden outline-none select-none active:cursor-grabbing", className].filter(Boolean).join(" ")}
style={{ background }}
/>
);
}
export default HoloCoins;
One prompt, any AI agent
Paste into Claude Code, Codex, Cursor or Windsurf. It carries your tweaks and the full source, so the agent installs it exactly.
Props
6 propsemblemsstring[]SVG path data for each coin's emblem (100 x 100 box). One coin per emblem.default six geometric emblemsdefault six geometric emblemsintervalnumberSeconds between automatic steps (0 = no autoplay).default 3.2default 3.2holonumberStrength of the rainbow on edges and emblems, 0 to 1.5.default 1default 1onChange(index) => voidCalled when a coin comes to the centre.backgroundstringBackground colour.default "#000000"default "#000000"classNamestringExtra classes (it fills its parent).