Skip to content

Album Launch Hero

Music hero section for an album launch: giant condensed type, a generative sleeve, sliding vinyl and a reactive spectrum.

  • Heroes
  • Music & media
  • React only · 0 deps
  • 1 file
Full screen

Browser support · All evergreen browsers. Icon morph uses CSS `d` transitions (Chromium, Firefox); Safari swaps instantly.

Install. One command, or copy the file.

$npx shadcn@latest add https://freedesignmd.com/r/hero-music-waveform.json
  • Byte-identical to the preview
  • No Tailwind or config needed
  • SSR-safe · keyboard accessible
  • Respects reduced motion & transparency
components/heroes/hero-music-waveform.tsx
1/**
2 * HeroMusicWaveform, an album-launch hero for a streaming service. Giant
3 * condensed type, a generative op-art sleeve (two sets of concentric rings
4 * whose interference fringes drift with the music, set in a Swiss type band
5 * with catalogue number and running order), a vinyl that slides out of it, and
6 * a full-width spectrum of bars that dances to a synthetic signal and bulges
7 * toward the pointer. The play button morphs to pause (SVG path morph) and
8 * drives the energy of the spectrum. On scroll the sleeve tilts back and the
9 * bars flatten.
10 *
11 * Props: artist, album, release, catalogue, tracks, primaryCta, bars.
12 * CSS vars: --fd-wav-bg, --fd-wav-ink, --fd-wav-hot, --fd-wav-cool.
13 *
14 * Browser support: all evergreen browsers. No audio is played; the
15 * spectrum is procedural.
16 * Motion: one rAF loop (paused off-screen / hidden tab) writes scaleY on the
17 * bars and the sleeve transform; the play/pause morph is a CSS `d` transition
18 * on Chromium/Firefox, with a cross-fade fallback in Safari.
19 * prefers-reduced-motion: static bars, no spin, button still toggles.
20 * Accessibility: play button is a real <button aria-pressed>; track list is
21 * an <ol>; the spectrum is aria-hidden.
22 */
23import { useEffect, useRef, useState } from "react";
24
25export interface HeroMusicWaveformProps {
26 artist?: string;
27 album?: string;
28 release?: string;
29 tracks?: { title: string; time: string }[];
30 primaryCta?: { label: string; href: string };
31 catalogue?: string;
32 bars?: number;
33}
34
35// ring radii for the interference sleeve (two identical sets, offset centres)
36const RINGS = Array.from({ length: 46 }, (_, i) => 6 + i * 9);
37
38const DEFAULT_TRACKS = [
39 { title: "Saltwater Hymn", time: "3:41" },
40 { title: "Low Orbit (feat. Ana Brava)", time: "4:12" },
41 { title: "Nine Floors Up", time: "2:58" },
42];
43
44const PLAY = "M8 5 L8 19 L13.5 15.5 L13.5 8.5 Z M13.5 8.5 L13.5 15.5 L19 12 L19 12 Z";
45const PAUSE = "M7 5 L7 19 L10.5 19 L10.5 5 Z M13.5 5 L13.5 19 L17 19 L17 5 Z";
46
47export function HeroMusicWaveform({
48 artist = "Noor Okafor",
49 album = "TIDAL HEART",
50 release = "Out now · 11 tracks · 41 min",
51 tracks = DEFAULT_TRACKS,
52 primaryCta = { label: "Pre-save the vinyl", href: "#vinyl" },
53 catalogue = "RSN 041",
54 bars = 72,
55}: HeroMusicWaveformProps) {
56 const root = useRef<HTMLElement>(null);
57 const barRefs = useRef<(HTMLSpanElement | null)[]>([]);
58 const sleeve = useRef<HTMLDivElement>(null);
59 const big = useRef<HTMLHeadingElement>(null);
60 const prog = useRef<HTMLSpanElement>(null);
61 const clock = useRef<HTMLSpanElement>(null);
62 const moire = useRef<SVGGElement>(null);
63 const heart = useRef<SVGCircleElement>(null);
64 const [playing, setPlaying] = useState(true);
65 const playingRef = useRef(true);
66 playingRef.current = playing;
67
68 useEffect(() => {
69 const el = root.current;
70 if (!el) return;
71 if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
72 barRefs.current.forEach((b, i) => b && (b.style.transform = `scaleY(${(0.25 + 0.6 * Math.abs(Math.sin(i * 0.37) * Math.cos(i * 0.11))).toFixed(3)})`));
73 return;
74 }
75 const n = barRefs.current.length;
76 const level = new Float32Array(n);
77 let px = -10;
78 let pTarget = -10;
79 let energy = 1;
80 const onMove = (e: PointerEvent) => {
81 const r = el.getBoundingClientRect();
82 pTarget = (e.clientX - r.left) / r.width;
83 };
84 const onLeave = () => {
85 pTarget = -10;
86 };
87 el.addEventListener("pointermove", onMove);
88 el.addEventListener("pointerleave", onLeave);
89 let raf = 0;
90 let visible = true;
91 let last = performance.now();
92 let songT = 74;
93 const frame = (now: number) => {
94 raf = 0;
95 const dt = Math.min((now - last) / 1000, 0.05);
96 last = now;
97 const t = now / 1000;
98 energy += ((playingRef.current ? 1 : 0.12) - energy) * Math.min(1, dt * 4);
99 if (playingRef.current) songT += dt;
100 px = pTarget < -1 ? px + (-10 - px) * 0.05 : px + (pTarget - px) * 0.12;
101 // a beat at 96 bpm with a kick envelope
102 const beat = (t * 1.6) % 1;
103 const kick = Math.exp(-beat * 7);
104 const r = el.getBoundingClientRect();
105 const sc = Math.min(1, Math.max(0, -r.top / Math.max(1, r.height)));
106 for (let i = 0; i < n; i++) {
107 const u = i / (n - 1);
108 // spectrum envelope: bass heavy, mid hump, airy highs
109 const env = 0.55 * Math.exp(-u * 3.2) + 0.35 * Math.exp(-Math.pow((u - 0.42) / 0.16, 2)) + 0.12;
110 const wob = 0.5 + 0.5 * Math.sin(t * (3.1 + u * 9) + i * 1.7) * Math.sin(t * (1.3 + u * 3) + i * 0.45);
111 const k = u < 0.18 ? kick * (1 - u / 0.18) : kick * 0.15;
112 const near = Math.exp(-Math.pow((u - px) / 0.07, 2));
113 const target = Math.min(1, (env * (0.35 + 0.65 * wob) + k * 0.5) * energy * (1 - sc * 0.8) + near * 0.55 + 0.04);
114 level[i] += (target - level[i]) * (target > level[i] ? 0.45 : 0.12);
115 const b = barRefs.current[i];
116 if (b) b.style.transform = `scaleY(${level[i].toFixed(3)})`;
117 }
118 if (sleeve.current) sleeve.current.style.transform = `perspective(1400px) rotateX(${(sc * 28).toFixed(2)}deg) rotateY(${(-14 + (px > -1 ? (px - 0.5) * 10 : 0)).toFixed(2)}deg) translateY(${(sc * -60).toFixed(1)}px) scale(${(1 + kick * 0.008 * energy).toFixed(4)})`;
119 // the second ring set orbits slowly, so the fringes breathe with the track
120 if (moire.current) {
121 const a = songT * 0.45;
122 moire.current.setAttribute("transform", `translate(${(Math.cos(a) * 14 * energy).toFixed(2)} ${(Math.sin(a * 1.3) * 10 * energy).toFixed(2)})`);
123 }
124 if (heart.current) heart.current.setAttribute("r", (15 + kick * 5 * energy).toFixed(2));
125 if (big.current) big.current.style.transform = `translate3d(${(sc * -8).toFixed(2)}vw, 0, 0)`;
126 if (prog.current) prog.current.style.transform = `scaleX(${((songT % 221) / 221).toFixed(4)})`;
127 if (clock.current) {
128 const s = Math.floor(songT % 221);
129 clock.current.textContent = `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
130 }
131 if (visible && !document.hidden) raf = requestAnimationFrame(frame);
132 };
133 const start = () => {
134 if (!raf && visible && !document.hidden) {
135 last = performance.now();
136 raf = requestAnimationFrame(frame);
137 }
138 };
139 const io = new IntersectionObserver(([e]) => {
140 visible = e.isIntersecting;
141 if (visible) start();
142 });
143 io.observe(el);
144 document.addEventListener("visibilitychange", start);
145 start();
146 return () => {
147 cancelAnimationFrame(raf);
148 io.disconnect();
149 document.removeEventListener("visibilitychange", start);
150 el.removeEventListener("pointermove", onMove);
151 el.removeEventListener("pointerleave", onLeave);
152 };
153 }, [bars]);
154
155 return (
156 <section ref={root} className="fd-wav" data-playing={playing ? "" : undefined} aria-label={`${artist}, ${album}`}>
157 <style>{css}</style>
158 <div className="fd-wav-top">
159 <p className="fd-wav-artist">{artist}</p>
160 <p className="fd-wav-release">{release}</p>
161 </div>
162 <h1 ref={big} className="fd-wav-big" aria-label={album}>
163 {album.split(" ").map((w, wi) => (
164 <span key={wi} className="fd-wav-word" aria-hidden="true">
165 {Array.from(w).map((c, ci) => (
166 <span key={ci} className="fd-wav-c" style={{ animationDelay: `${wi * 220 + ci * 45}ms` }}>
167 {c}
168 </span>
169 ))}
170 </span>
171 ))}
172 </h1>
173
174 <div className="fd-wav-stage">
175 <div ref={sleeve} className="fd-wav-sleeve" aria-hidden="true">
176 <div className="fd-wav-vinyl">
177 <div className="fd-wav-label">
178 <span>{artist.split(" ")[0].toUpperCase()}</span>
179 </div>
180 </div>
181 <div className="fd-wav-art">
182 <div className="fd-wav-art-top">
183 <span>{artist}</span>
184 <span>{catalogue}</span>
185 </div>
186 <svg className="fd-wav-moire" viewBox="0 0 400 300" preserveAspectRatio="xMidYMid slice" aria-hidden="true" focusable="false">
187 <rect width="400" height="300" fill="#ECE6DA" />
188 <g fill="none" stroke="#120E0F" strokeWidth="3.6">
189 {RINGS.map((r) => (
190 <circle key={r} cx="170" cy="160" r={r} />
191 ))}
192 </g>
193 <g ref={moire} fill="none" stroke="#120E0F" strokeWidth="3.6">
194 {RINGS.map((r) => (
195 <circle key={r} cx="236" cy="138" r={r} />
196 ))}
197 </g>
198 <circle ref={heart} cx="203" cy="149" r="15" fill="#FF5A36" />
199 </svg>
200 <div className="fd-wav-art-band">
201 <span className="fd-wav-art-t">{album}</span>
202 <span className="fd-wav-art-m">
203 <span>LP · 33⅓</span>
204 <span>{tracks.length > 0 ? `A1 ${tracks[0].title}` : ""}</span>
205 </span>
206 </div>
207 </div>
208 </div>
209
210 <div className="fd-wav-player">
211 <button
212 type="button"
213 className="fd-wav-play"
214 aria-pressed={playing}
215 aria-label={playing ? "Pause preview" : "Play preview"}
216 onClick={() => setPlaying((p) => !p)}
217 >
218 <svg viewBox="0 0 24 24" width="28" height="28" aria-hidden="true">
219 <path className="fd-wav-icon" d={playing ? PAUSE : PLAY} fill="currentColor" />
220 </svg>
221 </button>
222 <div className="fd-wav-now">
223 <span className="fd-wav-now-k">{playing ? "Now playing" : "Paused"}</span>
224 <b>{tracks[0]?.title}</b>
225 <div className="fd-wav-bar">
226 <span ref={prog} />
227 </div>
228 <div className="fd-wav-times">
229 <span ref={clock}>1:14</span>
230 <span>{tracks[0]?.time}</span>
231 </div>
232 </div>
233 <ol className="fd-wav-tracks">
234 {tracks.map((t, i) => (
235 <li key={t.title} className={i === 0 ? "is-on" : undefined}>
236 <span className="fd-wav-n">{String(i + 1).padStart(2, "0")}</span>
237 <span className="fd-wav-tt">{t.title}</span>
238 <span className="fd-wav-tm">{t.time}</span>
239 </li>
240 ))}
241 </ol>
242 <a className="fd-wav-cta" href={primaryCta.href}>
243 {primaryCta.label}
244 </a>
245 </div>
246 </div>
247
248 <div className="fd-wav-spec" aria-hidden="true">
249 {Array.from({ length: bars }, (_, i) => (
250 <span key={i} ref={(n) => { barRefs.current[i] = n; }} className="fd-wav-b" style={{ ["--u" as string]: i / (bars - 1) }} />
251 ))}
252 </div>
253 </section>
254 );
255}
256
257const css = `
258.fd-wav, .fd-wav *, .fd-wav *::before, .fd-wav *::after { box-sizing: border-box; }
259.fd-wav {
260 --fd-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
261 --fd-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
262 --fd-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
263 --fd-dur-1: 120ms; --fd-dur-2: 240ms; --fd-dur-3: 420ms; --fd-dur-4: 700ms;
264 --fd-wav-bg: #0E0A0B;
265 --fd-wav-ink: #F6EDE4;
266 --fd-wav-hot: #FF5A36;
267 --fd-wav-cool: #FFB547;
268 --fd-wav-cond: "Helvetica Neue", "Arial Narrow", "Roboto Condensed", "DejaVu Sans Condensed", ui-sans-serif, -apple-system, "Inter", sans-serif;
269 --fd-wav-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
270 position: relative; display: block; overflow: hidden; margin: 0; padding: 0; min-height: 880px;
271 background: var(--fd-wav-bg); color: var(--fd-wav-ink); font: 400 1rem/1.5 var(--fd-wav-sans); isolation: isolate;
272}
273.fd-wav-top { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; max-width: 1320px; margin: 0 auto; padding: 96px 40px 0; animation: fd-wav-fade var(--fd-dur-4) var(--fd-ease-out) 600ms both; }
274.fd-wav-artist, .fd-wav-release { margin: 0; padding: 0; font: 600 0.75rem/1 var(--fd-wav-sans); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(246,237,228,0.7); }
275.fd-wav-artist { color: var(--fd-wav-hot); }
276.fd-wav-big {
277 position: relative; z-index: 1; display: flex; justify-content: center; gap: 0.18em; margin: 6px 0 0; padding: 0 20px; white-space: nowrap; will-change: transform;
278 font: 800 clamp(5rem, 17vw, 17rem)/0.82 var(--fd-wav-cond); font-stretch: condensed; letter-spacing: -0.055em; color: var(--fd-wav-ink);
279 transform-origin: center;
280}
281.fd-wav-word { display: inline-flex; overflow: hidden; padding: 0.02em 0 0.04em; }
282.fd-wav-c { display: inline-block; transform: scaleY(1.12); transform-origin: bottom; animation: fd-wav-in 900ms var(--fd-ease-out) both; }
283.fd-wav-word:last-child .fd-wav-c { -webkit-text-stroke: 2px var(--fd-wav-ink); color: transparent; }
284
285.fd-wav-stage { position: relative; z-index: 3; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: start; max-width: 1140px; margin: -9vw auto 0; padding: 0 40px; }
286.fd-wav-sleeve { position: relative; width: 340px; aspect-ratio: 1; transform-style: preserve-3d; will-change: transform; animation: fd-wav-sleevein 1200ms var(--fd-ease-out) 300ms both; }
287.fd-wav-art {
288 position: absolute; inset: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 2px;
289 background: #ECE6DA; color: #120E0F;
290 box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 40px 80px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.06);
291}
292.fd-wav-art-top { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 12px 14px 10px; border-bottom: 2px solid #120E0F; font: 600 0.625rem/1 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase; color: #120E0F; }
293.fd-wav-moire { display: block; width: 100%; height: 100%; min-height: 0; }
294.fd-wav-art-band { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 8px 14px 12px; border-top: 2px solid #120E0F; background: #ECE6DA; }
295.fd-wav-art-t { display: block; margin: 0; font: 800 2.25rem/0.86 var(--fd-wav-cond); font-stretch: condensed; letter-spacing: -0.045em; color: #120E0F; white-space: nowrap; }
296.fd-wav-art-m { display: flex; justify-content: space-between; gap: 8px; font: 500 0.5625rem/1 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: #4A4244; }
297.fd-wav-art-m span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
298.fd-wav-vinyl {
299 position: absolute; inset: 3%; border-radius: 50%;
300 background: repeating-radial-gradient(circle at 50% 50%, #161112 0 1px, #0a0708 1px 3px), radial-gradient(circle, #1a1213, #050404);
301 box-shadow: 0 20px 50px -20px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(255,255,255,0.05);
302 transform: translateX(0); animation: fd-wav-slide 1400ms var(--fd-ease-out) 1100ms both;
303}
304.fd-wav-vinyl::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 10%, rgba(255,255,255,0.12) 14%, transparent 20% 55%, rgba(255,255,255,0.08) 60%, transparent 66%); }
305.fd-wav-label { position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 1; margin: -17% 0 0 -17%; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #0E0A0B 0 5%, #FF5A36 6% 100%); animation: fd-wav-spin 1.8s linear infinite; animation-play-state: paused; }
306.fd-wav[data-playing] .fd-wav-label { animation-play-state: running; }
307.fd-wav-label span { font: 800 0.5625rem/1 var(--fd-wav-sans); letter-spacing: 0.2em; color: #0E0A0B; transform: translateY(-14px); }
308
309.fd-wav-player { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 22px; align-items: center; max-width: 520px; margin: 11vw 0 0 auto; animation: fd-wav-rise var(--fd-dur-4) var(--fd-ease-out) 900ms both; }
310.fd-wav-play {
311 appearance: none; -webkit-appearance: none; cursor: pointer; display: grid; place-items: center; width: 84px; height: 84px; margin: 0; padding: 0; border: 0; border-radius: 9999px;
312 background: var(--fd-wav-ink); color: var(--fd-wav-bg); box-shadow: 0 0 0 8px rgba(246,237,228,0.06), 0 20px 50px -14px rgba(255,90,54,0.65);
313 transition: transform var(--fd-dur-2) var(--fd-spring), box-shadow var(--fd-dur-3) var(--fd-ease-out);
314}
315.fd-wav-play svg { display: block; }
316.fd-wav-icon { transition: d var(--fd-dur-3) var(--fd-ease-in-out); }
317.fd-wav-play:hover { box-shadow: 0 0 0 12px rgba(246,237,228,0.08), 0 24px 60px -14px rgba(255,90,54,0.8); }
318.fd-wav-play:active { transform: scale(0.96); transition-duration: var(--fd-dur-1); }
319.fd-wav-play:focus-visible, .fd-wav-cta:focus-visible { outline: 2px solid rgba(255,181,71,0.8); outline-offset: 3px; }
320.fd-wav-now { min-width: 0; }
321.fd-wav-now-k { display: block; margin: 0 0 6px; font: 600 0.6875rem/1 var(--fd-wav-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--fd-wav-cool); }
322.fd-wav-now b { display: block; font: 600 1.375rem/1.1 var(--fd-wav-sans); letter-spacing: -0.02em; color: var(--fd-wav-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
323.fd-wav-bar { position: relative; height: 3px; margin: 14px 0 8px; border-radius: 9999px; background: rgba(246,237,228,0.14); overflow: hidden; }
324.fd-wav-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, var(--fd-wav-hot), var(--fd-wav-cool)); transform-origin: left; transform: scaleX(0.33); }
325.fd-wav-times { display: flex; justify-content: space-between; font: 500 0.75rem/1 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(246,237,228,0.5); font-variant-numeric: tabular-nums; }
326.fd-wav-tracks { grid-column: 1 / -1; margin: 6px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(246,237,228,0.1); }
327.fd-wav-tracks li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; margin: 0; padding: 12px 0; border-bottom: 1px solid rgba(246,237,228,0.08); font: 400 0.9375rem/1.2 var(--fd-wav-sans); color: rgba(246,237,228,0.6); }
328.fd-wav-tracks li.is-on { color: var(--fd-wav-ink); }
329.fd-wav-tracks li.is-on .fd-wav-n { color: var(--fd-wav-hot); }
330.fd-wav-n, .fd-wav-tm { font: 500 0.75rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(246,237,228,0.4); }
331.fd-wav-tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
332.fd-wav-cta { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; height: 46px; margin: 4px 0 0; padding: 0 22px; border-radius: 9999px; border: 1px solid rgba(246,237,228,0.25); color: var(--fd-wav-ink); text-decoration: none; font: 600 0.875rem/1 var(--fd-wav-sans); letter-spacing: 0.02em; transition: background var(--fd-dur-2), color var(--fd-dur-2), transform var(--fd-dur-2) var(--fd-spring); }
333.fd-wav-cta:hover { background: var(--fd-wav-ink); color: var(--fd-wav-bg); }
334.fd-wav-cta:active { transform: scale(0.96); }
335
336.fd-wav-spec { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 200px; display: flex; align-items: flex-end; gap: 3px; padding: 0 3px; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
337.fd-wav-b { flex: 1; height: 100%; border-radius: 3px 3px 0 0; transform-origin: bottom; transform: scaleY(0.1); will-change: transform; background: linear-gradient(180deg, color-mix(in srgb, var(--fd-wav-cool) calc(var(--u) * 100%), var(--fd-wav-hot)) 0%, rgba(255,90,54,0.05) 100%); opacity: 0.85; }
338
339@keyframes fd-wav-in { from { transform: translateY(100%) scaleY(1.6); } to { transform: scaleY(1.12); } }
340@keyframes fd-wav-fade { from { opacity: 0; } to { opacity: 1; } }
341@keyframes fd-wav-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
342@keyframes fd-wav-sleevein { from { opacity: 0; transform: perspective(1400px) rotateY(-50deg) translateX(-80px); filter: blur(10px); } to { opacity: 1; filter: none; } }
343@keyframes fd-wav-slide { from { transform: translateX(0) rotate(0deg); } to { transform: translateX(38%) rotate(140deg); } }
344@keyframes fd-wav-spin { to { transform: rotate(360deg); } }
345
346@media (max-width: 900px) {
347 .fd-wav { min-height: 844px; }
348 .fd-wav-top { padding: 84px 20px 0; }
349 .fd-wav-release { display: none; }
350 .fd-wav-big { flex-direction: column; align-items: center; gap: 0; font-size: 27vw; margin-top: 14px; }
351 .fd-wav-stage { grid-template-columns: 1fr; gap: 28px; margin-top: 24px; padding: 0 20px; }
352 .fd-wav-sleeve { width: 210px; margin: 0 auto 0 8px; }
353 .fd-wav-art-top { padding: 8px 9px 7px; font-size: 0.5rem; }
354 .fd-wav-art-band { padding: 6px 9px 8px; gap: 4px; }
355 .fd-wav-art-t { font-size: 1.375rem; }
356 .fd-wav-art-m { font-size: 0.4375rem; }
357 .fd-wav-player { margin: 0; grid-template-columns: auto minmax(0, 1fr); }
358 .fd-wav-stage { align-items: start; }
359 .fd-wav-play { width: 64px; height: 64px; }
360 .fd-wav-tracks, .fd-wav-cta { display: none; }
361 .fd-wav-spec { height: 120px; }
362}
363@media (prefers-reduced-motion: reduce) {
364 .fd-wav *, .fd-wav *::before { animation: none !important; }
365 .fd-wav-c { transform: scaleY(1.12); }
366 .fd-wav-vinyl { transform: translateX(38%); }
367}
368`;
369
370/* ───────────────────────── Demo ───────────────────────── */
371
372export function Demo() {
373 return (
374 <div className="fd-wav-demo">
375 <style>{demoCss}</style>
376 <header className="fd-wav-demo-nav">
377 <a className="fd-wav-demo-logo" href="#top">
378 <svg viewBox="0 0 24 24" width="22" height="22" aria-hidden="true">
379 <path d="M3 14v-4M7 18V6M11 15V9M15 20V4M19 16V8" stroke="#FF5A36" strokeWidth="2.4" strokeLinecap="round" />
380 </svg>
381 Resonant
382 </a>
383 <nav aria-label="Primary">
384 <a href="#home">Home</a>
385 <a href="#new">New releases</a>
386 <a href="#live">Live</a>
387 <a href="#library">Library</a>
388 </nav>
389 <a className="fd-wav-demo-cta" href="#trial">Try 3 months free</a>
390 </header>
391 <HeroMusicWaveform />
392 </div>
393 );
394}
395
396const demoCss = `
397.fd-wav-demo { position: relative; margin: 0; padding: 0; min-height: 100vh; background: #0E0A0B; }
398.fd-wav-demo *, .fd-wav-demo *::before, .fd-wav-demo *::after { box-sizing: border-box; }
399.fd-wav-demo-nav { position: absolute; z-index: 10; top: 0; left: 0; right: 0; max-width: 1320px; height: 72px; margin: 0 auto; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
400.fd-wav-demo-logo { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: #F6EDE4; text-decoration: none; font: 700 1.125rem/1 ui-sans-serif, -apple-system, "Inter", sans-serif; letter-spacing: -0.03em; }
401.fd-wav-demo-logo svg { display: block; }
402.fd-wav-demo-nav nav { display: flex; gap: 28px; }
403.fd-wav-demo-nav nav a { color: rgba(246,237,228,0.6); text-decoration: none; font: 500 0.875rem/1 ui-sans-serif, -apple-system, "Inter", sans-serif; transition: color 120ms; }
404.fd-wav-demo-nav nav a:hover { color: #F6EDE4; }
405.fd-wav-demo-cta { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 9999px; background: #FF5A36; color: #0E0A0B; text-decoration: none; font: 700 0.8125rem/1 ui-sans-serif, -apple-system, "Inter", sans-serif; }
406.fd-wav-demo-nav a:focus-visible { outline: 2px solid rgba(255,181,71,.8); outline-offset: 2px; border-radius: 8px; }
407@media (max-width: 900px) { .fd-wav-demo-nav { padding: 0 20px; height: 64px; } .fd-wav-demo-nav nav { display: none; } }
408`;

More Heroes. Same file contract.

Ledger Card Hero, heroes preview: Fintech hero section with a CSS 3D metal card that tilts to the cursor, then flips and docks on scroll as…

Ledger Card Hero

Fintech hero section with a CSS 3D metal card that tilts to the cursor, then flips and docks on scroll as stats count up.

Agent Terminal Hero, heroes preview: AI hero section with a terminal that types a prompt and streams an agent's plan while a dashboard assembles…

Agent Terminal Hero

AI hero section with a terminal that types a prompt and streams an agent's plan while a dashboard assembles beside it.

Maison Editorial Hero, heroes preview: Editorial fashion hero section: a giant serif masthead over three campaign photos, revealed by clip-path wipes

Maison Editorial Hero

Editorial fashion hero section: a giant serif masthead over three campaign photos, revealed by clip-path wipes.

Questions about Album Launch Hero

Run npx shadcn@latest add https://freedesignmd.com/r/hero-music-waveform.json, or open the page and copy the file into your project. It has zero dependencies besides React. What you copy is the exact file that renders the live demo.

Music hero section for an album launch: giant condensed type, a generative sleeve, sliding vinyl and a reactive spectrum. It is a free, MIT-licensed React heroes component from the freedesignmd library.

Yes. It is free and MIT-licensed, use, modify and ship it in personal and commercial projects without attribution.

All evergreen browsers. Icon morph uses CSS `d` transitions (Chromium, Firefox); Safari swaps instantly.

Yes. It is a plain React component with its own styles, so it runs in Next.js, Vite, Remix and Lovable projects, and it needs no Tailwind setup. It has zero dependencies besides React.