Files
hyperframes/skills/music-to-video/references/motion-primitives/particle-burst/index.html
T
Miao YangandClaude Opus 4.8 a34d3dba4d feat(skills): unify bgm-to-video flows into music-to-video
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>
2026-06-23 21:33:01 +08:00

142 lines
3.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>24 · particle_burst</title>
<script src="../assets/gsap.min.js"></script>
<style>
:root {
--hg-violet: #7c3aed;
--hg-violet-2: #a855f7;
--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;
}
.hero {
font-weight: 900;
font-size: 320px;
letter-spacing: -0.05em;
color: var(--hg-fg);
white-space: nowrap;
will-change: transform, opacity;
position: relative;
z-index: 10;
}
.particle-stage {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
}
.particle {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--hg-violet-2);
box-shadow: 0 0 12px var(--hg-violet-2);
opacity: 0;
will-change: transform, opacity;
}
</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="particle-stage" id="particles"></div>
<div class="stage"><div class="hero">SPARK</div></div>
</div>
</div>
<script>
window.__timelines = window.__timelines || {};
const tl = gsap.timeline({ paused: true });
// Build N particles deterministically
const N = 36;
const container = document.getElementById("particles");
const particles = [];
for (let i = 0; i < N; i++) {
const p = document.createElement("div");
p.className = "particle";
// Vary size per particle for visual interest
const sz = 4 + (i % 4) * 3;
p.style.width = sz + "px";
p.style.height = sz + "px";
// Slight color variation
const hue = ((i * 17) % 60) - 30;
p.style.filter = `hue-rotate(${hue}deg)`;
container.appendChild(p);
particles.push(p);
}
// Hero punch + flash entry
tl.fromTo(
".hero",
{ scale: 0.85, opacity: 0 },
{ scale: 1, opacity: 1, duration: 0.3, ease: "power4.out" },
0.3,
);
// Particles burst out
particles.forEach((p, i) => {
const angle = (i / N) * Math.PI * 2 + i * 0.137; // golden-angle jitter
const radius = 500 + (i % 5) * 90 + (i % 3) * 40;
const tx = Math.cos(angle) * radius;
const ty = Math.sin(angle) * radius;
const dur = 1.1 + (i % 5) * 0.08;
tl.fromTo(
p,
{ x: 0, y: 0, scale: 1, opacity: 1 },
{ x: tx, y: ty, scale: 0, opacity: 0, duration: dur, ease: "expo.out" },
0.35 + (i % 6) * 0.012,
);
});
// Hero settle wobble
tl.to(".hero", { scale: 1.04, duration: 0.1, ease: "power3.out" }, 0.35);
tl.to(".hero", { scale: 1.0, duration: 0.5, ease: "elastic.out(1, 0.5)" }, 0.45);
window.__timelines["main"] = tl;
</script>
</body>
</html>