Files
hyperframes/registry/components/cursor/demo.html
T
Miguel Angel Simon Sierra e9172e3331 feat(registry): polish demo previews to shadcn-grade across catalog
Improve all 169 component demo previews for catalog legibility and polish:
- replace jagged clip-path cursor with a crisp SVG pointer (context-menu,
  cursor, simulated-cursor)
- scale under-sized UI primitives to fill the frame; enrich sparse demos
  with context (sibling rows, skeleton content, profile cards)
- normalize toward a neutral zinc/stone palette, bump small type, tidy
  spacing/radius/shadows
- preserve GSAP timelines, data-* composition attrs, and determinism
2026-06-25 00:57:26 -04:00

152 lines
4.2 KiB
HTML
Vendored

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Cursor - Demo</title>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
<style>
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
width: 1920px;
height: 1080px;
overflow: hidden;
}
#demo {
width: 1920px;
height: 1080px;
display: grid;
place-items: center;
background: #f4f4f5;
font-family: Inter, system-ui, sans-serif;
}
.demo-frame {
display: grid;
place-items: center;
min-width: 760px;
min-height: 480px;
padding: 56px;
/* ponytail: scale-up wrapper — not a GSAP target so transform is safe */
transform: scale(2.8);
}
.hf-ui-cursor-stage {
position: relative;
width: 420px;
height: 240px;
font-family: Inter, system-ui, sans-serif;
}
.hf-ui-cursor-target {
position: absolute;
left: 170px;
top: 84px;
display: grid;
place-items: center;
width: 150px;
height: 56px;
border-radius: 14px;
background: #18181b;
color: #ffffff;
font-size: 15px;
font-weight: 600;
letter-spacing: -0.01em;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.hf-ui-cursor-pointer {
position: absolute;
left: 70px;
top: 42px;
width: 30px;
height: 30px;
filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.3));
}
.hf-ui-cursor-ripple {
position: absolute;
left: 240px;
top: 112px;
width: 20px;
height: 20px;
border: 2px solid #18181b;
border-radius: 999px;
opacity: 0;
transform: translate(-50%, -50%) scale(0.2);
}
.hf-ui-cursor-label {
position: absolute;
left: 64px;
top: 88px;
padding: 7px 14px;
border-radius: 999px;
background: #ffffff;
color: #18181b;
font-size: 13px;
font-weight: 600;
letter-spacing: -0.01em;
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e4e7;
}
</style>
</head>
<body>
<div
id="demo"
data-composition-id="cursor-demo"
data-start="0"
data-width="1920"
data-height="1080"
data-duration="5"
>
<div class="demo-frame">
<div class="hf-ui-cursor-stage">
<div class="hf-ui-cursor-target">Generate</div>
<div class="hf-ui-cursor-ripple"></div>
<div class="hf-ui-cursor-pointer">
<svg width="30" height="30" viewBox="0 0 24 24" fill="none">
<path
d="M5.5 3.2 L5.5 19.6 L9.7 15.7 L12.5 21.9 L15.0 20.7 L12.3 14.6 L17.9 14.2 Z"
fill="#18181b"
stroke="#ffffff"
stroke-width="1.5"
stroke-linejoin="round"
/>
</svg>
</div>
<div class="hf-ui-cursor-label">Click</div>
</div>
</div>
<script>
const tl = gsap.timeline({ paused: true });
tl.fromTo(
".hf-ui-cursor-pointer",
{ x: 0, y: 0, opacity: 0 },
{ x: 154, y: 74, opacity: 1, duration: 0.82, ease: "power3.inOut" },
0.25,
);
tl.fromTo(
".hf-ui-cursor-label",
{ opacity: 0, y: 8 },
{ opacity: 1, y: 0, duration: 0.22, ease: "power2.out" },
0.35,
);
tl.fromTo(
".hf-ui-cursor-ripple",
{ opacity: 0.75, scale: 0.2 },
{ opacity: 0, scale: 2.7, duration: 0.54, ease: "power2.out" },
1.02,
);
tl.to(
".hf-ui-cursor-target",
{ scale: 0.96, duration: 0.1, yoyo: true, repeat: 1, ease: "power1.inOut" },
1.02,
);
tl.set({}, {}, 5);
window.__timelines = window.__timelines || {};
window.__timelines["cursor-demo"] = tl;
</script>
</div>
</body>
</html>