Liquid blob album 3D hero
An oil-on-water blob floats over a giant album title. Press play and a drum machine made in the browser starts; every kick punches the blob. Hover to bulge it, click to pluck a note.
"use client";
import { useEffect, useRef, useState } from "react";
import * as THREE from "three";
import "./blob-hero.css";
type BlobHeroProps = {
artist?: string;
album?: string;
release?: string;
text?: string;
track?: string;
cta?: { label: string; href: string };
};
/* ------------------------------------------------------------------ */
/* A tiny drum machine made with the Web Audio API: kick, clap, hats and bass. */
const BASS = [45, 0, 0, 45, 0, 0, 48, 0, 43, 0, 0, 43, 0, 50, 0, 48];
class Beat {
ctx: AudioContext;
out: GainNode;
analyser: AnalyserNode;
noise: AudioBuffer;
bpm = 112;
step = 0;
next = 0;
timer = 0;
lastKick = -10;
constructor() {
this.ctx = new AudioContext();
this.out = this.ctx.createGain();
this.out.gain.value = 0.55;
this.analyser = this.ctx.createAnalyser();
this.analyser.fftSize = 64;
this.out.connect(this.analyser).connect(this.ctx.destination);
this.noise = this.ctx.createBuffer(
1,
this.ctx.sampleRate,
this.ctx.sampleRate,
);
const data = this.noise.getChannelData(0);
for (let i = 0; i < data.length; i++) data[i] = Math.random() * 2 - 1;
}
start() {
void this.ctx.resume();
this.next = this.ctx.currentTime + 0.05;
this.step = 0;
clearInterval(this.timer);
this.timer = window.setInterval(() => this.schedule(), 25);
}
stop() {
clearInterval(this.timer);
void this.ctx.suspend();
}
close() {
clearInterval(this.timer);
void this.ctx.close();
}
schedule() {
const sixteenth = 60 / this.bpm / 4;
while (this.next < this.ctx.currentTime + 0.12) {
const s = this.step % 16;
if (s % 4 === 0 || s === 10) this.kick(this.next);
if (s === 4 || s === 12) this.clap(this.next);
if (s % 2 === 1) this.hat(this.next, s % 4 === 3 ? 0.09 : 0.05);
if (BASS[s]) this.bass(this.next, BASS[s], sixteenth * 2.5);
this.next += sixteenth;
this.step++;
}
}
kick(t: number) {
const o = this.ctx.createOscillator();
const g = this.ctx.createGain();
o.frequency.setValueAtTime(150, t);
o.frequency.exponentialRampToValueAtTime(42, t + 0.12);
g.gain.setValueAtTime(1, t);
g.gain.exponentialRampToValueAtTime(0.001, t + 0.4);
o.connect(g).connect(this.out);
o.start(t);
o.stop(t + 0.42);
this.lastKick = t;
}
burst(
t: number,
type: BiquadFilterType,
freq: number,
level: number,
decay: number,
) {
const src = this.ctx.createBufferSource();
src.buffer = this.noise;
const f = this.ctx.createBiquadFilter();
f.type = type;
f.frequency.value = freq;
const g = this.ctx.createGain();
g.gain.setValueAtTime(level, t);
g.gain.exponentialRampToValueAtTime(0.001, t + decay);
src.connect(f).connect(g).connect(this.out);
src.start(t, Math.random() * 0.5);
src.stop(t + decay + 0.02);
}
clap(t: number) {
this.burst(t, "bandpass", 1600, 0.5, 0.18);
this.burst(t + 0.012, "bandpass", 1900, 0.3, 0.12);
}
hat(t: number, level: number) {
this.burst(t, "highpass", 7500, level, 0.05);
}
bass(t: number, midi: number, len: number) {
const o = this.ctx.createOscillator();
o.type = "sawtooth";
o.frequency.value = 440 * Math.pow(2, (midi - 69) / 12);
const f = this.ctx.createBiquadFilter();
f.type = "lowpass";
f.frequency.setValueAtTime(900, t);
f.frequency.exponentialRampToValueAtTime(180, t + len);
const g = this.ctx.createGain();
g.gain.setValueAtTime(0.22, t);
g.gain.exponentialRampToValueAtTime(0.001, t + len);
o.connect(f).connect(g).connect(this.out);
o.start(t);
o.stop(t + len + 0.02);
}
pluck() {
const t = this.ctx.currentTime;
const o = this.ctx.createOscillator();
o.type = "triangle";
o.frequency.value =
440 *
Math.pow(
2,
([69, 72, 74, 76, 79][Math.floor(Math.random() * 5)] - 69) / 12,
);
const g = this.ctx.createGain();
g.gain.setValueAtTime(0.25, t);
g.gain.exponentialRampToValueAtTime(0.001, t + 0.9);
o.connect(g).connect(this.out);
o.start(t);
o.stop(t + 0.92);
}
/** 0..1, how loud the mix is right now. */
level() {
const buf = new Uint8Array(this.analyser.frequencyBinCount);
this.analyser.getByteTimeDomainData(buf);
let sum = 0;
for (const v of buf) sum += ((v - 128) / 128) ** 2;
return Math.min(1, Math.sqrt(sum / buf.length) * 3);
}
}
/* ------------------------------------------------------------------ */
const noiseGLSL = /* glsl */ `
vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
float snoise(vec3 v) {
const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
vec3 i = floor(v + dot(v, C.yyy));
vec3 x0 = v - i + dot(i, C.xxx);
vec3 g = step(x0.yzx, x0.xyz);
vec3 l = 1.0 - g;
vec3 i1 = min(g.xyz, l.zxy);
vec3 i2 = max(g.xyz, l.zxy);
vec3 x1 = x0 - i1 + C.xxx;
vec3 x2 = x0 - i2 + C.yyy;
vec3 x3 = x0 - D.yyy;
i = mod289(i);
vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0))
+ i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));
float n_ = 0.142857142857;
vec3 ns = n_ * D.wyz - D.xzx;
vec4 j = p - 49.0 * floor(p * ns.z * ns.z);
vec4 x_ = floor(j * ns.z);
vec4 y_ = floor(j - 7.0 * x_);
vec4 x = x_ * ns.x + ns.yyyy;
vec4 y = y_ * ns.x + ns.yyyy;
vec4 h = 1.0 - abs(x) - abs(y);
vec4 b0 = vec4(x.xy, y.xy);
vec4 b1 = vec4(x.zw, y.zw);
vec4 s0 = floor(b0) * 2.0 + 1.0;
vec4 s1 = floor(b1) * 2.0 + 1.0;
vec4 sh = -step(h, vec4(0.0));
vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
vec3 p0 = vec3(a0.xy, h.x);
vec3 p1 = vec3(a0.zw, h.y);
vec3 p2 = vec3(a1.xy, h.z);
vec3 p3 = vec3(a1.zw, h.w);
vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w;
vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);
m = m * m;
return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
}
`;
const vertex = /* glsl */ `
uniform float uTime;
uniform float uAmp;
uniform float uKick;
uniform float uSpike;
uniform vec3 uPoint;
uniform float uPointOn;
varying vec3 vN;
varying vec3 vView;
varying float vD;
${noiseGLSL}
float disp(vec3 p) {
float n = snoise(p * 1.05 + vec3(0.0, uTime * 0.3, uTime * 0.18));
float fine = snoise(p * 3.2 - uTime * 0.6) * (0.05 + uSpike * 0.5);
float bulge = exp(-pow(distance(p, uPoint) * 2.6, 2.0)) * uPointOn;
return n * uAmp + fine * 0.16 + bulge * 0.28 + uKick * 0.1;
}
vec3 shape(vec3 p) { return p * (1.0 + disp(p)); }
void main() {
vec3 p = normalize(position);
vec3 up = abs(p.y) > 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
vec3 t = normalize(cross(p, up));
vec3 b = normalize(cross(p, t));
vec3 a0 = shape(p);
vec3 a1 = shape(normalize(p + t * 0.01));
vec3 a2 = shape(normalize(p + b * 0.01));
vec3 n = normalize(cross(a1 - a0, a2 - a0));
if (dot(n, p) < 0.0) n = -n;
vD = disp(p);
vec4 mv = modelViewMatrix * vec4(a0, 1.0);
vN = normalize(normalMatrix * n);
vView = normalize(-mv.xyz);
gl_Position = projectionMatrix * mv;
}
`;
const fragment = /* glsl */ `
uniform float uTime;
uniform float uKick;
varying vec3 vN;
varying vec3 vView;
varying float vD;
void main() {
vec3 n = normalize(vN);
vec3 v = normalize(vView);
float fres = pow(1.0 - max(dot(n, v), 0.0), 2.2);
// Thin-film colours: they shift with the viewing angle and the surface.
vec3 film = 0.5 + 0.5 * cos(6.2831 * (vec3(0.0, 0.33, 0.67) + fres * 1.3 + vD * 1.8 + uTime * 0.03));
vec3 r = reflect(-v, n);
vec3 env = mix(vec3(0.02, 0.02, 0.07), vec3(0.62, 0.6, 0.92), smoothstep(-0.3, 1.0, r.y));
env += vec3(0.85, 1.0, 0.25) * smoothstep(0.7, 1.0, r.x) * 0.35;
vec3 L = normalize(vec3(-0.4, 0.7, 0.6));
vec3 H = normalize(L + v);
float spec = pow(max(dot(n, H), 0.0), 120.0);
vec3 col = env * 0.55 + vec3(0.06, 0.05, 0.16);
col = mix(col, film, 0.2 + fres * 0.65);
col += spec * 0.7 + uKick * 0.08 * film;
gl_FragColor = vec4(col, 1.0);
}
`;
/**
* BlobHero
* - A liquid, oil-on-water blob (one ShaderMaterial: simplex noise displacement, normals
* rebuilt in the vertex shader, thin-film colour) floats over the album title.
* - Press Play and a small drum machine starts in the browser (Web Audio, no files);
* every kick punches the blob and the mix level stirs its surface.
* - Hover bulges the blob toward the cursor; fast moves raise ripples; click plucks a note.
*/
export function BlobHero({
artist = "Velvet Static",
album = "Soft Machines",
release = "New album, out 14 March",
text = "Eleven songs made on broken synths and one borrowed drum machine. Press play for a taste.",
track = "Glasshouse (preview)",
cta = { label: "Pre-save the album", href: "#static-presave" },
}: BlobHeroProps) {
const rootRef = useRef<HTMLElement>(null);
const stageRef = useRef<HTMLDivElement>(null);
const beatRef = useRef<Beat | null>(null);
const [playing, setPlaying] = useState(false);
const [bpm, setBpm] = useState(112);
const [failed, setFailed] = useState(false);
const toggle = () => {
if (!beatRef.current) {
try {
beatRef.current = new Beat();
} catch {
return;
}
}
const beat = beatRef.current;
beat.bpm = bpm;
if (playing) beat.stop();
else beat.start();
setPlaying(!playing);
};
const changeBpm = (v: number) => {
setBpm(v);
if (beatRef.current) beatRef.current.bpm = v;
};
// Stop the music when the hero leaves the page.
useEffect(() => {
return () => {
beatRef.current?.close();
beatRef.current = null;
};
}, []);
useEffect(() => {
const root = rootRef.current;
const stage = stageRef.current;
if (!root || !stage) return;
const reduce = matchMedia("(prefers-reduced-motion: reduce)").matches;
let renderer: THREE.WebGLRenderer;
try {
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
} catch {
const id = requestAnimationFrame(() => setFailed(true));
return () => cancelAnimationFrame(id);
}
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setClearColor(0x000000, 0);
stage.appendChild(renderer.domElement);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(35, 1, 0.1, 50);
camera.position.set(0, 0, 7);
const uniforms = {
uTime: { value: 0 },
uAmp: { value: 0.16 },
uKick: { value: 0 },
uSpike: { value: 0 },
uPoint: { value: new THREE.Vector3(0, 0, 1) },
uPointOn: { value: 0 },
};
const geo = new THREE.IcosahedronGeometry(1, 64);
const blob = new THREE.Mesh(
geo,
new THREE.ShaderMaterial({
uniforms,
vertexShader: vertex,
fragmentShader: fragment,
}),
);
scene.add(blob);
const resize = (w: number, h: number) => {
if (w < 2 || h < 2) return;
renderer.setSize(w, h, false);
camera.aspect = w / h;
camera.updateProjectionMatrix();
const s =
camera.aspect < 0.8
? 0.82
: Math.min(1.12, 0.75 + camera.aspect * 0.22);
blob.scale.setScalar(s);
blob.position.set(0, camera.aspect < 0.8 ? 0.5 : 0.1, 0);
};
const ro = new ResizeObserver(([e]) =>
resize(e.contentRect.width, e.contentRect.height),
);
ro.observe(stage);
/* ---- Pointer ---- */
const ray = new THREE.Raycaster();
const ndc = new THREE.Vector2();
const sphere = new THREE.Sphere();
const hit = new THREE.Vector3();
let over = 0;
let speed = 0;
let lastX = 0;
let lastY = 0;
let lastT = 0;
let pluck = 0;
const onMove = (e: PointerEvent) => {
const r = stage.getBoundingClientRect();
ndc.set(
((e.clientX - r.left) / r.width) * 2 - 1,
-((e.clientY - r.top) / r.height) * 2 + 1,
);
ray.setFromCamera(ndc, camera);
sphere.set(blob.position, blob.scale.x * 1.1);
if (ray.ray.intersectSphere(sphere, hit)) {
// Into the blob's own space, so the bulge stays under the cursor as it turns.
blob.worldToLocal(hit);
uniforms.uPoint.value.copy(hit.normalize());
over = 1;
stage.dataset.over = "true";
} else {
over = 0;
delete stage.dataset.over;
}
const now = performance.now();
const dt = Math.max(1, now - lastT);
speed = Math.min(
1,
speed + Math.hypot(e.clientX - lastX, e.clientY - lastY) / dt / 6,
);
lastX = e.clientX;
lastY = e.clientY;
lastT = now;
};
const onLeave = () => {
over = 0;
delete stage.dataset.over;
};
const onDown = () => {
if (!over) return;
pluck = 1;
beatRef.current?.pluck();
};
stage.addEventListener("pointermove", onMove);
stage.addEventListener("pointerleave", onLeave);
stage.addEventListener("pointerdown", onDown);
/* ---- Loop ---- */
let raf = 0;
let visible = true;
const t0 = performance.now();
let last = t0;
let level = 0;
const loop = (now: number) => {
raf = 0;
if (!visible || document.hidden) return;
const dt = Math.min(0.05, (now - last) / 1000);
last = now;
const t = (now - t0) / 1000;
const beat = beatRef.current;
const on = beat && beat.ctx.state === "running";
const kick = on
? Math.exp(-Math.max(0, beat.ctx.currentTime - beat.lastKick) * 9)
: 0;
level += ((on ? beat.level() : 0) - level) * 0.2;
pluck *= 0.92;
speed *= 0.94;
uniforms.uTime.value = reduce
? 0
: t * (0.6 + (on ? beat.bpm / 112 : 0.6) * 0.6);
uniforms.uKick.value = reduce ? 0 : Math.max(kick, pluck);
uniforms.uAmp.value = 0.15 + level * 0.16;
uniforms.uSpike.value = reduce ? 0 : speed;
uniforms.uPointOn.value += (over - uniforms.uPointOn.value) * 0.08;
if (!reduce) {
blob.rotation.y += dt * 0.15;
blob.rotation.x = Math.sin(t * 0.25) * 0.25;
}
root.style.setProperty("--kick", kick.toFixed(3));
root.style.setProperty("--level", level.toFixed(3));
renderer.render(scene, camera);
raf = requestAnimationFrame(loop);
};
const wake = () => {
if (!raf && visible && !document.hidden) {
last = performance.now();
raf = requestAnimationFrame(loop);
}
};
const io = new IntersectionObserver(([e]) => {
visible = e.isIntersecting;
// Scrolled away: stop the music too, so it never plays from an unseen page.
if (!visible && beatRef.current?.ctx.state === "running") {
beatRef.current.stop();
setPlaying(false);
}
wake();
});
io.observe(stage);
document.addEventListener("visibilitychange", wake);
wake();
return () => {
cancelAnimationFrame(raf);
ro.disconnect();
io.disconnect();
document.removeEventListener("visibilitychange", wake);
stage.removeEventListener("pointermove", onMove);
stage.removeEventListener("pointerleave", onLeave);
stage.removeEventListener("pointerdown", onDown);
geo.dispose();
(blob.material as THREE.Material).dispose();
renderer.dispose();
renderer.forceContextLoss();
renderer.domElement.remove();
};
}, []);
const words = album.split(" ");
return (
<section
ref={rootRef}
className="gu-static"
data-playing={playing || undefined}
data-failed={failed || undefined}
aria-labelledby="gu-static-title"
>
<h1 id="gu-static-title" className="gu-static__title">
<span className="sr-only">
{artist}: {album}
</span>
{words.map((w, i) => (
<span
key={i}
aria-hidden="true"
style={{ animationDelay: `${0.1 + i * 0.12}s` }}
>
{w}
</span>
))}
</h1>
<div ref={stageRef} className="gu-static__stage" aria-hidden="true" />
{failed && <div className="gu-static__fallback" aria-hidden="true" />}
<header className="gu-static__bar">
<a className="gu-static__mark" href="#">
{artist}
</a>
<nav aria-label="Main">
<a href="#static-tour">Tour</a>
<a href="#static-shop">Shop</a>
<a className="gu-static__cta" href={cta.href}>
{cta.label}
</a>
</nav>
</header>
<div className="gu-static__foot">
<div className="gu-static__about">
<p className="gu-static__release">{release}</p>
<p>{text}</p>
</div>
<div className="gu-static__player">
<button
type="button"
className="gu-static__play"
onClick={toggle}
aria-pressed={playing}
aria-label={playing ? "Pause the preview" : "Play the preview"}
>
<svg viewBox="0 0 24 24" aria-hidden="true">
{playing ? (
<path d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
) : (
<path d="M7 4.5v15L19.5 12z" />
)}
</svg>
</button>
<div className="gu-static__now">
<span>{playing ? "Now playing" : "Preview"}</span>
<strong>{track}</strong>
<div className="gu-static__bars" aria-hidden="true">
{Array.from({ length: 12 }, (_, i) => (
<i key={i} style={{ animationDelay: `${(i * 97) % 600}ms` }} />
))}
</div>
</div>
<label className="gu-static__tempo">
<span>
Tempo <b>{bpm}</b>
</span>
<input
type="range"
min={84}
max={140}
value={bpm}
onChange={(e) => changeBpm(Number(e.target.value))}
aria-valuetext={`${bpm} beats a minute`}
/>
</label>
</div>
</div>
</section>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Liquid blob album 3D hero
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
An album release hero for a band ("Velvet Static", album "Soft Machines"). A liquid, iridescent blob (three.js ShaderMaterial) floats over the giant album title. A Play button starts a small drum machine built with the Web Audio API (no audio files), and the blob pulses with every kick.
## Layout and look
- Section min-height 740px, background #0d0b1c with a violet glow that brightens on each kick. Text #efeaf6, muted #a49fbb, volt #d7ff3a (only the play button and bars), violet #6a5cff.
- The h1 is the album title, set huge (up to 17rem) in a condensed display face (Impact/Haettenschweiler stack), uppercase, centred behind the canvas. The first word is outlined and the second solid, and it swells slightly with each kick. The artist name is in an sr-only span.
- Top bar: band name in the display face, Tour and Shop links, an outlined "Pre-save the album" pill.
- Bottom left: release line + one short paragraph. Bottom right: a frosted pill player with a 56px volt play/pause button (aria-pressed), "Now playing" + track name, 12 thin volt bars that dance while playing, and a tempo range slider (84–140 bpm).
## The 3D scene
1. IcosahedronGeometry(1, 64). The vertex shader displaces points on the unit sphere with 3D simplex noise (slow) + fine noise (raised by pointer speed) + a gaussian bulge toward the cursor + a kick punch. Normals are rebuilt by displacing two nearby points along the tangent and bitangent.
2. Fragment: thin-film colour (cosine palette driven by fresnel, displacement and time) over a fake studio reflection (dark floor to lilac sky, plus a lime side light) and a tight specular.
3. Scale about 1.1 on wide screens and 0.82 on narrow ones; it turns slowly.
## The drum machine
A 16-step loop scheduled 120ms ahead every 25ms:
- kick on 1, 5, 9, 11, 13 (a sine dropping from 150 to 42 Hz);
- a two-layer bandpass-noise clap on 5 and 13;
- highpass noise hats on the off-beats;
- a sawtooth bass line through a closing lowpass.
An AnalyserNode supplies an RMS level that drives the blob's amplitude, and the time since the last kick drives the punch. Clicking the blob plays a triangle-wave note from a pentatonic set. The audio pauses when the hero scrolls off screen and closes on unmount.
## Accessibility
The canvas is decorative. The play button has a label and aria-pressed. The tempo slider has aria-valuetext in beats a minute.
## Reduced motion
The blob stays still and does not turn; there is no punch, no dancing bars and no entrance animation. The audio still works.
## Props
artist, album, release, text, track, cta ({ label, href }).
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: three. Translate it faithfully; do not add new libraries unless my framework needs them.
### BlobHero.tsx
```tsx
"use client";
import { useEffect, useRef, useState } from "react";
import * as THREE from "three";
import "./blob-hero.css";
type BlobHeroProps = {
artist?: string;
album?: string;
release?: string;
text?: string;
track?: string;
cta?: { label: string; href: string };
};
/* ------------------------------------------------------------------ */
/* A tiny drum machine made with the Web Audio API: kick, clap, hats and bass. */
const BASS = [45, 0, 0, 45, 0, 0, 48, 0, 43, 0, 0, 43, 0, 50, 0, 48];
class Beat {
ctx: AudioContext;
out: GainNode;
analyser: AnalyserNode;
noise: AudioBuffer;
bpm = 112;
step = 0;
next = 0;
timer = 0;
lastKick = -10;
constructor() {
this.ctx = new AudioContext();
this.out = this.ctx.createGain();
this.out.gain.value = 0.55;
this.analyser = this.ctx.createAnalyser();
this.analyser.fftSize = 64;
this.out.connect(this.analyser).connect(this.ctx.destination);
this.noise = this.ctx.createBuffer(
1,
this.ctx.sampleRate,
this.ctx.sampleRate,
);
const data = this.noise.getChannelData(0);
for (let i = 0; i < data.length; i++) data[i] = Math.random() * 2 - 1;
}
start() {
void this.ctx.resume();
this.next = this.ctx.currentTime + 0.05;
this.step = 0;
clearInterval(this.timer);
this.timer = window.setInterval(() => this.schedule(), 25);
}
stop() {
clearInterval(this.timer);
void this.ctx.suspend();
}
close() {
clearInterval(this.timer);
void this.ctx.close();
}
schedule() {
const sixteenth = 60 / this.bpm / 4;
while (this.next < this.ctx.currentTime + 0.12) {
const s = this.step % 16;
if (s % 4 === 0 || s === 10) this.kick(this.next);
if (s === 4 || s === 12) this.clap(this.next);
if (s % 2 === 1) this.hat(this.next, s % 4 === 3 ? 0.09 : 0.05);
if (BASS[s]) this.bass(this.next, BASS[s], sixteenth * 2.5);
this.next += sixteenth;
this.step++;
}
}
kick(t: number) {
const o = this.ctx.createOscillator();
const g = this.ctx.createGain();
o.frequency.setValueAtTime(150, t);
o.frequency.exponentialRampToValueAtTime(42, t + 0.12);
g.gain.setValueAtTime(1, t);
g.gain.exponentialRampToValueAtTime(0.001, t + 0.4);
o.connect(g).connect(this.out);
o.start(t);
o.stop(t + 0.42);
this.lastKick = t;
}
burst(
t: number,
type: BiquadFilterType,
freq: number,
level: number,
decay: number,
) {
const src = this.ctx.createBufferSource();
src.buffer = this.noise;
const f = this.ctx.createBiquadFilter();
f.type = type;
f.frequency.value = freq;
const g = this.ctx.createGain();
g.gain.setValueAtTime(level, t);
g.gain.exponentialRampToValueAtTime(0.001, t + decay);
src.connect(f).connect(g).connect(this.out);
src.start(t, Math.random() * 0.5);
src.stop(t + decay + 0.02);
}
clap(t: number) {
this.burst(t, "bandpass", 1600, 0.5, 0.18);
this.burst(t + 0.012, "bandpass", 1900, 0.3, 0.12);
}
hat(t: number, level: number) {
this.burst(t, "highpass", 7500, level, 0.05);
}
bass(t: number, midi: number, len: number) {
const o = this.ctx.createOscillator();
o.type = "sawtooth";
o.frequency.value = 440 * Math.pow(2, (midi - 69) / 12);
const f = this.ctx.createBiquadFilter();
f.type = "lowpass";
f.frequency.setValueAtTime(900, t);
f.frequency.exponentialRampToValueAtTime(180, t + len);
const g = this.ctx.createGain();
g.gain.setValueAtTime(0.22, t);
g.gain.exponentialRampToValueAtTime(0.001, t + len);
o.connect(f).connect(g).connect(this.out);
o.start(t);
o.stop(t + len + 0.02);
}
pluck() {
const t = this.ctx.currentTime;
const o = this.ctx.createOscillator();
o.type = "triangle";
o.frequency.value =
440 *
Math.pow(
2,
([69, 72, 74, 76, 79][Math.floor(Math.random() * 5)] - 69) / 12,
);
const g = this.ctx.createGain();
g.gain.setValueAtTime(0.25, t);
g.gain.exponentialRampToValueAtTime(0.001, t + 0.9);
o.connect(g).connect(this.out);
o.start(t);
o.stop(t + 0.92);
}
/** 0..1, how loud the mix is right now. */
level() {
const buf = new Uint8Array(this.analyser.frequencyBinCount);
this.analyser.getByteTimeDomainData(buf);
let sum = 0;
for (const v of buf) sum += ((v - 128) / 128) ** 2;
return Math.min(1, Math.sqrt(sum / buf.length) * 3);
}
}
/* ------------------------------------------------------------------ */
const noiseGLSL = /* glsl */ `
vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
float snoise(vec3 v) {
const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
vec3 i = floor(v + dot(v, C.yyy));
vec3 x0 = v - i + dot(i, C.xxx);
vec3 g = step(x0.yzx, x0.xyz);
vec3 l = 1.0 - g;
vec3 i1 = min(g.xyz, l.zxy);
vec3 i2 = max(g.xyz, l.zxy);
vec3 x1 = x0 - i1 + C.xxx;
vec3 x2 = x0 - i2 + C.yyy;
vec3 x3 = x0 - D.yyy;
i = mod289(i);
vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0))
+ i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));
float n_ = 0.142857142857;
vec3 ns = n_ * D.wyz - D.xzx;
vec4 j = p - 49.0 * floor(p * ns.z * ns.z);
vec4 x_ = floor(j * ns.z);
vec4 y_ = floor(j - 7.0 * x_);
vec4 x = x_ * ns.x + ns.yyyy;
vec4 y = y_ * ns.x + ns.yyyy;
vec4 h = 1.0 - abs(x) - abs(y);
vec4 b0 = vec4(x.xy, y.xy);
vec4 b1 = vec4(x.zw, y.zw);
vec4 s0 = floor(b0) * 2.0 + 1.0;
vec4 s1 = floor(b1) * 2.0 + 1.0;
vec4 sh = -step(h, vec4(0.0));
vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
vec3 p0 = vec3(a0.xy, h.x);
vec3 p1 = vec3(a0.zw, h.y);
vec3 p2 = vec3(a1.xy, h.z);
vec3 p3 = vec3(a1.zw, h.w);
vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w;
vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);
m = m * m;
return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
}
`;
const vertex = /* glsl */ `
uniform float uTime;
uniform float uAmp;
uniform float uKick;
uniform float uSpike;
uniform vec3 uPoint;
uniform float uPointOn;
varying vec3 vN;
varying vec3 vView;
varying float vD;
${noiseGLSL}
float disp(vec3 p) {
float n = snoise(p * 1.05 + vec3(0.0, uTime * 0.3, uTime * 0.18));
float fine = snoise(p * 3.2 - uTime * 0.6) * (0.05 + uSpike * 0.5);
float bulge = exp(-pow(distance(p, uPoint) * 2.6, 2.0)) * uPointOn;
return n * uAmp + fine * 0.16 + bulge * 0.28 + uKick * 0.1;
}
vec3 shape(vec3 p) { return p * (1.0 + disp(p)); }
void main() {
vec3 p = normalize(position);
vec3 up = abs(p.y) > 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
vec3 t = normalize(cross(p, up));
vec3 b = normalize(cross(p, t));
vec3 a0 = shape(p);
vec3 a1 = shape(normalize(p + t * 0.01));
vec3 a2 = shape(normalize(p + b * 0.01));
vec3 n = normalize(cross(a1 - a0, a2 - a0));
if (dot(n, p) < 0.0) n = -n;
vD = disp(p);
vec4 mv = modelViewMatrix * vec4(a0, 1.0);
vN = normalize(normalMatrix * n);
vView = normalize(-mv.xyz);
gl_Position = projectionMatrix * mv;
}
`;
const fragment = /* glsl */ `
uniform float uTime;
uniform float uKick;
varying vec3 vN;
varying vec3 vView;
varying float vD;
void main() {
vec3 n = normalize(vN);
vec3 v = normalize(vView);
float fres = pow(1.0 - max(dot(n, v), 0.0), 2.2);
// Thin-film colours: they shift with the viewing angle and the surface.
vec3 film = 0.5 + 0.5 * cos(6.2831 * (vec3(0.0, 0.33, 0.67) + fres * 1.3 + vD * 1.8 + uTime * 0.03));
vec3 r = reflect(-v, n);
vec3 env = mix(vec3(0.02, 0.02, 0.07), vec3(0.62, 0.6, 0.92), smoothstep(-0.3, 1.0, r.y));
env += vec3(0.85, 1.0, 0.25) * smoothstep(0.7, 1.0, r.x) * 0.35;
vec3 L = normalize(vec3(-0.4, 0.7, 0.6));
vec3 H = normalize(L + v);
float spec = pow(max(dot(n, H), 0.0), 120.0);
vec3 col = env * 0.55 + vec3(0.06, 0.05, 0.16);
col = mix(col, film, 0.2 + fres * 0.65);
col += spec * 0.7 + uKick * 0.08 * film;
gl_FragColor = vec4(col, 1.0);
}
`;
/**
* BlobHero
* - A liquid, oil-on-water blob (one ShaderMaterial: simplex noise displacement, normals
* rebuilt in the vertex shader, thin-film colour) floats over the album title.
* - Press Play and a small drum machine starts in the browser (Web Audio, no files);
* every kick punches the blob and the mix level stirs its surface.
* - Hover bulges the blob toward the cursor; fast moves raise ripples; click plucks a note.
*/
export function BlobHero({
artist = "Velvet Static",
album = "Soft Machines",
release = "New album, out 14 March",
text = "Eleven songs made on broken synths and one borrowed drum machine. Press play for a taste.",
track = "Glasshouse (preview)",
cta = { label: "Pre-save the album", href: "#static-presave" },
}: BlobHeroProps) {
const rootRef = useRef<HTMLElement>(null);
const stageRef = useRef<HTMLDivElement>(null);
const beatRef = useRef<Beat | null>(null);
const [playing, setPlaying] = useState(false);
const [bpm, setBpm] = useState(112);
const [failed, setFailed] = useState(false);
const toggle = () => {
if (!beatRef.current) {
try {
beatRef.current = new Beat();
} catch {
return;
}
}
const beat = beatRef.current;
beat.bpm = bpm;
if (playing) beat.stop();
else beat.start();
setPlaying(!playing);
};
const changeBpm = (v: number) => {
setBpm(v);
if (beatRef.current) beatRef.current.bpm = v;
};
// Stop the music when the hero leaves the page.
useEffect(() => {
return () => {
beatRef.current?.close();
beatRef.current = null;
};
}, []);
useEffect(() => {
const root = rootRef.current;
const stage = stageRef.current;
if (!root || !stage) return;
const reduce = matchMedia("(prefers-reduced-motion: reduce)").matches;
let renderer: THREE.WebGLRenderer;
try {
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
} catch {
const id = requestAnimationFrame(() => setFailed(true));
return () => cancelAnimationFrame(id);
}
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setClearColor(0x000000, 0);
stage.appendChild(renderer.domElement);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(35, 1, 0.1, 50);
camera.position.set(0, 0, 7);
const uniforms = {
uTime: { value: 0 },
uAmp: { value: 0.16 },
uKick: { value: 0 },
uSpike: { value: 0 },
uPoint: { value: new THREE.Vector3(0, 0, 1) },
uPointOn: { value: 0 },
};
const geo = new THREE.IcosahedronGeometry(1, 64);
const blob = new THREE.Mesh(
geo,
new THREE.ShaderMaterial({
uniforms,
vertexShader: vertex,
fragmentShader: fragment,
}),
);
scene.add(blob);
const resize = (w: number, h: number) => {
if (w < 2 || h < 2) return;
renderer.setSize(w, h, false);
camera.aspect = w / h;
camera.updateProjectionMatrix();
const s =
camera.aspect < 0.8
? 0.82
: Math.min(1.12, 0.75 + camera.aspect * 0.22);
blob.scale.setScalar(s);
blob.position.set(0, camera.aspect < 0.8 ? 0.5 : 0.1, 0);
};
const ro = new ResizeObserver(([e]) =>
resize(e.contentRect.width, e.contentRect.height),
);
ro.observe(stage);
/* ---- Pointer ---- */
const ray = new THREE.Raycaster();
const ndc = new THREE.Vector2();
const sphere = new THREE.Sphere();
const hit = new THREE.Vector3();
let over = 0;
let speed = 0;
let lastX = 0;
let lastY = 0;
let lastT = 0;
let pluck = 0;
const onMove = (e: PointerEvent) => {
const r = stage.getBoundingClientRect();
ndc.set(
((e.clientX - r.left) / r.width) * 2 - 1,
-((e.clientY - r.top) / r.height) * 2 + 1,
);
ray.setFromCamera(ndc, camera);
sphere.set(blob.position, blob.scale.x * 1.1);
if (ray.ray.intersectSphere(sphere, hit)) {
// Into the blob's own space, so the bulge stays under the cursor as it turns.
blob.worldToLocal(hit);
uniforms.uPoint.value.copy(hit.normalize());
over = 1;
stage.dataset.over = "true";
} else {
over = 0;
delete stage.dataset.over;
}
const now = performance.now();
const dt = Math.max(1, now - lastT);
speed = Math.min(
1,
speed + Math.hypot(e.clientX - lastX, e.clientY - lastY) / dt / 6,
);
lastX = e.clientX;
lastY = e.clientY;
lastT = now;
};
const onLeave = () => {
over = 0;
delete stage.dataset.over;
};
const onDown = () => {
if (!over) return;
pluck = 1;
beatRef.current?.pluck();
};
stage.addEventListener("pointermove", onMove);
stage.addEventListener("pointerleave", onLeave);
stage.addEventListener("pointerdown", onDown);
/* ---- Loop ---- */
let raf = 0;
let visible = true;
const t0 = performance.now();
let last = t0;
let level = 0;
const loop = (now: number) => {
raf = 0;
if (!visible || document.hidden) return;
const dt = Math.min(0.05, (now - last) / 1000);
last = now;
const t = (now - t0) / 1000;
const beat = beatRef.current;
const on = beat && beat.ctx.state === "running";
const kick = on
? Math.exp(-Math.max(0, beat.ctx.currentTime - beat.lastKick) * 9)
: 0;
level += ((on ? beat.level() : 0) - level) * 0.2;
pluck *= 0.92;
speed *= 0.94;
uniforms.uTime.value = reduce
? 0
: t * (0.6 + (on ? beat.bpm / 112 : 0.6) * 0.6);
uniforms.uKick.value = reduce ? 0 : Math.max(kick, pluck);
uniforms.uAmp.value = 0.15 + level * 0.16;
uniforms.uSpike.value = reduce ? 0 : speed;
uniforms.uPointOn.value += (over - uniforms.uPointOn.value) * 0.08;
if (!reduce) {
blob.rotation.y += dt * 0.15;
blob.rotation.x = Math.sin(t * 0.25) * 0.25;
}
root.style.setProperty("--kick", kick.toFixed(3));
root.style.setProperty("--level", level.toFixed(3));
renderer.render(scene, camera);
raf = requestAnimationFrame(loop);
};
const wake = () => {
if (!raf && visible && !document.hidden) {
last = performance.now();
raf = requestAnimationFrame(loop);
}
};
const io = new IntersectionObserver(([e]) => {
visible = e.isIntersecting;
// Scrolled away: stop the music too, so it never plays from an unseen page.
if (!visible && beatRef.current?.ctx.state === "running") {
beatRef.current.stop();
setPlaying(false);
}
wake();
});
io.observe(stage);
document.addEventListener("visibilitychange", wake);
wake();
return () => {
cancelAnimationFrame(raf);
ro.disconnect();
io.disconnect();
document.removeEventListener("visibilitychange", wake);
stage.removeEventListener("pointermove", onMove);
stage.removeEventListener("pointerleave", onLeave);
stage.removeEventListener("pointerdown", onDown);
geo.dispose();
(blob.material as THREE.Material).dispose();
renderer.dispose();
renderer.forceContextLoss();
renderer.domElement.remove();
};
}, []);
const words = album.split(" ");
return (
<section
ref={rootRef}
className="gu-static"
data-playing={playing || undefined}
data-failed={failed || undefined}
aria-labelledby="gu-static-title"
>
<h1 id="gu-static-title" className="gu-static__title">
<span className="sr-only">
{artist}: {album}
</span>
{words.map((w, i) => (
<span
key={i}
aria-hidden="true"
style={{ animationDelay: `${0.1 + i * 0.12}s` }}
>
{w}
</span>
))}
</h1>
<div ref={stageRef} className="gu-static__stage" aria-hidden="true" />
{failed && <div className="gu-static__fallback" aria-hidden="true" />}
<header className="gu-static__bar">
<a className="gu-static__mark" href="#">
{artist}
</a>
<nav aria-label="Main">
<a href="#static-tour">Tour</a>
<a href="#static-shop">Shop</a>
<a className="gu-static__cta" href={cta.href}>
{cta.label}
</a>
</nav>
</header>
<div className="gu-static__foot">
<div className="gu-static__about">
<p className="gu-static__release">{release}</p>
<p>{text}</p>
</div>
<div className="gu-static__player">
<button
type="button"
className="gu-static__play"
onClick={toggle}
aria-pressed={playing}
aria-label={playing ? "Pause the preview" : "Play the preview"}
>
<svg viewBox="0 0 24 24" aria-hidden="true">
{playing ? (
<path d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
) : (
<path d="M7 4.5v15L19.5 12z" />
)}
</svg>
</button>
<div className="gu-static__now">
<span>{playing ? "Now playing" : "Preview"}</span>
<strong>{track}</strong>
<div className="gu-static__bars" aria-hidden="true">
{Array.from({ length: 12 }, (_, i) => (
<i key={i} style={{ animationDelay: `${(i * 97) % 600}ms` }} />
))}
</div>
</div>
<label className="gu-static__tempo">
<span>
Tempo <b>{bpm}</b>
</span>
<input
type="range"
min={84}
max={140}
value={bpm}
onChange={(e) => changeBpm(Number(e.target.value))}
aria-valuetext={`${bpm} beats a minute`}
/>
</label>
</div>
</div>
</section>
);
}
```
### blob-hero.css
```css
/* Velvet Static: an album cover come alive; the giant title sits behind a liquid blob. */
.gu-static {
--bg: #0d0b1c;
--text: #efeaf6;
--muted: #a49fbb;
--line: rgb(239 234 246 / 0.14);
--volt: #d7ff3a;
--violet: #6a5cff;
--focus: #d7ff3a;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--kick: 0;
--level: 0;
--display:
"Haettenschweiler", "Impact", "Arial Narrow Bold",
"Helvetica Neue Condensed", sans-serif;
position: relative;
container-type: inline-size;
min-height: 740px;
overflow: hidden;
isolation: isolate;
display: grid;
grid-template-rows: auto 1fr auto;
background:
radial-gradient(
45% 55% at 50% 50%,
rgb(106 92 255 / calc(0.22 + var(--kick) * 0.18)),
transparent 72%
),
var(--bg);
color: var(--text);
font-family:
system-ui,
-apple-system,
"Segoe UI",
sans-serif;
line-height: 1.5;
}
.gu-static *,
.gu-static *::before,
.gu-static *::after {
box-sizing: border-box;
}
.gu-static a {
color: inherit;
}
.gu-static :focus-visible {
outline: 2px solid var(--focus);
outline-offset: 3px;
}
.gu-static .sr-only {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
/* The giant title: behind the blob, nudged by every kick drum. */
.gu-static__title {
position: absolute;
inset: 0;
z-index: 0;
display: grid;
place-content: center;
margin: 0;
font-family: var(--display);
font-size: clamp(5rem, 21cqi, 17rem);
font-weight: 400;
line-height: 0.82;
letter-spacing: -0.01em;
text-align: center;
text-transform: uppercase;
pointer-events: none;
}
.gu-static__title span[aria-hidden] {
display: block;
color: transparent;
-webkit-text-stroke: 1.5px rgb(239 234 246 / 0.55);
animation: gu-static-in 1.2s var(--ease) both;
}
.gu-static__title span[aria-hidden]:nth-of-type(3) {
color: var(--text);
-webkit-text-stroke: 0;
transform: scale(calc(1 + var(--kick) * 0.015));
}
.gu-static__stage {
position: absolute;
inset: 0;
z-index: 1;
}
.gu-static__stage[data-over] {
cursor: pointer;
}
.gu-static__stage canvas {
display: block;
width: 100%;
height: 100%;
}
.gu-static__bar,
.gu-static__foot {
position: relative;
z-index: 2;
pointer-events: none;
}
.gu-static__bar a,
.gu-static__foot button,
.gu-static__foot input {
pointer-events: auto;
}
.gu-static__bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24px 5%;
}
.gu-static__mark {
font-family: var(--display);
font-size: 1.6rem;
letter-spacing: 0.02em;
text-transform: uppercase;
text-decoration: none;
}
.gu-static__bar nav {
display: flex;
align-items: center;
gap: 22px;
font-size: 0.92rem;
}
.gu-static__bar nav > a:not(.gu-static__cta) {
text-decoration: none;
opacity: 0.8;
}
.gu-static__cta {
padding: 10px 18px;
border: 1px solid var(--line);
border-radius: 999px;
text-decoration: none;
transition:
background-color 0.3s var(--ease),
color 0.3s var(--ease);
}
.gu-static__cta:hover {
background: var(--text);
color: var(--bg) !important;
}
.gu-static__foot {
grid-row: 3;
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 28px;
padding: 0 5% 36px;
}
.gu-static__about {
max-width: 340px;
animation: gu-static-in 1s var(--ease) 0.4s both;
}
.gu-static__about p {
margin: 0;
color: var(--muted);
font-size: 0.95rem;
}
.gu-static__about .gu-static__release {
margin-bottom: 6px;
color: var(--text);
font-weight: 700;
font-size: 1.05rem;
}
/* The player: volt play button, track name, bars that dance while playing, tempo slider. */
.gu-static__player {
display: flex;
align-items: center;
gap: 16px;
padding: 12px 18px 12px 12px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgb(13 11 28 / 0.55);
backdrop-filter: blur(14px);
animation: gu-static-in 1s var(--ease) 0.5s both;
}
.gu-static__play {
display: grid;
place-items: center;
width: 56px;
aspect-ratio: 1;
flex: none;
border: 0;
border-radius: 50%;
background: var(--volt);
color: #14160a;
cursor: pointer;
box-shadow: 0 0 0 calc(var(--kick) * 10px) rgb(215 255 58 / 0.25);
transition: transform 0.3s var(--ease);
}
.gu-static__play:hover {
transform: scale(1.06);
}
.gu-static__play svg {
width: 22px;
fill: currentColor;
}
.gu-static__now {
display: grid;
min-width: 150px;
}
.gu-static__now span {
font-size: 0.75rem;
color: var(--muted);
}
.gu-static__now strong {
font-size: 0.95rem;
font-weight: 650;
}
.gu-static__bars {
display: flex;
align-items: flex-end;
gap: 3px;
height: 14px;
margin-top: 4px;
}
.gu-static__bars i {
width: 3px;
height: 100%;
border-radius: 2px;
background: var(--volt);
transform-origin: bottom;
transform: scaleY(0.18);
transition: transform 0.4s var(--ease);
}
.gu-static[data-playing] .gu-static__bars i {
animation: gu-static-bar 0.55s ease-in-out infinite alternate;
}
.gu-static__tempo {
display: grid;
gap: 2px;
padding-left: 16px;
border-left: 1px solid var(--line);
font-size: 0.75rem;
color: var(--muted);
}
.gu-static__tempo b {
color: var(--text);
font-variant-numeric: tabular-nums;
}
.gu-static__tempo input {
width: 120px;
accent-color: var(--volt);
}
@keyframes gu-static-in {
from {
opacity: 0;
transform: translateY(24px);
}
}
@keyframes gu-static-bar {
from {
transform: scaleY(0.2);
}
to {
transform: scaleY(1);
}
}
/* No WebGL: an oily gradient disc. */
.gu-static__fallback {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
width: 38cqi;
aspect-ratio: 1;
translate: -50% -50%;
border-radius: 46% 54% 50% 50%;
background:
radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.7), transparent 25%),
conic-gradient(from 40deg, #6a5cff, #ff5ac8, #d7ff3a, #3ad7ff, #6a5cff);
}
@container (max-width: 760px) {
.gu-static__bar nav > a:not(.gu-static__cta) {
display: none;
}
.gu-static__foot {
flex-direction: column;
align-items: stretch;
}
.gu-static__player {
border-radius: 24px;
flex-wrap: wrap;
}
.gu-static__tempo {
flex: 1 1 100%;
padding: 10px 0 0;
border-left: 0;
border-top: 1px solid var(--line);
}
.gu-static__tempo input {
width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
.gu-static *,
.gu-static *::before {
animation: none !important;
}
}
```
You might also want
Next piece: Magazine cover ring 3D heroVoice particle cloud 3D hero
Components, advanced, needs three
Contour map 3D hero
Components, advanced, needs three
Glass prism 3D hero
Components, advanced, needs three