mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
Replace bgm-to-video, bgm-to-video-new, bgm-to-video-refactor, and the standalone beat-sync/montage skills with a single music-to-video skill. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
137 lines
3.7 KiB
HTML
137 lines
3.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=1920, height=1080" />
|
|
<title>28 · text_wave_distort</title>
|
|
<script src="../assets/gsap.min.js"></script>
|
|
<style>
|
|
:root {
|
|
--hg-violet: #7c3aed;
|
|
--hg-violet-2: #a855f7;
|
|
--hg-cyan: #2afff0;
|
|
--hg-bg: #0a0a0f;
|
|
--hg-fg: #f5f5fa;
|
|
--hg-dim: #6b6b78;
|
|
}
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
html,
|
|
body {
|
|
margin: 0;
|
|
width: 1920px;
|
|
height: 1080px;
|
|
overflow: hidden;
|
|
background: var(--hg-bg);
|
|
font-family: "Inter", system-ui, sans-serif;
|
|
color: var(--hg-fg);
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
#scene {
|
|
position: absolute;
|
|
inset: 0;
|
|
width: 1920px;
|
|
height: 1080px;
|
|
}
|
|
.stage {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.wave-hero {
|
|
font-family: "Playfair Display", serif;
|
|
font-style: italic;
|
|
font-weight: 900;
|
|
font-size: 280px;
|
|
letter-spacing: -0.02em;
|
|
white-space: nowrap;
|
|
text-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
|
|
}
|
|
.wave-hero .char {
|
|
display: inline-block;
|
|
will-change: transform;
|
|
}
|
|
/* per-char solid colors marching across a violet→cyan ramp */
|
|
.wave-hero .char:nth-child(1) {
|
|
color: #7c3aed;
|
|
}
|
|
.wave-hero .char:nth-child(2) {
|
|
color: #a855f7;
|
|
}
|
|
.wave-hero .char:nth-child(3) {
|
|
color: #d946ef;
|
|
}
|
|
.wave-hero .char:nth-child(4) {
|
|
color: #ec4899;
|
|
}
|
|
.wave-hero .char:nth-child(5) {
|
|
color: #2afff0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div
|
|
id="root"
|
|
data-composition-id="main"
|
|
data-start="0"
|
|
data-duration="2"
|
|
data-width="1920"
|
|
data-height="1080"
|
|
>
|
|
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
|
<div class="stage">
|
|
<div class="wave-hero" id="hero">
|
|
<span class="char">f</span><span class="char">l</span><span class="char">u</span
|
|
><span class="char">i</span><span class="char">d</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
window.__timelines = window.__timelines || {};
|
|
const tl = gsap.timeline({ paused: true });
|
|
|
|
// Explicit fromTo entry — safer than .from() in paused/seek mode
|
|
tl.fromTo(
|
|
"#hero .char",
|
|
{ y: 60, opacity: 0 },
|
|
{ y: 0, opacity: 1, stagger: 0.06, ease: "back.out(1.8)", duration: 0.5 },
|
|
0.1,
|
|
);
|
|
|
|
// Continuous wave: phase 0→4 cycles over 1.5s, amplitude envelope rise→settle
|
|
const state = { phase: 0 };
|
|
tl.to(
|
|
state,
|
|
{
|
|
phase: 4,
|
|
duration: 1.5,
|
|
ease: "none",
|
|
onUpdate: function () {
|
|
const chars = document.querySelectorAll("#hero .char");
|
|
const p = state.phase / 4;
|
|
let amp;
|
|
if (p < 0.35) amp = (p / 0.35) * 24;
|
|
else if (p < 0.7)
|
|
amp = 24 - ((p - 0.35) / 0.35) * 12; // 24 → 12
|
|
else amp = 12 - ((p - 0.7) / 0.3) * 4; // 12 → 8
|
|
chars.forEach((c, i) => {
|
|
const y = amp * Math.sin(state.phase * Math.PI * 2 + i * 0.45);
|
|
// Use gsap.set so it cooperates with GSAP's transform tracking
|
|
gsap.set(c, { y });
|
|
});
|
|
},
|
|
},
|
|
0.65,
|
|
);
|
|
|
|
window.__timelines["main"] = tl;
|
|
</script>
|
|
</body>
|
|
</html>
|