About
A clock, or a countdown, cast in liquid mercury. Each digit melts into the next as it changes, wobbling like a drop, while soft studio lights slide across the metal. The pointer warms the surface into ripples; a click sends a splash ring across every digit.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Mercury Clock to your project and fits it to your theme.
Code
How Mercury Clock is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import type { ReactNode } from "react";
import { MercuryClock } from "@/components/ui/mercury-clock";
const settings = {
mode: "Countdown",
melt: 0.9,
tint: "#7fb2ff"
};
/* The demo's Google Fonts. In a Next.js app, use next/font/google instead. */
if (typeof document !== "undefined" && !document.getElementById("mercury-clock-fonts")) {
const style = document.createElement("style");
style.id = "mercury-clock-fonts";
style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@100..900&display=swap'); .rh-inter-tight { font-family: 'Inter Tight', sans-serif; }";
document.head.appendChild(style);
}
/** A gentle entrance: rises and fades in, a beat after `delay` seconds. */
function Rise({ children, delay = 0, className = "" }: { children: ReactNode; delay?: number; className?: string }) {
return (
<div className={className} style={{ animation: `rh-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) ${delay}s both` }}>
<style>{`@keyframes rh-rise { from { opacity: 0; transform: translateY(28px); } } @media (prefers-reduced-motion: reduce) { @keyframes rh-rise { from { opacity: 0; } } }`}</style>
{children}
</div>
);
}
const type = { className: "rh-inter-tight", style: { fontFamily: "'Inter Tight', sans-serif" } };
// A drop two and a half days away, fixed when the page loads.
const DROP = new Date(Date.now() + ((2 * 24 + 14) * 3600 + 37 * 60 + 12) * 1000);
function DemoContent(props: Partial<typeof settings> = {}) {
const v = { ...settings, ...props };
const countdown = v.mode === "Countdown";
return (
<main className={`${type.className} relative grid h-svh cursor-crosshair grid-rows-[auto_1fr_auto] overflow-hidden bg-[#050608] bg-[radial-gradient(80%_60%_at_50%_55%,#121826,transparent)] text-[#e9eef7]`}>
<Rise className="flex justify-between gap-6 p-[5vmin] text-[14px]">
<span className="font-semibold">Halcyon 04</span>
<span className="text-[#e9eef7]/60">{countdown ? "The drop opens in" : "Time in your city"}</span>
</Rise>
<MercuryClock to={countdown ? DROP : undefined} melt={Number(v.melt)} tint={String(v.tint)} weight={600} className={type.className} />
<Rise delay={0.15} className="flex items-end justify-between gap-6 p-[5vmin] text-[14px] text-[#e9eef7]/60">
<span className="max-w-[18rem]">{countdown ? "Days, hours, minutes, seconds. Two hundred pieces, no restock." : "Hours, minutes, seconds, cast fresh every second."}</span>
<span className="hidden sm:block">Move to warm it, click to splash it</span>
</Rise>
</main>
);
}
/** The demo in its own colours, filling the frame. */
export default function Demo(props: Partial<typeof settings> = {}) {
return (
<div className="min-h-svh w-full" style={{ background: "#050608" }}>
<DemoContent {...props} />
</div>
);
}
















