Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011h6NB8JQtfPc6eRCefEzBB
98 lines
2.8 KiB
HTML
98 lines
2.8 KiB
HTML
<template id="palette-flip-template">
|
|
<div data-composition-id="palette-flip" data-width="1920" data-height="1080" data-duration="2.6">
|
|
<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;
|
|
}
|
|
.stage {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.kicker {
|
|
font-weight: 700;
|
|
font-size: 38px;
|
|
letter-spacing: 0.42em;
|
|
text-transform: uppercase;
|
|
margin-bottom: 40px;
|
|
}
|
|
.word {
|
|
font-weight: 900;
|
|
font-size: 300px;
|
|
letter-spacing: -0.05em;
|
|
line-height: 0.9;
|
|
white-space: nowrap;
|
|
}
|
|
.bars {
|
|
display: flex;
|
|
gap: 26px;
|
|
margin-top: 56px;
|
|
}
|
|
.bar {
|
|
width: 220px;
|
|
height: 26px;
|
|
border-radius: 4px;
|
|
}
|
|
.bar.b2 {
|
|
width: 140px;
|
|
}
|
|
.bar.b3 {
|
|
width: 90px;
|
|
}
|
|
</style>
|
|
<div class="stage">
|
|
<div class="kicker" id="kicker">REGIME</div>
|
|
<div class="word" id="word">REGIME</div>
|
|
<div class="bars">
|
|
<div class="bar b1"></div>
|
|
<div class="bar b2"></div>
|
|
<div class="bar b3"></div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
window.__timelines = window.__timelines || {};
|
|
const tl = gsap.timeline({ paused: true });
|
|
|
|
// Four distinct palette regimes — same layout, re-skinned on each flip.
|
|
const regimes = [
|
|
{ bg: "#0a0a0f", fg: "#f5f5fa", accent: "#7c3aed", kicker: "#a855f7" }, // dark / violet
|
|
{ bg: "#f4ead8", fg: "#1a1410", accent: "#ff5a47", kicker: "#c4452f" }, // cream / coral
|
|
{ bg: "#08222b", fg: "#eafaf6", accent: "#1fd1b0", kicker: "#7fe3d2" }, // navy / teal
|
|
{ bg: "#000000", fg: "#ffce3a", accent: "#ffce3a", kicker: "#7a6010" }, // black / amber
|
|
];
|
|
|
|
const beat = 0.6;
|
|
const scene = "#scene";
|
|
const word = "#word";
|
|
const kicker = "#kicker";
|
|
const bars = ".bar";
|
|
|
|
// Instant 0ms flips on every beat — cycle through the regimes deterministically.
|
|
// The motion IS the colour change; layout never moves.
|
|
const flips = 5;
|
|
for (let i = 0; i < flips; i++) {
|
|
const p = regimes[i % regimes.length];
|
|
const t = i * beat;
|
|
tl.set(scene, { backgroundColor: p.bg }, t);
|
|
tl.set(word, { color: p.fg }, t);
|
|
tl.set(kicker, { color: p.kicker }, t);
|
|
tl.set(bars, { backgroundColor: p.accent }, t);
|
|
}
|
|
|
|
window.__timelines["palette-flip"] = tl;
|
|
</script>
|
|
</div>
|
|
</template>
|