Release
releaseA record, a single, an episode: the cover art rises in, who and what, a pulse on the track's beat, the date and where to listen, in 15 s.
Install
$ npx paper-motion add releaseWrites a scene to pieces/, wired to your brand folder.
Tune it, then add it to your kit
Parameters
title
artist
what
action
bpm
cover
format
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>release</title>
<!--
Recipe · release (15 s, square). A record, a single, an episode: the cover art, who and what, when and where.
One idea: the sleeve is an OBJECT. It arrives turning in space (edge first, then its face), the camera orbits it
slowly the whole piece, the words stand a step behind it and the bars a step in front, so everything parallaxes on
the beat. Pulse: the sleeve breathes on the track's BPM. Close: the camera settles straight on the action.
Cover 0–1.5 s · Words 1.5–6 s · Pulse whole piece · Action 9–15 s.
Look, fonts, pace and sound come from /brand (serve from the project root). Edit CONFIG first: the cover (a square
image), the names, the BPM. Render with the music: `pamo render scene.html --audio track.wav --loudness -14`.
-->
<style>
#stage { overflow: hidden; }
.abs { position: absolute; box-sizing: border-box; }
#glow { inset: -20%; filter: blur(70px); opacity: 0.55; background-size: cover; background-position: center; }
#sleeve { overflow: hidden; }
#sleeve img, #sleeve .fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#bars { display: flex; align-items: flex-end; gap: 4%; }
#bars i { flex: 1; display: block; border-radius: 999px; }
#words { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
#words.center { align-items: center; text-align: center; }
</style>
</head>
<body>
<main id="stage">
<div id="bg" class="abs" style="inset:0"></div>
<div id="glow" class="abs"></div>
<div id="vig" class="abs" style="inset:0"></div>
<div id="world">
<div id="words"><div id="title"></div><div id="artist"></div><div id="what"></div></div>
<div id="sleeve"></div>
<div id="bars"></div>
<div id="action"></div>
</div>
<div id="mark" class="abs"></div>
</main>
<script type="module">
import { scene, progress, ease, noise, fract } from 'paper-motion';
import { wordRise, blurIn, trackIn } from 'paper-motion/moves';
import { camera } from 'paper-motion/kit';
import { loadBrand } from 'paper-motion/brand';
const CONFIG = {
background: null,
cover: null,
title: 'Title',
artist: null,
what: 'the debut EP',
action: 'Out 21 Nov · everywhere you listen',
bpm: 96,
format: [1080, 1080],
};
const B = await loadBrand();
const [W, H] = CONFIG.format, SHORT = Math.min(W, H), D = 15, tall = H >= W; // square and portrait stack the words under the sleeve
const s = scene({ width: W, height: H, fps: 30, duration: D, background: B.color('ground') });
const bgId = CONFIG.background ?? B.set.entries.find((e) => e.shader && !e.image)?.id;
if (bgId) B.shader(s, '#bg', bgId);
document.querySelector('#bg').style.opacity = 0.3;
document.querySelector('#vig').style.background = 'radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.65) 100%)';
const $ = (id) => document.getElementById(id);
const DIST = SHORT * 0.75, K = 1 + DIST / (SHORT * 1.8);
const cam = camera($('stage'), $('world'), { perspective: SHORT * 1.8 });
// the sleeve: an object at the origin; the words a step behind it, the bars a step in front
const R = (B.tokens?.shape?.radius ?? 12) * (SHORT / 1080) * K;
const side = (H > W ? SHORT * 0.56 : tall ? SHORT * 0.34 : SHORT * 0.5) * K;
const sleeve = $('sleeve');
Object.assign(sleeve.style, { width: `${side}px`, height: `${side}px`, borderRadius: `${R * 0.6}px`, background: B.surface(), boxShadow: `0 ${SHORT * 0.04}px ${SHORT * 0.12}px rgba(0,0,0,0.55)` });
const sleevePos = { x: tall ? 0 : -SHORT * 0.2 * K, y: tall ? -SHORT * (H > W ? 0.2 : 0.24) * K : -SHORT * 0.04 * K, z: 0 };
if (CONFIG.cover) {
const img = document.createElement('img'); img.src = CONFIG.cover; sleeve.append(img);
$('glow').style.backgroundImage = `url(${CONFIG.cover})`;
} else {
const fill = document.createElement('div'); fill.className = 'fill'; sleeve.append(fill);
if (bgId) B.shader(s, fill, bgId);
const mono = document.createElement('div');
Object.assign(mono.style, { position: 'absolute', left: '8%', bottom: '7%', fontFamily: B.font('mono'), fontSize: `${side * 0.05}px`, color: B.color('figure'), letterSpacing: '0.04em' });
mono.textContent = (CONFIG.artist || B.name).toUpperCase();
sleeve.append(mono);
$('glow').style.background = `radial-gradient(circle at 35% 50%, ${B.color('accent')} 0%, ${B.color('ground')} 60%)`;
}
const words = $('words');
const ww = (tall ? W * 0.84 : W * 0.42) * K;
words.style.width = `${ww}px`; if (tall) words.classList.add('center');
const title = B.style($('title'), 'display', { short: SHORT * K }), artist = B.style($('artist'), 'title', { short: SHORT * K, color: 'figure' }), what = B.style($('what'), 'body', { short: SHORT * K, color: 'muted' });
title.textContent = CONFIG.title; artist.textContent = CONFIG.artist || B.name; what.textContent = CONFIG.what;
artist.style.marginTop = `${SHORT * 0.025}px`; what.style.marginTop = `${SHORT * 0.015}px`;
Object.assign(what.style, { fontSize: `${SHORT * K * 0.03}px`, lineHeight: 1.35 });
const bars = $('bars'), bh = SHORT * 0.07 * K;
Object.assign(bars.style, { width: `${Math.min(ww, SHORT * 0.4 * K)}px`, height: `${bh}px` });
bars.innerHTML = Array.from({ length: 12 }, (_, i) => `<i style="background:${i === 7 ? B.color('accent') : B.color('figure')};opacity:${i === 7 ? 1 : 0.55}"></i>`).join('');
const barEls = [...bars.children];
const action = B.style($('action'), 'body', { short: SHORT * K, color: 'figure' });
Object.assign(action.style, { fontFamily: B.font('mono'), fontSize: `${SHORT * K * 0.03}px`, letterSpacing: '0em', lineHeight: 1.3, width: `${W * 0.84 * K}px`, textAlign: tall ? 'center' : 'left' });
action.textContent = CONFIG.action;
const mark = B.style($('mark'), 'caption', { short: SHORT, color: 'muted' });
Object.assign(mark.style, { right: `${W * 0.08}px`, bottom: `${H * 0.085}px`, fontFamily: B.font('mono'), letterSpacing: '0.06em' });
mark.textContent = B.name.toUpperCase();
await document.fonts.ready;
for (const el of [title, artist]) { el.style.whiteSpace = 'nowrap'; const k = ww / el.scrollWidth; if (k < 1) el.style.fontSize = `${parseFloat(el.style.fontSize) * Math.max(k, 0.4)}px`; }
// places: words behind and beside (or under) the sleeve, bars in front, action low in front
if (tall) sleevePos.y = -(side + SHORT * 0.06 * K + words.offsetHeight + SHORT * 0.05 * K + bh) / 2 + side / 2;
const wordsPos = tall ? { x: 0, y: sleevePos.y + side / 2 + SHORT * 0.06 * K + words.offsetHeight / 2, z: -SHORT * 0.12 } : { x: sleevePos.x + side / 2 + SHORT * 0.06 * K + ww / 2, y: sleevePos.y - side * 0.12, z: -SHORT * 0.14 };
cam.place(words, wordsPos);
const barsY = tall ? wordsPos.y + words.offsetHeight / 2 + SHORT * 0.05 * K + bh / 2 : sleevePos.y + side / 2 - bh / 2;
cam.place(bars, { x: tall ? 0 : wordsPos.x - ww / 2 + Math.min(ww, SHORT * 0.4 * K) / 2, y: barsY, z: SHORT * 0.1 });
// square and portrait: the action takes the bars' place when it lands (the bars step aside)
cam.place(action, { x: 0, y: tall ? barsY : H * 0.42 * K, z: SHORT * 0.14 });
// the orbit: a slow arc around the sleeve, settling straight for the action
const T = { cover: [0.1, 1.4], title: 1.5, artist: 2.3, what: 3.0, bars: 3.3, action: 9.4, mark: 10.6 };
const beat = 60 / CONFIG.bpm;
const path = [
[0, { x: SHORT * 0.06, y: 0, z: DIST * 1.12, yaw: 10, pitch: 0 }],
[T.cover[1] + 0.4, { x: SHORT * 0.02, z: DIST, yaw: 5, pitch: 0 }, ease.outCubic],
[T.action, { x: -SHORT * 0.02, yaw: -5, pitch: 0 }, ease.inOutSine], // the orbit, slow, through the words
[T.action + 1.4, { x: 0, y: 0, z: DIST * 0.98, yaw: 0, pitch: 0 }, ease.inOutCubic], // straight for the action
[D, { z: DIST * 0.94 }, ease.inOutSine],
];
s.update((t) => {
cam.travel(t, path);
cam.focus(DIST, SHORT * 1.4, 6);
// the sleeve turns in, edge first, then breathes on the beat
const inP = progress(t, ...T.cover, ease.outExpo);
const ph = t < T.bars ? 1 : fract((t - T.bars) / beat);
const pulse = 1 + 0.014 * Math.exp(-7 * ph) * (t >= T.bars ? 1 : 0);
cam.place(sleeve, { ...sleevePos, yaw: (1 - inP) * -70 + Math.sin(t * 0.6) * 2, x: sleevePos.x + (1 - inP) * SHORT * 0.1, scale: pulse * (0.9 + 0.1 * inP) });
sleeve.style.opacity = String(Math.min(1, inP * 1.6));
$('glow').style.opacity = String(0.5 * inP);
wordRise(title, t, { start: T.title, each: B.pace.stagger, duration: 0.9 });
trackIn(artist, t, { start: T.artist, duration: 1.0 });
blurIn(what, t, { start: T.what, duration: 0.8 });
const barsIn = progress(t, T.bars, T.bars + 0.8, ease.outCubic);
bars.style.opacity = String(barsIn * (tall ? 1 - progress(t, T.action + 0.3, T.action + 0.9) : 1));
barEls.forEach((b, i) => { const n = noise(i * 0.9, t * 1.7), hit = Math.exp(-6 * fract((t - T.bars) / beat + i * 0.05)); b.style.height = `${(0.18 + 0.62 * n + 0.2 * hit) * 100 * barsIn}%`; });
blurIn(action, t, { start: T.action + 0.8, duration: 0.9 });
blurIn(mark, t, { start: T.mark, duration: 0.8 });
});
B.cue(s, 'land', T.cover[1] - 0.2); B.cue(s, 'text', T.title); B.cue(s, 'text', T.artist); B.cue(s, 'transition', T.action); B.cue(s, 'land', T.action + 1.2);
B.sound(s);
await s.start();
</script>
</body>
</html>
Defaults
Structure
Release01 / 04
Cover
the sleeve rises through a mask
0.0 / 15 s
01Cover
03Pulse
02Words
04Action
0 s15 s
- 010–1.5 sCoverthe sleeve rises through a mask
- 021.4–4 sWordstitle, who, what it is
- 033.2–15 sPulsethe cover and a row of bars move on the beat
- 049.4–15 sActionthe date and where to listen, then the wordmark
The script, sketched: the beats in order and their length, in the brand's colors and type. The clip above is the engine's render of the same recipe.
Notes
- Wired to the brand folder: needs brand/tokens.json (a palette and a font pair work: pamo add sage-night instrument) and, for the background, a shader-set entry (pamo add mesh-sage).
- Made for a cover and a track: render with --audio; the pulse follows CONFIG.bpm, not the audio.
- Uses these moves from the engine: word-rise, track-in, blur-in.
Spec
- Id
- release
- Type
- Recipes
- Version
- 1.0.0
- Engine
- >=0.2.1
- License
- MIT
- Data
- r/release.json