Files
hyperframes/registry/components/toggle/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

85 lines
2.1 KiB
HTML
Vendored

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Toggle - 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: #f7f7f8;
font-family: Inter, system-ui, sans-serif;
}
.demo-frame {
display: grid;
place-items: center;
min-width: 760px;
min-height: 480px;
padding: 56px;
}
.hf-ui-toggle {
--hf-toggle-scale: 1;
height: 44px;
padding: 0 16px;
border: 1px solid #d4d4d8;
border-radius: 10px;
background: #fff;
color: #18181b;
font:
850 15px/1 Inter,
system-ui,
sans-serif;
cursor: default;
transform: scale(var(--hf-toggle-scale));
}
.hf-ui-toggle[aria-pressed="true"] {
background: #18181b;
color: #fff;
border-color: #18181b;
}
.demo-frame { transform: scale(1.5); } /* qa-scale */
</style>
</head>
<body>
<div
id="demo"
data-composition-id="toggle-demo"
data-start="0"
data-width="1920"
data-height="1080"
data-duration="5"
>
<div class="demo-frame">
<button class="hf-ui-toggle" type="button" aria-pressed="true">Bold</button>
</div>
<script>
const tl = gsap.timeline({ paused: true });
const startTime = 0.45;
tl.fromTo(
".hf-ui-toggle",
{ "--hf-toggle-scale": 0.9 },
{ "--hf-toggle-scale": 1, duration: 0.24, ease: "back.out(1.8)" },
startTime,
);
tl.set({}, {}, 5);
window.__timelines = window.__timelines || {};
window.__timelines["toggle-demo"] = tl;
</script>
</div>
</body>
</html>