Files
2026-08-13 21:10:12 -04:00

101 lines
2.8 KiB
HTML
Vendored

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Strikethrough Replace - 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: 900px;
min-height: 500px;
padding: 64px;
/* ponytail: scale non-GSAP wrapper; GSAP targets are children */
transform: scale(2.8);
}
.hf-catalog-strikethrough-replace {
color: #18181b;
font-family: Inter, system-ui, sans-serif;
font-weight: 900;
letter-spacing: -0.04em;
}
.hf-catalog-strikethrough-replace {
position: relative;
display: inline-grid;
grid-auto-flow: column;
gap: 18px;
align-items: center;
font-size: 58px;
}
.hf-catalog-strikethrough-replace i {
position: absolute;
left: 0;
width: 48%;
height: 6px;
border-radius: 999px;
background: #ef4444;
transform: scaleX(var(--hf-strike-progress, 1));
transform-origin: left center;
}
.hf-catalog-strikethrough-replace strong {
opacity: var(--hf-replace-opacity, 1);
}
</style>
</head>
<body>
<div
id="demo"
data-composition-id="strikethrough-replace-demo"
data-start="0"
data-width="1920"
data-height="1080"
data-duration="5"
>
<div class="demo-frame">
<div class="hf-catalog-strikethrough-replace">
<span>Slow</span><i></i><strong>Fast</strong>
</div>
</div>
<script>
const tl = gsap.timeline({ paused: true });
const startTime = 0.5;
tl.fromTo(
".hf-catalog-strikethrough-replace i",
{ "--hf-strike-progress": 0 },
{ "--hf-strike-progress": 1, duration: 0.28, ease: "power2.out" },
startTime,
);
tl.fromTo(
".hf-catalog-strikethrough-replace strong",
{ "--hf-replace-opacity": 0, y: 14 },
{ "--hf-replace-opacity": 1, y: 0, duration: 0.3, ease: "power2.out" },
startTime + 0.24,
);
tl.set({}, {}, 5);
window.__timelines = window.__timelines || {};
window.__timelines["strikethrough-replace-demo"] = tl;
</script>
</div>
</body>
</html>