EffectsNew
Glass Logo Reveal
A logo sting: a capsule of thick glass carries your mark and name into view, then lands on the real lockup.
Requires WebGL2 and a mark from your origin or served with CORS. Without WebGL2 the finished lockup shows at once.
Preview
StartLockup
Demos ready. Update 0.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add https:/ / glassyui.com/ r/ glass-logo-reveal.jsonAdds 3 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassLogoReveal } from "@/components/glassyui/glass-logo-reveal";
export function Intro() {
return (
<GlassLogoReveal
className="w-full max-w-3xl rounded-3xl"
markSrc="/logo.svg"
name="Acme"
/>
);
}Examples
Play it again
const [run, setRun] = useState(0);
return (
<>
<GlassLogoReveal key={run} markSrc="/logo.svg" name="Acme" />
<button type="button" onClick={() => setRun(run + 1)}>
Replay
</button>
</>
);Scrub it with a slider
const [moment, setMoment] = useState<number>();
return (
<>
<GlassLogoReveal markSrc="/logo.svg" name="Acme" progress={moment} />
<input
aria-label="Moment"
max={100}
min={0}
type="range"
onChange={(event) => setMoment(Number(event.target.value) / 100)}
/>
</>
);Open a splash screen
const [splash, setSplash] = useState(true);
return splash ? (
<GlassLogoReveal
className="fixed inset-0 aspect-auto"
markSrc="/logo.svg"
name="Acme"
play="mount"
onComplete={() => setTimeout(() => setSplash(false), 600)}
/>
) : (
<App />
);Set the stage and the type
<GlassLogoReveal
className="aspect-[3/1] bg-black font-semibold text-white"
markSrc="/logo-white.svg"
name="Acme"
/>API reference
GlassLogoReveal
A figure with role img: the stage, drawn on a canvas, and the lockup it lands on. Its background is the stage and its colour the name; size the lockup with font-size.
| Prop | Type | Default | Description |
|---|---|---|---|
markSrcRequired | string | None | The mark, from your origin or served with CORS. An SVG stays sharp under the glass. |
nameRequired | string | None | The name set beside the mark, in the figure's font and colour. Also its accessible name. |
play | 'visible' | 'mount' | 'visible' | Plays once: when half the figure is on screen, or as soon as it mounts. |
progress | number | None | Holds one moment, from 0 (the empty stage) to 1 (the lockup), instead of playing. Clearing it plays on from there. |
duration | number | 2600 | Milliseconds from the empty stage to the lockup. |
onComplete | () => void | None | Called once the lockup has landed, or at once under reduced motion. |
Also accepts HTML figure attributes (no children).
- Types
GlassLogoRevealPropsGlassLogoRevealPlay- Accessibility
- The figure is named by name; pass aria-label for a fuller name. Reduced motion and reduced transparency show the lockup at once.