Setting the file. One moment. Scene · Music To Video · heygen-com/hyperframes · Skills DocsGsap Min
(opens in a new tab)
references/motion-primitives/palette-flip/scene.html
HTML·97 lines·3 KB
7 --hg-bg: #0a0a0f;
8 --hg-fg: #f5f5fa;
9 --hg-dim: #6b6b78;
10 }
11 * {
12 margin: 0;
13 padding: 0;
14 box-sizing: border-box;
15 }
16 .stage {
17 position: absolute;
18 inset: 0;
19 display: flex;
20 flex-direction: column;
21 align-items: center;
22 justify-content: center;
23 }
24 .kicker {
25 font-weight: 700;
26 font-size: 38px;
27 letter-spacing: 0.42em;
28 text-transform: uppercase;
29 margin-bottom: 40px;
30 }
31 .word {
32 font-weight: 900;
33 font-size: 300px;
34 letter-spacing: -0.05em;
35 line-height: 0.9;
36 white-space: nowrap;
37 }
38 .bars {
39 display: flex;
40 gap: 26px;
41 margin-top: 56px;
42 }
43 .bar {
44 width: 220px;
45 height: 26px;
46 border-radius: 4px;
47 }
48 .bar.b2 {
49 width: 140px;
50 }
51 .bar.b3 {
52 width: 90px;
53 }
54 </style>
55 <div class="stage">
56 <div class="kicker" id="kicker">REGIME</div>
57 <div class="word" id="word">REGIME</div>
58 <div class="bars">
59 <div class="bar b1"></div>
60 <div class="bar b2"></div>
61 <div class="bar b3"></div>
62 </div>
63 </div>
64 <script>
65 window.__timelines = window.__timelines || {};
66 const tl = gsap.timeline({ paused: true });
67
68 // Four distinct palette regimes — same layout, re-skinned on each flip.
69 const regimes = [
70 { bg: "#0a0a0f", fg: "#f5f5fa", accent: "#7c3aed", kicker: "#a855f7" }, // dark / violet
71 { bg: "#f4ead8", fg: "#1a1410", accent: "#ff5a47", kicker: "#c4452f" }, // cream / coral
72 { bg: "#08222b", fg: "#eafaf6", accent: "#1fd1b0", kicker: "#7fe3d2" }, // navy / teal
73 { bg: "#000000", fg: "#ffce3a", accent: "#ffce3a", kicker: "#7a6010" }, // black / amber
74 ];
75
76 const beat = 0.6;
77 const scene = "#scene";
78 const word = "#word";
79 const kicker = "#kicker";
80 const bars = ".bar";
81
82 // Instant 0ms flips on every beat — cycle through the regimes deterministically.
83 // The motion IS the colour change; layout never moves.
84 const flips = 5;
85 for (let i = 0; i < flips; i++) {
86 const p = regimes[i % regimes.length];
87 const t = i * beat;
88 tl.set(scene, { backgroundColor: p.bg }, t);
89 tl.set(word, { color: p.fg }, t);
90 tl.set(kicker, { color: p.kicker }, t);
91 tl.set(bars, { backgroundColor: p.accent }, t);
92 }
93
94 window.__timelines["palette-flip"] = tl;
95 </script>
96 </div>
97</template>