Files
hyperframes/docs/public/spike/marker-highlight.html
T

96 lines
2.6 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Marker Highlight - 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 wrapper only — GSAP targets children, not this element */
transform: scale(3.5);
}
.hf-remocn-marker-highlight {
color: #18181b;
font-family: Inter, system-ui, sans-serif;
font-weight: 900;
letter-spacing: -0.04em;
}
.hf-remocn-marker-highlight {
position: relative;
display: inline-grid;
padding: 8px 12px;
font-size: 64px;
}
.hf-remocn-marker-highlight mark {
position: absolute;
inset: auto 0 9px;
height: 24px;
border-radius: 4px;
background: #fde047;
transform: scaleX(var(--hf-marker-progress, 1));
transform-origin: left center;
}
.hf-remocn-marker-highlight span {
position: relative;
}
</style>
</head>
<body>
<div
id="demo"
data-composition-id="marker-highlight-demo"
data-start="0"
data-width="1920"
data-height="1080"
data-duration="5"
>
<div class="demo-frame">
<div class="hf-remocn-marker-highlight"><mark></mark><span>Launch ready</span></div>
</div>
<script>
const tl = gsap.timeline({ paused: true });
const startTime = 0.5;
tl.fromTo(
".hf-remocn-marker-highlight mark",
{ "--hf-marker-progress": 0 },
{ "--hf-marker-progress": 1, duration: 0.42, ease: "power2.out" },
startTime,
);
tl.fromTo(
".hf-remocn-marker-highlight span",
{ color: "#71717a" },
{ color: "#18181b", duration: 0.28 },
startTime + 0.16,
);
tl.set({}, {}, 5);
window.__timelines = window.__timelines || {};
window.__timelines["marker-highlight-demo"] = tl;
</script>
</div>
</body>
</html>