Files
hyperframes/registry/components/per-word-crossfade/demo.html
T
Miguel Ángel 9734578e60 feat(registry): bring back the video-primitive moves (#3169)
Restores the 208 catalog items reverted after their previews 404'd in
production, this time on the payload mechanism rather than the .html files
that caused the outage.

The generator no longer writes a preview document to docs/public. That writer,
and the machinery under it, existed only to produce files the docs host
discards, so it is gone rather than bypassed. Items now embed the composition
itself via a payload, which is what the previous change already does for the
items that were already in the catalog.

The variables explorer is parked, not restored: it drove its preview through
the same unpublished .html path, so it would have shown an empty frame. Items
that declare variables get the live player plus the static variables table, and
reconnecting the explorer to payloads is a follow-up.
2026-08-10 18:46:03 -04:00

143 lines
3.9 KiB
HTML
Vendored

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Per-Word Crossfade - 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: #fafafa;
font-family: Inter, system-ui, sans-serif;
}
.demo-frame {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 40px;
width: 1920px;
height: 1080px;
padding: 120px 160px;
}
/* outgoing phrase — static, fades out */
.phrase-out {
display: inline-flex;
gap: 28px;
font-size: 128px;
font-weight: 900;
letter-spacing: -0.04em;
line-height: 1;
color: #71717a;
font-family: Inter, system-ui, sans-serif;
position: relative;
}
.phrase-out span {
display: inline-block;
will-change: opacity;
}
/* incoming phrase — the GSAP-animated element */
.hf-remocn-per-word-crossfade {
color: #18181b;
font-family: Inter, system-ui, sans-serif;
font-weight: 900;
letter-spacing: -0.04em;
}
.hf-remocn-per-word-crossfade {
display: inline-flex;
gap: 28px;
font-size: 128px;
line-height: 1;
}
.hf-remocn-per-word-crossfade span {
display: inline-block;
transform: translate(var(--hf-word-x, 0px), var(--hf-word-y, 0px))
scale(var(--hf-word-scale, 1));
filter: blur(var(--hf-word-blur, 0px));
will-change: transform, filter, opacity;
}
/* label */
.demo-label {
font-size: 26px;
font-weight: 500;
color: #a1a1aa;
letter-spacing: 0.08em;
text-transform: uppercase;
margin-top: 24px;
}
</style>
</head>
<body>
<div
id="demo"
data-composition-id="per-word-crossfade-demo"
data-start="0"
data-width="1920"
data-height="1080"
data-duration="5"
>
<div class="demo-frame">
<!-- outgoing phrase: fades out word-by-word -->
<div class="phrase-out">
<span>Write</span><span>once</span><span>publish</span><span>anywhere</span>
</div>
<!-- incoming phrase: per-word crossfade in -->
<div class="hf-remocn-per-word-crossfade">
<span>Create</span><span>once</span><span>reuse</span><span>everywhere</span>
</div>
<div class="demo-label">per-word crossfade</div>
</div>
<script>
const tl = gsap.timeline({ paused: true });
const startTime = 0.5;
// outgoing phrase fades out word-by-word
tl.to(
".phrase-out span",
{
opacity: 0,
duration: 0.25,
stagger: 0.055,
ease: "power2.in",
},
startTime,
);
// incoming phrase fades in word-by-word (the named component)
tl.fromTo(
".hf-remocn-per-word-crossfade span",
{ opacity: 0, "--hf-word-y": "22px", "--hf-word-scale": 0.92, "--hf-word-blur": "5px" },
{
opacity: 1,
"--hf-word-y": "0px",
"--hf-word-scale": 1,
"--hf-word-blur": "0px",
duration: 0.3,
stagger: 0.055,
ease: "power3.out",
},
startTime + 0.1,
);
tl.set({}, {}, 5);
window.__timelines = window.__timelines || {};
window.__timelines["per-word-crossfade-demo"] = tl;
</script>
</div>
</body>
</html>