feat(skills): add bgm-to-video skill
Add the music-to-video skill: turns a music/BGM track into a kinetic typography video. Includes the director/builder/music-reader/finalize agents, reference contracts, beatgrid analysis script, motion-primitive library, and starter templates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@@ -0,0 +1,191 @@
|
||||
---
|
||||
name: bgm-to-video
|
||||
description: >
|
||||
Use when the user has a BGM / background-music track (audio file, or a video to pull
|
||||
audio from) and wants a music-grounded, beat-synced HyperFrames video. This is the
|
||||
template-driven path: a deterministic analyzer reads the beat, a Music Reader classifies
|
||||
the track into sections and marks where each could be cut finer (beat type + mood, no
|
||||
content), then a Director decides each section's groups (it alone sees the templates) and
|
||||
matches each to a reverse-engineered Group Template from a catalog and adapts
|
||||
it (binding copy, palette, and timing), falling back to free creative-coding when no
|
||||
template fits, and a Builder realizes it as one paused-GSAP HyperFrames composition.
|
||||
V1 is asset-free: typography, generative shader/geometry backgrounds, code-native
|
||||
motion. "template" names the method (match-and-adapt), not a fixed look.
|
||||
metadata:
|
||||
{
|
||||
"tags": "bgm, music, beat-sync, templates, group-template, creative-coding, typography, gsap, hyperframes, visual-plan",
|
||||
}
|
||||
---
|
||||
|
||||
# bgm-to-video — template-driven, music-grounded video
|
||||
|
||||
Input is a **BGM track**. Output is a beat-synced HyperFrames video where **music is the
|
||||
spine; the visual for each group is chosen by matching a reverse-engineered template**,
|
||||
not invented from scratch each time. When nothing matches, the Director free-composes —
|
||||
the catalog is a head start, not a cage.
|
||||
|
||||
## Two layers
|
||||
|
||||
| Layer | Artifact | What it is | Used by |
|
||||
| -------------------------- | --------------------------------- | ----------------------------------------------------------------------------- | -------- |
|
||||
| **L0 · Motion Primitives** | `references/motion-primitives.md` | atoms: one anchor → one GSAP micro-move | Builder |
|
||||
| **L1 · Group Templates** | `templates/<id>/` | a whole-group archetype (roles + timing + stop rule + exit), composed from L0 | Director |
|
||||
|
||||
The linchpin: the **Music Reader's per-group output** and a **template's match-face** are
|
||||
the same schema — `GroupSignature` (`references/signature-schema.md`). Matching is then
|
||||
mechanical.
|
||||
|
||||
## How templates get into the catalog
|
||||
|
||||
Templates are **reverse-engineered from golden-sample videos** by the
|
||||
`bgm-golden_sample_reverse` skill (`reverse-to-template.md`): slice a group → beatgrid
|
||||
(signature) → Gemini video analysis (roles/motion/transition) → a `card.json` (+ a
|
||||
parameterized reference `index.html`), promoted into `templates/<id>/`.
|
||||
|
||||
## Pipeline
|
||||
|
||||
| # | Phase | Exec | Artifact | Detail |
|
||||
| --- | ---------- | -------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||||
| 0 | init | Bash | `assets/bgm.mp3` | create project, place/extract BGM |
|
||||
| 1 | analyze | Python | `audiomap.json` | deterministic beat / energy / roll / hard-stop analysis |
|
||||
| 2 | read music | subagent | `music-read.json` | Music Reader → `sections[]` (a `GroupSignature` each) + `cut_candidates[]` (classify only; no group-count decision) |
|
||||
| 3 | plan | subagent | `visual-plan.json` | Director → subdivide sections into groups (catalog-aware) + match a template per group + adapt; else free-compose |
|
||||
| 4 | build | subagent | `index.html` | Builder → mount each group (fork template impl, or author from L0) on one timeline |
|
||||
| 5 | verify | Bash | gate | lint + validate + inspect |
|
||||
| 6 | render | Bash | `renders/video.mp4` | muxed video with BGM |
|
||||
| 7 | finalize | subagent | repaired output | snapshot QA + one repair loop |
|
||||
|
||||
`SKILL_DIR` = this skill directory. `PROJECT_DIR` = `videos/<project-name>/`.
|
||||
|
||||
## Step 0 — Init project + place BGM
|
||||
|
||||
```bash
|
||||
mkdir -p "$PROJECT_DIR/assets" "$PROJECT_DIR/renders"
|
||||
cp "<user-music>" "$PROJECT_DIR/assets/bgm.mp3" # extract from video first if needed
|
||||
```
|
||||
|
||||
Optional style files at the project root: `frame.md`, `design.md` / `DESIGN.md`.
|
||||
|
||||
## Step 1 — Analyze the music
|
||||
|
||||
```bash
|
||||
python3 <SKILL_DIR>/scripts/analyze-beatgrid.py "$PROJECT_DIR/assets/bgm.mp3" \
|
||||
-o "$PROJECT_DIR/audiomap.json" --print
|
||||
```
|
||||
|
||||
Writes the canonical timing source. Sections are NOT baked in.
|
||||
|
||||
## Step 2 — Read music (Music Reader → music-read.json)
|
||||
|
||||
Dispatch one subagent. Prompt = full contents of [`agents/music-reader.md`](agents/music-reader.md) + dispatch context:
|
||||
|
||||
```text
|
||||
SKILL_DIR: <absolute path>
|
||||
PROJECT_DIR: <absolute path>
|
||||
AudioMap: <PROJECT_DIR>/audiomap.json
|
||||
Signature schema: <SKILL_DIR>/references/signature-schema.md
|
||||
Write music read to: <PROJECT_DIR>/music-read.json
|
||||
```
|
||||
|
||||
The Music Reader **only classifies**: it cuts the track into **sections** (musical
|
||||
macro-structure), writes a `GroupSignature` per section, and lists each section's
|
||||
**`cut_candidates`** — the musically-legal places it _could_ be cut finer. It does **not**
|
||||
decide how many groups a section becomes (that needs the catalog, which it can't see). No
|
||||
copy, no fonts, no colors, no layout.
|
||||
|
||||
## Step 3 — Plan (Director → visual-plan.json)
|
||||
|
||||
Dispatch one subagent. Prompt = full contents of [`agents/director.md`](agents/director.md) + dispatch context:
|
||||
|
||||
```text
|
||||
SKILL_DIR: <absolute path>
|
||||
PROJECT_DIR: <absolute path>
|
||||
User request / brief: <user's request and supplied copy>
|
||||
AudioMap: <PROJECT_DIR>/audiomap.json
|
||||
MusicRead: <PROJECT_DIR>/music-read.json
|
||||
Template catalog: read EVERY <SKILL_DIR>/templates/*/card.json (status:"promoted")
|
||||
Signature schema: <SKILL_DIR>/references/signature-schema.md
|
||||
Template definition: <SKILL_DIR>/references/template-definition.md
|
||||
Transition catalog: <SKILL_DIR>/references/transition-catalog.md
|
||||
Visual plan contract: <SKILL_DIR>/references/visual-plan-contract.md
|
||||
Motion primitives (for free-compose): <SKILL_DIR>/references/motion-primitives.md
|
||||
Style files to read if present: <PROJECT_DIR>/frame.md, design.md, DESIGN.md
|
||||
Write visual plan to: <PROJECT_DIR>/visual-plan.json
|
||||
```
|
||||
|
||||
The Director first **subdivides each section into groups** by acting on its
|
||||
`cut_candidates` (catalog-aware: keep a section whole when one template fits, split it when
|
||||
a template would be stretched or it spans multiple gestures), then matches each group to a
|
||||
promoted template, binds the template's params (copy it writes from the brief, palette from
|
||||
mood, anchors from this group's beats), reconciles the stop rule to the group boundary,
|
||||
plans `fast_cut` transitions, and free-composes any group with no match. It does **not**
|
||||
write HTML/GSAP.
|
||||
|
||||
## Step 4 — Build (Builder → index.html)
|
||||
|
||||
Dispatch one subagent. Prompt = full contents of [`agents/builder.md`](agents/builder.md) + dispatch context:
|
||||
|
||||
```text
|
||||
SKILL_DIR: <absolute path>
|
||||
PROJECT_DIR: <absolute path>
|
||||
AudioMap: <PROJECT_DIR>/audiomap.json
|
||||
VisualPlan: <PROJECT_DIR>/visual-plan.json
|
||||
Template reference impls: for each group with a templateRef, <SKILL_DIR>/templates/<templateRef>/index.html
|
||||
Visual plan contract: <SKILL_DIR>/references/visual-plan-contract.md
|
||||
Template definition: <SKILL_DIR>/references/template-definition.md
|
||||
Motion primitives: <SKILL_DIR>/references/motion-primitives.md
|
||||
Builder contract: <SKILL_DIR>/references/builder-contract.md
|
||||
BGM path for HTML: assets/bgm.mp3
|
||||
Write composition to: <PROJECT_DIR>/index.html
|
||||
```
|
||||
|
||||
The Builder mounts each group as a gated sub-scene on ONE paused timeline: fork the
|
||||
group's template reference impl and re-host its tweens at the group's absolute audio
|
||||
seconds (or author from L0 primitives when free-composed), then apply the group→group
|
||||
transitions.
|
||||
|
||||
## Step 5 — Verify gates
|
||||
|
||||
```bash
|
||||
( cd "$PROJECT_DIR" && npx hyperframes lint . && npx hyperframes validate . )
|
||||
( cd "$PROJECT_DIR" && npx hyperframes inspect . )
|
||||
```
|
||||
|
||||
Inspect: t=0, each group's `span_sec` start, each transition `at`, the final frame. On
|
||||
failure → Step 7.
|
||||
|
||||
## Step 6 — Render
|
||||
|
||||
```bash
|
||||
( cd "$PROJECT_DIR" && npx hyperframes render . -q draft -o renders/video.mp4 --fps 30 )
|
||||
```
|
||||
|
||||
Expect video + audio, duration == `audiomap.audio.duration_sec`.
|
||||
|
||||
## Step 7 — Finalize / repair
|
||||
|
||||
Dispatch one subagent. Prompt = full contents of [`agents/finalize.md`](agents/finalize.md) + the contracts above + the verbatim gate-failure output. Finalize edits `index.html` only; if the plan is creatively wrong, return to Step 3.
|
||||
|
||||
## Resume table
|
||||
|
||||
| You have | Continue from |
|
||||
| --------------------- | ------------- |
|
||||
| `assets/bgm.mp3` only | Step 1 |
|
||||
| `audiomap.json` | Step 2 |
|
||||
| `music-read.json` | Step 3 |
|
||||
| `visual-plan.json` | Step 4 |
|
||||
| `index.html` | Step 5 |
|
||||
| gates passed | Step 6 |
|
||||
| a gate failed | Step 7 |
|
||||
|
||||
## Directory layout
|
||||
|
||||
```
|
||||
bgm-to-video/
|
||||
SKILL.md
|
||||
agents/ music-reader.md · director.md · builder.md · finalize.md
|
||||
references/ signature-schema.md · template-definition.md · transition-catalog.md
|
||||
visual-plan-contract.md · motion-primitives.md (L0) · builder-contract.md
|
||||
scripts/ analyze-beatgrid.py
|
||||
templates/ <id>/ { card.json · index.html · README.md } ← the L1 catalog
|
||||
```
|
||||
@@ -0,0 +1,72 @@
|
||||
# Builder (template-driven) — mount groups on one timeline
|
||||
|
||||
Turn `visual-plan.json` + `audiomap.json` into one renderable HyperFrames `index.html`.
|
||||
Each group is a **gated sub-scene**: for a `templateRef` group, fork the template's
|
||||
reference impl and re-host it; for a `free_design` group, author from L0 primitives. All
|
||||
groups share **one paused GSAP timeline** at absolute audio seconds.
|
||||
|
||||
## Inputs
|
||||
|
||||
- `visual-plan.json` — groups (templateRef + params + role_bindings, or free_design) + transitions.
|
||||
- `audiomap.json` — timing truth.
|
||||
- **Template reference impls** — `templates/<templateRef>/index.html` for each matched group.
|
||||
- `references/template-definition.md`, `visual-plan-contract.md`, `motion-primitives.md`,
|
||||
`builder-contract.md`. Read `builder-contract.md` — the HyperFrames mechanics
|
||||
(root `#stage`, the `<audio>` tag, the one paused timeline, the forbidden list,
|
||||
seek-safety) are non-negotiable and unchanged.
|
||||
|
||||
Output: a single-file composition at the requested `index.html`.
|
||||
|
||||
## The core method: each group is a gated sub-scene
|
||||
|
||||
The whole video is ONE composition with ONE `#stage` and ONE paused timeline. Build it
|
||||
group by group:
|
||||
|
||||
1. **One container per group** inside `#stage`:
|
||||
`<div class="group" id="g1" style="position:absolute; inset:0;">…</div>`. Stable id.
|
||||
2. **Gate visibility by the group's span.** A group is only visible during its
|
||||
`span_sec`. Use 0ms `fast_cut` sets on the master timeline:
|
||||
`tl.set("#g1",{autoAlpha:1},start); tl.set("#g1",{autoAlpha:0},end);` (and start hidden
|
||||
at t=0 unless it's the first group). The transition between groups IS this hard cut.
|
||||
3. **Re-host each group's animation at an OFFSET.** A template reference impl is a
|
||||
standalone composition (its own 0-based timeline). You **inline its DOM + CSS + shader
|
||||
into the group container** and **re-create its tweens on the master timeline shifted by
|
||||
the group's `start`**: a tween the impl placed at `t` goes at `start + t`. Map the
|
||||
impl's local reveal/hold/exit onto the group's real `role_bindings` seconds (e.g.
|
||||
reveal on `role_bindings.message.reveal_at`, field breath on `field.surge_at`). Set the
|
||||
group's element ids/uniform var names with a `g1_` prefix so multiple groups don't
|
||||
collide.
|
||||
4. **Fill the template's params.** Apply `visual-plan.json` `params` as the concrete
|
||||
values (text content, palette → CSS vars / shader uniforms, flowSpeed, duration). You
|
||||
may pass them as the impl's composition-variables OR hard-code them into the inlined
|
||||
group — either way the rendered values must equal `params`.
|
||||
5. **Free-design groups:** author the container from `motion-primitives.md` recipes, same
|
||||
gating + offset rules.
|
||||
|
||||
> WebGL templates: give each group its own `<canvas>` + renderer inside its container; a
|
||||
> continuous render loop is fine (the reference impls already do this and explain why it
|
||||
> stays deterministic — all _visible_ state comes from timeline-driven uniforms). Gate the
|
||||
> container with `autoAlpha`, not by tearing down the renderer.
|
||||
|
||||
## Transitions
|
||||
|
||||
`visual-plan.json.transitions` are all `fast_cut`: realize each as the 0ms visibility
|
||||
swap at `at` (hide the outgoing group, show the incoming one on the same frame). No
|
||||
crossfade, no tween. The cut is the transition.
|
||||
|
||||
## Timeline discipline (from builder-contract.md)
|
||||
|
||||
- Exactly one `gsap.timeline({ paused:true })`; register `window.__timelines["<compositionId>"] = tl;`; end with `tl.seek(0);`.
|
||||
- All tween positions are absolute audio seconds from `audiomap.json` (offset per group as above).
|
||||
- Hard hits / cuts / palette flips are 0ms `tl.set(...)`. Eased entrances 300–500ms. Lead a move that must _land_ on a beat by ~40–190ms.
|
||||
- No `stagger`, timers, `requestAnimationFrame` for visual _state_, `Math.random`, `Date.now`, remote assets/fonts, infinite repeats, render-critical callbacks. Fake them deterministically (see builder-contract.md).
|
||||
|
||||
## Self-Check
|
||||
|
||||
- Passes `npx hyperframes lint .` and `npx hyperframes validate .`.
|
||||
- `#stage` + `<audio id="bgm" data-timeline-role="music" ...>`; one paused timeline; duration == `audiomap.audio.duration_sec`.
|
||||
- Each group is visible exactly across its `span_sec` and hidden outside it; t=0 is not accidentally blank.
|
||||
- Each group's rendered text/palette equals its `visual-plan.json` `params`.
|
||||
- Group→group cuts are 0ms and land on the `transitions[].at` second.
|
||||
- Group ids/var names are namespaced; no two groups' elements or uniforms collide.
|
||||
- Final frame is intentional; main text readable, not colliding.
|
||||
@@ -0,0 +1,121 @@
|
||||
# Director (template-driven) — match, adapt, transition
|
||||
|
||||
Turn the brief + `music-read.json` into `visual-plan.json`. For each **section**, decide
|
||||
how finely to split it into **groups** (you own this call — you alone see the catalog),
|
||||
then for each group **match a promoted Group Template and adapt it**; free-compose only
|
||||
when nothing fits.
|
||||
|
||||
Your mantra: **music is the spine; a template is a head start, not a cage.**
|
||||
|
||||
## Inputs
|
||||
|
||||
- User brief / supplied copy — topic, mood, exact words to keep.
|
||||
- `music-read.json` — `sections[]`: each is a `GroupSignature` over its whole span **plus**
|
||||
a `cut_candidates[]` menu of musically-legal internal cut points. **There are no groups
|
||||
yet — you create them** by choosing which candidates to act on.
|
||||
- `audiomap.json` — timing truth (anchor seconds).
|
||||
- **Template catalog** — read EVERY `templates/*/card.json` with `status:"promoted"`.
|
||||
- `references/signature-schema.md`, `template-definition.md`, `transition-catalog.md`,
|
||||
`visual-plan-contract.md`, `motion-primitives.md` (for free-compose).
|
||||
- Style files if present: `frame.md` → `design.md` → `DESIGN.md`.
|
||||
|
||||
Read the contracts before writing. Output: one valid `visual-plan.json`, no commentary.
|
||||
|
||||
## Per section: decide its groups (subdivide)
|
||||
|
||||
You decide how many groups each section becomes, because the right granularity depends on
|
||||
the **template native spans** in the catalog — which only you can see. A group's native
|
||||
span ≈ the length of a card's `examples[].span_sec`.
|
||||
|
||||
1. **Try the section whole first.** Treat the section as one group (its `GroupSignature` is
|
||||
already in `music-read.json`) and run the match below.
|
||||
2. **Subdivide only if the whole-section fit is bad**, cutting at the section's
|
||||
`cut_candidates[]`:
|
||||
- **Pacing** — the best-matching card's native span is much shorter than the section
|
||||
(the template would be stretched / leave dead air). Cut so each group ≈ a matchable
|
||||
native span.
|
||||
- **Gesture** — the section spans parts no single template or thesis covers well (e.g. a
|
||||
busy opener + a closing lockup). Cut at the candidate(s) that separate them.
|
||||
3. **How to cut.** Pick the **fewest, strongest** `cut_candidates` that fix the above; each
|
||||
group's `span_sec` = consecutive cut points (plus the section ends). Keep every group
|
||||
**≥ ~1 bar**. Derive each group's `GroupSignature` over its slice (signature-schema
|
||||
derivation table) and **re-classify `structural_type` on that slice** — it may differ
|
||||
from the section's.
|
||||
4. **Don't over-cut.** If one template already fits the whole section's pacing, keep it
|
||||
whole. A `void_breath` / `sustained_hold` / `hard_stop_freeze` section has no candidates
|
||||
— never split it. Multiple templates across a section's groups are fine; cohesion is the
|
||||
brand spine, not reuse.
|
||||
|
||||
## Per group: match → select → adapt
|
||||
|
||||
Run this on each group you produced above (the section itself when you kept it whole).
|
||||
|
||||
1. **Match.** Keep promoted cards where
|
||||
`card.match.structural_type == group.structural_type`
|
||||
**and** the group's `GroupSignature` satisfies **every** `card.match.requires`
|
||||
predicate **and** `group.mood` overlaps `card.match.mood_fit`.
|
||||
2. **Rank & select.** Order survivors by signature closeness to the card's `examples[]`
|
||||
(and example count as a tiebreak); take the top → `templateRef`. If **no card
|
||||
survives**, set `templateRef:null` and write a `free_design` (one visual thesis for the
|
||||
group, built from `motion-primitives.md` — pick a density topology, name the
|
||||
primitives).
|
||||
3. **Adapt (bind the template).**
|
||||
- Fill `params` (keys exactly from the card) — **copy you wrote** into the text slots,
|
||||
**palette** from the brand spine, `flowSpeed`/etc. to taste, `duration` = the group's
|
||||
span length.
|
||||
- Fill `role_bindings` with this group's **real anchor seconds** (entry downbeat, surge
|
||||
time, …) from its slice of the AudioMap — not the card's example times.
|
||||
- **Reconcile the stop rule:** if the card's `exit_trigger` and the group's `span_sec`
|
||||
end disagree, snap the boundary to the nearest AudioMap anchor and use that.
|
||||
|
||||
## Brand spine (unify the groups)
|
||||
|
||||
Set one `style`: one type family, a ≤4–6 swatch palette, ≤2 accents per frame, from the
|
||||
brief's mood. Different templates per group are expected — the spine is what makes them
|
||||
read as one piece. Pick the palette once; every group's `params.palette` draws from it.
|
||||
|
||||
## Write the copy (you own the words)
|
||||
|
||||
- Keep exact user words; else invent with taste, on the brief's mood.
|
||||
- **Message vs texture:** a readable word holds ≥1 beat (headline 3–8, sentence 4–10),
|
||||
stable + focal; a word held <1 beat is texture (strobe/grid/ticks). Never force a
|
||||
message onto a sub-beat — demote it to texture.
|
||||
- Place copy into the matched template's text params, or (free groups) onto the group's
|
||||
anchors. Declare anchor + accumulate/stagger intent; leave micro-timing to the Builder.
|
||||
- A closing `logo`/CTA lands on the final hit / hard stop and holds through trailing
|
||||
silence.
|
||||
|
||||
## Transitions
|
||||
|
||||
One `transitions[]` entry per adjacent group pair. **`transition` is always `"fast_cut"`**
|
||||
for now (decision #4): a 0ms hard cut at the boundary second. Do not emit richer
|
||||
transitions yet (the interface exists for later — see `transition-catalog.md`).
|
||||
|
||||
## Direction stance
|
||||
|
||||
- **You own group count.** `music-read.json` gives sections + legal `cut_candidates`, not
|
||||
groups — subdivide each section yourself (see above), because only you know the template
|
||||
native spans. Keep a section whole when one template fits it; split it when a template
|
||||
would otherwise be stretched or when it spans gestures no single template covers. Groups
|
||||
in one section may use **different templates** — no reuse constraint; the brand spine
|
||||
unifies them.
|
||||
- One template (or one free thesis) per group — but the visual **system may change** at
|
||||
each boundary; the brand spine unifies them.
|
||||
- Trust the match: a `sustained_hold` group wants the held-message template's stillness,
|
||||
not invented motion. Don't over-design a group the template already solves.
|
||||
- Free-compose is a real fallback, not a failure — use it whenever the catalog has no
|
||||
honest match, and write it as carefully as a matched group.
|
||||
|
||||
## Self-Check
|
||||
|
||||
- Every section became ≥1 group; each group entry carries its `section_id`, `span_sec`
|
||||
drawn from the section's `cut_candidates` (or the whole section span), all groups in
|
||||
order tiling `duration_s`. No group is < ~1 bar; no cut lands inside a roll.
|
||||
- Each group's `GroupSignature` is derived over its own slice (or inherited from the
|
||||
section when kept whole); its `structural_type` may differ from the section's.
|
||||
- Every group has a `templateRef` (promoted, exists) **or** a `free_design`.
|
||||
- For each `templateRef`: `match.requires` is actually satisfied by the group's signature;
|
||||
`params` keys == the card's `params`; `role_bindings` use real AudioMap seconds.
|
||||
- `style` brand spine is set and every `params.palette` is drawn from it.
|
||||
- One `fast_cut` transition per boundary.
|
||||
- `duration_s == audiomap.audio.duration_sec`.
|
||||
@@ -0,0 +1,39 @@
|
||||
# Finalize / Repair (template-driven)
|
||||
|
||||
Use after lint, validate, inspect, or render fails. You may edit `index.html` only.
|
||||
|
||||
## Inputs
|
||||
|
||||
- `audiomap.json`
|
||||
- `visual-plan.json`
|
||||
- current `index.html`
|
||||
- `references/visual-plan-contract.md`
|
||||
- `references/template-definition.md`
|
||||
- `references/builder-contract.md`
|
||||
- `references/motion-primitives.md`
|
||||
- lint / validate / inspect / render output (verbatim)
|
||||
- render quality target
|
||||
|
||||
Read the relevant contracts before repairing.
|
||||
|
||||
## Flow
|
||||
|
||||
1. Read the failure output first. Separate contract failures from visual issues.
|
||||
2. Inspect important times: `t=0`, every group's `span_sec` start, every
|
||||
`transitions[].at`, and the final frame.
|
||||
3. Repair narrowly: blank/empty frames; a group visible outside its `span_sec` (or hidden
|
||||
inside it); elements or uniforms colliding between groups (namespacing); invisible
|
||||
elements; bad attrs; missing timeline registration; forbidden GSAP; obvious timing
|
||||
misses; a group whose rendered text/palette doesn't match its `params`.
|
||||
4. Re-run `npx hyperframes lint .`, `npx hyperframes validate .`, and inspect.
|
||||
5. Render when gates pass.
|
||||
|
||||
## Rules
|
||||
|
||||
- Do not change duration or audio timing to hide sync issues.
|
||||
- Do not redesign the concept during repair. If the plan is creatively wrong (wrong
|
||||
template matched, wrong copy), return to the Director (Step 3) — don't patch around it.
|
||||
- Keep each group's visibility gated to its `span_sec`; keep group→group cuts 0ms on the
|
||||
`transitions[].at` second.
|
||||
- Do not add remote assets, network fetches, timers, or nondeterminism.
|
||||
- Prefer small CSS/GSAP fixes over structural rewrites.
|
||||
@@ -0,0 +1,128 @@
|
||||
# Music Reader (template-driven) — classify only
|
||||
|
||||
Turn `audiomap.json` into `music-read.json`: cut the track into **sections** (musical
|
||||
macro-structure), write a `GroupSignature` for each section, and list the musically-legal
|
||||
**cut candidates** inside each (the internal anchors the Director _may_ subdivide on). You
|
||||
**classify and surface facts**; you do not design, and **you do not decide group count** —
|
||||
how finely a section is split is the Director's call, because only the Director sees the
|
||||
template catalog.
|
||||
|
||||
You are not choosing visuals, copy, fonts, colors, layout, or motifs. You answer, per
|
||||
section: _what kind of beat is this_, _what mood_, and _where could this legally be cut
|
||||
finer_. Everything else is the Director's job.
|
||||
|
||||
## Inputs
|
||||
|
||||
- `audiomap.json` — factual music data.
|
||||
- `references/signature-schema.md` — the `GroupSignature` schema + controlled vocab +
|
||||
derivation formulas + the `structural_type` classification rubric. **Read it first.**
|
||||
|
||||
## Output
|
||||
|
||||
Write exactly one valid JSON file to the requested path: `music-read.json`. No markdown,
|
||||
no commentary.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"duration_s": 7.198, // == audiomap.audio.duration_sec
|
||||
"bpm": 129.2,
|
||||
"one_line": "A held recap card that breaks into a per-onset typography hit.",
|
||||
"sections": [
|
||||
{
|
||||
// a section IS a GroupSignature over its whole span (so the Director can match it
|
||||
// as one group if it chooses not to subdivide) + the legal cut points inside it.
|
||||
"id": "s1",
|
||||
"span_sec": [0.0, 7.198], // snapped to AudioMap anchors; sections tile the track
|
||||
"structural_type": "per_onset_sequential", // the section's dominant archetype
|
||||
"mood": ["hype"],
|
||||
/* …every other GroupSignature field per references/signature-schema.md
|
||||
(energy_level, density, onset_rate, onset_gap_bars, has_roll, entry, exit_trigger, …),
|
||||
derived over the WHOLE section span … */
|
||||
"cut_candidates": [
|
||||
// internal anchors the Director MAY cut on — musically legal only. Empty for a
|
||||
// single-gesture section. NEVER a point inside a rolls[] run.
|
||||
{ "time": 3.692, "kind": "key_moment", "strength": "strong" },
|
||||
{ "time": 5.759, "kind": "phrase", "strength": "medium" },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
`sections[]` is an ordered list whose `span_sec` tile the whole track with no gaps or
|
||||
overlaps (first starts at 0, last ends at `duration_s`). Each section is a full
|
||||
`GroupSignature` (derived over its span) **plus** a `cut_candidates[]` menu. **There is no
|
||||
`groups[]` here** — the Director creates groups in `visual-plan.json` by choosing which
|
||||
cut candidates to act on.
|
||||
|
||||
## How to read (pipeline — run in order)
|
||||
|
||||
1. **Gestalt.** From `summary` / `tempo` / `audio.duration_sec` + the drum histogram +
|
||||
roll count, write the `one_line` and note the density arc.
|
||||
2. **Segment into sections.** Walk `energy_phases[]` in order and split the track where the
|
||||
music genuinely changes state — at `hard_stops[]`, `SURGE`/`DROP` `key_moments`, the
|
||||
start/end of a `rolls[]` run, an **onset desert** (a long gap in `events[]`), or a big
|
||||
energy-level jump. Collapse adjacent phases that are really one gesture. Expect ~1–6
|
||||
sections; a short clip may be one. **Snap every boundary to an AudioMap anchor**
|
||||
(downbeat / hard_stop / phrase / key_moment / energy-phase edge), then **re-snap to the
|
||||
nearest `beats_sec`** (key_moments / energy-phase edges are 1-second-resolution facts;
|
||||
the beat grid is precise — tolerance ≤ ½ beat).
|
||||
3. **Per section, build the `GroupSignature`** over the whole section span. Use the
|
||||
derivation table in `signature-schema.md` for every objective field (`energy_level`,
|
||||
`density`, `onset_rate`, `onset_gap_bars`, `has_steady_grid`, `span_bars`, `entry`),
|
||||
classify `structural_type` (rubric, top-down first-match; `unclassified` + a `note` if
|
||||
nothing fits), tag `mood` (1–3), and set `exit_trigger`. All from the audiomap — never
|
||||
invented.
|
||||
4. **Per section, list `cut_candidates[]`** — the internal anchors the Director _may_ cut
|
||||
on. This is a **menu of musical facts, not a decision**: you do not pick how many groups,
|
||||
only where a cut would be legal.
|
||||
- **Include** each anchor that lies strictly inside the span: an internal `key_moment`
|
||||
(mini SURGE/DROP), a mid-section `hard_stop`, the edge of a partial `rolls[]` run, a
|
||||
`phrases[]` edge, or a clear onset-cluster gap (≥ ~1 bar between consecutive
|
||||
`events[]`). Tag each `{time, kind, strength}` and snap its `time` to the nearest beat.
|
||||
- **Exclude (illegal cuts):** any point **inside** a `rolls[]` run (a roll is one
|
||||
cascade), and any candidate that would leave a fragment **< ~1 bar**.
|
||||
- **Emit an empty list** for a single-gesture section (`void_breath` / `sustained_hold` /
|
||||
`hard_stop_freeze`) — it must never be subdivided.
|
||||
|
||||
> The Director reads the catalog (template native spans + what matches) and decides which
|
||||
> of these candidates to act on; an unused candidate costs nothing. Detecting where a cut
|
||||
> is _legal_ is musical (yours); deciding where a cut is _useful_ is catalog-aware (theirs).
|
||||
|
||||
## Worked example — a section + its cut candidates
|
||||
|
||||
Section `s_final` = `[19.412, 30.0]`, `per_onset_sequential`, ~4.6 bars @ 103.4 bpm, with
|
||||
a `hard_stop` at ~24s and a `SURGE` at ~26s inside it. You emit it as **one section**
|
||||
carrying its whole-span `GroupSignature` plus:
|
||||
|
||||
```jsonc
|
||||
"cut_candidates": [
|
||||
{ "time": 23.963, "kind": "hard_stop", "strength": "strong" }, // snapped to the downbeat
|
||||
{ "time": 26.215, "kind": "surge", "strength": "strong" },
|
||||
]
|
||||
```
|
||||
|
||||
You do **not** decide whether this becomes 1, 2, or 3 groups. The Director may keep it
|
||||
whole (if one template fits), or cut at one/both candidates (e.g. a per-onset opener + a
|
||||
closing lockup) — that is its catalog-aware call.
|
||||
|
||||
## Section boundaries are proposals
|
||||
|
||||
You propose section `span_sec`; the Director may nudge a boundary to fit a chosen
|
||||
template's stop rule, then reconcile to the nearest anchor (decision #2). Because both of
|
||||
you derive from the same audiomap, this rarely moves anything — but write the most
|
||||
defensible audio boundary, not a guess.
|
||||
|
||||
## Self-Check
|
||||
|
||||
- `duration_s == audiomap.audio.duration_sec`; `sections[].span_sec` tile it with no
|
||||
gap/overlap (first at 0, last at `duration_s`).
|
||||
- Every section carries a full `GroupSignature` (every field traces to an audiomap value or
|
||||
a span of it) **plus** a `cut_candidates[]` list (possibly empty).
|
||||
- Every `cut_candidates[].time` sits on an AudioMap anchor re-snapped to the nearest beat;
|
||||
none is inside a `rolls[]` run; none would leave a sub-1-bar fragment; single-gesture
|
||||
sections (`void_breath` / `sustained_hold` / `hard_stop_freeze`) have an empty list.
|
||||
- `structural_type`, `mood`, `exit_trigger.type` are controlled-vocab (or `unclassified`
|
||||
with a note).
|
||||
- **No `groups[]` and no group-count decision** anywhere — that is the Director's.
|
||||
- No content, no fonts, no colors, no layout, no copy anywhere in the output.
|
||||
@@ -0,0 +1,143 @@
|
||||
# Builder Contract
|
||||
|
||||
This is the complete implementation contract for LLM-first BGM compositions. Builder
|
||||
and Finalize must read it before editing `index.html`.
|
||||
|
||||
The timeline is seekable sheet music: one paused GSAP timeline, absolute audio-second
|
||||
positions, deterministic elements, no browser-play-only tricks.
|
||||
|
||||
## Root Composition
|
||||
|
||||
The root is a real stage element, not `<html>`:
|
||||
|
||||
```html
|
||||
<div
|
||||
id="stage"
|
||||
data-composition-id="bgm"
|
||||
data-start="0"
|
||||
data-duration="23.005"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
></div>
|
||||
```
|
||||
|
||||
- `data-composition-id` must equal the `window.__timelines` key.
|
||||
- Use `data-duration`, not `data-composition-duration`.
|
||||
- `data-width` / `data-height` define the frame.
|
||||
- Root CSS must set explicit pixel `width` and `height`.
|
||||
- Landscape 1920x1080 is default unless `visual-plan.json.canvas` requests otherwise.
|
||||
|
||||
## Audio
|
||||
|
||||
```html
|
||||
<audio
|
||||
id="bgm"
|
||||
data-timeline-role="music"
|
||||
src="assets/bgm.mp3"
|
||||
data-start="0"
|
||||
data-duration="23.005"
|
||||
data-media-start="0"
|
||||
data-volume="1.0"
|
||||
></audio>
|
||||
```
|
||||
|
||||
- Source HTML uses `data-duration`; emitting raw `data-end` triggers lint warnings.
|
||||
- `data-timeline-role="music"` marks the BGM track.
|
||||
- The file must exist beside `index.html` at `assets/bgm.mp3`.
|
||||
|
||||
## Timeline
|
||||
|
||||
- Exactly one render-critical `gsap.timeline({ paused: true })`.
|
||||
- Register it: `window.__timelines["<compositionId>"] = tl;`.
|
||||
- End the script with `tl.seek(0);`.
|
||||
- Tween positions are absolute audio seconds from `audiomap.json`.
|
||||
- Percentage keyframes only live inside a single tween's `keyframes`.
|
||||
- `easeEach` belongs inside `keyframes`, never as a sibling tween prop.
|
||||
|
||||
## Timing Discipline
|
||||
|
||||
- Group-level cuts land on `visual-plan.json` `groups[].span_sec` boundaries (= the
|
||||
`transitions[].at` seconds), snapped to nearby downbeats.
|
||||
- Phrase moves use `audiomap.phrases[]`.
|
||||
- Word entries and layout changes prefer `grid.downbeats_sec[]`.
|
||||
- Micro accents use `grid.beats_sec[]` or selected `events[].t`.
|
||||
- Rolls use `rolls[].start/end` and should feel continuous or cascading.
|
||||
- Hard stops use `hard_stops[].t` and should visibly freeze, cut, or hold.
|
||||
|
||||
## Layout Before Animation
|
||||
|
||||
Build the most important static frame first:
|
||||
|
||||
- A scene container fills the stage.
|
||||
- Use CSS grid/flex/padding for content layout.
|
||||
- Use absolute positioning for decorative systems, overlays, masks, and generated
|
||||
geometry.
|
||||
- Keep title-safe padding. Do not let hero text touch the frame edge.
|
||||
- Use `vmin`, `clamp`, or measured CSS to keep type readable across aspect choices.
|
||||
|
||||
Animate from hidden/offscreen states into the CSS end-state. The CSS end-state is the
|
||||
truth.
|
||||
|
||||
## Seek-Safe Reveal
|
||||
|
||||
- Delayed elements are hidden until entrance and visible after seeking.
|
||||
- Initial hidden state may be inline CSS or `gsap.set(..., {autoAlpha:0})` at time 0.
|
||||
- Reveal with `fromTo` or paired `set` + motion tweens.
|
||||
- Finite repeats only.
|
||||
|
||||
## Forbidden
|
||||
|
||||
`tl.play()`, `setTimeout`, `setInterval`, `requestAnimationFrame`, runtime network,
|
||||
remote assets, remote fonts, `Math.random`, `Date.now`, `new Date`, `ScrollTrigger`,
|
||||
`repeat:-1`, render-critical callbacks, `.call()`, `.addLabel()`, `.addPause()`.
|
||||
|
||||
## Discouraged
|
||||
|
||||
- `stagger:` does not serialize cleanly; expand multi-element moves into explicit
|
||||
per-element tweens with offset positions.
|
||||
- Google Fonts links fail in offline/sandboxed renders. Use system-safe stacks or
|
||||
local `@font-face`.
|
||||
- Out-of-alias font family names can trigger lint warnings.
|
||||
|
||||
## Faking the forbidden patterns
|
||||
|
||||
The bans still leave you every move the music wants — do them deterministically:
|
||||
|
||||
- **Instead of `stagger`:** schedule explicit per-element work at `t + i*step` — either
|
||||
`delay: i*0.04` on each tween, or one `tl.set(el[i], props, eventTime[i])` per onset.
|
||||
This serialises cleanly and lands each element on its own beat.
|
||||
- **Instead of `Math.random`:** derive variation from the index —
|
||||
`palette[(i*7 + step*3) % palette.length]`, a fixed coordinate/rotation table, or a
|
||||
hand-keyed scrambled-string array. Looks random, stays seek-deterministic.
|
||||
- **Instant text / number swaps:** `tl.set(el, { textContent: "…" }, T)` is allowed and is
|
||||
the workhorse percussive move. Give the node `width: max-content` (or a fixed width) and
|
||||
centre it so a longer word does not reflow the layout.
|
||||
|
||||
## CSS Values
|
||||
|
||||
Complex CSS strings for `clipPath`, `filter`, or transforms should be valid CSS in the
|
||||
HTML source. If a serializer path requires raw passthrough, use the repo convention:
|
||||
`"__raw:'inset(0 0% 0 0)'"`.
|
||||
|
||||
## Visual QA
|
||||
|
||||
- `t=0` is not blank unless intentional silence is specified.
|
||||
- The first meaningful visual appears during the first section.
|
||||
- Drop / surge has a visible hit within about 0.15s of the intended anchor.
|
||||
- Dense sections show visual density, not just a single static word.
|
||||
- Hard stop creates a readable hold or freeze.
|
||||
- Final frame is intentional.
|
||||
- Main text is readable and not colliding.
|
||||
- Palette is coherent; define colors once through CSS variables or one palette block.
|
||||
|
||||
## Inspect Targets
|
||||
|
||||
When running `hyperframes inspect`, include:
|
||||
|
||||
- `0`
|
||||
- every `visual-plan.json` `groups[].span_sec` start
|
||||
- every `transitions[].at`
|
||||
- strongest `DROP` / `SURGE` key moments
|
||||
- every `hard_stops[].t`
|
||||
- start/end of major `rolls[]`
|
||||
- `duration - 0.2`
|
||||
@@ -0,0 +1,123 @@
|
||||
# Motion Primitives — recipe catalog for Builder
|
||||
|
||||
The atomic layer: one anchor → one micro-move. Group Templates (L1) are composed from
|
||||
these; the Builder also reaches here directly when a group is free-composed. **Not a
|
||||
fixed API** — they are creative-coding recipes.
|
||||
|
||||
One flat catalog. The **recipe** column tells you what to lift:
|
||||
|
||||
- **✓** — a runnable, lint-clean composition at `motion-primitives/<id>/index.html`. Open
|
||||
it and lift the relevant tweens.
|
||||
- **≈ `<id>`** — no separate file; use that existing recipe, it's the same idea.
|
||||
- **—** — no standalone file. Implement it inline from the description + `builder-contract.md`;
|
||||
these are one-liners (e.g. a 0ms `tl.set`) or moves a template realizes internally.
|
||||
|
||||
## Timing & latency (applies to every primitive)
|
||||
|
||||
Quantified from frame-accurate reverse engineering of beat-synced reels:
|
||||
|
||||
- **Hard hits are 0ms.** Cuts, palette flips, content swaps, freezes are `tl.set(...)`
|
||||
with no duration — the percussion _is_ the motion. Easing a hit kills it.
|
||||
- **Lead the anchor.** A move that must _land_ on a beat (a wipe covering the frame, a
|
||||
count-up locking, two blocks colliding to centre) should **start ~40–190ms early** so it
|
||||
completes ON the anchor. Reactive entrances — something appearing _because_ of the hit —
|
||||
fire 0–45ms after.
|
||||
- **Eased entrances: 300–500ms** (scale punch, slides, camera pushes). **Macro builds:
|
||||
800–2000ms** spanning a whole roll / silence.
|
||||
- **Magnitudes:** scale-punch entrance 0→1; weight pulse 1→1.06; hero fill up to 1→5;
|
||||
chromatic split ~20px, resolve clean in ≤150ms.
|
||||
- **Per-bar caps:** one accumulating element per audio hit (not a burst); a camera move at
|
||||
most once per phrase, never per beat; a dense flip/strobe system runs ≤2–3s.
|
||||
- **Tension-builds lock.** A count-up / sequential build / morph must _resolve on_ a
|
||||
downbeat or hard_stop, never trail off mid-bar.
|
||||
|
||||
## Catalog
|
||||
|
||||
Each runnable recipe is self-contained and lint-clean: showcase chrome stripped,
|
||||
system-font fallback, shared `../assets/gsap.min.js`, one paused timeline on
|
||||
`window.__timelines["main"]`. To use one, read its `index.html` and lift the tweens.
|
||||
|
||||
| id | anchor | what it does | recipe |
|
||||
| ------------------------ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
||||
| `01-hypercut_whip` | beat / hard_stop | fast whip-pan hard cut between frames | ✓ |
|
||||
| `02-kinetic_letter_in` | downbeat / phrase | per-letter kinetic entrance | ✓ |
|
||||
| `03-braam_punch` | drop / surge | big "braam" impact — scale + weight slam | ✓ |
|
||||
| `04-chromatic_split` | snare / glitch / surge | RGB channel split / glitch on a word | ✓ |
|
||||
| `05-mask_reveal` | section_start / downbeat | clip-path mask wipe reveal | ✓ |
|
||||
| `07-screen_shake` | drop / crash / kick | camera/screen shake jitter | ✓ |
|
||||
| `08-binary_decrypt` | roll / build | scramble→decode text (binary → word) | ✓ |
|
||||
| `09-dolly_zoom` | phrase / build | vertigo dolly-zoom (scale vs perspective) | ✓ |
|
||||
| `10-iris_open` | section_start / reveal | circular iris-open reveal | ✓ |
|
||||
| `11-electric_arc` | accent / glitch | electric arc / lightning accent | ✓ |
|
||||
| `12-neon_flicker` | hold / texture | neon-sign flicker | ✓ |
|
||||
| `13-chrome_sweep` | downbeat / reveal | metallic specular sweep across text | ✓ |
|
||||
| `15-slot_machine_reveal` | roll → downbeat | slot-machine spin-to-land character reveal | ✓ |
|
||||
| `16-liquid_morph` | phrase / transition | liquid / blob morph | ✓ |
|
||||
| `17-gooey_metaball` | build / drop | gooey metaball merge field | ✓ |
|
||||
| `18-3d_card_flip` | downbeat / swap | 3D card flip (rotateY) | ✓ |
|
||||
| `19-crash_zoom_in` | drop / surge | violent crash zoom-in | ✓ |
|
||||
| `20-spotlight_sweep` | reveal / hold | spotlight / gradient sweep over text | ✓ |
|
||||
| `21-outline_to_fill` | downbeat / reveal | stroke outline → solid fill | ✓ |
|
||||
| `22-counting_punch` | roll → downbeat | number count-up that punches & locks | ✓ |
|
||||
| `24-particle_burst` | drop / crash | particle explosion burst | ✓ |
|
||||
| `25-radial_burst_lines` | drop / surge | radial speed-lines burst | ✓ |
|
||||
| `26-pixel_dissolve` | transition / hard_stop | pixelated dissolve | ✓ |
|
||||
| `27-datamosh_smear` | glitch / transition | datamosh / motion smear | ✓ |
|
||||
| `28-text_wave_distort` | hold / texture | wavy text distortion | ✓ |
|
||||
| `bg_flow_field` | energy / whole span (bed) | generative WebGL curl-noise flow-field **background bed** — palette-driven, breathes on the energy envelope; run it underneath and compose any foreground move over it | ✓ |
|
||||
| `blur_resolve` | stop / final hold | blur-in to crisp focus, then blur-out on the cut | ✓ |
|
||||
| `chromatic_pressure` | snare / glitch | RGB split / digital tension on a transient | ≈ `04-chromatic_split` |
|
||||
| `color_grid_shuffle` | onset | grid of cells recoloured by a deterministic index per onset | — |
|
||||
| `content_swap` | beat | 0ms swap of stacked nodes — the workhorse percussive move | ≈ `15-slot_machine_reveal` |
|
||||
| `directional_fill` | beat / reveal | directional wipe-fill (scaleX) sweeping across bars | ✓ |
|
||||
| `flash_cut` | drop / crash | full-frame flash masking a word/colour state change | ✓ |
|
||||
| `freeze_hold` | hard_stop | freeze the moving system and hold it (desaturate + vignette) | — |
|
||||
| `hard_cut` | beat / hard_stop | sample-accurate 0ms colour-block + word cut | ✓ |
|
||||
| `mosaic_pack` | beat / build | scattered tiles fly in and pack into a grid | ✓ |
|
||||
| `negative_space_hold` | silence / hard_stop / final hold | kill busy layers, hold one readable mark in empty space | — |
|
||||
| `overlay_pop` | accent | badge / lower-third overlay pops in over a base | — |
|
||||
| `palette_flip` | section change | same layout re-skins via 0ms palette-variable flips | ✓ |
|
||||
| `staggered_exit` | phrase / transition | ordered cascade-out clearing the frame | ✓ |
|
||||
| `staggered_reveal` | build | ordered cascade-in of a stack / list | — |
|
||||
| `system_replace` | drop / regime change | hard-cut the entire visual system, then boot the new one | — |
|
||||
| `text_spectral_rays` | phrase / sweep (hero text) | volumetric spectral light-rays cast by a wordmark toward a sweeping light cursor — grain + RGB-split; **WebGL hero-text system** | ✓ |
|
||||
| `tile_mosaic` | build / reveal | grid of tiles revealed in a diagonal sweep, assembling a poster | ✓ |
|
||||
| `typewriter_reveal` | roll / build | char/word type-on, explicit per-span set (no `stagger`) + caret | ✓ |
|
||||
| `value_counter` | roll → downbeat | count-up that locks on a downbeat / hard_stop | ≈ `22-counting_punch` |
|
||||
| `word_grid_burst` | onsets → downbeat | grid of words revealed per onset, refocus one on a downbeat | ✓ |
|
||||
|
||||
> **Template-private verbs.** Some templates declare motion verbs realized only inside their
|
||||
> own impl — e.g. `held_lockup`, `anchor_pop_in`, `word_slot_cycle`, `per_line_color`,
|
||||
> `scene_palette_flip`, `beat_jitter_shake`, `box_zoom_wipe` (split-anchor-word-slot),
|
||||
> `motion-blur` (logo-split). Those live in the template's own `index.html` / README, not
|
||||
> here. Promote one into this catalog only when a second template needs it.
|
||||
|
||||
## How to combine
|
||||
|
||||
- One dominant system per group; layer at most one texture recipe over one structural recipe.
|
||||
- Structure on strong beats (cuts, camera, system_replace → downbeat / phrase / section_start);
|
||||
texture on weak / syncopated hits (content_swap, typewriter letters, chromatic accents).
|
||||
- A roll is an accumulation container — build during it, hard-cut to a clean layout on the
|
||||
downbeat that ends it.
|
||||
- `drop` ≠ `downbeat`: a downbeat is a cut within the regime; a drop is a regime change
|
||||
(`system_replace`, total clear, element-count jump).
|
||||
- Let silence remove density (`negative_space_hold`).
|
||||
- **Background beds are a layer, not a move.** A bed (e.g. `bg_flow_field`) runs the whole
|
||||
span on the **energy / phrase** channel, leaving the **beat anchors** free for the
|
||||
foreground — so it composes cleanly _under_ any discrete primitive (text `content_swap`,
|
||||
`hard_cut`, a held mark…). One bed at a time; when mounting into a group, merge the bed's
|
||||
uniform tweens onto the group's master timeline (don't run a second timeline), bundle a
|
||||
local `three`/WebGL (no CDN), and repaint via the timeline's `onUpdate` (no rAF).
|
||||
- **WebGL "system" primitives come in two roles:** a **bed** (`bg_flow_field`, behind
|
||||
everything) and a **hero-text treatment** (`text_spectral_rays`, which rasterizes the
|
||||
wordmark and _is_ the hero). Use at most one of each; feed text/raster locally (no CDN
|
||||
fonts), repaint via `onUpdate`.
|
||||
- **`text_spectral_rays` renders its OWN wordmark — never give the word a second source.**
|
||||
It draws the solid letters AND the rays from one glyph mask (perfectly registered). Do NOT
|
||||
use it as a "rays-only" layer behind a separate DOM logo (or stack `content_swap` /
|
||||
`chromatic_pressure` on the same word): the two fonts/positions won't match and you get a
|
||||
doubled / ghosted wordmark — and deleting the shader's letter terms does not fix it (the
|
||||
ray mask is still the second, misaligned copy). Let the shader be the wordmark; hide any
|
||||
DOM logo (keep it only as an invisible layout spacer). If you move the word off
|
||||
frame-center, move the light cursor's `y` by the same amount. Full recipe:
|
||||
[`motion-primitives/text_spectral_rays/USAGE.md`](motion-primitives/text_spectral_rays/USAGE.md).
|
||||
@@ -0,0 +1,79 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>01 · hypercut_whip</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: transform, filter;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage"><div class="hero" id="hero">HYPERCUT</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.set("#hero", { x: 0, filter: "blur(0px)" }, 0);
|
||||
tl.to("#hero", { x: 1800, filter: "blur(30px)", duration: 0.18, ease: "power4.in" }, 1.65);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,92 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>02 · kinetic_letter_in</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.char {
|
||||
display: inline-block;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="hero" id="hero">
|
||||
<span class="char">K</span><span class="char">I</span><span class="char">N</span
|
||||
><span class="char">E</span><span class="char">T</span><span class="char">I</span
|
||||
><span class="char">C</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.from(
|
||||
".char",
|
||||
{ y: 80, opacity: 0, stagger: 0.045, ease: "back.out(2)", duration: 0.55 },
|
||||
0.05,
|
||||
);
|
||||
tl.to("#hero", { letterSpacing: "0.04em", duration: 0.6, ease: "power2.out" }, 0.7);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,135 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>03 · braam_punch</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: transform, text-shadow;
|
||||
}
|
||||
.glow-ring {
|
||||
position: absolute;
|
||||
width: 900px;
|
||||
height: 900px;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle, rgba(124, 58, 237, 0.55) 0%, rgba(124, 58, 237, 0) 65%);
|
||||
filter: blur(20px);
|
||||
will-change: transform, opacity;
|
||||
opacity: 0;
|
||||
}
|
||||
.flash {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: #fff;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="glow-ring"></div>
|
||||
<div class="hero" id="hero">BRAAM</div>
|
||||
</div>
|
||||
<div class="flash"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.set("#hero", { scale: 0.92, opacity: 0 }, 0);
|
||||
tl.set(".glow-ring", { scale: 0.6, opacity: 0 }, 0);
|
||||
tl.to("#hero", { opacity: 1, duration: 0.18, ease: "power2.out" }, 0.05);
|
||||
tl.to(".glow-ring", { scale: 1.2, opacity: 1, duration: 0.45, ease: "power3.out" }, 0.05);
|
||||
tl.to(
|
||||
"#hero",
|
||||
{
|
||||
scale: 1.18,
|
||||
textShadow: "0 0 60px rgba(168,85,247,0.9)",
|
||||
duration: 0.12,
|
||||
ease: "power4.out",
|
||||
},
|
||||
0.25,
|
||||
);
|
||||
tl.to(
|
||||
"#hero",
|
||||
{
|
||||
scale: 1.0,
|
||||
textShadow: "0 0 0px rgba(168,85,247,0)",
|
||||
duration: 0.7,
|
||||
ease: "elastic.out(1, 0.5)",
|
||||
},
|
||||
0.37,
|
||||
);
|
||||
tl.fromTo(
|
||||
".flash",
|
||||
{ opacity: 0 },
|
||||
{ opacity: 0.85, duration: 0.06, ease: "power4.out" },
|
||||
0.25,
|
||||
);
|
||||
tl.to(".flash", { opacity: 0, duration: 0.35, ease: "power3.in" }, 0.31);
|
||||
tl.to(
|
||||
".glow-ring",
|
||||
{ scale: 1.45, opacity: 0.4, duration: 1.0, ease: "power2.out", overwrite: "auto" },
|
||||
0.55,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,146 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>04 · chromatic_split</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.stack {
|
||||
position: relative;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.layer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
mix-blend-mode: screen;
|
||||
will-change: transform;
|
||||
}
|
||||
.layer.r {
|
||||
color: #ff2a4a;
|
||||
}
|
||||
.layer.g {
|
||||
color: #2afff0;
|
||||
}
|
||||
.layer.b {
|
||||
color: #b56dff;
|
||||
}
|
||||
.spacer {
|
||||
color: transparent;
|
||||
}
|
||||
.scanlines {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(255, 255, 255, 0) 0px,
|
||||
rgba(255, 255, 255, 0) 3px,
|
||||
rgba(255, 255, 255, 0.04) 3px,
|
||||
rgba(255, 255, 255, 0.04) 4px
|
||||
);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="stack">
|
||||
<span class="spacer">GLITCH</span>
|
||||
<span class="layer r">GLITCH</span>
|
||||
<span class="layer g">GLITCH</span>
|
||||
<span class="layer b">GLITCH</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scanlines"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
".stack",
|
||||
{ opacity: 0, scale: 0.95 },
|
||||
{ opacity: 1, scale: 1, duration: 0.25, ease: "power2.out" },
|
||||
0.05,
|
||||
);
|
||||
tl.set(".layer.r", { x: -2 }, 0);
|
||||
tl.set(".layer.g", { x: 2 }, 0);
|
||||
tl.set(".layer.b", { x: 0 }, 0);
|
||||
tl.to(".layer.r", { x: -14, duration: 0.06, ease: "steps(1)" }, 0.35);
|
||||
tl.to(".layer.g", { x: 14, duration: 0.06, ease: "steps(1)" }, 0.35);
|
||||
tl.to(".layer.r", { x: -4, duration: 0.06, ease: "steps(1)" }, 0.5);
|
||||
tl.to(".layer.g", { x: 4, duration: 0.06, ease: "steps(1)" }, 0.5);
|
||||
tl.to(".layer.r", { x: -22, duration: 0.04, ease: "steps(1)" }, 0.85);
|
||||
tl.to(".layer.g", { x: 22, duration: 0.04, ease: "steps(1)" }, 0.85);
|
||||
tl.to(".layer.b", { x: 6, duration: 0.04, ease: "steps(1)" }, 0.85);
|
||||
tl.to(".layer.r", { x: -6, duration: 0.04, ease: "steps(1)" }, 0.97);
|
||||
tl.to(".layer.g", { x: 6, duration: 0.04, ease: "steps(1)" }, 0.97);
|
||||
tl.to(".layer.b", { x: -2, duration: 0.04, ease: "steps(1)" }, 0.97);
|
||||
tl.to(".layer.r", { x: -3, duration: 0.4, ease: "power2.out" }, 1.2);
|
||||
tl.to(".layer.g", { x: 3, duration: 0.4, ease: "power2.out" }, 1.2);
|
||||
tl.to(".layer.b", { x: 0, duration: 0.4, ease: "power2.out" }, 1.2);
|
||||
tl.fromTo(
|
||||
".scanlines",
|
||||
{ opacity: 0 },
|
||||
{ opacity: 0.85, duration: 0.06, ease: "steps(1)" },
|
||||
0.35,
|
||||
);
|
||||
tl.to(".scanlines", { opacity: 0.25, duration: 0.5, ease: "power2.out" }, 1.0);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,109 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>05 · mask_reveal</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.mask-wrap {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 0 60px;
|
||||
}
|
||||
.mask-clip {
|
||||
clip-path: inset(0 100% 0 0);
|
||||
will-change: clip-path;
|
||||
}
|
||||
.sweep {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 8px;
|
||||
background: var(--hg-violet);
|
||||
box-shadow:
|
||||
0 0 40px var(--hg-violet),
|
||||
0 0 80px var(--hg-violet);
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="mask-wrap">
|
||||
<div class="hero mask-clip">REVEAL</div>
|
||||
<div class="sweep"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.set(".mask-clip", { clipPath: "inset(0 100% 0 0)" }, 0);
|
||||
tl.set(".sweep", { x: 0, opacity: 0 }, 0);
|
||||
tl.to(".sweep", { opacity: 1, duration: 0.08, ease: "power2.out" }, 0.1);
|
||||
tl.to(".sweep", { x: 1300, duration: 0.75, ease: "expo.out" }, 0.15);
|
||||
tl.to(".mask-clip", { clipPath: "inset(0 0% 0 0)", duration: 0.75, ease: "expo.out" }, 0.18);
|
||||
tl.to(".sweep", { opacity: 0, duration: 0.3, ease: "power2.in" }, 0.85);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>07 · screen_shake</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.shake-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
will-change: transform;
|
||||
}
|
||||
.impact-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at 50% 50%, rgba(255, 42, 74, 0.18) 0%, transparent 60%);
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="impact-bg"></div>
|
||||
<div class="shake-stage"><div class="hero">IMPACT</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
".hero",
|
||||
{ scale: 0.6, opacity: 0 },
|
||||
{ scale: 1, opacity: 1, duration: 0.15, ease: "power4.out" },
|
||||
0.3,
|
||||
);
|
||||
tl.fromTo(
|
||||
".impact-bg",
|
||||
{ opacity: 0 },
|
||||
{ opacity: 1, duration: 0.06, ease: "steps(1)" },
|
||||
0.3,
|
||||
);
|
||||
tl.to(".impact-bg", { opacity: 0, duration: 0.6, ease: "power2.in" }, 0.4);
|
||||
|
||||
const shakeStart = 0.32;
|
||||
const shakeAmps = [28, -24, 20, -22, 16, -18, 14, -14, 10, -8, 6, -5, 3, -2];
|
||||
shakeAmps.forEach((amp, i) => {
|
||||
tl.to(
|
||||
".shake-stage",
|
||||
{ x: amp, y: amp * 0.7 * (i % 2 ? -1 : 1), duration: 0.03, ease: "steps(1)" },
|
||||
shakeStart + i * 0.03,
|
||||
);
|
||||
});
|
||||
tl.to(
|
||||
".shake-stage",
|
||||
{ x: 0, y: 0, duration: 0.1, ease: "power2.out" },
|
||||
shakeStart + shakeAmps.length * 0.03,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,120 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>08 · binary_decrypt</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.crypt {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-weight: 700;
|
||||
font-size: 200px;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--hg-cyan);
|
||||
text-shadow: 0 0 30px rgba(42, 255, 240, 0.5);
|
||||
}
|
||||
.crypt .char {
|
||||
display: inline-block;
|
||||
min-width: 1ch;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="crypt">
|
||||
<span class="char" data-target="D">_</span><span class="char" data-target="E">_</span
|
||||
><span class="char" data-target="C">_</span><span class="char" data-target="R">_</span
|
||||
><span class="char" data-target="Y">_</span><span class="char" data-target="P">_</span
|
||||
><span class="char" data-target="T">_</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const SCRAMBLE = "01█▓▒░▀▄■◆◇▪▫";
|
||||
function scrambleChar(charIdx, phase) {
|
||||
const tick = Math.floor(phase * 60);
|
||||
const i = (charIdx * 7 + tick * 13 + 3) % SCRAMBLE.length;
|
||||
return SCRAMBLE.charAt(i);
|
||||
}
|
||||
const cryptState = [{ p: 0 }, { p: 0 }, { p: 0 }, { p: 0 }, { p: 0 }, { p: 0 }, { p: 0 }];
|
||||
cryptState.forEach((state, idx) => {
|
||||
tl.to(
|
||||
state,
|
||||
{
|
||||
p: 1,
|
||||
duration: 0.85,
|
||||
delay: idx * 0.05,
|
||||
ease: "power2.out",
|
||||
onUpdate: function () {
|
||||
const spans = document.querySelectorAll(".crypt .char");
|
||||
const span = spans[idx];
|
||||
if (!span) return;
|
||||
const target = span.getAttribute("data-target");
|
||||
if (state.p >= 0.72) {
|
||||
span.textContent = target;
|
||||
span.style.color = "var(--hg-fg)";
|
||||
span.style.textShadow = "0 0 30px rgba(168, 85, 247, 0.8)";
|
||||
} else {
|
||||
span.textContent = scrambleChar(idx, state.p);
|
||||
}
|
||||
},
|
||||
},
|
||||
0.15,
|
||||
);
|
||||
});
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,137 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>09 · dolly_zoom</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.layers {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.bg-far,
|
||||
.bg-mid,
|
||||
.bg-near {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
will-change: transform, filter;
|
||||
}
|
||||
.bg-far {
|
||||
background:
|
||||
radial-gradient(2px 2px at 20% 30%, var(--hg-dim) 50%, transparent 51%),
|
||||
radial-gradient(2px 2px at 70% 80%, var(--hg-dim) 50%, transparent 51%),
|
||||
radial-gradient(1px 1px at 45% 60%, var(--hg-dim) 50%, transparent 51%),
|
||||
radial-gradient(1px 1px at 85% 25%, var(--hg-dim) 50%, transparent 51%),
|
||||
radial-gradient(2px 2px at 10% 75%, var(--hg-dim) 50%, transparent 51%),
|
||||
radial-gradient(1px 1px at 60% 15%, var(--hg-dim) 50%, transparent 51%);
|
||||
background-size: 400px 400px;
|
||||
filter: blur(2px);
|
||||
}
|
||||
.bg-mid {
|
||||
background:
|
||||
linear-gradient(90deg, transparent 49.7%, rgba(168, 85, 247, 0.25) 50%, transparent 50.3%)
|
||||
0 0 / 200px 200px,
|
||||
linear-gradient(
|
||||
180deg,
|
||||
transparent 49.7%,
|
||||
rgba(168, 85, 247, 0.15) 50%,
|
||||
transparent 50.3%
|
||||
)
|
||||
0 0 / 200px 200px;
|
||||
}
|
||||
.bg-near {
|
||||
background:
|
||||
radial-gradient(circle at 15% 50%, rgba(168, 85, 247, 0.4) 0%, transparent 25%),
|
||||
radial-gradient(circle at 85% 50%, rgba(124, 58, 237, 0.4) 0%, transparent 25%);
|
||||
}
|
||||
.subject {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
font-family: "Playfair Display", serif;
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
font-size: 180px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="layers">
|
||||
<div class="bg-far"></div>
|
||||
<div class="bg-mid"></div>
|
||||
<div class="bg-near"></div>
|
||||
</div>
|
||||
<div class="stage"><div class="subject">subject.</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
".bg-far",
|
||||
{ scale: 1, filter: "blur(2px)" },
|
||||
{ scale: 1.6, filter: "blur(4px)", duration: 1.8, ease: "power2.inOut" },
|
||||
0.1,
|
||||
);
|
||||
tl.fromTo(".bg-mid", { scale: 1 }, { scale: 1.4, duration: 1.8, ease: "power2.inOut" }, 0.1);
|
||||
tl.fromTo(".bg-near", { scale: 1 }, { scale: 1.2, duration: 1.8, ease: "power2.inOut" }, 0.1);
|
||||
tl.fromTo(
|
||||
".subject",
|
||||
{ opacity: 0, scale: 1.1 },
|
||||
{ opacity: 1, scale: 1, duration: 0.6, ease: "power3.out" },
|
||||
0.15,
|
||||
);
|
||||
tl.to(".layers", { skewY: -0.5, duration: 1.8, ease: "power2.inOut" }, 0.1);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,104 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>10 · iris_open</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.iris-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
clip-path: circle(0% at 50% 50%);
|
||||
will-change: clip-path;
|
||||
background: linear-gradient(135deg, #1a0033 0%, #0a0a0f 60%);
|
||||
}
|
||||
.iris-stage .hero {
|
||||
font-family: "Playfair Display", serif;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.iris-ring {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--hg-violet);
|
||||
box-shadow: 0 0 40px var(--hg-violet);
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="iris-stage">
|
||||
<div class="iris-ring" style="width: 200px; height: 200px"></div>
|
||||
<div class="hero">IRIS</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.set(".iris-stage", { clipPath: "circle(0% at 50% 50%)" }, 0);
|
||||
tl.fromTo(
|
||||
".iris-ring",
|
||||
{ scale: 0, opacity: 0.9 },
|
||||
{ scale: 9, opacity: 0, duration: 0.85, ease: "expo.out" },
|
||||
0.2,
|
||||
);
|
||||
tl.to(
|
||||
".iris-stage",
|
||||
{ clipPath: "circle(75% at 50% 50%)", duration: 0.9, ease: "expo.out" },
|
||||
0.3,
|
||||
);
|
||||
tl.from(".iris-stage .hero", { y: 40, opacity: 0, duration: 0.6, ease: "power3.out" }, 0.6);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>11 · electric_arc</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.arc-svg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
.arc-path {
|
||||
fill: none;
|
||||
stroke: var(--hg-fg);
|
||||
stroke-width: 3;
|
||||
stroke-linecap: round;
|
||||
filter: drop-shadow(0 0 8px var(--hg-cyan)) drop-shadow(0 0 16px var(--hg-cyan));
|
||||
stroke-dasharray: 1200;
|
||||
stroke-dashoffset: 1200;
|
||||
will-change: stroke-dashoffset, opacity;
|
||||
}
|
||||
.arc-flash {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at 50% 50%, rgba(42, 255, 240, 0.3) 0%, transparent 40%);
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
}
|
||||
.arc-label {
|
||||
font-weight: 900;
|
||||
font-size: 240px;
|
||||
letter-spacing: -0.04em;
|
||||
color: var(--hg-fg);
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<svg class="arc-svg" viewBox="0 0 1920 1080" preserveAspectRatio="none">
|
||||
<path
|
||||
class="arc-path"
|
||||
id="arc1"
|
||||
d="M 200 540 L 380 480 L 440 580 L 620 500 L 720 600 L 880 510 L 960 540"
|
||||
/>
|
||||
<path
|
||||
class="arc-path"
|
||||
id="arc2"
|
||||
d="M 1720 540 L 1540 600 L 1480 500 L 1300 580 L 1200 480 L 1040 570 L 960 540"
|
||||
/>
|
||||
<path
|
||||
class="arc-path"
|
||||
id="arc3"
|
||||
d="M 960 200 L 920 360 L 1040 420 L 940 520 L 960 540"
|
||||
/>
|
||||
</svg>
|
||||
<div class="arc-flash"></div>
|
||||
<div class="arc-label">CHARGE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
".arc-label",
|
||||
{ opacity: 0, scale: 0.9 },
|
||||
{ opacity: 1, scale: 1, duration: 0.3, ease: "power3.out" },
|
||||
0.5,
|
||||
);
|
||||
const arcs = ["#arc1", "#arc2", "#arc3"];
|
||||
arcs.forEach((p, i) => {
|
||||
tl.fromTo(
|
||||
p,
|
||||
{ strokeDashoffset: 1200, opacity: 0 },
|
||||
{ strokeDashoffset: 0, opacity: 1, duration: 0.18, ease: "power4.out" },
|
||||
0.15 + i * 0.05,
|
||||
);
|
||||
});
|
||||
tl.to(arcs.join(","), { opacity: 0.3, duration: 0.04, ease: "steps(1)" }, 0.55);
|
||||
tl.to(arcs.join(","), { opacity: 1, duration: 0.04, ease: "steps(1)" }, 0.6);
|
||||
tl.to(arcs.join(","), { opacity: 0.5, duration: 0.04, ease: "steps(1)" }, 0.7);
|
||||
tl.to(arcs.join(","), { opacity: 1, duration: 0.04, ease: "steps(1)" }, 0.78);
|
||||
tl.fromTo(
|
||||
".arc-flash",
|
||||
{ opacity: 0 },
|
||||
{ opacity: 1, duration: 0.06, ease: "steps(1)" },
|
||||
0.5,
|
||||
);
|
||||
tl.to(".arc-flash", { opacity: 0, duration: 0.5, ease: "power2.out" }, 0.6);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,108 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>12 · neon_flicker</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.neon {
|
||||
font-family: "Playfair Display", serif;
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.02em;
|
||||
color: #ff64a0;
|
||||
text-shadow:
|
||||
0 0 8px #ff64a0,
|
||||
0 0 24px #ff64a0,
|
||||
0 0 60px #ff1a7a,
|
||||
0 0 120px #ff1a7a;
|
||||
will-change: opacity, text-shadow;
|
||||
}
|
||||
.neon-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(
|
||||
circle at 50% 50%,
|
||||
rgba(255, 26, 122, 0.12) 0%,
|
||||
transparent 60%
|
||||
);
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="neon-bg"></div>
|
||||
<div class="stage"><div class="neon">neon</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.set(".neon", { opacity: 0 }, 0);
|
||||
const neonPattern = [
|
||||
{ t: 0.2, o: 1 },
|
||||
{ t: 0.26, o: 0 },
|
||||
{ t: 0.3, o: 1 },
|
||||
{ t: 0.38, o: 0.3 },
|
||||
{ t: 0.42, o: 1 },
|
||||
{ t: 0.5, o: 0.5 },
|
||||
{ t: 0.55, o: 1 },
|
||||
];
|
||||
neonPattern.forEach((p) => {
|
||||
tl.to(".neon", { opacity: p.o, duration: 0.02, ease: "steps(1)" }, p.t);
|
||||
});
|
||||
tl.to(".neon-bg", { opacity: 1, duration: 0.4, ease: "power2.out" }, 0.5);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,103 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>13 · chrome_sweep</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.chrome {
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
background: linear-gradient(
|
||||
110deg,
|
||||
#404048 0%,
|
||||
#b4b4be 20%,
|
||||
#ffffff 45%,
|
||||
#ffffff 50%,
|
||||
#d8d8e0 60%,
|
||||
#5a5a64 85%,
|
||||
#ffffff 100%
|
||||
);
|
||||
background-size: 250% 100%;
|
||||
background-position: 200% 0;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
color: transparent;
|
||||
will-change: background-position;
|
||||
filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.4));
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage"><div class="chrome">CHROME</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
".chrome",
|
||||
{ opacity: 0, scale: 0.96 },
|
||||
{ opacity: 1, scale: 1, duration: 0.3, ease: "power3.out" },
|
||||
0.2,
|
||||
);
|
||||
tl.fromTo(
|
||||
".chrome",
|
||||
{ backgroundPosition: "200% 0" },
|
||||
{ backgroundPosition: "-100% 0", duration: 1.4, ease: "power2.inOut" },
|
||||
0.3,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,130 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>15 · slot_machine_reveal</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.slot {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-weight: 700;
|
||||
font-size: 280px;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--hg-fg);
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
}
|
||||
.slot .digit {
|
||||
display: inline-block;
|
||||
min-width: 1ch;
|
||||
text-shadow: 0 0 40px rgba(168, 85, 247, 0.6);
|
||||
}
|
||||
.slot-label {
|
||||
position: absolute;
|
||||
bottom: 30%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 22px;
|
||||
color: var(--hg-dim);
|
||||
letter-spacing: 0.4em;
|
||||
text-transform: uppercase;
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="slot">
|
||||
<span class="digit" data-target="5">0</span>
|
||||
<span class="digit" data-target=".">0</span>
|
||||
<span class="digit" data-target="5">0</span>
|
||||
<span class="digit" data-target="x">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slot-label">FINAL VERSION</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const DIGITS = "0123456789";
|
||||
const slotStates = [{ p: 0 }, { p: 0 }, { p: 0 }, { p: 0 }];
|
||||
slotStates.forEach((state, idx) => {
|
||||
tl.to(
|
||||
state,
|
||||
{
|
||||
p: 1,
|
||||
duration: 1.0,
|
||||
delay: idx * 0.08,
|
||||
ease: "power3.out",
|
||||
onUpdate: function () {
|
||||
const spans = document.querySelectorAll(".slot .digit");
|
||||
const span = spans[idx];
|
||||
if (!span) return;
|
||||
const target = span.getAttribute("data-target");
|
||||
if (state.p >= 0.85) {
|
||||
span.textContent = target;
|
||||
span.style.color = "var(--hg-violet-2)";
|
||||
} else {
|
||||
const tick = Math.floor(state.p * 80 + idx * 3);
|
||||
span.textContent = DIGITS.charAt(tick % 10);
|
||||
}
|
||||
},
|
||||
},
|
||||
0.15,
|
||||
);
|
||||
});
|
||||
tl.to(".slot-label", { opacity: 1, duration: 0.5, ease: "power2.out" }, 1.2);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,131 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>16 · liquid_morph</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.blob-wrap {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.blob {
|
||||
position: absolute;
|
||||
width: 1100px;
|
||||
height: 800px;
|
||||
background: linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #d946ef 100%);
|
||||
clip-path: polygon(
|
||||
50% 5%,
|
||||
65% 8%,
|
||||
78% 16%,
|
||||
88% 30%,
|
||||
92% 50%,
|
||||
88% 70%,
|
||||
78% 84%,
|
||||
65% 92%,
|
||||
50% 95%,
|
||||
35% 92%,
|
||||
22% 84%,
|
||||
12% 70%,
|
||||
8% 50%,
|
||||
12% 30%,
|
||||
22% 16%,
|
||||
35% 8%
|
||||
);
|
||||
will-change: clip-path, transform;
|
||||
filter: blur(0.5px);
|
||||
}
|
||||
.hero {
|
||||
font-family: "Playfair Display", serif;
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
mix-blend-mode: difference;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="blob-wrap"><div class="blob"></div></div>
|
||||
<div class="stage"><div class="hero">liquid</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const BLOB_A =
|
||||
"polygon(50% 5%, 65% 8%, 78% 16%, 88% 30%, 92% 50%, 88% 70%, 78% 84%, 65% 92%, 50% 95%, 35% 92%, 22% 84%, 12% 70%, 8% 50%, 12% 30%, 22% 16%, 35% 8%)";
|
||||
const BLOB_B =
|
||||
"polygon(38% 10%, 58% 4%, 75% 14%, 90% 28%, 95% 46%, 86% 60%, 80% 78%, 62% 88%, 46% 94%, 30% 86%, 16% 74%, 6% 58%, 10% 40%, 20% 22%, 30% 14%, 38% 10%)";
|
||||
const BLOB_C =
|
||||
"polygon(46% 8%, 62% 10%, 80% 20%, 92% 36%, 90% 52%, 92% 70%, 76% 86%, 58% 90%, 44% 94%, 28% 88%, 14% 76%, 10% 60%, 12% 44%, 18% 26%, 30% 12%, 38% 8%)";
|
||||
|
||||
tl.set(".blob", { clipPath: BLOB_A, scale: 0.95 }, 0);
|
||||
tl.to(".blob", { clipPath: BLOB_B, scale: 1.05, duration: 0.7, ease: "power2.inOut" }, 0.2);
|
||||
tl.to(".blob", { clipPath: BLOB_C, scale: 1.0, duration: 0.7, ease: "power2.inOut" }, 0.9);
|
||||
tl.fromTo(
|
||||
".hero",
|
||||
{ opacity: 0, y: 30 },
|
||||
{ opacity: 1, y: 0, duration: 0.6, ease: "power3.out" },
|
||||
0.4,
|
||||
);
|
||||
tl.to(".blob", { rotation: 6, duration: 1.5, ease: "sine.inOut" }, 0.2);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,241 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>17 · gooey_metaball</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.hero {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.04em;
|
||||
color: var(--hg-fg);
|
||||
z-index: 5;
|
||||
pointer-events: none;
|
||||
}
|
||||
.gooey-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
filter: url(#gooey-filter);
|
||||
}
|
||||
.ball {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: var(--hg-violet-2);
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
will-change: transform;
|
||||
opacity: 0;
|
||||
}
|
||||
.ball.a {
|
||||
width: 280px;
|
||||
height: 280px;
|
||||
background: #7c3aed;
|
||||
}
|
||||
.ball.b {
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
background: #a855f7;
|
||||
}
|
||||
.ball.c {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background: #d946ef;
|
||||
}
|
||||
.ball.d {
|
||||
width: 320px;
|
||||
height: 320px;
|
||||
background: #8b5cf6;
|
||||
}
|
||||
.ball.e {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
background: #c084fc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<svg style="position: absolute; width: 0; height: 0">
|
||||
<defs>
|
||||
<filter id="gooey-filter">
|
||||
<feGaussianBlur in="SourceGraphic" stdDeviation="20" result="blur" />
|
||||
<feColorMatrix
|
||||
in="blur"
|
||||
mode="matrix"
|
||||
values="
|
||||
1 0 0 0 0
|
||||
0 1 0 0 0
|
||||
0 0 1 0 0
|
||||
0 0 0 22 -10"
|
||||
result="gooey"
|
||||
/>
|
||||
<feComposite in="SourceGraphic" in2="gooey" operator="atop" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
<div class="gooey-stage">
|
||||
<div class="ball a" id="ballA"></div>
|
||||
<div class="ball b" id="ballB"></div>
|
||||
<div class="ball c" id="ballC"></div>
|
||||
<div class="ball d" id="ballD"></div>
|
||||
<div class="ball e" id="ballE"></div>
|
||||
</div>
|
||||
|
||||
<div class="hero">GOOEY</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Initial: all balls collapsed at center
|
||||
["#ballA", "#ballB", "#ballC", "#ballD", "#ballE"].forEach((id) => {
|
||||
tl.set(id, { xPercent: -50, yPercent: -50, scale: 0, opacity: 0 }, 0);
|
||||
});
|
||||
// Spawn outward
|
||||
tl.to(
|
||||
"#ballA",
|
||||
{
|
||||
xPercent: -50 - 120,
|
||||
yPercent: -50 + 20,
|
||||
scale: 1,
|
||||
opacity: 1,
|
||||
duration: 0.5,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.15,
|
||||
);
|
||||
tl.to(
|
||||
"#ballB",
|
||||
{
|
||||
xPercent: -50 + 100,
|
||||
yPercent: -50 + 50,
|
||||
scale: 1,
|
||||
opacity: 1,
|
||||
duration: 0.55,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.2,
|
||||
);
|
||||
tl.to(
|
||||
"#ballC",
|
||||
{
|
||||
xPercent: -50 + 30,
|
||||
yPercent: -50 - 80,
|
||||
scale: 1,
|
||||
opacity: 1,
|
||||
duration: 0.55,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.25,
|
||||
);
|
||||
tl.to(
|
||||
"#ballD",
|
||||
{
|
||||
xPercent: -50 - 50,
|
||||
yPercent: -50 - 30,
|
||||
scale: 1,
|
||||
opacity: 1,
|
||||
duration: 0.55,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.3,
|
||||
);
|
||||
tl.to(
|
||||
"#ballE",
|
||||
{
|
||||
xPercent: -50 + 80,
|
||||
yPercent: -50 - 40,
|
||||
scale: 1,
|
||||
opacity: 1,
|
||||
duration: 0.55,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.18,
|
||||
);
|
||||
|
||||
// Idle drift
|
||||
tl.to(
|
||||
"#ballA",
|
||||
{ xPercent: "+=20", yPercent: "+=12", duration: 1.0, ease: "sine.inOut" },
|
||||
0.7,
|
||||
);
|
||||
tl.to(
|
||||
"#ballB",
|
||||
{ xPercent: "-=18", yPercent: "-=10", duration: 1.0, ease: "sine.inOut" },
|
||||
0.7,
|
||||
);
|
||||
tl.to(
|
||||
"#ballC",
|
||||
{ xPercent: "-=15", yPercent: "+=20", duration: 1.0, ease: "sine.inOut" },
|
||||
0.7,
|
||||
);
|
||||
tl.to(
|
||||
"#ballD",
|
||||
{ xPercent: "+=25", yPercent: "+=8", duration: 1.0, ease: "sine.inOut" },
|
||||
0.7,
|
||||
);
|
||||
tl.to(
|
||||
"#ballE",
|
||||
{ xPercent: "-=22", yPercent: "+=18", duration: 1.0, ease: "sine.inOut" },
|
||||
0.7,
|
||||
);
|
||||
|
||||
// Reveal text behind
|
||||
tl.fromTo(
|
||||
".hero",
|
||||
{ opacity: 0, scale: 0.95 },
|
||||
{ opacity: 1, scale: 1, duration: 0.5, ease: "power3.out" },
|
||||
0.6,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>18 · 3d_card_flip</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.card-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 2400px;
|
||||
}
|
||||
.card {
|
||||
position: relative;
|
||||
width: 1000px;
|
||||
height: 580px;
|
||||
transform-style: preserve-3d;
|
||||
will-change: transform;
|
||||
}
|
||||
.face {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
backface-visibility: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 900;
|
||||
font-size: 200px;
|
||||
letter-spacing: -0.04em;
|
||||
border-radius: 24px;
|
||||
box-shadow:
|
||||
0 40px 80px rgba(0, 0, 0, 0.5),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.08) inset;
|
||||
}
|
||||
.face.front {
|
||||
background: linear-gradient(135deg, #1e1b3a 0%, #0a0a0f 100%);
|
||||
color: var(--hg-fg);
|
||||
}
|
||||
.face.back {
|
||||
background: linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #d946ef 100%);
|
||||
color: var(--hg-fg);
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
.face .meta {
|
||||
position: absolute;
|
||||
top: 36px;
|
||||
left: 40px;
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
letter-spacing: 0.16em;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.card-shadow {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 22%;
|
||||
width: 1000px;
|
||||
height: 80px;
|
||||
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
|
||||
transform: translateX(-50%);
|
||||
filter: blur(12px);
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="card-shadow"></div>
|
||||
<div class="card-stage">
|
||||
<div class="card" id="card">
|
||||
<div class="face front">
|
||||
<div class="meta">v4 · CURRENT</div>
|
||||
PRODUCT
|
||||
</div>
|
||||
<div class="face back">
|
||||
<div class="meta">v5 · LAUNCH</div>
|
||||
v5.0
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.fromTo(
|
||||
"#card",
|
||||
{ rotateY: 0, scale: 0.92, opacity: 0 },
|
||||
{ rotateY: 0, scale: 1, opacity: 1, duration: 0.45, ease: "power3.out" },
|
||||
0.15,
|
||||
);
|
||||
|
||||
// Hold then flip
|
||||
tl.to("#card", { rotateY: 180, duration: 1.0, ease: "power3.inOut" }, 0.7);
|
||||
|
||||
// Shadow squishes mid-flip
|
||||
tl.to(
|
||||
".card-shadow",
|
||||
{ scaleX: 0.6, opacity: 0.4, duration: 0.5, ease: "power2.inOut" },
|
||||
0.7,
|
||||
);
|
||||
tl.to(".card-shadow", { scaleX: 1, opacity: 0.7, duration: 0.5, ease: "power2.inOut" }, 1.2);
|
||||
|
||||
// Tiny landing settle
|
||||
tl.to("#card", { scale: 1.02, duration: 0.12, ease: "power2.out" }, 1.68);
|
||||
tl.to("#card", { scale: 1, duration: 0.3, ease: "elastic.out(1, 0.5)" }, 1.8);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>19 · crash_zoom_in</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.zoom-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
will-change: transform;
|
||||
}
|
||||
.radial-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(
|
||||
circle at center,
|
||||
rgba(168, 85, 247, 0.18) 0%,
|
||||
transparent 35%,
|
||||
rgba(0, 0, 0, 0.6) 80%
|
||||
);
|
||||
opacity: 0;
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
.speed-lines {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: repeating-radial-gradient(
|
||||
circle at 50% 50%,
|
||||
transparent 0px,
|
||||
transparent 6px,
|
||||
rgba(255, 255, 255, 0.08) 7px,
|
||||
transparent 8px
|
||||
);
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 360px;
|
||||
letter-spacing: -0.05em;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: transform, filter;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="radial-bg"></div>
|
||||
<div class="speed-lines"></div>
|
||||
<div class="zoom-stage"><div class="hero">CRASH</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Hold black for tension
|
||||
tl.set(".hero", { scale: 0.03, filter: "blur(20px)", opacity: 0 }, 0);
|
||||
|
||||
const CRASH = 0.45;
|
||||
|
||||
// The crash itself
|
||||
tl.to(
|
||||
".hero",
|
||||
{ scale: 1.0, filter: "blur(0px)", opacity: 1, duration: 0.32, ease: "expo.in" },
|
||||
CRASH,
|
||||
);
|
||||
|
||||
// Background swoosh in same window
|
||||
tl.fromTo(
|
||||
".radial-bg",
|
||||
{ opacity: 0, scale: 0.4 },
|
||||
{ opacity: 1, scale: 1, duration: 0.32, ease: "expo.in" },
|
||||
CRASH,
|
||||
);
|
||||
tl.fromTo(
|
||||
".speed-lines",
|
||||
{ opacity: 0, scale: 0.2 },
|
||||
{ opacity: 1, scale: 1.4, duration: 0.32, ease: "expo.in" },
|
||||
CRASH,
|
||||
);
|
||||
|
||||
// Landing settle
|
||||
const LAND = CRASH + 0.32;
|
||||
tl.to(".hero", { scale: 0.96, duration: 0.08, ease: "power3.out" }, LAND);
|
||||
tl.to(".hero", { scale: 1.0, duration: 0.5, ease: "elastic.out(1, 0.55)" }, LAND + 0.08);
|
||||
|
||||
// Quick landing shake
|
||||
const sh = [9, -7, 5, -4, 2, -1];
|
||||
sh.forEach((amp, i) => {
|
||||
tl.to(
|
||||
".zoom-stage",
|
||||
{ x: amp, y: amp * 0.5 * (i % 2 ? -1 : 1), duration: 0.03, ease: "steps(1)" },
|
||||
LAND + i * 0.03,
|
||||
);
|
||||
});
|
||||
tl.to(
|
||||
".zoom-stage",
|
||||
{ x: 0, y: 0, duration: 0.1, ease: "power2.out" },
|
||||
LAND + sh.length * 0.03,
|
||||
);
|
||||
|
||||
// Speed lines fade
|
||||
tl.to(".speed-lines", { opacity: 0, duration: 0.4, ease: "power2.out" }, LAND + 0.05);
|
||||
// Radial settles
|
||||
tl.to(".radial-bg", { opacity: 0.5, duration: 0.5, ease: "power2.out" }, LAND);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,137 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>20 · spotlight_sweep</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.dim-layer {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: #03030a;
|
||||
}
|
||||
.hero-bright,
|
||||
.hero-dim {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Playfair Display", serif;
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.04em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.hero-dim {
|
||||
color: rgba(245, 245, 250, 0.06);
|
||||
}
|
||||
.hero-bright {
|
||||
color: var(--hg-fg);
|
||||
text-shadow:
|
||||
0 0 30px rgba(168, 85, 247, 0.4),
|
||||
0 0 80px rgba(168, 85, 247, 0.2);
|
||||
-webkit-mask-image: radial-gradient(
|
||||
circle 360px at -400px 50%,
|
||||
#000 0%,
|
||||
rgba(0, 0, 0, 0.6) 60%,
|
||||
transparent 80%
|
||||
);
|
||||
mask-image: radial-gradient(
|
||||
circle 360px at -400px 50%,
|
||||
#000 0%,
|
||||
rgba(0, 0, 0, 0.6) 60%,
|
||||
transparent 80%
|
||||
);
|
||||
will-change: mask-image;
|
||||
}
|
||||
.spotlight-glow {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(
|
||||
circle 380px at -400px 50%,
|
||||
rgba(168, 85, 247, 0.18) 0%,
|
||||
transparent 60%
|
||||
);
|
||||
will-change: background;
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="dim-layer"></div>
|
||||
<div class="hero-dim">DISCOVER</div>
|
||||
<div class="hero-bright" id="bright">DISCOVER</div>
|
||||
<div class="spotlight-glow" id="glow"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Animate the spotlight x position via mask-image (use a proxy + onUpdate for smoothness)
|
||||
const state = { x: -400 };
|
||||
tl.to(
|
||||
state,
|
||||
{
|
||||
x: 2300,
|
||||
duration: 1.4,
|
||||
ease: "power2.inOut",
|
||||
onUpdate: function () {
|
||||
const m = `radial-gradient(circle 360px at ${state.x}px 50%, #000 0%, rgba(0,0,0,0.6) 60%, transparent 80%)`;
|
||||
const g = `radial-gradient(circle 380px at ${state.x}px 50%, rgba(168, 85, 247, 0.18) 0%, transparent 60%)`;
|
||||
const bright = document.getElementById("bright");
|
||||
const glow = document.getElementById("glow");
|
||||
if (bright) {
|
||||
bright.style.maskImage = m;
|
||||
bright.style.webkitMaskImage = m;
|
||||
}
|
||||
if (glow) glow.style.background = g;
|
||||
},
|
||||
},
|
||||
0.3,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>21 · outline_to_fill</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.outline-stack {
|
||||
position: relative;
|
||||
font-family: "Playfair Display", serif;
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.stroke-layer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
color: transparent;
|
||||
-webkit-text-stroke: 3px var(--hg-violet-2);
|
||||
text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
|
||||
will-change:
|
||||
opacity,
|
||||
-webkit-text-stroke;
|
||||
}
|
||||
.fill-layer {
|
||||
position: relative;
|
||||
color: var(--hg-fg);
|
||||
clip-path: inset(100% 0 0 0);
|
||||
will-change: clip-path;
|
||||
}
|
||||
.spacer {
|
||||
color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="outline-stack">
|
||||
<span class="spacer">Premium</span>
|
||||
<span class="stroke-layer">Premium</span>
|
||||
<span class="fill-layer">Premium</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Stroke draws in
|
||||
tl.fromTo(
|
||||
".stroke-layer",
|
||||
{ opacity: 0, scale: 1.04 },
|
||||
{ opacity: 1, scale: 1, duration: 0.45, ease: "power3.out" },
|
||||
0.15,
|
||||
);
|
||||
|
||||
// Fill rises from bottom
|
||||
tl.set(".fill-layer", { clipPath: "inset(100% 0 0 0)" }, 0);
|
||||
tl.to(".fill-layer", { clipPath: "inset(0% 0 0 0)", duration: 1.0, ease: "expo.out" }, 0.55);
|
||||
|
||||
// Stroke recedes once fill arrives
|
||||
tl.to(".stroke-layer", { opacity: 0.35, duration: 0.6, ease: "power2.out" }, 1.0);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>22 · counting_punch</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
}
|
||||
.counter {
|
||||
font-weight: 900;
|
||||
font-size: 360px;
|
||||
letter-spacing: -0.04em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--hg-fg);
|
||||
will-change: transform, text-shadow;
|
||||
line-height: 1;
|
||||
}
|
||||
.caption {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 28px;
|
||||
color: var(--hg-dim);
|
||||
letter-spacing: 0.3em;
|
||||
text-transform: uppercase;
|
||||
opacity: 0;
|
||||
}
|
||||
.underline {
|
||||
height: 4px;
|
||||
background: var(--hg-violet-2);
|
||||
width: 0;
|
||||
box-shadow: 0 0 20px var(--hg-violet);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="counter" id="counter">0</div>
|
||||
<div class="underline" id="underline"></div>
|
||||
<div class="caption" id="caption">USERS THIS WEEK</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const TARGET = 12847;
|
||||
const counter = { v: 0 };
|
||||
let lastShown = 0;
|
||||
|
||||
function format(n) {
|
||||
return Math.floor(n).toLocaleString("en-US");
|
||||
}
|
||||
|
||||
tl.to(
|
||||
counter,
|
||||
{
|
||||
v: TARGET,
|
||||
duration: 1.15,
|
||||
ease: "expo.out",
|
||||
onUpdate: function () {
|
||||
const el = document.getElementById("counter");
|
||||
if (!el) return;
|
||||
const cur = Math.floor(counter.v);
|
||||
if (cur !== lastShown) {
|
||||
el.textContent = format(cur);
|
||||
// tiny scale tick on each digit change
|
||||
el.style.transform = "scale(1.045)";
|
||||
el.style.textShadow = "0 0 40px rgba(168, 85, 247, 0.6)";
|
||||
// browser will paint, then this resets via the next onUpdate
|
||||
}
|
||||
lastShown = cur;
|
||||
},
|
||||
},
|
||||
0.15,
|
||||
);
|
||||
|
||||
// Big settle punch at landing
|
||||
tl.to(
|
||||
"#counter",
|
||||
{
|
||||
scale: 1.12,
|
||||
textShadow: "0 0 80px rgba(168, 85, 247, 0.9)",
|
||||
duration: 0.1,
|
||||
ease: "power4.out",
|
||||
},
|
||||
1.3,
|
||||
);
|
||||
tl.to(
|
||||
"#counter",
|
||||
{
|
||||
scale: 1.0,
|
||||
textShadow: "0 0 20px rgba(168, 85, 247, 0.4)",
|
||||
duration: 0.6,
|
||||
ease: "elastic.out(1, 0.55)",
|
||||
},
|
||||
1.4,
|
||||
);
|
||||
|
||||
// Underline draws
|
||||
tl.to("#underline", { width: 420, duration: 0.6, ease: "expo.out" }, 1.35);
|
||||
tl.to("#caption", { opacity: 1, duration: 0.5, ease: "power2.out" }, 1.55);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,141 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>24 · particle_burst</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.05em;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: transform, opacity;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
.particle-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
.particle {
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--hg-violet-2);
|
||||
box-shadow: 0 0 12px var(--hg-violet-2);
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="particle-stage" id="particles"></div>
|
||||
<div class="stage"><div class="hero">SPARK</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Build N particles deterministically
|
||||
const N = 36;
|
||||
const container = document.getElementById("particles");
|
||||
const particles = [];
|
||||
for (let i = 0; i < N; i++) {
|
||||
const p = document.createElement("div");
|
||||
p.className = "particle";
|
||||
// Vary size per particle for visual interest
|
||||
const sz = 4 + (i % 4) * 3;
|
||||
p.style.width = sz + "px";
|
||||
p.style.height = sz + "px";
|
||||
// Slight color variation
|
||||
const hue = ((i * 17) % 60) - 30;
|
||||
p.style.filter = `hue-rotate(${hue}deg)`;
|
||||
container.appendChild(p);
|
||||
particles.push(p);
|
||||
}
|
||||
|
||||
// Hero punch + flash entry
|
||||
tl.fromTo(
|
||||
".hero",
|
||||
{ scale: 0.85, opacity: 0 },
|
||||
{ scale: 1, opacity: 1, duration: 0.3, ease: "power4.out" },
|
||||
0.3,
|
||||
);
|
||||
|
||||
// Particles burst out
|
||||
particles.forEach((p, i) => {
|
||||
const angle = (i / N) * Math.PI * 2 + i * 0.137; // golden-angle jitter
|
||||
const radius = 500 + (i % 5) * 90 + (i % 3) * 40;
|
||||
const tx = Math.cos(angle) * radius;
|
||||
const ty = Math.sin(angle) * radius;
|
||||
const dur = 1.1 + (i % 5) * 0.08;
|
||||
tl.fromTo(
|
||||
p,
|
||||
{ x: 0, y: 0, scale: 1, opacity: 1 },
|
||||
{ x: tx, y: ty, scale: 0, opacity: 0, duration: dur, ease: "expo.out" },
|
||||
0.35 + (i % 6) * 0.012,
|
||||
);
|
||||
});
|
||||
|
||||
// Hero settle wobble
|
||||
tl.to(".hero", { scale: 1.04, duration: 0.1, ease: "power3.out" }, 0.35);
|
||||
tl.to(".hero", { scale: 1.0, duration: 0.5, ease: "elastic.out(1, 0.5)" }, 0.45);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,160 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>25 · radial_burst_lines</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.05em;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
will-change: transform;
|
||||
}
|
||||
.burst-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
.line {
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 180px;
|
||||
background: linear-gradient(to top, transparent 0%, var(--hg-fg) 50%, transparent 100%);
|
||||
transform-origin: bottom center;
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="burst-stage" id="bursts"></div>
|
||||
<div class="stage"><div class="hero">BAM</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Build 20 lines
|
||||
const N = 20;
|
||||
const container = document.getElementById("bursts");
|
||||
const lines = [];
|
||||
for (let i = 0; i < N; i++) {
|
||||
const l = document.createElement("div");
|
||||
l.className = "line";
|
||||
const angle = (i / N) * 360;
|
||||
const innerRadius = 220;
|
||||
// Rotate around center, push outward via transform-origin trick.
|
||||
// Easier: use translate then rotate
|
||||
l.style.transform = `rotate(${angle}deg) translateY(-${innerRadius}px) scaleY(0)`;
|
||||
container.appendChild(l);
|
||||
lines.push({ el: l, angle });
|
||||
}
|
||||
|
||||
// Hero punch
|
||||
tl.fromTo(
|
||||
".hero",
|
||||
{ scale: 0.7, opacity: 0 },
|
||||
{ scale: 1.1, opacity: 1, duration: 0.15, ease: "power4.out" },
|
||||
0.3,
|
||||
);
|
||||
tl.to(".hero", { scale: 1.0, duration: 0.4, ease: "elastic.out(1, 0.5)" }, 0.45);
|
||||
|
||||
// Burst lines expand
|
||||
lines.forEach((l, i) => {
|
||||
const innerRadius = 220 + (i % 3) * 30; // vary radius
|
||||
const len = 200 + (i % 4) * 40; // vary length
|
||||
const ang = l.angle;
|
||||
tl.set(
|
||||
l.el,
|
||||
{
|
||||
rotation: ang,
|
||||
x: 0,
|
||||
y: 0,
|
||||
scaleY: 0,
|
||||
opacity: 0,
|
||||
transformOrigin: "center bottom",
|
||||
},
|
||||
0,
|
||||
);
|
||||
// GSAP transforms compose, so we set the rotation + translate via separate properties
|
||||
// Use a custom transform string approach
|
||||
tl.to(
|
||||
l.el,
|
||||
{
|
||||
scaleY: 1,
|
||||
opacity: 1,
|
||||
duration: 0.18,
|
||||
ease: "power4.out",
|
||||
onUpdate: function () {
|
||||
const p = this.progress();
|
||||
const t = -innerRadius - len * p * 0.2;
|
||||
l.el.style.transform = `rotate(${ang}deg) translateY(${t}px) scaleY(${p})`;
|
||||
l.el.style.opacity = (p > 0.7 ? 1 - (p - 0.7) / 0.3 : 1).toString();
|
||||
},
|
||||
},
|
||||
0.32 + (i % 5) * 0.018,
|
||||
);
|
||||
});
|
||||
|
||||
// Hold then fade
|
||||
tl.to(".line", { opacity: 0, duration: 0.4, ease: "power2.out" }, 0.9);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,121 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>26 · pixel_dissolve</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.05em;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
background: linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #d946ef 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
color: transparent;
|
||||
}
|
||||
.grid {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: grid;
|
||||
will-change: contents;
|
||||
pointer-events: none;
|
||||
}
|
||||
.cell {
|
||||
background: var(--hg-bg);
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage"><div class="hero">DISSOLVE</div></div>
|
||||
<div class="grid" id="grid"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const COLS = 24;
|
||||
const ROWS = 14;
|
||||
const grid = document.getElementById("grid");
|
||||
grid.style.gridTemplateColumns = `repeat(${COLS}, 1fr)`;
|
||||
grid.style.gridTemplateRows = `repeat(${ROWS}, 1fr)`;
|
||||
|
||||
const cells = [];
|
||||
for (let i = 0; i < COLS * ROWS; i++) {
|
||||
const c = document.createElement("div");
|
||||
c.className = "cell";
|
||||
grid.appendChild(c);
|
||||
cells.push(c);
|
||||
}
|
||||
|
||||
// Deterministic shuffle: hash function based on i+j
|
||||
function hash(i) {
|
||||
return ((i * 9301 + 49297) % 233280) / 233280;
|
||||
}
|
||||
const order = cells.map((c, i) => ({ c, i, h: hash(i) })).sort((a, b) => a.h - b.h);
|
||||
|
||||
// All cells start visible (covering hero), fade out in shuffled order
|
||||
const TOTAL = 0.85;
|
||||
order.forEach((o, k) => {
|
||||
const t = 0.35 + (k / order.length) * TOTAL;
|
||||
tl.to(o.c, { opacity: 0, duration: 0.06, ease: "steps(1)" }, t);
|
||||
});
|
||||
|
||||
// After dissolve, gentle hero scale settle (it was always visible, now exposed)
|
||||
tl.fromTo(".hero", { scale: 1.03 }, { scale: 1.0, duration: 0.5, ease: "power2.out" }, 1.0);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,166 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>27 · datamosh_smear</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-magenta: #ff2a4a;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.smear-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.smear-hero {
|
||||
position: relative;
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.05em;
|
||||
line-height: 0.95;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.smear-layer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
mix-blend-mode: screen;
|
||||
will-change: transform, opacity, filter;
|
||||
}
|
||||
.smear-layer.l1 {
|
||||
color: #ff2a4a;
|
||||
}
|
||||
.smear-layer.l2 {
|
||||
color: #2afff0;
|
||||
}
|
||||
.smear-layer.l3 {
|
||||
color: #b56dff;
|
||||
}
|
||||
.smear-layer.l4 {
|
||||
color: #ffd166;
|
||||
}
|
||||
.smear-layer.l5 {
|
||||
color: #f5f5fa;
|
||||
}
|
||||
.spacer {
|
||||
color: transparent;
|
||||
}
|
||||
.scan-noise {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(255, 255, 255, 0) 0px,
|
||||
rgba(255, 255, 255, 0) 2px,
|
||||
rgba(255, 255, 255, 0.07) 3px
|
||||
),
|
||||
repeating-linear-gradient(
|
||||
90deg,
|
||||
rgba(0, 0, 0, 0) 0px,
|
||||
rgba(0, 0, 0, 0) 4px,
|
||||
rgba(0, 0, 0, 0.15) 5px
|
||||
);
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
pointer-events: none;
|
||||
mix-blend-mode: overlay;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="smear-stage">
|
||||
<div class="smear-hero">
|
||||
<span class="spacer">SMEAR</span>
|
||||
<span class="smear-layer l1">SMEAR</span>
|
||||
<span class="smear-layer l2">SMEAR</span>
|
||||
<span class="smear-layer l3">SMEAR</span>
|
||||
<span class="smear-layer l4">SMEAR</span>
|
||||
<span class="smear-layer l5">SMEAR</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scan-noise"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// All layers start far right, stagger-lag in, then settle near center
|
||||
const layers = [
|
||||
".smear-layer.l1",
|
||||
".smear-layer.l2",
|
||||
".smear-layer.l3",
|
||||
".smear-layer.l4",
|
||||
".smear-layer.l5",
|
||||
];
|
||||
|
||||
layers.forEach((sel, i) => {
|
||||
tl.fromTo(
|
||||
sel,
|
||||
{ x: 360, opacity: 0, filter: "blur(20px)" },
|
||||
{ x: 0, opacity: 0.85, filter: "blur(0px)", duration: 0.7, ease: "expo.out" },
|
||||
0.2 + i * 0.08,
|
||||
);
|
||||
});
|
||||
|
||||
// Final settle: pull layers into proper offset
|
||||
const finalX = [-6, -2, 0, 2, 4];
|
||||
layers.forEach((sel, i) => {
|
||||
tl.to(sel, { x: finalX[i], duration: 0.4, ease: "power2.out" }, 1.1);
|
||||
});
|
||||
|
||||
// Scan noise pulses
|
||||
tl.fromTo(
|
||||
".scan-noise",
|
||||
{ opacity: 0 },
|
||||
{ opacity: 1, duration: 0.06, ease: "steps(1)" },
|
||||
0.2,
|
||||
);
|
||||
tl.to(".scan-noise", { opacity: 0.25, duration: 0.8, ease: "power2.out" }, 0.6);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,136 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>28 · text_wave_distort</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-cyan: #2afff0;
|
||||
--hg-bg: #0a0a0f;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.wave-hero {
|
||||
font-family: "Playfair Display", serif;
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
font-size: 280px;
|
||||
letter-spacing: -0.02em;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
|
||||
}
|
||||
.wave-hero .char {
|
||||
display: inline-block;
|
||||
will-change: transform;
|
||||
}
|
||||
/* per-char solid colors marching across a violet→cyan ramp */
|
||||
.wave-hero .char:nth-child(1) {
|
||||
color: #7c3aed;
|
||||
}
|
||||
.wave-hero .char:nth-child(2) {
|
||||
color: #a855f7;
|
||||
}
|
||||
.wave-hero .char:nth-child(3) {
|
||||
color: #d946ef;
|
||||
}
|
||||
.wave-hero .char:nth-child(4) {
|
||||
color: #ec4899;
|
||||
}
|
||||
.wave-hero .char:nth-child(5) {
|
||||
color: #2afff0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="wave-hero" id="hero">
|
||||
<span class="char">f</span><span class="char">l</span><span class="char">u</span
|
||||
><span class="char">i</span><span class="char">d</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Explicit fromTo entry — safer than .from() in paused/seek mode
|
||||
tl.fromTo(
|
||||
"#hero .char",
|
||||
{ y: 60, opacity: 0 },
|
||||
{ y: 0, opacity: 1, stagger: 0.06, ease: "back.out(1.8)", duration: 0.5 },
|
||||
0.1,
|
||||
);
|
||||
|
||||
// Continuous wave: phase 0→4 cycles over 1.5s, amplitude envelope rise→settle
|
||||
const state = { phase: 0 };
|
||||
tl.to(
|
||||
state,
|
||||
{
|
||||
phase: 4,
|
||||
duration: 1.5,
|
||||
ease: "none",
|
||||
onUpdate: function () {
|
||||
const chars = document.querySelectorAll("#hero .char");
|
||||
const p = state.phase / 4;
|
||||
let amp;
|
||||
if (p < 0.35) amp = (p / 0.35) * 24;
|
||||
else if (p < 0.7)
|
||||
amp = 24 - ((p - 0.35) / 0.35) * 12; // 24 → 12
|
||||
else amp = 12 - ((p - 0.7) / 0.3) * 4; // 12 → 8
|
||||
chars.forEach((c, i) => {
|
||||
const y = amp * Math.sin(state.phase * Math.PI * 2 + i * 0.45);
|
||||
// Use gsap.set so it cooperates with GSAP's transform tracking
|
||||
gsap.set(c, { y });
|
||||
});
|
||||
},
|
||||
},
|
||||
0.65,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,326 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en"
|
||||
data-composition-variables='[
|
||||
{"id":"bgColor", "type":"color", "label":"Page background", "default":"#050507"},
|
||||
{"id":"colorLow", "type":"color", "label":"Flow — shadow tone", "default":"#0a1430"},
|
||||
{"id":"colorMid", "type":"color", "label":"Flow — mid tone", "default":"#6a6f9e"},
|
||||
{"id":"colorHigh", "type":"color", "label":"Flow — highlight tone", "default":"#e8f0ff"},
|
||||
{"id":"accentColor","type":"color", "label":"Core / glow accent", "default":"#aee4ff"},
|
||||
{"id":"flowSpeed", "type":"number", "label":"Flow speed", "default":1, "min":0.1, "max":3, "step":0.1}
|
||||
]'
|
||||
>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>bg_flow_field</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-bg: #050507;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.field {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
display: block;
|
||||
}
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 40px;
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
mix-blend-mode: screen;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="4" data-track-index="1">
|
||||
<canvas class="field" width="1920" height="1080"></canvas>
|
||||
<div class="label">bg_flow_field</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// ── Variables (palette + speed); falls back to defaults standalone ──
|
||||
const defaults = {
|
||||
bgColor: "#050507",
|
||||
colorLow: "#0a1430",
|
||||
colorMid: "#6a6f9e",
|
||||
colorHigh: "#e8f0ff",
|
||||
accentColor: "#aee4ff",
|
||||
flowSpeed: 1,
|
||||
};
|
||||
const vars = Object.assign(
|
||||
{},
|
||||
defaults,
|
||||
window.__hyperframes && window.__hyperframes.getVariables
|
||||
? window.__hyperframes.getVariables()
|
||||
: {},
|
||||
);
|
||||
|
||||
// sRGB hex -> linear-light [r,g,b] (shader works in linear, gamma-encodes at end)
|
||||
function hexLin(hex) {
|
||||
let h = String(hex).replace("#", "").trim();
|
||||
if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
|
||||
const r = parseInt(h.substr(0, 2), 16) / 255;
|
||||
const g = parseInt(h.substr(2, 2), 16) / 255;
|
||||
const b = parseInt(h.substr(4, 2), 16) / 255;
|
||||
const lin = (c) => Math.pow(c, 2.2);
|
||||
return [lin(r), lin(g), lin(b)];
|
||||
}
|
||||
|
||||
const canvas = document.querySelector(".field");
|
||||
const gl = canvas.getContext("webgl", {
|
||||
antialias: false,
|
||||
alpha: false,
|
||||
preserveDrawingBuffer: true,
|
||||
});
|
||||
|
||||
const VERT = [
|
||||
"attribute vec2 position;",
|
||||
"varying vec2 vUv;",
|
||||
"void main(){",
|
||||
" vUv = position * 0.5 + 0.5;",
|
||||
" gl_Position = vec4(position, 0.0, 1.0);",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
// Curl-noise flow field — ported verbatim from the held-message-living-field
|
||||
// template's "living field" background. All visible state comes from uniforms.
|
||||
const FRAG = [
|
||||
"precision highp float;",
|
||||
"varying vec2 vUv;",
|
||||
"uniform float uTime;",
|
||||
"uniform float uPhase;",
|
||||
"uniform float uReveal;",
|
||||
"uniform float uChromAb;",
|
||||
"uniform float uVignette;",
|
||||
"uniform float uIntensity;",
|
||||
"uniform float uSpeed;",
|
||||
"uniform vec2 uResolution;",
|
||||
"uniform vec3 uColLow;",
|
||||
"uniform vec3 uColMid;",
|
||||
"uniform vec3 uColHigh;",
|
||||
"uniform vec3 uAccent;",
|
||||
"float hash21(vec2 p){",
|
||||
" p = fract(p * vec2(123.34, 456.21));",
|
||||
" p += dot(p, p + 45.32);",
|
||||
" return fract(p.x * p.y);",
|
||||
"}",
|
||||
"float noise2(vec2 p){",
|
||||
" vec2 i = floor(p);",
|
||||
" vec2 f = fract(p);",
|
||||
" vec2 u = f * f * (3.0 - 2.0 * f);",
|
||||
" float a = hash21(i);",
|
||||
" float b = hash21(i + vec2(1.0, 0.0));",
|
||||
" float c = hash21(i + vec2(0.0, 1.0));",
|
||||
" float d = hash21(i + vec2(1.0, 1.0));",
|
||||
" return mix(mix(a,b,u.x), mix(c,d,u.x), u.y);",
|
||||
"}",
|
||||
"float fbm(vec2 p){",
|
||||
" float v = 0.0;",
|
||||
" float a = 0.5;",
|
||||
" for(int i=0;i<5;i++){",
|
||||
" v += a * noise2(p);",
|
||||
" p *= 2.02;",
|
||||
" a *= 0.5;",
|
||||
" }",
|
||||
" return v;",
|
||||
"}",
|
||||
"vec2 curl(vec2 p, float t){",
|
||||
" float e = 0.6;",
|
||||
" float n1 = fbm(p + vec2(0.0, e) + t*0.18);",
|
||||
" float n2 = fbm(p + vec2(0.0, -e) + t*0.18);",
|
||||
" float n3 = fbm(p + vec2( e, 0.0) + t*0.18);",
|
||||
" float n4 = fbm(p + vec2(-e, 0.0) + t*0.18);",
|
||||
" return vec2(n1 - n2, -(n3 - n4));",
|
||||
"}",
|
||||
"vec3 palette(float t){",
|
||||
" t = clamp(t, 0.0, 1.0);",
|
||||
" vec3 lowMid = mix(uColLow, uColMid, smoothstep(0.0, 0.5, t));",
|
||||
" return mix(lowMid, uColHigh, smoothstep(0.5, 1.0, t));",
|
||||
"}",
|
||||
"vec3 sampleField(vec2 uv, float t, float energy){",
|
||||
" vec2 p = (uv - 0.5) * vec2(uResolution.x/uResolution.y, 1.0) * 2.4;",
|
||||
" vec2 c = curl(p * 0.9, t);",
|
||||
" vec2 q = p + c * (0.45 + 0.55 * energy);",
|
||||
" float flow = fbm(q * 1.6 + vec2(t * 0.11, -t * 0.07));",
|
||||
" float bands = sin(flow * 14.0 + t * 1.1);",
|
||||
" bands = smoothstep(0.0, 1.0, 0.5 + 0.5 * bands);",
|
||||
" float r = length(p);",
|
||||
" float core = smoothstep(1.5, 0.05, r) * (0.6 + 0.4 * energy);",
|
||||
" float glow = exp(-r * 1.6) * (0.55 + 0.45 * energy);",
|
||||
" float k = clamp(flow * 0.85 + 0.15 * bands + 0.25 * core + 0.6 * glow, 0.0, 1.4);",
|
||||
" vec3 col = palette(k * 0.9 + 0.1 * sin(t * 0.4));",
|
||||
" col *= 0.7 + 0.6 * energy;",
|
||||
" col += uAccent * core * 0.55;",
|
||||
" return col;",
|
||||
"}",
|
||||
"void main(){",
|
||||
" vec2 uv = vUv;",
|
||||
" float t = uTime * uSpeed;",
|
||||
" float e = uIntensity;",
|
||||
" vec2 dir = normalize(uv - 0.5 + 1e-6);",
|
||||
" float ca = uChromAb * (0.004 + 0.012 * length(uv - 0.5));",
|
||||
" vec3 cR = sampleField(uv + dir * ca, t, e);",
|
||||
" vec3 cG = sampleField(uv, t, e);",
|
||||
" vec3 cB = sampleField(uv - dir * ca, t, e);",
|
||||
" vec3 col = vec3(cR.r, cG.g, cB.b);",
|
||||
" float lum = dot(col, vec3(0.299, 0.587, 0.114));",
|
||||
" col = mix(vec3(lum), col, 1.05);",
|
||||
" float rev = uReveal;",
|
||||
" float sweep = smoothstep(0.0, 0.6, rev) * (1.0 - smoothstep(0.6, 1.0, rev));",
|
||||
" col += uColHigh * sweep * 0.35;",
|
||||
" vec3 phaseTint = mix(vec3(0.85, 0.92, 1.05), vec3(1.05, 0.95, 0.85), uPhase);",
|
||||
" col *= phaseTint;",
|
||||
" float v = length(uv - 0.5);",
|
||||
" col *= 1.0 - smoothstep(0.45, 0.95, v) * uVignette;",
|
||||
" col = col / (col + 1.0);",
|
||||
" col = pow(col, vec3(1.0/2.2));",
|
||||
" gl_FragColor = vec4(col, 1.0);",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
function compile(type, src) {
|
||||
const s = gl.createShader(type);
|
||||
gl.shaderSource(s, src);
|
||||
gl.compileShader(s);
|
||||
return s;
|
||||
}
|
||||
const prog = gl.createProgram();
|
||||
gl.attachShader(prog, compile(gl.VERTEX_SHADER, VERT));
|
||||
gl.attachShader(prog, compile(gl.FRAGMENT_SHADER, FRAG));
|
||||
gl.linkProgram(prog);
|
||||
gl.useProgram(prog);
|
||||
|
||||
// full-screen triangle
|
||||
const buf = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buf);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);
|
||||
const posLoc = gl.getAttribLocation(prog, "position");
|
||||
gl.enableVertexAttribArray(posLoc);
|
||||
gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.viewport(0, 0, 1920, 1080);
|
||||
|
||||
const L = (n) => gl.getUniformLocation(prog, n);
|
||||
const uLoc = {
|
||||
uTime: L("uTime"),
|
||||
uPhase: L("uPhase"),
|
||||
uReveal: L("uReveal"),
|
||||
uChromAb: L("uChromAb"),
|
||||
uVignette: L("uVignette"),
|
||||
uIntensity: L("uIntensity"),
|
||||
uSpeed: L("uSpeed"),
|
||||
uResolution: L("uResolution"),
|
||||
uColLow: L("uColLow"),
|
||||
uColMid: L("uColMid"),
|
||||
uColHigh: L("uColHigh"),
|
||||
uAccent: L("uAccent"),
|
||||
};
|
||||
|
||||
// animated uniform state (GSAP tweens these .value fields)
|
||||
const u = {
|
||||
uTime: { value: 0 },
|
||||
uPhase: { value: 0.1 },
|
||||
uReveal: { value: 0 },
|
||||
uChromAb: { value: 0 },
|
||||
uVignette: { value: 0 },
|
||||
uIntensity: { value: 0.3 },
|
||||
};
|
||||
const speed = Number(vars.flowSpeed) || 1;
|
||||
const cLow = hexLin(vars.colorLow);
|
||||
const cMid = hexLin(vars.colorMid);
|
||||
const cHigh = hexLin(vars.colorHigh);
|
||||
const cAcc = hexLin(vars.accentColor);
|
||||
|
||||
function render() {
|
||||
gl.uniform1f(uLoc.uTime, u.uTime.value);
|
||||
gl.uniform1f(uLoc.uPhase, u.uPhase.value);
|
||||
gl.uniform1f(uLoc.uReveal, u.uReveal.value);
|
||||
gl.uniform1f(uLoc.uChromAb, u.uChromAb.value);
|
||||
gl.uniform1f(uLoc.uVignette, u.uVignette.value);
|
||||
gl.uniform1f(uLoc.uIntensity, u.uIntensity.value);
|
||||
gl.uniform1f(uLoc.uSpeed, speed);
|
||||
gl.uniform2f(uLoc.uResolution, 1920, 1080);
|
||||
gl.uniform3fv(uLoc.uColLow, cLow);
|
||||
gl.uniform3fv(uLoc.uColMid, cMid);
|
||||
gl.uniform3fv(uLoc.uColHigh, cHigh);
|
||||
gl.uniform3fv(uLoc.uAccent, cAcc);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||
}
|
||||
render(); // initial frame so a seek to 0 / first paint is correct
|
||||
|
||||
// ── Energy-envelope drive (the "living field" breath): all repaint is via
|
||||
// onUpdate, so the field is fully determined by the timeline position — no
|
||||
// requestAnimationFrame, seek-safe. ──
|
||||
tl.eventCallback("onUpdate", render);
|
||||
|
||||
tl.to(u.uTime, { value: 4, duration: 4, ease: "none" }, 0);
|
||||
|
||||
// energy: settle-in → breathe → SURGE → settle dark for the hold
|
||||
tl.to(u.uIntensity, { value: 0.6, duration: 1.2, ease: "sine.inOut" }, 0);
|
||||
tl.to(u.uIntensity, { value: 1.0, duration: 0.7, ease: "power2.in" }, 1.3);
|
||||
tl.to(u.uIntensity, { value: 0.35, duration: 2.0, ease: "power2.out" }, 2.0);
|
||||
|
||||
// chromatic light-leak: light at entry, spikes on the surge, then settles
|
||||
tl.fromTo(u.uChromAb, { value: 0 }, { value: 0.4, duration: 1.2, ease: "sine.in" }, 0);
|
||||
tl.to(u.uChromAb, { value: 1.4, duration: 0.5, ease: "power3.in" }, 1.4);
|
||||
tl.to(u.uChromAb, { value: 0.2, duration: 1.6, ease: "power2.out" }, 1.9);
|
||||
|
||||
// a brief highlight sweep across the surge
|
||||
tl.fromTo(u.uReveal, { value: 0 }, { value: 1, duration: 0.7, ease: "none" }, 1.3);
|
||||
tl.set(u.uReveal, { value: 0 }, 2.0);
|
||||
|
||||
// colour-temperature drift
|
||||
tl.to(u.uPhase, { value: 0.6, duration: 2.2, ease: "sine.inOut" }, 0.6);
|
||||
|
||||
// black mask settles the field to near-black + central glow for the hold
|
||||
tl.to(u.uVignette, { value: 0.85, duration: 1.6, ease: "power2.out" }, 1.9);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>blur_resolve</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.hero {
|
||||
font-weight: 900;
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: filter, transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="hero" id="hero">FOCUS</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Resolve: heavy blur + scaled-up + dim settles into perfect crisp focus.
|
||||
tl.fromTo(
|
||||
"#hero",
|
||||
{ filter: "blur(36px)", scale: 1.08, opacity: 0.25 },
|
||||
{ filter: "blur(0px)", scale: 1, opacity: 1, duration: 0.7, ease: "power2.out" },
|
||||
0.05,
|
||||
);
|
||||
|
||||
// Hold crisp through the middle (no keys needed — state persists to ~1.5).
|
||||
|
||||
// Blur-out near the end: brief defocus + dim, a cut-away that loops seamlessly.
|
||||
tl.to(
|
||||
"#hero",
|
||||
{ filter: "blur(24px)", opacity: 0.25, duration: 0.25, ease: "power2.in" },
|
||||
1.7,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,133 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>directional_fill</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 36px;
|
||||
}
|
||||
.bar {
|
||||
position: relative;
|
||||
width: 1040px;
|
||||
height: 188px;
|
||||
border: 3px solid var(--hg-dim);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 56px;
|
||||
}
|
||||
.fill {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
transform: scaleX(0);
|
||||
will-change: transform;
|
||||
}
|
||||
.fill.a {
|
||||
background: var(--hg-violet);
|
||||
transform-origin: left center;
|
||||
}
|
||||
.fill.b {
|
||||
background: var(--hg-violet-2);
|
||||
transform-origin: right center;
|
||||
}
|
||||
.fill.c {
|
||||
background: #2afff0;
|
||||
transform-origin: left center;
|
||||
}
|
||||
.label {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
font-weight: 900;
|
||||
font-size: 96px;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1;
|
||||
color: var(--hg-fg);
|
||||
will-change: color;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="1.8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="1.8" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="bar">
|
||||
<div class="fill a"></div>
|
||||
<span class="label" id="l1">READY</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div class="fill b"></div>
|
||||
<span class="label" id="l2">SET</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div class="fill c"></div>
|
||||
<span class="label" id="l3">FILL</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Bar 1 — sweeps left -> right, landing on the beat at ~0.55s.
|
||||
tl.to(".fill.a", { scaleX: 1, duration: 0.35, ease: "power2.out" }, 0.2);
|
||||
tl.set("#l1", { color: "var(--hg-bg)" }, 0.55);
|
||||
|
||||
// Bar 2 — sweeps right -> left, landing at ~0.85s.
|
||||
tl.to(".fill.b", { scaleX: 1, duration: 0.35, ease: "power2.out" }, 0.5);
|
||||
tl.set("#l2", { color: "var(--hg-bg)" }, 0.85);
|
||||
|
||||
// Bar 3 — sweeps left -> right, landing at ~1.15s.
|
||||
tl.to(".fill.c", { scaleX: 1, duration: 0.35, ease: "power2.out" }, 0.8);
|
||||
tl.set("#l3", { color: "var(--hg-bg)" }, 1.15);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,132 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>flash_cut</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.word {
|
||||
position: absolute;
|
||||
font-weight: 900;
|
||||
font-size: 260px;
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 0.95;
|
||||
white-space: nowrap;
|
||||
color: var(--hg-fg);
|
||||
will-change: opacity;
|
||||
}
|
||||
.accent {
|
||||
position: absolute;
|
||||
bottom: 360px;
|
||||
width: 220px;
|
||||
height: 14px;
|
||||
border-radius: 999px;
|
||||
background: var(--hg-violet);
|
||||
will-change: background, transform;
|
||||
}
|
||||
.flash {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: #ffffff;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="1.8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="1.8" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="accent" id="accent"></div>
|
||||
<div class="word" id="w0">READY</div>
|
||||
<div class="word" id="w1">IMPACT</div>
|
||||
<div class="word" id="w2">DONE</div>
|
||||
</div>
|
||||
<div class="flash" id="flash"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Initial state: first word visible, others hidden, accent violet.
|
||||
tl.set("#w0", { opacity: 1 }, 0);
|
||||
tl.set("#w1", { opacity: 0 }, 0);
|
||||
tl.set("#w2", { opacity: 0 }, 0);
|
||||
tl.set("#accent", { backgroundColor: "#7c3aed", scaleX: 1 }, 0);
|
||||
tl.set("#flash", { opacity: 0 }, 0);
|
||||
|
||||
// Two hits; during each white frame, swap underlying word + accent colour.
|
||||
const hits = [
|
||||
{ t: 0.5, from: "#w0", to: "#w1", color: "#a855f7", scaleX: 1.45 },
|
||||
{ t: 1.2, from: "#w1", to: "#w2", color: "#f5f5fa", scaleX: 0.7 },
|
||||
];
|
||||
|
||||
hits.forEach((h) => {
|
||||
// Instant full-frame white flash on the hit.
|
||||
tl.set("#flash", { opacity: 1 }, h.t);
|
||||
// While white (~2 frames at 30fps), swap the revealed state.
|
||||
tl.set(h.from, { opacity: 0 }, h.t + 0.03);
|
||||
tl.set(h.to, { opacity: 1 }, h.t + 0.03);
|
||||
tl.set("#accent", { backgroundColor: h.color, scaleX: h.scaleX }, h.t + 0.03);
|
||||
// Snap the flash back out within ~3 frames.
|
||||
tl.set("#flash", { opacity: 0 }, h.t + 0.06);
|
||||
});
|
||||
|
||||
// Graceful loop: dip back to white at the very end and restore the start
|
||||
// state so the cycle re-enters cleanly on the next pass.
|
||||
tl.set("#flash", { opacity: 1 }, 1.74);
|
||||
tl.set("#w2", { opacity: 0 }, 1.77);
|
||||
tl.set("#w0", { opacity: 1 }, 1.77);
|
||||
tl.set("#accent", { backgroundColor: "#7c3aed", scaleX: 1 }, 1.77);
|
||||
tl.set("#flash", { opacity: 0 }, 1.8);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>hard_cut</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
.panel {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
}
|
||||
.word {
|
||||
font-weight: 900;
|
||||
font-size: 340px;
|
||||
letter-spacing: -0.05em;
|
||||
line-height: 0.9;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage" id="stage"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Deterministic palette + word list. Variation is derived from index only.
|
||||
const BG = ["#7c3aed", "#0a0a0f", "#ff2a4a", "#2afff0", "#a855f7", "#f5f5fa", "#0a0a0f"];
|
||||
const FG = ["#f5f5fa", "#a855f7", "#0a0a0f", "#0a0a0f", "#0a0a0f", "#7c3aed", "#f5f5fa"];
|
||||
const WORDS = ["CUT", "NOW", "HARD", "SNAP", "STOP", "GO", "CUT"];
|
||||
const STEP = 0.28; // beat interval
|
||||
const N = WORDS.length;
|
||||
|
||||
// Build one full-frame panel per cut, all hidden but the first.
|
||||
const stage = document.getElementById("stage");
|
||||
for (let i = 0; i < N; i++) {
|
||||
const panel = document.createElement("div");
|
||||
panel.className = "panel";
|
||||
panel.id = "p" + i;
|
||||
panel.style.background = BG[i];
|
||||
panel.style.opacity = i === 0 ? "1" : "0";
|
||||
const word = document.createElement("div");
|
||||
word.className = "word";
|
||||
word.style.color = FG[i];
|
||||
word.textContent = WORDS[i];
|
||||
panel.appendChild(word);
|
||||
stage.appendChild(panel);
|
||||
}
|
||||
|
||||
// Sample-accurate 0ms cuts: at each beat, hide current panel, show next.
|
||||
// tl.set has no duration and no ease — brutal instant switching.
|
||||
for (let i = 1; i < N; i++) {
|
||||
const t = i * STEP;
|
||||
tl.set("#p" + (i - 1), { opacity: 0 }, t);
|
||||
tl.set("#p" + i, { opacity: 1 }, t);
|
||||
}
|
||||
|
||||
// Loop gracefully: snap back to the first panel before the clip ends so a
|
||||
// re-entry starts clean on the same color/word it began with.
|
||||
tl.set("#p" + (N - 1), { opacity: 0 }, N * STEP);
|
||||
tl.set("#p0", { opacity: 1 }, N * STEP);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,124 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>mosaic_pack</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 200px);
|
||||
grid-template-rows: repeat(4, 200px);
|
||||
gap: 18px;
|
||||
}
|
||||
.tile {
|
||||
border-radius: 14px;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2.4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2.4" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="grid" id="grid"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Deterministic palette + grid build (6x4 = 24 cells).
|
||||
const PALETTE = ["#7c3aed", "#a855f7", "#f5f5fa", "#2a2a3a", "#b56dff", "#6b6b78"];
|
||||
const COLS = 6;
|
||||
const ROWS = 4;
|
||||
const COUNT = COLS * ROWS;
|
||||
const grid = document.getElementById("grid");
|
||||
const tiles = [];
|
||||
for (let i = 0; i < COUNT; i++) {
|
||||
const tile = document.createElement("div");
|
||||
tile.className = "tile";
|
||||
tile.style.background = PALETTE[i % PALETTE.length];
|
||||
grid.appendChild(tile);
|
||||
tiles.push(tile);
|
||||
}
|
||||
|
||||
// Scatter each tile from a deterministic offset/rotation, then pack into place.
|
||||
// Land order ripples diagonally (col + row) for a deterministic "assembling" feel.
|
||||
const STEP = 0.07;
|
||||
for (let i = 0; i < COUNT; i++) {
|
||||
const col = i % COLS;
|
||||
const row = Math.floor(i / COLS);
|
||||
const dx = (((i * 53) % 200) - 100) * 9; // far-flung scatter X
|
||||
const dy = (((i * 89) % 200) - 100) * 7; // far-flung scatter Y
|
||||
const rot = ((i * 37) % 80) - 40; // deterministic tilt
|
||||
const order = col + row; // diagonal land sequence
|
||||
tl.fromTo(
|
||||
tiles[i],
|
||||
{ x: dx, y: dy, rotation: rot, scale: 0.6, autoAlpha: 0.15 },
|
||||
{
|
||||
x: 0,
|
||||
y: 0,
|
||||
rotation: 0,
|
||||
scale: 1,
|
||||
autoAlpha: 1,
|
||||
duration: 0.6,
|
||||
ease: "back.out(1.6)",
|
||||
},
|
||||
0.1 + order * STEP,
|
||||
);
|
||||
}
|
||||
|
||||
// Settle the packed poster with a tiny breath so the loop seats cleanly.
|
||||
tl.to("#grid", { scale: 1.02, duration: 0.18, ease: "power2.out" }, 1.9);
|
||||
tl.to("#grid", { scale: 1, duration: 0.32, ease: "power2.inOut" }, 2.08);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,132 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>palette_flip</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.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>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2.6"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2.6" data-track-index="1">
|
||||
<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>
|
||||
</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["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>staggered_exit</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 320px);
|
||||
grid-template-rows: repeat(2, 320px);
|
||||
gap: 36px;
|
||||
}
|
||||
.card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 28px;
|
||||
background: linear-gradient(135deg, var(--hg-violet), var(--hg-violet-2));
|
||||
color: var(--hg-fg);
|
||||
font-weight: 900;
|
||||
font-size: 72px;
|
||||
letter-spacing: -0.02em;
|
||||
box-shadow: 0 24px 60px rgba(124, 58, 237, 0.35);
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="grid">
|
||||
<div class="card">NORTH</div>
|
||||
<div class="card">EAST</div>
|
||||
<div class="card">SOUTH</div>
|
||||
<div class="card">WEST</div>
|
||||
<div class="card">PEAK</div>
|
||||
<div class="card">EDGE</div>
|
||||
<div class="card">CORE</div>
|
||||
<div class="card">FLUX</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const cards = gsap.utils.toArray(".card");
|
||||
const hold = 0.4; // fully visible hold before the cascade begins
|
||||
const step = 0.11; // per-element offset
|
||||
const exitDur = 0.45;
|
||||
|
||||
// start fully visible
|
||||
tl.set(cards, { autoAlpha: 1, y: 0 }, 0);
|
||||
|
||||
// ordered exit: each card slides down + fades, one after another
|
||||
for (let i = 0; i < cards.length; i++) {
|
||||
tl.to(
|
||||
cards[i],
|
||||
{ y: 80, autoAlpha: 0, duration: exitDur, ease: "power3.in" },
|
||||
hold + i * step,
|
||||
);
|
||||
}
|
||||
|
||||
// snap all back to the visible start state so the next loop begins full
|
||||
tl.set(cards, { autoAlpha: 1, y: 0 }, 1.95);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
# Using `text_spectral_rays` — it OWNS its wordmark
|
||||
|
||||
`text_spectral_rays` is a **self-contained WebGL hero-text renderer**. From ONE rasterized
|
||||
glyph mask it draws **both** the solid wordmark **and** the spectral rays that emanate from
|
||||
it. Letters and rays share the same mask, so they are always perfectly registered.
|
||||
|
||||
## The one trap: never give the word a second source
|
||||
|
||||
The ghost / doubled-wordmark artifact comes from splitting the word across two sources:
|
||||
|
||||
- ❌ **Wrong** — use the shader as a "rays-only background" and draw the visible letters
|
||||
with a **separate DOM element** (or stack a second text move like `content_swap` /
|
||||
`chromatic_pressure` on the same word). The DOM font (e.g. Inter) and the shader's raster
|
||||
font (Arial Black / Impact fallback) differ in width, shape, and position, so the ray
|
||||
edges never line up with the DOM letters → a misregistered ghost. **Deleting the shader's
|
||||
letter terms does NOT fix it** — the ray mask itself is still the second, misaligned copy
|
||||
of the word.
|
||||
|
||||
- ✅ **Right** — let the shader render the wordmark. There is exactly ONE source, so a
|
||||
ghost is structurally impossible.
|
||||
|
||||
## Integrate in one pass
|
||||
|
||||
1. **It IS the wordmark.** Hide any DOM logo for that word (keep it only as an invisible
|
||||
layout spacer if a tagline/CTA below depends on its box). Never stack a discrete text
|
||||
move on the same word.
|
||||
2. **One timeline.** Merge its `progress` / `effectMix` state tweens onto the group's master
|
||||
timeline and repaint via `tl.eventCallback("onUpdate", render)` — no second timeline, no
|
||||
`requestAnimationFrame`.
|
||||
3. **Align the cursor to the word.** `mouse.y` must equal the mask's vertical center. If you
|
||||
move the rasterized word off frame-center (e.g. up, to leave room for a tagline), shift
|
||||
the cursor's `y` by the same amount — otherwise the rays cast at the wrong angle.
|
||||
4. **Local raster only.** Rasterize the word with a bundled / system font (no CDN font);
|
||||
upload the mask + colour canvases as textures.
|
||||
5. **Entrance.** Slam the whole canvas (autoAlpha + a scale punch, `transform-origin` on the
|
||||
word's optical center) on the hit; let `effectMix` bloom the rays just after. The solid
|
||||
letters are present the instant the canvas reveals.
|
||||
|
||||
## Pairs with
|
||||
|
||||
A background bed (`bg_flow_field`) or **separate** supporting elements (tagline, CTA, rule)
|
||||
— never a second treatment of its own word.
|
||||
@@ -0,0 +1,313 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en"
|
||||
data-composition-variables='[
|
||||
{"id":"text", "type":"string", "label":"Wordmark", "default":"SPECTRAL"},
|
||||
{"id":"textColor", "type":"color", "label":"Wordmark fill", "default":"#f6ff7a"},
|
||||
{"id":"bgColor", "type":"color", "label":"Stage background", "default":"#000000"},
|
||||
{"id":"sweepSpeed", "type":"number", "label":"Light sweep speed", "default":1, "min":0.2, "max":3, "step":0.1}
|
||||
]'
|
||||
>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>text_spectral_rays</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--hg-violet: #7c3aed;
|
||||
--hg-violet-2: #a855f7;
|
||||
--hg-bg: #000000;
|
||||
--hg-fg: #f5f5fa;
|
||||
--hg-dim: #6b6b78;
|
||||
}
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: #000;
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
background: #000;
|
||||
}
|
||||
.vfx-canvas {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
display: block;
|
||||
}
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 40px;
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
mix-blend-mode: screen;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="4" data-track-index="1">
|
||||
<canvas class="vfx-canvas" width="1920" height="1080" aria-hidden="true"></canvas>
|
||||
<div class="label">text_spectral_rays</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
(function () {
|
||||
const W = 1920;
|
||||
const H = 1080;
|
||||
|
||||
const defaults = {
|
||||
text: "SPECTRAL",
|
||||
textColor: "#f6ff7a",
|
||||
bgColor: "#000000",
|
||||
sweepSpeed: 1,
|
||||
};
|
||||
const vars = Object.assign(
|
||||
{},
|
||||
defaults,
|
||||
window.__hyperframes && window.__hyperframes.getVariables
|
||||
? window.__hyperframes.getVariables()
|
||||
: {},
|
||||
);
|
||||
|
||||
const canvas = document.querySelector(".vfx-canvas");
|
||||
const gl = canvas.getContext("webgl", {
|
||||
premultipliedAlpha: false,
|
||||
preserveDrawingBuffer: true,
|
||||
});
|
||||
|
||||
// animated state — GSAP tweens these; mouse (the light cursor) is derived
|
||||
const state = { progress: 0, effectMix: 0 };
|
||||
const mouse = { x: 0, y: H * 0.5 };
|
||||
const speed = Number(vars.sweepSpeed) || 1;
|
||||
|
||||
// ── Rasterize the wordmark into a white MASK + a coloured SRC canvas ──
|
||||
function drawWord(ctx, fill) {
|
||||
ctx.clearRect(0, 0, W, H);
|
||||
let fs = 340;
|
||||
const stack = "900 " + fs + 'px "Arial Black", Impact, "Inter", system-ui, sans-serif';
|
||||
ctx.font = stack;
|
||||
const maxW = 1600;
|
||||
const measured = ctx.measureText(vars.text).width || 1;
|
||||
if (measured > maxW) {
|
||||
fs = Math.floor((fs * maxW) / measured);
|
||||
ctx.font = "900 " + fs + 'px "Arial Black", Impact, "Inter", system-ui, sans-serif';
|
||||
}
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillStyle = fill;
|
||||
ctx.fillText(vars.text, W * 0.5, H * 0.5);
|
||||
}
|
||||
const maskCanvas = document.createElement("canvas");
|
||||
maskCanvas.width = W;
|
||||
maskCanvas.height = H;
|
||||
drawWord(maskCanvas.getContext("2d"), "#ffffff");
|
||||
const colorCanvas = document.createElement("canvas");
|
||||
colorCanvas.width = W;
|
||||
colorCanvas.height = H;
|
||||
drawWord(colorCanvas.getContext("2d"), vars.textColor);
|
||||
|
||||
// ── WebGL fallback: flat fill (keeps the timeline registered) ──
|
||||
if (!gl) {
|
||||
const ctx = canvas.getContext("2d");
|
||||
ctx.fillStyle = vars.bgColor;
|
||||
ctx.fillRect(0, 0, W, H);
|
||||
tl.to(state, { progress: 1, duration: 3.6, ease: "none" }, 0.2);
|
||||
window.__timelines["main"] = tl;
|
||||
return;
|
||||
}
|
||||
|
||||
const VERT = [
|
||||
"attribute vec2 position;",
|
||||
"varying vec2 vUv;",
|
||||
"void main(){",
|
||||
" vUv = position * 0.5 + 0.5;",
|
||||
" gl_Position = vec4(position, 0.0, 1.0);",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
// Volumetric spectral light-rays cast by the text mask toward a moving
|
||||
// light cursor — ported from the vfx-text-cursor golden sample, made
|
||||
// generic (reads any text mask/colour). All state from uniforms.
|
||||
const FRAG = [
|
||||
"precision highp float;",
|
||||
"varying vec2 vUv;",
|
||||
"uniform vec2 resolution;",
|
||||
"uniform vec2 mouse;",
|
||||
"uniform float maskY;",
|
||||
"uniform float maskScale;",
|
||||
"uniform float effectMix;",
|
||||
"uniform sampler2D src;",
|
||||
"uniform sampler2D colorSrc;",
|
||||
"#define PI 3.141593",
|
||||
"#define SAMPLES 112.0",
|
||||
"float hash(vec2 p){ return fract(sin(dot(p, vec2(489.0,589.0))) * 492.0) * 2.0 - 1.0; }",
|
||||
"float hash(vec3 p){ return fract(sin(dot(p, vec3(489.0,589.0,58.0))) * 492.0) * 2.0 - 1.0; }",
|
||||
"vec2 hash2(vec3 p){ return vec2(hash(p), hash(p + 1.0)); }",
|
||||
"vec4 readMask(vec2 uv){ if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){return vec4(0.0);} return texture2D(src, uv); }",
|
||||
"vec4 readColor(vec2 uv){ if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){return vec4(0.0);} return texture2D(colorSrc, uv); }",
|
||||
"vec3 spectrum(float x){ return cos((x - vec3(0.0,0.5,1.0)) * vec3(0.6,1.0,0.5) * PI); }",
|
||||
"void main(){",
|
||||
" vec2 uv = vUv;",
|
||||
" vec2 center = vec2(0.5, 0.5);",
|
||||
" vec2 maskUv = (uv - center) / maskScale + center + vec2(0.0, maskY / resolution.y);",
|
||||
" float mask = readMask(maskUv).r;",
|
||||
" vec4 col0 = readColor(maskUv);",
|
||||
" vec2 p = uv * 2.0 - 1.0;",
|
||||
" p.x *= resolution.x / resolution.y;",
|
||||
" vec2 mp = mouse / resolution;",
|
||||
" mp.y = 1.0 - mp.y;",
|
||||
" mp = mp * 2.0 - 1.0;",
|
||||
" mp.x *= resolution.x / resolution.y;",
|
||||
" vec2 rp = p;",
|
||||
" vec2 d = (mp - p) / SAMPLES;",
|
||||
" float acc = 0.0;",
|
||||
" for(float i = 0.0; i < SAMPLES; i++){",
|
||||
" rp += d;",
|
||||
" rp += hash2(vec3(rp, i)) * 0.5 / SAMPLES;",
|
||||
" vec2 uv2 = rp;",
|
||||
" uv2.x /= resolution.x / resolution.y;",
|
||||
" uv2 = uv2 * 0.5 + 0.5;",
|
||||
" vec2 rayUv = (uv2 - center) / maskScale + center + vec2(0.0, maskY / resolution.y);",
|
||||
" acc += readMask(rayUv).r / SAMPLES;",
|
||||
" }",
|
||||
" vec4 c = vec4(0.0, 0.0, 0.0, 1.0);",
|
||||
" c -= acc * 0.24;",
|
||||
" c += vec4(spectrum(cos(acc * 4.9)), 1.0) * acc * 3.65;",
|
||||
" c.rgb = max(c.rgb - 0.035, 0.0);",
|
||||
" c.rgb *= 1.16;",
|
||||
" float cursorX = mouse.x / resolution.x;",
|
||||
" float sweep = exp(-pow((uv.x - cursorX) * 6.2, 2.0));",
|
||||
" float textProximity = smoothstep(0.006, 0.34, acc);",
|
||||
" float longRay = smoothstep(0.004, 0.18, acc);",
|
||||
" vec3 sweepColor = vec3(0.14, 0.65, 0.85) + spectrum(cursorX * 1.8) * 0.28;",
|
||||
" c.rgb += sweepColor * sweep * (0.34 + textProximity * 2.35);",
|
||||
" c.rgb += spectrum(cursorX + acc * 2.0) * longRay * 0.58;",
|
||||
" c.rgb += col0.rgb * acc * 1.18;",
|
||||
" c.rgb += col0.rgb * sweep * mask * 0.92;",
|
||||
" c.rgb *= effectMix;",
|
||||
" c.rgb = mix(c.rgb, col0.rgb, smoothstep(0.02, 0.75, col0.a));",
|
||||
" c.rgb += vec3(1.0) * smoothstep(0.04, 0.38, mask) * 0.12 * effectMix;",
|
||||
" float grain = hash(vec3(uv.xyy + mouse.x * 0.0007));",
|
||||
" float dust = smoothstep(0.02, 0.38, acc) + smoothstep(0.03, 0.22, mask);",
|
||||
" c.rgb += grain * 0.07 * (0.42 + dust) * effectMix;",
|
||||
" c.rgb += spectrum(grain + cursorX) * abs(grain) * 0.045 * smoothstep(0.02, 0.5, acc) * effectMix;",
|
||||
" c.a = 1.0;",
|
||||
" gl_FragColor = c;",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
function compile(type, source) {
|
||||
const s = gl.createShader(type);
|
||||
gl.shaderSource(s, source);
|
||||
gl.compileShader(s);
|
||||
return s;
|
||||
}
|
||||
const program = gl.createProgram();
|
||||
gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));
|
||||
gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));
|
||||
gl.linkProgram(program);
|
||||
gl.useProgram(program);
|
||||
|
||||
function createTexture(source) {
|
||||
const t = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, t);
|
||||
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
return t;
|
||||
}
|
||||
const maskTex = createTexture(maskCanvas);
|
||||
const colorTex = createTexture(colorCanvas);
|
||||
|
||||
const buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
||||
gl.bufferData(
|
||||
gl.ARRAY_BUFFER,
|
||||
new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]),
|
||||
gl.STATIC_DRAW,
|
||||
);
|
||||
const posLoc = gl.getAttribLocation(program, "position");
|
||||
const L = (n) => gl.getUniformLocation(program, n);
|
||||
const uRes = L("resolution");
|
||||
const uMouse = L("mouse");
|
||||
const uMaskY = L("maskY");
|
||||
const uMaskScale = L("maskScale");
|
||||
const uMix = L("effectMix");
|
||||
const uSrc = L("src");
|
||||
const uColorSrc = L("colorSrc");
|
||||
|
||||
function render() {
|
||||
mouse.x = state.progress * W;
|
||||
mouse.y = H * 0.5;
|
||||
gl.viewport(0, 0, W, H);
|
||||
gl.clearColor(0, 0, 0, 1);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.useProgram(program);
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
||||
gl.enableVertexAttribArray(posLoc);
|
||||
gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, maskTex);
|
||||
gl.uniform1i(uSrc, 0);
|
||||
gl.activeTexture(gl.TEXTURE1);
|
||||
gl.bindTexture(gl.TEXTURE_2D, colorTex);
|
||||
gl.uniform1i(uColorSrc, 1);
|
||||
gl.uniform2f(uRes, W, H);
|
||||
gl.uniform2f(uMouse, mouse.x, mouse.y);
|
||||
gl.uniform1f(uMaskY, 0);
|
||||
gl.uniform1f(uMaskScale, 1);
|
||||
gl.uniform1f(uMix, state.effectMix);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
||||
}
|
||||
render(); // initial frame (seek-to-0 correctness)
|
||||
|
||||
// All repaint via the timeline's onUpdate — fully seek-safe, no rAF.
|
||||
tl.eventCallback("onUpdate", render);
|
||||
|
||||
// effect punches in, the light cursor sweeps L→R across the wordmark,
|
||||
// then fades for a clean loop.
|
||||
tl.set(state, { progress: 0, effectMix: 0 }, 0);
|
||||
tl.to(state, { effectMix: 1, duration: 0.45, ease: "power3.out" }, 0.15);
|
||||
tl.to(state, { progress: 1, duration: 3.4 / speed, ease: "none" }, 0.2);
|
||||
tl.to(state, { effectMix: 0, duration: 0.4, ease: "power2.in" }, 3.6);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>tile_mosaic</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.mosaic {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
grid-template-rows: repeat(4, 1fr);
|
||||
gap: 6px;
|
||||
width: 1440px;
|
||||
height: 960px;
|
||||
}
|
||||
.tile {
|
||||
border-radius: 4px;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
.title {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 900;
|
||||
font-size: 220px;
|
||||
letter-spacing: -0.03em;
|
||||
color: var(--hg-fg);
|
||||
text-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
|
||||
will-change: transform, opacity;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2.4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2.4" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="mosaic" id="mosaic"></div>
|
||||
<div class="title" id="title">MOSAIC</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const COLS = 6;
|
||||
const ROWS = 4;
|
||||
const STEP = 0.06;
|
||||
// Deterministic palette; tile colour chosen by index, no randomness.
|
||||
const PALETTE = [
|
||||
"#7c3aed",
|
||||
"#a855f7",
|
||||
"#6d28d9",
|
||||
"#c084fc",
|
||||
"#5b21b6",
|
||||
"#8b5cf6",
|
||||
"#9333ea",
|
||||
"#4c1d95",
|
||||
];
|
||||
|
||||
const mosaic = document.getElementById("mosaic");
|
||||
const tiles = [];
|
||||
for (let i = 0; i < COLS * ROWS; i++) {
|
||||
const row = Math.floor(i / COLS);
|
||||
const col = i % COLS;
|
||||
const cell = document.createElement("div");
|
||||
cell.className = "tile";
|
||||
const a = PALETTE[(row + col) % PALETTE.length];
|
||||
const b = PALETTE[(row + col + 3) % PALETTE.length];
|
||||
cell.style.background = "linear-gradient(135deg, " + a + " 0%, " + b + " 100%)";
|
||||
mosaic.appendChild(cell);
|
||||
tiles.push({ el: cell, diag: row + col });
|
||||
}
|
||||
|
||||
// Diagonal sweep: reveal order governed by (row + col), explicit per-tile timing.
|
||||
for (const t of tiles) {
|
||||
tl.fromTo(
|
||||
t.el,
|
||||
{ autoAlpha: 0, scale: 0.6 },
|
||||
{ autoAlpha: 1, scale: 1, duration: 0.4, ease: "back.out(1.7)" },
|
||||
t.diag * STEP,
|
||||
);
|
||||
}
|
||||
|
||||
// Title settles over the finished, dense mosaic.
|
||||
tl.fromTo(
|
||||
"#title",
|
||||
{ autoAlpha: 0, scale: 1.12 },
|
||||
{ autoAlpha: 1, scale: 1, duration: 0.45, ease: "power2.out" },
|
||||
1.7,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,122 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>typewriter_reveal</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.line {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
font-family: "JetBrains Mono", ui-monospace, monospace;
|
||||
font-weight: 800;
|
||||
font-size: 200px;
|
||||
letter-spacing: 0.02em;
|
||||
line-height: 0.95;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.char {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
will-change: opacity;
|
||||
}
|
||||
.char.space {
|
||||
width: 0.4em;
|
||||
}
|
||||
.caret {
|
||||
display: inline-block;
|
||||
width: 0.09em;
|
||||
height: 0.86em;
|
||||
margin-left: 0.06em;
|
||||
background: var(--hg-violet-2);
|
||||
will-change: opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2.4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2.4" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="line" id="line">
|
||||
<span class="char">S</span><span class="char">Y</span><span class="char">S</span
|
||||
><span class="char">T</span><span class="char">E</span><span class="char">M</span
|
||||
><span class="char space"> </span><span class="char">O</span
|
||||
><span class="char">N</span><span class="char">L</span><span class="char">I</span
|
||||
><span class="char">N</span><span class="char">E</span
|
||||
><span class="caret" id="caret"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
const chars = gsap.utils.toArray(".char");
|
||||
const step = 0.07;
|
||||
|
||||
// Explicit per-character reveal: one set() per char at time i * step.
|
||||
chars.forEach((char, i) => {
|
||||
tl.set(char, { opacity: 1 }, i * step);
|
||||
});
|
||||
|
||||
const lastT = (chars.length - 1) * step;
|
||||
|
||||
// Caret rides just past the last revealed char and blinks a finite number
|
||||
// of times (no repeat:-1), then the phrase locks crisp.
|
||||
tl.set("#caret", { opacity: 1 }, 0);
|
||||
tl.to(
|
||||
"#caret",
|
||||
{ opacity: 0, duration: 0.09, ease: "steps(1)", repeat: 8, yoyo: true },
|
||||
lastT + step,
|
||||
);
|
||||
tl.set("#caret", { opacity: 0 }, 2.32);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,126 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>word_grid_burst</title>
|
||||
<script src="../assets/gsap.min.js"></script>
|
||||
<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;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--hg-bg);
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
color: var(--hg-fg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
#scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
}
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-template-rows: repeat(3, 1fr);
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
padding: 140px 120px;
|
||||
gap: 24px;
|
||||
}
|
||||
.cell {
|
||||
font-weight: 900;
|
||||
font-size: 92px;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 0.95;
|
||||
color: var(--hg-fg);
|
||||
white-space: nowrap;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-duration="2.8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="scene" class="clip" data-start="0" data-duration="2.8" data-track-index="1">
|
||||
<div class="stage">
|
||||
<div class="cell">PULSE</div>
|
||||
<div class="cell">FORGE</div>
|
||||
<div class="cell">SURGE</div>
|
||||
<div class="cell">VOLT</div>
|
||||
<div class="cell">CORE</div>
|
||||
<div class="cell">FLUX</div>
|
||||
<div class="cell">SPARK</div>
|
||||
<div class="cell">DRIVE</div>
|
||||
<div class="cell">BLAZE</div>
|
||||
<div class="cell">WAVE</div>
|
||||
<div class="cell">SHIFT</div>
|
||||
<div class="cell">BOLT</div>
|
||||
<div class="cell">RUSH</div>
|
||||
<div class="cell">PEAK</div>
|
||||
<div class="cell">IGNITE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
|
||||
// Deterministic reveal order: scatter sequence across the 15-cell grid.
|
||||
const order = [7, 0, 12, 4, 9, 2, 14, 6, 11, 1, 8, 3, 13, 5, 10];
|
||||
const cells = gsap.utils.toArray(".cell");
|
||||
const step = 0.13;
|
||||
const FOCUS = 7; // chosen focal cell ("DRIVE")
|
||||
|
||||
// Each cell pops in on its own "onset" — explicit per-cell timing.
|
||||
order.forEach((idx, i) => {
|
||||
tl.fromTo(
|
||||
cells[idx],
|
||||
{ autoAlpha: 0, scale: 0.8 },
|
||||
{ autoAlpha: 1, scale: 1, duration: 0.22, ease: "back.out(1.8)" },
|
||||
i * step,
|
||||
);
|
||||
});
|
||||
|
||||
// Downbeat refocus (~2.3s): dim the whole grid, pop the focal word.
|
||||
tl.to(".cell", { autoAlpha: 0.25, duration: 0.18, ease: "power2.out" }, 2.3);
|
||||
tl.to(
|
||||
cells[FOCUS],
|
||||
{
|
||||
autoAlpha: 1,
|
||||
scale: 1.25,
|
||||
color: "var(--hg-violet-2)",
|
||||
duration: 0.22,
|
||||
ease: "back.out(2)",
|
||||
},
|
||||
2.32,
|
||||
);
|
||||
|
||||
window.__timelines["main"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,195 @@
|
||||
# GroupSignature — the shared schema (linchpin)
|
||||
|
||||
One schema, three producers:
|
||||
|
||||
- the **Music Reader** emits one `GroupSignature` per **section** (over its whole span);
|
||||
- the **Director** derives one per **group** when it subdivides a section;
|
||||
- a **template's match-face** declares which `GroupSignature`s it fits.
|
||||
|
||||
Because all speak this vocabulary, matching a group to a template is mechanical. **Do not
|
||||
let them drift.** Every field here is derived from `audiomap.json` (fact) — never invented
|
||||
— so it holds at runtime with no video.
|
||||
|
||||
## Two levels: sections → groups
|
||||
|
||||
Segmentation is split across two stages by who knows what:
|
||||
|
||||
1. **Sections** (Music Reader, catalog-blind) — the musical macro-structure: runs of one
|
||||
gesture, snapped to real state-changes. Each section is a full `GroupSignature` over its
|
||||
whole span **plus** a `cut_candidates[]` menu — the musically-legal internal anchors a
|
||||
finer cut could land on. The Music Reader does **not** decide how many groups a section
|
||||
becomes.
|
||||
2. **Groups** (Director, catalog-aware) — the treatment units a template actually binds to.
|
||||
The Director subdivides each section by acting on zero or more of its `cut_candidates`,
|
||||
because the right granularity depends on template native spans only it can see. A
|
||||
section kept whole is one group (== itself); a long / multi-gesture section becomes
|
||||
several. The Director derives each group's `GroupSignature` over its own slice.
|
||||
|
||||
`sections[]` (in `music-read.json`) tile the **whole track** (first at 0, last at
|
||||
`duration_s`, no gaps/overlaps). The Director's `groups[]` (in `visual-plan.json`) tile it
|
||||
too; every group carries the `section_id` it came from, and a section's groups tile that
|
||||
section's span.
|
||||
|
||||
A **template matches a `group`** (which may be a whole section) — the match-face below is
|
||||
unchanged. **Multiple templates inside one section are fine** (the brand spine unifies
|
||||
them, not template reuse).
|
||||
|
||||
```jsonc
|
||||
"sections": [
|
||||
{
|
||||
// a GroupSignature over the whole section span (every field below) + a cut menu
|
||||
"id": "s1",
|
||||
"span_sec": [19.412, 30.0], // [start,end], snapped to AudioMap anchors (re-snapped to nearest beat)
|
||||
"structural_type": "per_onset_sequential",
|
||||
"mood": ["dark", "cinematic"],
|
||||
// …all other GroupSignature fields, derived over the whole span…
|
||||
"cut_candidates": [
|
||||
// musically-legal internal cut points the Director MAY use; empty for a single
|
||||
// gesture; NEVER inside a rolls[] run; never leaving a sub-1-bar fragment.
|
||||
{ "time": 23.963, "kind": "hard_stop", "strength": "strong" },
|
||||
{ "time": 26.215, "kind": "surge", "strength": "strong" },
|
||||
],
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
## The object
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"id": "g1", // group id within the track
|
||||
"section_id": "s1", // the section this group lives in (its groups tile the section span)
|
||||
"span_sec": [0.0, 4.017], // [start, end], snapped to AudioMap anchors
|
||||
"span_bars": 2, // length in bars (rounded)
|
||||
|
||||
"structural_type": "sustained_hold", // controlled vocab — see rubric below
|
||||
"mood": ["warm", "cinematic"], // controlled vocab, 1–3 tags
|
||||
|
||||
// ── objective audio facts (straight from audiomap) ──
|
||||
"energy_level": "HIGH", // VOID | LOW | MEDIUM | HIGH (dominant phase)
|
||||
"energy": 0.8, // 0–1, mean of the dominant phase
|
||||
"density": "sparse", // sparse | medium | dense (audiomap fact)
|
||||
"onset_rate": 1.0, // onsets / sec over the span
|
||||
"onset_gap_bars": 2.05, // longest onset desert, in bars (key discriminator)
|
||||
"has_steady_grid": true, // stable bpm + ≥2 downbeats present
|
||||
"bpm": 129.2,
|
||||
|
||||
// ── roll lane (from audiomap rolls[] overlapping the span; false/null if none) ──
|
||||
"has_roll": false, // any rolls[] entry overlaps the group
|
||||
"roll_kind": null, // dominant roll kind: fill | accel-roll | sustained-fill
|
||||
"roll_rate_per_min": 0, // hits/min of the dominant (longest) overlapping roll
|
||||
"roll_count": 0, // rolls[] entries overlapping the span
|
||||
|
||||
// ── boundaries ──
|
||||
"entry": { "anchor": "downbeat", "time": 0.093 },
|
||||
"exit_trigger": { "type": "first_onset_reentry", "time": 4.017 },
|
||||
}
|
||||
```
|
||||
|
||||
## Field derivation (from audiomap — make this automatic)
|
||||
|
||||
| field | how to compute |
|
||||
| --------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `span_sec` | the group's [start,end]; snap each to nearest `downbeats_sec` / `hard_stops` / `phrase` edge |
|
||||
| `span_bars` | `round((end-start) / bar_dur)`, where `bar_dur = beats_per_bar * 60/bpm` |
|
||||
| `energy_level` / `energy` | the `energy_phases[]` block covering most of the span → its `level` / `energy` |
|
||||
| `density` | dominant `energy_phases[].density` over the span |
|
||||
| `onset_rate` | `count(events in span) / (end-start)` |
|
||||
| `onset_gap_bars` | `max gap between consecutive events[].t inside the span` ÷ `bar_dur` |
|
||||
| `has_steady_grid` | `tempo.n_bars >= 2` and bpm stable |
|
||||
| `has_roll` / `roll_count` | any / count of `rolls[]` overlapping the span |
|
||||
| `roll_kind` / `roll_rate_per_min` | `kind` / `rate_per_min` of the dominant (longest) overlapping roll |
|
||||
| `entry` | first anchor at/after `start` (prefer `downbeat`) |
|
||||
| `exit_trigger` | see exit-trigger rule below |
|
||||
|
||||
Worked example (group_1): max onset gap `3.971 − 0.163 = 3.808s`; `bar_dur =
|
||||
4·(60/129.2) = 1.858s`; `onset_gap_bars = 3.808/1.858 = 2.05`. ✓
|
||||
|
||||
## exit_trigger rule (also the group boundary)
|
||||
|
||||
Pick the first that applies, snap its time to the nearest downbeat:
|
||||
|
||||
1. longest onset gap ≥ ~1.5 bars **and** an onset follows it → `first_onset_reentry`
|
||||
(the held section ends when rhythm re-enters — group_1).
|
||||
2. a terminal `hard_stops[]` in the span → `hard_stop`.
|
||||
3. a `SURGE` into a denser phase at the end → `surge`.
|
||||
4. otherwise → `downbeat` (next bar) or `end` (track end).
|
||||
|
||||
> Per decision #2: the Music Reader proposes the boundary; when a chosen template's
|
||||
> stop rule disagrees, the **Director reconciles** to the nearest AudioMap anchor.
|
||||
> They rarely conflict because both come from these same facts.
|
||||
|
||||
## Controlled vocabularies (SEED — grows as we reverse)
|
||||
|
||||
These lists are the dictionary both sides must use. Adding a value is a deliberate
|
||||
catalog change, not an ad-hoc string.
|
||||
|
||||
### `structural_type`
|
||||
|
||||
| value | the music | seen in |
|
||||
| ---------------------- | ----------------------------------------------------------- | ------------------ |
|
||||
| `sustained_hold` | energy present but few/no onsets — a held pad/riser | group_1 |
|
||||
| `per_onset_sequential` | discrete onsets drive one reveal each (typing/word-by-word) | group_2 (expected) |
|
||||
| `roll_cascade` | a `rolls[]` run → continuous cascade / multiply | — |
|
||||
| `dense_multiply` | HIGH + dense, no single message → field/grid/strobe | — |
|
||||
| `void_breath` | VOID / silence dominant → clear & hold | — |
|
||||
| `hard_stop_freeze` | terminal hard stop → freeze to negative space | — |
|
||||
| `drop_regime_change` | SURGE into dense → system replace | — |
|
||||
|
||||
> `dense_multiply` is currently a **broad bucket** — three promoted templates live under
|
||||
> it (`roll-flipbook-word-cycle`, `held-text-strobe-burst`, `poster-tile-mosaic`),
|
||||
> disambiguated by their `match.requires` (a fast `sustained-fill` roll vs a tiny
|
||||
> `onset_gap_bars` strobe vs a tessellating tile program). Candidate future subtypes:
|
||||
> `held_strobe`, `tile_mosaic_program`. Split them out when a 4th example forces it.
|
||||
|
||||
### `structural_type` classification rubric (decision tree)
|
||||
|
||||
Run top-down, first match wins:
|
||||
|
||||
1. VOID dominant & `onset_rate ≈ 0` → `void_breath`
|
||||
2. terminal `hard_stop` + freeze, little after → `hard_stop_freeze`
|
||||
3. `rolls[]` spans most of the group → `roll_cascade`
|
||||
4. `energy_level ≥ MEDIUM` & `density == sparse` & `onset_gap_bars ≥ 1.5` → `sustained_hold`
|
||||
5. `density == dense` & `energy_level == HIGH` & no dominant readable mark → `dense_multiply`
|
||||
6. onsets present, discrete, each plausibly one reveal → `per_onset_sequential`
|
||||
7. `SURGE` into a denser phase → `drop_regime_change`
|
||||
8. none fit cleanly → leave `structural_type: "unclassified"` and flag for a NEW type.
|
||||
|
||||
### `mood` (1–3 tags)
|
||||
|
||||
`warm` · `dark` · `hype` · `elegant` · `glitch` · `cinematic` · `playful` · `tense` ·
|
||||
`dreamy` · `aggressive`. Derive from `energy_phases[].feel` (warm/heavy/bright/sparse)
|
||||
|
||||
- energy + the Gemini read's genre cues.
|
||||
|
||||
### `exit_trigger.type`
|
||||
|
||||
`first_onset_reentry` · `hard_stop` · `surge` · `downbeat` · `end`.
|
||||
|
||||
### role kinds (used by templates, see template-definition.md)
|
||||
|
||||
`message` (readable text) · `background` (field/texture) · `camera` · `asset` ·
|
||||
`overlay` (grain/vignette/chrome).
|
||||
|
||||
### motion verbs (per role; each maps to an L0 primitive or a custom phrase)
|
||||
|
||||
`freeze_after_reveal` · `energy_envelope_breath` · `per_onset_pop` · `cascade` ·
|
||||
`strobe` · `camera_push` · `hold` · `font_shuffle` (cycle typefaces on the beat) ·
|
||||
`flipbook` (0ms word/glyph swap per 16th over a roll) · `scramble_decode` (scrambled →
|
||||
locked phrase). Link the L0 id in the template's `uses_primitives`; a verb with no L0 id
|
||||
is a custom phrase the impl defines.
|
||||
|
||||
> **Meta-templates** (a base + a program of beat-synced _operations_, e.g.
|
||||
> `poster-tile-mosaic`) may declare an `operations` / `engine` block instead of role
|
||||
> `motion` verbs — see template-definition.md extension fields.
|
||||
|
||||
## Self-check
|
||||
|
||||
- Every field traces to an `audiomap.json` value or a span of it.
|
||||
- `structural_type`, `mood`, `exit_trigger.type`, role kinds, motion verbs are all from
|
||||
the controlled vocab (or explicitly flagged as a proposed new value).
|
||||
- `sections[]` (music-read) and the Director's `groups[]` (visual-plan) each tile the whole
|
||||
track; every group's `section_id` names an existing section; a section's groups tile its
|
||||
`span_sec`.
|
||||
- The same object validates whether it came from the Music Reader (a section), the Director
|
||||
(a group), or a template example.
|
||||
@@ -0,0 +1,156 @@
|
||||
# Template definition — what a Group Template IS
|
||||
|
||||
A Group Template is a reverse-engineered, reusable archetype for **one whole group** of
|
||||
a BGM track. It lives at `templates/<id>/` and has three parts:
|
||||
|
||||
```
|
||||
templates/<id>/
|
||||
card.json ← the spec: match-face + build-face (this doc)
|
||||
index.html ← the reference implementation (parameterized, asset-free)
|
||||
README.md ← human notes + provenance + the source frames
|
||||
```
|
||||
|
||||
A card has **two faces**:
|
||||
|
||||
- **match-face** — small, structured, in `GroupSignature` vocab. The Director reads it
|
||||
to decide _does this template fit this group?_ Keep it concise (decision: simple).
|
||||
- **build-face** — richer. Tells the Builder _how to realize it_: roles, fillable
|
||||
params, the reference impl, the primitives used, the exit transition.
|
||||
|
||||
## `card.json` schema
|
||||
|
||||
```jsonc
|
||||
{
|
||||
// ── identity ──
|
||||
"id": "held-message-living-field",
|
||||
"name": "Held Message / Living Field",
|
||||
"one_line": "A readable mark held dead still over a soft, color-shifting blurred field.",
|
||||
"status": "draft", // draft (in reverse workspace) → promoted (in catalog)
|
||||
|
||||
// ── MATCH FACE (GroupSignature predicates — see signature-schema.md) ──
|
||||
"match": {
|
||||
"structural_type": "sustained_hold",
|
||||
"requires": {
|
||||
// predicates over a group's GroupSignature
|
||||
"energy_level": ">=MEDIUM",
|
||||
"density": "sparse",
|
||||
"onset_gap_bars": ">=1.5",
|
||||
"has_steady_grid": true,
|
||||
},
|
||||
"mood_fit": ["warm", "dark", "elegant", "cinematic"],
|
||||
"span_bars": [2, 8], // typical extent
|
||||
"exit_trigger": ["first_onset_reentry", "hard_stop"],
|
||||
},
|
||||
|
||||
// examples = real reversed groups this template was mined from. Auto-filled from each
|
||||
// sample's audiomap. More examples → more trustworthy `requires` thresholds.
|
||||
"examples": [
|
||||
{
|
||||
"sample": "bgm_test_2",
|
||||
"group": "g1",
|
||||
"bpm": 129.2,
|
||||
"energy": 0.8,
|
||||
"density": "sparse",
|
||||
"onset_gap_bars": 2.05,
|
||||
"span_sec": [0.0, 4.017],
|
||||
},
|
||||
],
|
||||
|
||||
// ── BUILD FACE ──
|
||||
"roles": {
|
||||
"message": {
|
||||
"kind": "message",
|
||||
"motion": "freeze_after_reveal", // reveal on entry, then dead still
|
||||
"anchor": "entry.downbeat",
|
||||
"notes": "readable ≥ whole span; no per-element motion (there are no onsets)",
|
||||
},
|
||||
"field": {
|
||||
"kind": "background",
|
||||
"motion": "energy_envelope_breath", // brightness/chroma track the energy envelope
|
||||
"anchor": "energy",
|
||||
"notes": "the ONLY thing moving; peaks at the SURGE; settles dark for the hold",
|
||||
},
|
||||
// optional: "camera", "asset", "overlay"
|
||||
},
|
||||
|
||||
"params": {
|
||||
// fillable slots = composition-variables in index.html
|
||||
"text": { "type": "string", "maps_to": "message.content" },
|
||||
"palette": { "type": "object", "keys": ["bg", "colorLow", "colorMid", "colorHigh", "accent"] },
|
||||
"flowSpeed": { "type": "number", "default": 1 },
|
||||
"duration": { "type": "number", "from": "group.span_sec length" },
|
||||
},
|
||||
|
||||
"reference_impl": "index.html",
|
||||
"uses_primitives": ["blur_resolve", "negative_space_hold", "chromatic_pressure"],
|
||||
|
||||
// group→group exit. Default fast_cut for everything now (decision #4); the observed
|
||||
// transition is recorded for later.
|
||||
"transition_out": { "default": "fast_cut", "observed": "anticipation_glitch_cut" },
|
||||
|
||||
// ── provenance ──
|
||||
"reversed_from": ["bgm-golden-sample-reverse/gorup-by-group/group_1"],
|
||||
"created": "fill at promotion time", // scripts can't call Date.now(); stamp by hand
|
||||
}
|
||||
```
|
||||
|
||||
### Required fields
|
||||
|
||||
`id`, `name`, `one_line`, `status`, `match` (`structural_type` + `requires` +
|
||||
`mood_fit` + `exit_trigger`), `examples[]` (≥1), `roles` (≥1), `params`,
|
||||
`reference_impl`, `transition_out`, `reversed_from`.
|
||||
|
||||
## Rules for each face
|
||||
|
||||
**match-face — keep it minimal.**
|
||||
|
||||
- `requires` predicates use simple operators: `">=X"`, `"<=X"`, `"==X"`, a literal, or a
|
||||
list (any-of). Only constrain fields that actually distinguish this template.
|
||||
- Don't encode creative taste here — that's the build-face. The match-face answers one
|
||||
question: _does this group's signature fit?_
|
||||
|
||||
**build-face — whole-group, roles declared separately (decisions #1, #2).**
|
||||
|
||||
- One template covers the whole group (background + text together), but every moving
|
||||
thing is its own `role` with its own `motion` + `anchor`, so roles can be factored
|
||||
into composable role-templates later without rewriting cards.
|
||||
- Each `role.motion` is a verb from the signature schema; each verb resolves to an L0
|
||||
primitive id listed in `uses_primitives` (or a custom phrase the Builder can implement).
|
||||
- `params` are exactly the composition-variables the reference impl exposes (so the
|
||||
Builder fills them by passing `--variables`, no code edit needed for content/palette).
|
||||
|
||||
## Reference implementation (`index.html`)
|
||||
|
||||
- A HyperFrames composition (one paused GSAP timeline, deterministic, asset-free, passes
|
||||
`lint` + `validate`).
|
||||
- Exposes `params` as `data-composition-variables` (text + palette + speed + duration).
|
||||
- A template may **bundle local assets** under `assets/` when its look genuinely needs
|
||||
them (e.g. `held-text-strobe-burst` ships texture-mask PNGs + a local `gsap.min.js`).
|
||||
Local bundled assets are allowed; remote assets / remote fonts are not.
|
||||
|
||||
## Extension fields (allowed beyond the required set)
|
||||
|
||||
Cards may carry extra fields when a template needs them. Promoted examples use:
|
||||
|
||||
- `beat_map` — script-side musical timing constants the impl reads (onset / roll seconds,
|
||||
font / flip steps). Content lives in `params`; musical _timing_ lives here.
|
||||
- `bundled_assets` — a note on what the impl ships under `assets/`.
|
||||
- `base_template` / `operations` / `engine` / `program_format` / `program_data` —
|
||||
**meta-templates**: one base look + a data-driven _program_ of beat-synced operations
|
||||
(e.g. `poster-tile-mosaic`). The `program` param is the compose-by-data surface; the
|
||||
operator code is fixed. Such a card may omit the standard `roles` motion-verbs.
|
||||
- `provenance` — the source video / audiomap / video-read the template was reversed from.
|
||||
- `examples[]` entries may carry extra audio facts (`roll`, `bursts_sec`,
|
||||
`downbeats_sec`, …) beyond the required signature fields.
|
||||
|
||||
## Status lifecycle
|
||||
|
||||
`draft` (produced in the reverse workspace) → reviewed → `promoted` (copied into
|
||||
`templates/<id>/`, added to the catalog). The Director only matches `promoted` cards.
|
||||
|
||||
## Worked example
|
||||
|
||||
The catalog ships five promoted templates (`held-message-living-field`,
|
||||
`typewriter-phrase-keyword-shuffle`, `roll-flipbook-word-cycle`,
|
||||
`held-text-strobe-burst`, `poster-tile-mosaic`) — each a real reversed group. Read any
|
||||
`templates/<id>/card.json` for a filled-in reference.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Transition Catalog (group → group)
|
||||
|
||||
Transitions between groups are L1 patterns, just like Group Templates. This catalog is
|
||||
the interface; the Director picks a transition for each group boundary.
|
||||
|
||||
> **Decision #4: keep the interface, default EVERYTHING to `fast_cut` for now.** The
|
||||
> reverse pipeline still _records_ the real observed transition on each template
|
||||
> (`transition_out.observed`) so we can activate richer ones later — but the Director
|
||||
> emits `fast_cut` for every boundary until we say otherwise.
|
||||
|
||||
## Entry schema
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"id": "fast_cut",
|
||||
"one_line": "Instant hard cut on the boundary downbeat. 0ms.",
|
||||
"anchor": "boundary.downbeat", // which audio moment it lands on
|
||||
"duration_ms": 0,
|
||||
"mechanism": "tl.set(): kill group A, show group B on the same frame — no tween.",
|
||||
"uses_primitives": ["hard_cut"], // L0 ids (bgm-motion-vocabulary.md)
|
||||
"status": "active", // active | recorded (known but not yet emitted)
|
||||
}
|
||||
```
|
||||
|
||||
## Active
|
||||
|
||||
### `fast_cut` — DEFAULT for all boundaries
|
||||
|
||||
- **Anchor:** the boundary downbeat (the group's `exit_trigger.time`, snapped).
|
||||
- **Mechanism:** 0ms `tl.set()` — hide group A, reveal group B on the same frame. No
|
||||
crossfade, no tween. The cut _is_ the transition.
|
||||
- **Why default:** zero-asset, never wrong, reads as decisive editing; lets us ship the
|
||||
template pipeline before investing in bespoke transitions.
|
||||
- **Primitives:** `hard_cut`.
|
||||
|
||||
## Recorded (known from reverses, NOT emitted yet)
|
||||
|
||||
These come out of the reverse pipeline as `transition_out.observed`. Kept here as the
|
||||
backlog to activate once fast_cut-everything is working.
|
||||
|
||||
### `anticipation_glitch_cut` _(observed: group_1 → group_2)_
|
||||
|
||||
- A few-frame chromatic/noise glitch on the **pre-beat** (the onset just before the
|
||||
boundary downbeat), impact landing on the downbeat. A "spring" that amplifies the
|
||||
next group's entrance. Primitives: `chromatic_pressure` + `hard_cut`.
|
||||
- Status: `recorded`. To activate: add `"status":"active"` and let the Director choose
|
||||
it when a boundary's `exit_trigger.type == "first_onset_reentry"`.
|
||||
|
||||
## How the Director uses it (target)
|
||||
|
||||
For each adjacent group pair, set `transitions[]` entry `{ from, to, transition:
|
||||
"fast_cut", at: boundary_time }`. Until further notice, `transition` is always
|
||||
`fast_cut`. A template's `transition_out.observed` is metadata for the future, not an
|
||||
instruction.
|
||||
@@ -0,0 +1,158 @@
|
||||
# Visual Plan Contract (template-driven)
|
||||
|
||||
The Director writes `visual-plan.json`. It is a build spec, not code. Unlike the
|
||||
scene-based plan, this one is **group-driven**: the Director **creates the groups** by
|
||||
subdividing each `music-read.json` section at its `cut_candidates` (catalog-aware — see
|
||||
director.md), then writes one entry per group, each either bound to a **promoted Group
|
||||
Template** or **free-composed**, plus the group→group transitions.
|
||||
|
||||
## Output shape
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"compositionId": "bgm",
|
||||
"duration_s": 7.198, // == audiomap.audio.duration_sec, exactly
|
||||
"canvas": { "w": 1920, "h": 1080, "fps": 30 },
|
||||
|
||||
// ── brand spine: ONE identity across all groups, so different templates still read
|
||||
// as one piece. The Director sets this from the brief's mood. ──
|
||||
"style": {
|
||||
"name": "warm cinematic recap",
|
||||
"mood": "warm / cinematic",
|
||||
"palette": ["#040406", "#100a2e", "#d23b5e", "#ffd9c2", "#ffb27a"],
|
||||
"font": "system-safe stack or local @font-face",
|
||||
"texture": "grain / light-leak",
|
||||
},
|
||||
|
||||
// echoed from music-read.json (the source sections + cut_candidates the Director split).
|
||||
// Groups that share a section may use DIFFERENT templates — no reuse rule; the brand
|
||||
// spine unifies them.
|
||||
"sections": [
|
||||
{
|
||||
"id": "s1",
|
||||
"span_sec": [0.0, 7.198],
|
||||
"structural_type": "sustained_hold",
|
||||
"mood": ["warm", "cinematic"],
|
||||
},
|
||||
],
|
||||
|
||||
"groups": [
|
||||
{
|
||||
"id": "g1",
|
||||
"section_id": "s1", // the section this group was cut from
|
||||
"span_sec": [0.0, 4.017], // Director-chosen: between cut_candidates (or the whole section), reconciled to the stop rule
|
||||
"structural_type": "sustained_hold",
|
||||
"mood": ["warm", "cinematic"],
|
||||
|
||||
"templateRef": "held-message-living-field", // a promoted template id, or null
|
||||
|
||||
// params = the template's composition-variables, filled. Keys MUST match the
|
||||
// template card's `params`. (Omitted when templateRef is null.)
|
||||
"params": {
|
||||
"kickerText": "PREVIOUSLY ON",
|
||||
"heroText": "DUCKLIFE",
|
||||
"palette": {
|
||||
"bgColor": "#040406",
|
||||
"colorLow": "#100a2e",
|
||||
"colorMid": "#d23b5e",
|
||||
"colorHigh": "#ffd9c2",
|
||||
"accentColor": "#ffb27a",
|
||||
},
|
||||
"flowSpeed": 1,
|
||||
"duration": 4.017,
|
||||
},
|
||||
|
||||
// bind each template role to this group's real anchors (absolute audio seconds)
|
||||
"role_bindings": {
|
||||
"message": { "reveal_at": 0.093, "motion": "freeze_after_reveal" },
|
||||
"field": { "drive": "energy_envelope", "surge_at": 1.0 },
|
||||
},
|
||||
|
||||
// when templateRef is null, describe the free composition instead (uses L0):
|
||||
"free_design": null,
|
||||
// e.g. { "dominant_system": "per-onset typography", "layout": "...",
|
||||
// "primitives": ["content_swap","scale_punch"], "density_topology": "accumulate" }
|
||||
},
|
||||
],
|
||||
|
||||
"transitions": [
|
||||
{ "from": "g1", "to": "g2", "transition": "fast_cut", "at": 4.017 }, // default fast_cut
|
||||
],
|
||||
|
||||
// the Director owns the words (see Copy rules). Texture vs message decided per item.
|
||||
"copy": {
|
||||
"headline": "DUCKLIFE",
|
||||
"kickers": ["PREVIOUSLY ON"],
|
||||
"taglineWords": [],
|
||||
"keywords": [],
|
||||
"ctaWords": [],
|
||||
"logo": null,
|
||||
},
|
||||
|
||||
"build_notes": ["one paused GSAP timeline", "no remote assets", "grain over every group"],
|
||||
"avoid": ["generic slideshow", "tiny unreadable hero text"],
|
||||
}
|
||||
```
|
||||
|
||||
Required fields: `compositionId`, `duration_s`, `canvas`, `style`, `groups[]`,
|
||||
`transitions[]`, `copy`, `build_notes[]`. Echo `sections[]` from music-read for
|
||||
traceability; each group carries its `section_id`.
|
||||
|
||||
## Group rules
|
||||
|
||||
- **The Director creates groups by subdividing sections** (director.md): each group's
|
||||
`span_sec` runs between chosen `cut_candidates` (or is the whole section), then is
|
||||
**reconciled** to the chosen template's stop rule (snap to the nearest AudioMap anchor —
|
||||
decision #2). Groups are in audio order; adjacent `span_sec` tile the timeline with no
|
||||
gaps/overlaps; the last ends at `duration_s`; no group is < ~1 bar.
|
||||
- **Each group carries its `section_id`** (the section it was cut from). Groups that share a
|
||||
section may use **different templates** — match each independently; cohesion comes from
|
||||
the brand spine, not template reuse.
|
||||
- **Every group is either `templateRef` (a promoted id) or `free_design`** — never both,
|
||||
never neither.
|
||||
- **`params` keys must match the referenced card's `params`** exactly, so the Builder can
|
||||
pass them straight to the reference impl's composition-variables.
|
||||
- **`role_bindings` use real anchor seconds** from this group's slice of the AudioMap, not
|
||||
the template's example times.
|
||||
|
||||
## Matching (how the Director picks a template — see template-definition.md)
|
||||
|
||||
For each group: keep promoted cards where `card.match.structural_type == group.structural_type`
|
||||
**and** the group's `GroupSignature` satisfies every `card.match.requires` predicate
|
||||
**and** `mood` overlaps `card.match.mood_fit`. Rank survivors by signature closeness /
|
||||
example count; take the top. If none survive → `templateRef:null` + `free_design`
|
||||
(compose from `motion-primitives.md`, one thesis for the group).
|
||||
|
||||
## Transitions
|
||||
|
||||
One entry per adjacent pair. **`transition` is always `"fast_cut"` for now**
|
||||
(decision #4) — a 0ms hard cut at `at` (the boundary, = the earlier group's
|
||||
`exit_trigger` time, snapped). The catalog interface allows richer transitions later; do
|
||||
not emit them yet.
|
||||
|
||||
## Copy rules (Director owns the words)
|
||||
|
||||
- Keep any exact words the user supplied; otherwise invent with taste, on the brief's mood.
|
||||
- **Message vs texture:** a word that must be read holds ≥1 beat, stable and focal; a word
|
||||
held <1 beat is texture (strobe/ticks). Never force a message onto a sub-beat.
|
||||
- Copy fills template `params` (or, for free groups, rides the group's anchors). Do not
|
||||
hand-place every word's millisecond — declare the anchor + accumulate/stagger intent and
|
||||
leave micro-timing to the Builder.
|
||||
|
||||
## Brand spine
|
||||
|
||||
One type family, a ≤4–6 swatch palette, ≤2 accents per frame, applied across every group.
|
||||
Different templates per group are fine — the spine is what unifies them.
|
||||
|
||||
## Self-check
|
||||
|
||||
- `duration_s == audiomap.audio.duration_sec`; groups tile it exactly; no group < ~1 bar;
|
||||
no group boundary lands inside a `rolls[]` run.
|
||||
- Each group carries a `section_id` present in `sections[]`; its `span_sec` came from that
|
||||
section's `cut_candidates` (or is the whole section); groups in one section may use
|
||||
different templates.
|
||||
- Every group resolves to a promoted `templateRef` **or** a `free_design`.
|
||||
- Every `templateRef` exists under `templates/` and its `match.requires` is satisfied by
|
||||
the group's signature.
|
||||
- `params` keys == the card's `params`; `role_bindings` use real AudioMap seconds.
|
||||
- One `transitions[]` entry per boundary, all `fast_cut`.
|
||||
@@ -0,0 +1,531 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Beat-grid + drum/event analysis engine for bgm-to-video (Brain A).
|
||||
|
||||
Turns a BGM track directly into a deterministic `audiomap.json` — the music skeleton
|
||||
that the Director and Builder hang visuals on. It merges:
|
||||
|
||||
- a reliable tempo + beat grid + downbeat (librosa beat tracker),
|
||||
- metrical position per event (strong / weak / syncopated / off-grid) over a 16th-note bar grid,
|
||||
- drum-element classification (kick / snare / hihat / perc) via band-split,
|
||||
- special audio events (riser / glitch / crash-impact / hard-stop silence),
|
||||
- an energy narrative (audio-driven energy phases + builds + key moments; the Music
|
||||
Reader names the sections — no fixed Intro/Build/Drop/Outro template),
|
||||
- a phrase layer + per-section density budgets for visual planning.
|
||||
|
||||
Output is the canonical `audiomap.json` documented in the skill.
|
||||
|
||||
Usage:
|
||||
python3 analyze-beatgrid.py track.mp3 -o audiomap.json
|
||||
python3 analyze-beatgrid.py track.mp3 --print # also print a readable brief
|
||||
|
||||
Deps: ffmpeg/ffprobe on PATH + librosa, numpy, soundfile (band-split heuristics,
|
||||
no learned models / no madmom).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import librosa
|
||||
import numpy as np
|
||||
import soundfile as sf
|
||||
|
||||
SR = 22050
|
||||
HOP = 512 # ~23 ms frames
|
||||
AUDIOMAP_VERSION = 2
|
||||
|
||||
|
||||
# ── decode ────────────────────────────────────────────────────────────────
|
||||
def load_audio(path: str) -> tuple[np.ndarray, int, float]:
|
||||
"""Decode any ffmpeg-readable file to mono float32 @ SR via a temp wav."""
|
||||
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
||||
wav = tmp.name
|
||||
subprocess.run(
|
||||
["ffmpeg", "-y", "-i", path, "-ac", "1", "-ar", str(SR), wav],
|
||||
capture_output=True, check=True,
|
||||
)
|
||||
y, sr = sf.read(wav, dtype="float32")
|
||||
Path(wav).unlink(missing_ok=True)
|
||||
if y.ndim > 1:
|
||||
y = y.mean(axis=1)
|
||||
return y, sr, len(y) / sr
|
||||
|
||||
|
||||
# ── tempo + beat grid + downbeat phase ──────────────────────────────────────
|
||||
def beat_grid(y: np.ndarray, sr: int) -> dict:
|
||||
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr, hop_length=HOP, units="frames")
|
||||
beats = librosa.frames_to_time(beat_frames, sr=sr, hop_length=HOP)
|
||||
return {"bpm": float(np.atleast_1d(tempo)[0]), "beats": beats, "beat_frames": beat_frames}
|
||||
|
||||
|
||||
def _norm_flux(band: np.ndarray) -> np.ndarray:
|
||||
"""Positive first-difference (onset flux) of a band-energy curve, normalized."""
|
||||
flux = np.maximum(0.0, np.diff(np.sqrt(band), prepend=band[:1]))
|
||||
return flux / (flux.max() + 1e-9)
|
||||
|
||||
|
||||
def band_energy_curves(y: np.ndarray, sr: int) -> dict:
|
||||
"""Per-frame band energy + per-band normalized onset flux (for drum typing)."""
|
||||
S = np.abs(librosa.stft(y, hop_length=HOP)) ** 2
|
||||
freqs = librosa.fft_frequencies(sr=sr)
|
||||
# Tight drum bands: kick fundamental, snare body, hihat sizzle. Narrow bands
|
||||
# keep one drum's transient from leaking into another's flux on a full mix.
|
||||
low = (freqs < 150) # kick
|
||||
mid = (freqs >= 150) & (freqs < 900) # snare body
|
||||
high = (freqs >= 5000) # hihat / cymbal
|
||||
e_low, e_mid, e_high = S[low].sum(axis=0), S[mid].sum(axis=0), S[high].sum(axis=0)
|
||||
return {
|
||||
"S": S,
|
||||
"low": e_low, "mid": e_mid, "high": e_high,
|
||||
"total": S.sum(axis=0) + 1e-9,
|
||||
"flux_low": _norm_flux(e_low), "flux_mid": _norm_flux(e_mid), "flux_high": _norm_flux(e_high),
|
||||
"flatness": librosa.feature.spectral_flatness(S=np.sqrt(S))[0],
|
||||
"centroid": librosa.feature.spectral_centroid(S=np.sqrt(S), sr=sr)[0],
|
||||
"n": S.shape[1],
|
||||
}
|
||||
|
||||
|
||||
def downbeat_phase(beat_frames: np.ndarray, bc: dict, beats_per_bar: int = 4) -> int:
|
||||
"""Pick the bar phase whose beats carry the most KICK (low-band) energy."""
|
||||
kick = bc["low"] / bc["total"]
|
||||
best_p, best_score = 0, -1.0
|
||||
for p in range(beats_per_bar):
|
||||
idx = [bf for i, bf in enumerate(beat_frames) if (i - p) % beats_per_bar == 0]
|
||||
idx = [min(f, bc["n"] - 1) for f in idx]
|
||||
score = float(np.sum([kick[f] for f in idx])) if idx else 0.0
|
||||
if score > best_score:
|
||||
best_p, best_score = p, score
|
||||
return best_p
|
||||
|
||||
|
||||
# ── metrical position: strong / weak / syncopated / off-grid ─────────────────
|
||||
# 16-step bar grid (4 beats x 4 sixteenths). Strength by metrical weight.
|
||||
GRID_CLASS = {0: "strong", 8: "strong", 4: "weak", 12: "weak",
|
||||
2: "weak", 6: "weak", 10: "weak", 14: "weak"} # else (odd 16ths) -> syncopated
|
||||
|
||||
|
||||
def classify_metric(t: float, beats: np.ndarray, phase: int, bpb: int = 4) -> tuple:
|
||||
"""Return (grid_class, bar, beat_in_bar, step16) for a time t."""
|
||||
if len(beats) < 2:
|
||||
return "off-grid", -1, -1, -1
|
||||
i = int(np.searchsorted(beats, t) - 1)
|
||||
i = max(0, min(i, len(beats) - 2))
|
||||
beat_dur = beats[i + 1] - beats[i]
|
||||
frac = (t - beats[i]) / max(beat_dur, 1e-6) # 0..1 within the beat
|
||||
sixteenth = int(round(frac * 4)) % 4 # nearest 16th in beat
|
||||
carry = 1 if round(frac * 4) >= 4 else 0
|
||||
beat_idx = i + carry
|
||||
beat_in_bar = (beat_idx - phase) % bpb # 0..3
|
||||
bar = (beat_idx - phase) // bpb
|
||||
step16 = beat_in_bar * 4 + sixteenth # 0..15
|
||||
# distance to the nearest 16th line (in seconds) → off-grid test
|
||||
nearest = beats[i] + (round(frac * 4) / 4) * beat_dur
|
||||
if abs(t - nearest) > 0.5 * (beat_dur / 4):
|
||||
return "off-grid", bar, beat_in_bar + 1, step16
|
||||
return GRID_CLASS.get(step16, "syncopated"), bar, beat_in_bar + 1, step16
|
||||
|
||||
|
||||
# ── drum classification (band-split heuristic) ──────────────────────────────
|
||||
def frame_at(t: float, sr: int, n: int) -> int:
|
||||
return min(int(round(t * sr / HOP)), n - 1)
|
||||
|
||||
|
||||
def classify_drum(t: float, bc: dict, sr: int) -> tuple:
|
||||
"""(drum_type, energy_norm, feel): which band's onset TRANSIENT dominates.
|
||||
|
||||
Uses per-band normalized flux (relative transient strength), the standard
|
||||
way to separate kick (low) / snare (mid+noise) / hihat (high). Falls back to
|
||||
glitch for noisy non-harmonic bursts and perc when no band clearly leads.
|
||||
"""
|
||||
f = frame_at(t, sr, bc["n"])
|
||||
win = slice(max(0, f - 1), min(bc["n"], f + 2))
|
||||
fl = float(bc["flux_low"][win].max())
|
||||
fm = float(bc["flux_mid"][win].max())
|
||||
fh = float(bc["flux_high"][win].max())
|
||||
lo = float(bc["low"][win].mean()); md = float(bc["mid"][win].mean())
|
||||
hi = float(bc["high"][win].mean()); tot = float(bc["total"][win].mean())
|
||||
flat = float(bc["flatness"][win].mean())
|
||||
lr, mr, hr = lo / tot, md / tot, hi / tot
|
||||
|
||||
fluxes = {"kick": fl, "snare": fm, "hihat": fh}
|
||||
lead = max(fluxes, key=fluxes.get)
|
||||
lead_val = fluxes[lead]
|
||||
if lead_val < 0.06: # no real transient → texture/perc
|
||||
drum = "glitch" if flat > 0.30 else "perc"
|
||||
elif lead == "snare" and flat > 0.30 and mr < 0.30:
|
||||
drum = "glitch" # mid-band but noisy & thin → scratch/glitch
|
||||
else:
|
||||
drum = lead
|
||||
# feel (frequency character)
|
||||
has_bot, has_top, has_mid = lr > 0.30, hr > 0.20, mr > 0.30
|
||||
feel = ("full" if has_bot and has_top and has_mid else
|
||||
"heavy" if has_bot and not has_top else
|
||||
"bright" if has_top and not has_bot else
|
||||
"intimate" if has_mid else "sparse")
|
||||
return drum, tot, feel
|
||||
|
||||
|
||||
# ── energy structure (RMS @1s) + sections + key moments + builds ────────────
|
||||
def energy_structure(y: np.ndarray, sr: int, dur: float, first_onset: float = 0.0) -> dict:
|
||||
rms = librosa.feature.rms(y=y, hop_length=sr)[0] # ~1s frames
|
||||
rms = rms / (rms.max() + 1e-9)
|
||||
norms = rms.tolist()
|
||||
|
||||
def lvl(n):
|
||||
return "VOID" if n < 0.2 else "LOW" if n < 0.4 else "MEDIUM" if n < 0.65 else "HIGH"
|
||||
|
||||
phases, cur, cs = [], None, 0
|
||||
for i, n in enumerate(norms):
|
||||
l = lvl(n)
|
||||
if l != cur:
|
||||
if cur:
|
||||
phases.append({"s": cs, "e": i, "lvl": cur})
|
||||
cur, cs = l, i
|
||||
if cur:
|
||||
phases.append({"s": cs, "e": len(norms), "lvl": cur})
|
||||
|
||||
moments = []
|
||||
for i in range(1, len(norms)):
|
||||
d = norms[i] - norms[i - 1]
|
||||
if abs(d) > 0.12:
|
||||
moments.append({"t": i, "kind": "DROP" if d < 0 else "SURGE", "delta": round(d, 2)})
|
||||
moments.sort(key=lambda m: abs(m["delta"]), reverse=True)
|
||||
|
||||
# hard stop: a HIGH→low cliff (a sudden stop) in the back third
|
||||
hard_stops = [m for m in moments if m["kind"] == "DROP" and m["t"] > dur * 0.6 and m["delta"] < -0.25]
|
||||
|
||||
# NO forced Intro/Build/Drop/Outro template. The energy phases (audio-driven runs of
|
||||
# one energy level, variable count) are the raw structural blocks. The Music Reader
|
||||
# (LLM) decides the actual sections — count, boundaries, and free-form names — from
|
||||
# these phases + key_moments + rolls + hard_stops + phrases. Sections are
|
||||
# interpretation; only the timing they snap to is fact.
|
||||
phases_sec = []
|
||||
for p in phases:
|
||||
seg = norms[p["s"]:max(p["s"] + 1, p["e"])]
|
||||
phases_sec.append({
|
||||
"start": float(p["s"]),
|
||||
"end": float(min(p["e"], round(dur, 1))),
|
||||
"level": p["lvl"],
|
||||
"energy": round(float(np.mean(seg)) if seg else 0.0, 2),
|
||||
})
|
||||
|
||||
return {"norms": [round(n, 2) for n in norms], "phases": phases_sec,
|
||||
"moments": moments[:8], "hard_stops": hard_stops}
|
||||
|
||||
|
||||
# ── rolls / fills (localized rapid-onset runs) ───────────────────────────────
|
||||
# A roll is where choreography should switch from discrete hits to a continuous /
|
||||
# cascading visual (per-letter cascade, stagger). Derived straight from the onset
|
||||
# stream — runs never overlap, so no dedup is needed (unlike a band-energy detector).
|
||||
ROLL_MIN_HITS = 4
|
||||
ROLL_CONT = 0.55 # × beat_dur: gap up to ~half a beat still keeps a run alive
|
||||
ROLL_ACCEPT = 0.42 # × beat_dur: mean spacing denser than an 8th note counts
|
||||
ROLL_DEDUP = 0.08 # seconds: merge onsets closer than a 32nd (double-trigger)
|
||||
|
||||
|
||||
def detect_rolls(events: list, beat_dur: float) -> list:
|
||||
"""Runs of >=4 onsets whose MEAN spacing is denser than an 8th note. Tuned so a
|
||||
full hihat/snare roll is captured as ONE span (not fragmented down to its tail),
|
||||
while a sparse groove stays out — validated against the golden 7.5-9.5s roll.
|
||||
The linear scan means runs never overlap (no LEGACY-style double-counting)."""
|
||||
cont = beat_dur * ROLL_CONT # max gap that keeps a run alive
|
||||
accept = beat_dur * ROLL_ACCEPT # max MEAN gap for a run to count
|
||||
# collapse onset double-triggers (two onsets < a 32nd apart = one hit) so a
|
||||
# held/sparse passage can't masquerade as a roll on a duplicated transient.
|
||||
ev = []
|
||||
for e in events:
|
||||
if ev and e["t"] - ev[-1]["t"] <= ROLL_DEDUP:
|
||||
if e.get("energy", 0) > ev[-1].get("energy", 0):
|
||||
ev[-1] = e
|
||||
continue
|
||||
ev.append(e)
|
||||
times = [e["t"] for e in ev]
|
||||
n = len(times)
|
||||
rolls, i = [], 0
|
||||
while i < n - 1:
|
||||
j = i
|
||||
while j + 1 < n and (times[j + 1] - times[j]) <= cont:
|
||||
j += 1
|
||||
if j - i + 1 >= ROLL_MIN_HITS:
|
||||
gaps = [times[k + 1] - times[k] for k in range(i, j)]
|
||||
if sum(gaps) / len(gaps) <= accept:
|
||||
t0, t1 = times[i], times[j]
|
||||
half = len(gaps) // 2
|
||||
accel = (half >= 1 and
|
||||
sum(gaps[half:]) / (len(gaps) - half) <
|
||||
sum(gaps[:half]) / half * 0.85)
|
||||
dcount: dict[str, int] = {}
|
||||
for e in ev[i:j + 1]:
|
||||
dcount[e["drum"]] = dcount.get(e["drum"], 0) + 1
|
||||
rolls.append({
|
||||
"start": round(t0, 3), "end": round(t1, 3),
|
||||
"dur_sec": round(t1 - t0, 3),
|
||||
"hits": j - i + 1,
|
||||
"rate_per_min": round((j - i) / max(t1 - t0, 1e-6) * 60),
|
||||
"kind": "accel-roll" if accel else ("sustained-fill" if t1 - t0 > 1.2 else "fill"),
|
||||
"drum": max(dcount, key=dcount.get),
|
||||
})
|
||||
i = j + 1
|
||||
return rolls
|
||||
|
||||
|
||||
# ── per-section spectral character (sustained "feel") ────────────────────────
|
||||
# Coarse, reliable bands for how a SECTION sounds (not the noisy per-second dump).
|
||||
# Distinct from a per-event `feel`, which is the transient color of a single hit.
|
||||
FEEL_BANDS = [("sub", 0, 60), ("bass", 60, 250), ("low_mid", 250, 800),
|
||||
("mid", 800, 2500), ("presence", 2500, 6000), ("air", 6000, 1e9)]
|
||||
|
||||
|
||||
def annotate_section_feel(bc: dict, sr: int, sections: list) -> None:
|
||||
"""Attach {character, bands} to each energy phase from its sustained band balance."""
|
||||
S, n = bc["S"], bc["n"]
|
||||
freqs = librosa.fft_frequencies(sr=sr)
|
||||
fps = sr / HOP
|
||||
masks = [(name, (freqs >= lo) & (freqs < hi)) for name, lo, hi in FEEL_BANDS]
|
||||
for s in sections:
|
||||
f0 = int(s["start"] * fps)
|
||||
f1 = min(max(f0 + 1, int(s["end"] * fps)), n)
|
||||
seg = S[:, f0:f1]
|
||||
if seg.shape[1] == 0 or s.get("energy", 0) < 0.15:
|
||||
s["feel"] = {"character": "sparse", "bands": []}
|
||||
continue
|
||||
en = {name: float(seg[m].sum()) for name, m in masks}
|
||||
tot = sum(en.values()) + 1e-9
|
||||
ratios = {name: en[name] / tot for name in en}
|
||||
present = sorted([bn for bn, r in ratios.items() if r > 0.12],
|
||||
key=lambda bn: -ratios[bn])
|
||||
lo = ratios["sub"] + ratios["bass"]
|
||||
hi = ratios["presence"] + ratios["air"]
|
||||
mid = ratios["low_mid"] + ratios["mid"]
|
||||
char = ("heavy" if lo > 0.5 else "bright" if hi > 0.45 else
|
||||
"full" if lo > 0.25 and hi > 0.25 else
|
||||
"warm" if mid > 0.5 else "sparse")
|
||||
s["feel"] = {"character": char, "bands": present}
|
||||
|
||||
|
||||
# ── audiomap enrichment: phrase layer + section density budgets ─────────────
|
||||
def round3(n: float) -> float:
|
||||
return round(float(n), 3)
|
||||
|
||||
|
||||
def derive_phrases(downbeats: list[float], phrase_bars: int, duration_sec: float) -> list:
|
||||
"""Group downbeats into phrase spans of `phrase_bars` bars."""
|
||||
phrases = []
|
||||
if not downbeats:
|
||||
return phrases
|
||||
index = 0
|
||||
for i in range(0, len(downbeats), phrase_bars):
|
||||
start = downbeats[i]
|
||||
next_idx = i + phrase_bars
|
||||
end = downbeats[next_idx] if next_idx < len(downbeats) else duration_sec
|
||||
phrases.append({
|
||||
"index": index,
|
||||
"start": round3(start),
|
||||
"end": round3(end),
|
||||
"bars": min(phrase_bars, len(downbeats) - i),
|
||||
})
|
||||
index += 1
|
||||
return phrases
|
||||
|
||||
|
||||
def count_in(times: list[float], start: float, end: float) -> int:
|
||||
return sum(1 for t in times if t >= start - 1e-6 and t < end - 1e-6)
|
||||
|
||||
|
||||
def derive_phase_budgets(timeline: dict) -> list:
|
||||
"""Attach an objective density read to each energy phase.
|
||||
|
||||
Density is a fact (onsets-per-second + rolls). It is a hint for how much visual
|
||||
content a span can hold; it does not set timing or sections. The Music Reader uses
|
||||
these phases to decide the actual sections.
|
||||
"""
|
||||
phases = timeline.get("energy_phases", [])
|
||||
onset_times = [e["t"] for e in timeline.get("events", [])]
|
||||
rolls = timeline.get("rolls", [])
|
||||
hard_stops = timeline.get("hard_stops", [])
|
||||
|
||||
out = []
|
||||
for s in phases:
|
||||
span = max(1e-6, float(s.get("end", 0)) - float(s.get("start", 0)))
|
||||
onsets = count_in(onset_times, s["start"], s["end"])
|
||||
ph_rolls = [
|
||||
{"start": r["start"], "end": r["end"], "kind": r["kind"], "drum": r["drum"]}
|
||||
for r in rolls
|
||||
if r["start"] < s["end"] - 1e-6 and r["end"] > s["start"] + 1e-6
|
||||
]
|
||||
ph_stops = [
|
||||
h["t"]
|
||||
for h in hard_stops
|
||||
if h["t"] >= s["start"] - 1e-6 and h["t"] < s["end"] + 1e-6
|
||||
]
|
||||
|
||||
if s.get("energy", 0) < 0.2 or onsets < 6:
|
||||
density = "sparse"
|
||||
elif onsets >= 18 or ph_rolls:
|
||||
density = "dense"
|
||||
else:
|
||||
density = "medium"
|
||||
|
||||
enriched = dict(s)
|
||||
enriched["onsets"] = onsets
|
||||
enriched["onsetRate"] = round(onsets / span, 1)
|
||||
enriched["rolls"] = ph_rolls
|
||||
enriched["hardStops"] = ph_stops
|
||||
enriched["density"] = density
|
||||
out.append(enriched)
|
||||
return out
|
||||
|
||||
|
||||
def finalize_audiomap(timeline: dict, phrase_bars: int = 4) -> dict:
|
||||
downbeats = timeline.get("grid", {}).get("downbeats_sec", [])
|
||||
duration_sec = timeline.get("audio", {}).get("duration_sec", 0)
|
||||
energy_phases = derive_phase_budgets(timeline)
|
||||
phrases = derive_phrases(downbeats, phrase_bars, duration_sec)
|
||||
return {
|
||||
"version": AUDIOMAP_VERSION,
|
||||
"phraseBars": phrase_bars,
|
||||
**timeline,
|
||||
"energy_phases": energy_phases,
|
||||
"phrases": phrases,
|
||||
}
|
||||
|
||||
|
||||
# ── main ────────────────────────────────────────────────────────────────────
|
||||
def analyze(path: str, phrase_bars: int = 4) -> dict:
|
||||
y, sr, dur = load_audio(path)
|
||||
bg = beat_grid(y, sr)
|
||||
bc = band_energy_curves(y, sr)
|
||||
phase = downbeat_phase(bg["beat_frames"], bc)
|
||||
beats = bg["beats"]
|
||||
downbeats = [float(beats[i]) for i in range(len(beats)) if (i - phase) % 4 == 0]
|
||||
|
||||
# onsets → events
|
||||
onset_t = librosa.onset.onset_detect(
|
||||
y=y, sr=sr, hop_length=HOP, units="time", backtrack=True
|
||||
)
|
||||
en_at = bc["total"]
|
||||
en_max = float(en_at.max()) + 1e-9
|
||||
events = []
|
||||
for t in onset_t:
|
||||
gclass, bar, bib, step16 = classify_metric(float(t), beats, phase)
|
||||
drum, energy, feel = classify_drum(float(t), bc, sr)
|
||||
f = frame_at(float(t), sr, bc["n"])
|
||||
events.append({
|
||||
"t": round(float(t), 3),
|
||||
"bar": int(bar), "beat_in_bar": int(bib), "step16": int(step16),
|
||||
"grid": gclass, "drum": drum,
|
||||
"energy": round(float(en_at[f]) / en_max, 2), "feel": feel,
|
||||
"special": None,
|
||||
})
|
||||
|
||||
first_onset = next((float(t) for t in onset_t if t >= 2.0), 0.0)
|
||||
es = energy_structure(y, sr, dur, first_onset)
|
||||
|
||||
# tag specials onto nearby events
|
||||
for hs in es["hard_stops"]:
|
||||
for e in events:
|
||||
if abs(e["t"] - hs["t"]) < 0.6:
|
||||
e["special"] = "hard_stop"
|
||||
# riser: events inside a 1.5s+ rising-energy run that precedes a SURGE
|
||||
surges = [m["t"] for m in es["moments"] if m["kind"] == "SURGE"]
|
||||
for st in surges:
|
||||
for e in events:
|
||||
if st - 2.0 <= e["t"] < st and e["special"] is None and e["drum"] in ("perc", "glitch"):
|
||||
e["special"] = "riser"
|
||||
|
||||
# rolls / fills + whether each leads straight into a surge/drop (cascade cue)
|
||||
beat_dur = float(np.median(np.diff(beats))) if len(beats) > 1 else 60.0 / max(bg["bpm"], 1e-6)
|
||||
rolls = detect_rolls(events, beat_dur)
|
||||
for r in rolls:
|
||||
r["leads_to"] = next((m["kind"] for m in es["moments"]
|
||||
if 0 <= m["t"] - r["end"] <= 1.2), None)
|
||||
# near-silent windows (= VOID energy phases) — convenience for "hold / breathe"
|
||||
silences = [{"start": p["start"], "end": p["end"]}
|
||||
for p in es["phases"] if p["level"] == "VOID"]
|
||||
# per-phase sustained spectral character (how each energy block FEELS)
|
||||
annotate_section_feel(bc, sr, es["phases"])
|
||||
|
||||
n_drum = {}
|
||||
for e in events:
|
||||
n_drum[e["drum"]] = n_drum.get(e["drum"], 0) + 1
|
||||
n_grid = {}
|
||||
for e in events:
|
||||
n_grid[e["grid"]] = n_grid.get(e["grid"], 0) + 1
|
||||
|
||||
summary = (f"{bg['bpm']:.0f} BPM · {len(beats)} beats / {len(downbeats)} bars · "
|
||||
f"{len(events)} events ({n_drum}) · {len(rolls)} rolls · "
|
||||
f"{len(es['phases'])} energy phases · {dur:.1f}s")
|
||||
|
||||
timeline = {
|
||||
"summary": summary,
|
||||
"audio": {"path": path, "duration_sec": round(dur, 3), "sr": sr},
|
||||
"tempo": {"bpm": round(bg["bpm"], 1), "beats_per_bar": 4,
|
||||
"downbeat_phase": phase, "n_beats": len(beats), "n_bars": len(downbeats)},
|
||||
"grid": {"beats_sec": [round(float(b), 3) for b in beats],
|
||||
"downbeats_sec": [round(b, 3) for b in downbeats]},
|
||||
"energy_phases": es["phases"],
|
||||
"key_moments": es["moments"],
|
||||
"hard_stops": es["hard_stops"],
|
||||
"rolls": rolls,
|
||||
"silences": silences,
|
||||
"stats": {"drum_counts": n_drum, "grid_counts": n_grid},
|
||||
"events": events,
|
||||
}
|
||||
return finalize_audiomap(timeline, phrase_bars)
|
||||
|
||||
|
||||
def print_brief(d: dict) -> None:
|
||||
print(f"\n{d['summary']}\n{'='*70}")
|
||||
print("ENERGY PHASES (audio-driven blocks; the Music Reader names the sections)")
|
||||
for s in d.get("energy_phases", []):
|
||||
feel = s.get("feel", {})
|
||||
bands = ",".join(feel.get("bands", []))
|
||||
print(f" {s['start']:5.1f}-{s['end']:5.1f}s {s.get('level', ''):6s} energy={s.get('energy')} "
|
||||
f"{feel.get('character', ''):6s} [{bands}] {s.get('density', '?')}")
|
||||
print("PHRASES")
|
||||
for p in d.get("phrases", []):
|
||||
print(f" #{p['index']} {p['start']:5.2f}-{p['end']:5.2f}s bars={p['bars']}")
|
||||
print("KEY MOMENTS")
|
||||
for m in d["key_moments"]:
|
||||
print(f" {m['t']:3d}s {m['kind']:5s} Δ{m['delta']:+.2f}")
|
||||
print(f"HARD STOPS: {[h['t'] for h in d['hard_stops']]}")
|
||||
print("ROLLS / FILLS")
|
||||
for r in d.get("rolls", []):
|
||||
lead = f" → {r['leads_to']}" if r.get("leads_to") else ""
|
||||
print(f" {r['start']:6.2f}-{r['end']:5.2f}s {r['hits']:2d} hits @ {r['rate_per_min']:4d}/min "
|
||||
f"{r['kind']:10s} ({r['drum']}){lead}")
|
||||
print(f"SILENCES: {[(s['start'], s['end']) for s in d.get('silences', [])]}")
|
||||
print(f"DRUM COUNTS: {d['stats']['drum_counts']} GRID: {d['stats']['grid_counts']}")
|
||||
print(f"\nEVENTS ({len(d['events'])}) [t · bar:beat · grid · drum · energy · special]")
|
||||
for e in d["events"]:
|
||||
sp = f" <{e['special']}>" if e["special"] else ""
|
||||
print(f" {e['t']:6.2f}s b{e['bar']}:{e['beat_in_bar']} {e['grid']:3s} "
|
||||
f"{e['drum']:6s} e={e['energy']:.2f} {e['feel']:8s}{sp}")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("audio")
|
||||
ap.add_argument("-o", "--out", default=None)
|
||||
ap.add_argument("--phrase-bars", type=int, default=4)
|
||||
ap.add_argument("--print", action="store_true", dest="do_print")
|
||||
a = ap.parse_args()
|
||||
d = analyze(a.audio, phrase_bars=a.phrase_bars)
|
||||
if a.out:
|
||||
Path(a.out).write_text(json.dumps(d, ensure_ascii=False, indent=2))
|
||||
dens = " ".join(f"{s.get('level', '?')}:{s.get('density', '?')}" for s in d.get("energy_phases", []))
|
||||
print(
|
||||
f"[analyze-beatgrid] wrote audiomap {a.out} · {len(d.get('energy_phases', []))} phases · density [{dens}]",
|
||||
file=sys.stderr,
|
||||
)
|
||||
if a.do_print or not a.out:
|
||||
print_brief(d)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,128 @@
|
||||
# Card Flyby · accelerating 3D deck cascade — `card-flyby`
|
||||
|
||||
A depth column of **N cards** rolls **forward** through perspective. On each landing
|
||||
beat the next card **tumbles up into the front slot** and **wipes in** its solid colored
|
||||
face (angled clip-path), the previous front card **tumbles forward + falls toward the
|
||||
camera** on exit, and the cards behind **advance one slot**. Dwells **shrink card-to-card**,
|
||||
so the deck reads as an **accelerating rush** into a **held final card**.
|
||||
|
||||
> **Origin — sandbox, not a golden-sample reverse.** Unlike the other catalog templates,
|
||||
> this one was authored from the **`card-flyby` sandbox** composition (a Shader-Deck-style
|
||||
> flyby), so there is **no source `audiomap.json` / Gemini read**. The match-face is a
|
||||
> **hypothesis** about which music the look fits, and `card.json → examples[].synthetic`
|
||||
> flags its cadence as design-intent. The first time this template is matched to a real
|
||||
> reversed group, add that group as a real `examples[]` entry and tighten `requires`.
|
||||
|
||||
## Files
|
||||
|
||||
```
|
||||
card-flyby/
|
||||
card.json ← the spec (match-face + build-face) · status: promoted
|
||||
index.html ← reference impl (parameterized GSAP; data-driven deck)
|
||||
program.json ← the default 6-card deck + landing schedule (standalone, editable)
|
||||
assets/gsap.min.js ← bundled GSAP (offline-safe)
|
||||
renders/recreate.mp4 ← rendered proof @30fps (the default deck)
|
||||
```
|
||||
|
||||
No fonts are bundled — the look uses a system grotesque stack (`"Inter", "Helvetica
|
||||
Neue", Arial`). The original sandbox pulled Inter from Google Fonts + GSAP from a CDN
|
||||
and used a grab-bag of clashing per-card hexes; this promoted impl **drops the remote
|
||||
deps** (offline), makes the formerly-hardcoded deck **data-driven**, and replaces the
|
||||
ad-hoc colors with a cohesive **`theme` palette system**.
|
||||
|
||||
## How it moves
|
||||
|
||||
The scene carries a **static yaw** (side tilt); the cards' own **`rotateX`** drives the
|
||||
tumble. Depth comes from **perspective (Z translation)** plus aggressive `rotateX` on the
|
||||
cards behind — the rear card lies almost flat (~84°), each step closer rotates more
|
||||
upright, the front card is level (0°) and face-on. On exit a card continues _past_
|
||||
upright into a face-down tumble (`rotX → -88°`) while dropping down + toward the lens.
|
||||
|
||||
| slot | role | rotX | what it is |
|
||||
| --------- | ------- | ------- | ------------------------------------------------------- |
|
||||
| `far` | back | 84° | a card just entered the column (invisible, opacity 0) |
|
||||
| `s3`→`s1` | depth | 66°→22° | the rolling-forward column (opacity ramps in) |
|
||||
| `s0` | front | 0° | upright, face-on — **wipes in its solid face here** |
|
||||
| `exit` | leaving | −88° | tumbles forward + falls down + toward camera, fades out |
|
||||
|
||||
A card's pose is a pure function of how many slots it sits **behind the current front
|
||||
card** (`poseForRel(rel)`), so the column stays correctly depth-sorted and **any card
|
||||
count just works** (z-index is set instantly at each swap — CSS can't depth-sort
|
||||
non-intersecting planes). The default deck is 6 cards over 6.0s.
|
||||
|
||||
## Timing (`beat_map` in `card.json` / `landings`)
|
||||
|
||||
Content lives in `cards`; musical **timing** lives in `landings` — **one beat per card**,
|
||||
absolute audio seconds. The default schedule `[0.40, 1.70, 2.70, 3.45, 4.00, 4.40]`
|
||||
**accelerates** (gaps `1.30 → 1.00 → 0.75 → 0.55 → 0.40`); the final card lands early
|
||||
enough to hold ~1.6s before the cut. Each landing tween **leads its beat** by its own
|
||||
duration (`dur_i = clamp(0.32 · gap_into_i, 0.12, 0.42)`) so the card arrives _on_ the
|
||||
hit; the face wipe runs over the last ~85% of that window.
|
||||
|
||||
Omit `landings` and an accelerating schedule is **auto-derived** from the card count +
|
||||
duration (geometric ~0.78× gap decay) — so a 3- or 9-card deck cascades correctly with
|
||||
no hand timing.
|
||||
|
||||
## Themes (the look knob)
|
||||
|
||||
`theme` picks a **cohesive palette** — one temperature/saturation family, so any card
|
||||
count reads as a _designed_ set (the deck cycles the ramp in order; each face also gets a
|
||||
gentle top→bottom tonal gradient for depth). White-on-card stays AA at the card type
|
||||
sizes. Set `theme` and you have a whole new look in one knob.
|
||||
|
||||
| `theme` | family |
|
||||
| -------------------- | --------------------------------------------------------------------- |
|
||||
| `aurora` _(default)_ | cool jewel arc — teal → ocean → indigo → violet → plum, on blue-black |
|
||||
| `ember` | warm sunset arc — wine → brick → rust → amber → ochre → bronze |
|
||||
| `mono` | sleek monochrome blue staircase (dark → mid) |
|
||||
| `slate` | muted cool slate-grays — understated / editorial |
|
||||
|
||||
Add a palette by appending to the `THEMES` table in `index.html` (`bg` + `ink` + a
|
||||
`colors[]` ramp).
|
||||
|
||||
## Parameters (swap freely)
|
||||
|
||||
- `theme` — palette preset: `aurora` | `ember` | `mono` | `slate` (default `aurora`).
|
||||
- `bgColor` — override the radial field base. Empty → the theme's bg.
|
||||
- `cards` — **JSON array** of `{ title, color? }`; `title` is the big centered hero (the
|
||||
only copy on each card). Its length sets the deck depth. `color` is **optional** — omit
|
||||
it and the card takes the next color from the theme ramp (cohesive by default); set it
|
||||
to override one card. Empty → the built-in 6-card demo deck. (See `program.json`.)
|
||||
- `landings` — **JSON array** of land beats (abs seconds), one per card. Empty → derived.
|
||||
- `yaw` — static scene side-tilt in degrees (default `−12`; `0` = face-on).
|
||||
|
||||
Fill them with `--variables` (read inside the comp via `window.__hyperframes.getVariables()`):
|
||||
|
||||
```bash
|
||||
npx hyperframes render card-flyby -f 30 --strict-variables \
|
||||
--variables '{"theme":"ember","cards":"[{\"title\":\"BLACKOUT\"},{\"title\":\"THE HEIST\"}]","yaw":-8}'
|
||||
```
|
||||
|
||||
## Match (when the Director should reach for it)
|
||||
|
||||
`structural_type: per_onset_sequential` — a **stream of discrete onsets that
|
||||
accelerate** (a build into a downbeat) where you want to flash a **sequence of whole
|
||||
cards** (titles / projects / posters / video tiles), one per hit, climaxing on a held
|
||||
card. Discriminated from the typewriter / logo-sting `per_onset_sequential` templates by
|
||||
revealing **whole cards** (not letters/words of one message) and by the **accelerating
|
||||
cadence**. Put the card you want held longest on the strongest final hit. If the grid
|
||||
goes quiet (`onset_gap_bars ≥ ~1.5`) this is the wrong template — use a hold template.
|
||||
|
||||
> Candidate finer `structural_type`: an `accel-roll` flavor of `roll_cascade` (the
|
||||
> shrinking-dwell build) — flagged in `card.json` for catalog review, not yet a vocab
|
||||
> value. Proposed motion verbs `deck_advance` / `wipe_reveal` / `tumble_fall` are
|
||||
> likewise flagged.
|
||||
|
||||
## Verify
|
||||
|
||||
```bash
|
||||
npx hyperframes lint card-flyby # clean (1 inherent window.__timelines note)
|
||||
npx hyperframes validate card-flyby # no console errors · text passes WCAG AA
|
||||
npx hyperframes render card-flyby -f 30
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
`promoted` — in the catalog, matchable by the Director. Because it is sandbox-origin (no
|
||||
golden-sample provenance), the next reviewer pass should attach a **real reversed group**
|
||||
as an `examples[]` entry and tighten `match.requires` against it.
|
||||
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"id": "card-flyby",
|
||||
"name": "Card Flyby · accelerating 3D deck cascade",
|
||||
"one_line": "A depth column of N cards rolls forward through perspective: on each landing beat the next card tumbles up into the front slot and WIPES in its solid colored face (angled clip-path), the previous front card tumbles forward + falls toward the camera on exit, and the cards behind advance one slot — dwells shrink card-to-card so the deck reads as an accelerating rush into a held final card.",
|
||||
"status": "promoted",
|
||||
"created": "2026-06-17",
|
||||
|
||||
"base_template": {
|
||||
"primitive": "depth_card_column",
|
||||
"notes": "A 3D deck of N cards stacked in a perspective depth column (slots s0=front … s3 + far=back, plus an exit pose). Each card is a CSS wireframe (always present, opacity tracks its slot) over a solid face — a gentle top→bottom tonal gradient (--c1/--c2) — revealed by an angled clip-path wipe (--wipe 0→1). The scene carries a static yaw; the cards' own rotateX drives the tumble. N is DATA (the `cards` array) — the slot engine is rel-based (a card's pose is a pure function of how many slots it sits behind the current front card), so 3 / 6 / 9 cards all 'just work'. COLOR is a `theme` (a cohesive palette ramp cycled across the deck), per-card overridable. Asset-free: wireframe + solid cards + system type, bundled GSAP."
|
||||
},
|
||||
|
||||
"themes": {
|
||||
"_": "Cohesive palette presets (the `theme` param). Each is ONE temperature/saturation family so any card count reads as a designed set — the deck cycles the ramp in order. White-on-card stays AA at the card type sizes. Per-card `color` still overrides.",
|
||||
"aurora": "cool jewel arc — teal → ocean → indigo → violet → plum, on blue-black (DEFAULT)",
|
||||
"ember": "warm sunset arc — wine → brick → rust → amber → ochre → bronze, on warm near-black",
|
||||
"mono": "sleek monochrome blue staircase (dark → mid), on blue-black",
|
||||
"slate": "muted cool slate-grays — understated / editorial, on cool charcoal"
|
||||
},
|
||||
|
||||
"match": {
|
||||
"structural_type": "per_onset_sequential",
|
||||
"requires": {
|
||||
"energy_level": ">=MEDIUM",
|
||||
"has_steady_grid": true,
|
||||
"density": ["medium", "dense"],
|
||||
"onset_gap_bars": "<1.0"
|
||||
},
|
||||
"mood_fit": ["hype", "bold", "elegant", "cinematic", "playful"],
|
||||
"span_bars": [2, 6],
|
||||
"exit_trigger": ["surge", "downbeat", "hard_stop", "end"],
|
||||
"notes": "Reach for this when a section has a STREAM of discrete onsets that ACCELERATE (gaps shrinking / a build into a downbeat) and you want to flash a SEQUENCE of items — a deck of titles, projects, posters, video tiles — one per hit, climaxing on a held card. Each card lands on one onset (per_onset_sequential), so it shares the structural_type with the typewriter / logo-sting templates; it is discriminated by being a SEQUENCE OF WHOLE CARDS (not letters/words of one message) and by the accelerating cadence. The strongest hit (final downbeat / surge) should carry the card you want held longest. Candidate finer type: an `accel-roll` flavor of `roll_cascade` (the shrinking-dwell build) — flagged for catalog review, not yet a vocab value. If the grid goes quiet (onset_gap_bars >= ~1.5) this is the wrong template — use a hold template."
|
||||
},
|
||||
|
||||
"examples": [
|
||||
{
|
||||
"sample": "sandbox",
|
||||
"group": "card-flyby-sandbox",
|
||||
"synthetic": true,
|
||||
"structural_type": "per_onset_sequential",
|
||||
"energy_level": "HIGH",
|
||||
"density": "dense",
|
||||
"cards": 6,
|
||||
"span_sec": [0.0, 6.0],
|
||||
"landings_sec": [0.4, 1.7, 2.7, 3.45, 4.0, 4.4],
|
||||
"landing_gaps_sec": [1.3, 1.0, 0.75, 0.55, 0.4],
|
||||
"cadence": "accelerating (gaps shrink ~0.78× each card); final card holds ~1.6s",
|
||||
"exit_trigger": { "type": "end", "time": 6.0 },
|
||||
"note": "NOT reversed from a golden sample. This template was authored from the `card-flyby` SANDBOX composition (a Shader-Deck-style flyby), so these audio facts are the DESIGN-INTENT cadence (the hand-tuned landing schedule), not values derived from an `audiomap.json`. When this template is matched to a real group, `landings` is bound from that group's onset times (one per card) and the schedule re-derives — see beat_map."
|
||||
}
|
||||
],
|
||||
|
||||
"roles": {
|
||||
"deck_card": {
|
||||
"kind": "asset",
|
||||
"motion": "deck_advance",
|
||||
"anchor": "landings[]",
|
||||
"notes": "Each of the N cards. On every landing beat the whole column advances one slot toward the front (far→s3→s2→s1→s0). A card's pose is a pure function of its slot-distance behind the front card (rel), so the deck stays correctly depth-sorted for any N. PROPOSED verb 'deck_advance' (per-onset one-slot forward roll of a stacked depth column; ~content_swap promoted to a 3D column)."
|
||||
},
|
||||
"front_face": {
|
||||
"kind": "message",
|
||||
"motion": "wipe_reveal",
|
||||
"anchor": "landings[] + ~15% lead",
|
||||
"notes": "As the landing card rolls into s0 (upright, rotX 0), its SOLID colored face — a big CENTERED hero title + a small play glyph — is revealed by an angled clip-path wipe sweeping upper-left→lower-right (--wipe 0→1, ~0.72° diagonal). The title is the only copy on the face (no eyebrow tag / no meta footer). ~05-mask_reveal."
|
||||
},
|
||||
"exit_card": {
|
||||
"kind": "asset",
|
||||
"motion": "tumble_fall",
|
||||
"anchor": "landings[] (the OUTGOING front card)",
|
||||
"notes": "When a new card lands, the previous front card continues FORWARD past upright into a face-down tumble (rotX → -88°) while dropping DOWN and toward the camera (y +620, z +420, scale 1.10) and fading out. PROPOSED verb 'tumble_fall' (forward over-rotate + fall toward lens). Reverse of the incoming roll."
|
||||
},
|
||||
"field": {
|
||||
"kind": "background",
|
||||
"motion": "hold",
|
||||
"anchor": "none",
|
||||
"notes": "A static radial-gradient field behind the deck (default near-black #06070d). Dead still the whole span; the only motion is the deck. negative_space_hold."
|
||||
}
|
||||
},
|
||||
|
||||
"params": {
|
||||
"theme": {
|
||||
"type": "string",
|
||||
"maps_to": "palette (see themes)",
|
||||
"default": "aurora",
|
||||
"notes": "Palette preset: aurora | ember | mono | slate. Sets the field bg + the cohesive card-color ramp the deck cycles + the ink. The fastest knob for a whole new look."
|
||||
},
|
||||
"bgColor": {
|
||||
"type": "color",
|
||||
"maps_to": "field.color (radial gradient base)",
|
||||
"default": "",
|
||||
"notes": "Override the field background. Empty = the theme's bg. The radial centre/edge are derived from it."
|
||||
},
|
||||
"cards": {
|
||||
"type": "string",
|
||||
"maps_to": "deck (engine.cards)",
|
||||
"default": "",
|
||||
"notes": "JSON array of card objects { title, color? }. `title` is the big centered hero (the only required field). Its length sets N (the deck depth). `color` is OPTIONAL — omit it and the card takes the next color from the theme ramp (cohesive by default); set it to override one card. Empty = the built-in 6-card demo deck. THIS is the compose-by-data surface for content: add / drop / reorder cards — no code edit."
|
||||
},
|
||||
"landings": {
|
||||
"type": "string",
|
||||
"maps_to": "beat_map.landings (engine.landings)",
|
||||
"default": "",
|
||||
"notes": "JSON array of absolute audio seconds — ONE landing beat per card (length must equal `cards` length). Empty = an accelerating schedule auto-derived from the card count + duration. Bind these from the matched group's onset times so each card lands on a hit."
|
||||
},
|
||||
"yaw": {
|
||||
"type": "number",
|
||||
"maps_to": "scene.rotateY (deg)",
|
||||
"default": -12,
|
||||
"notes": "Static side-tilt of the whole deck. 0 = face-on; negative = scene rotated so the deck reads from the left."
|
||||
}
|
||||
},
|
||||
|
||||
"beat_map": {
|
||||
"comment": "Musical TIMING lives here; content lives in `cards`. All times are ABSOLUTE audio seconds. One landing per card; per-card transition duration is derived from the gap into each landing (faster as the cadence accelerates).",
|
||||
"landings": [0.4, 1.7, 2.7, 3.45, 4.0, 4.4],
|
||||
"landings_notes": "one per card, in deck order. Bind from the matched group's onset times. The schedule should ACCELERATE (gaps shrinking) for the signature build; the final card lands early enough to HOLD a beat before the cut. If omitted at build time, an accelerating schedule is generated from card count + duration.",
|
||||
"transition_dur_rule": "dur_i = clamp(0.32 * gap_into_i, 0.12, 0.42); each landing tween starts at landing - dur (leads the beat) so the card arrives ON the hit; the face wipe runs over the last ~85% of that window.",
|
||||
"duration": 6.0,
|
||||
"exit_note": "the final card rolls in and HOLDS front-and-center to the end (6.0s); the source then hard-cuts to the next group (fast_cut)."
|
||||
},
|
||||
|
||||
"engine": {
|
||||
"model": "data deck + rel-based slot column. The deck (`cards`) and the landing beats (`landings`) are DATA; the slot poses (s0..far + exit) and the per-landing orchestration are fixed code. `poseForRel(rel)` maps a card's slot-distance behind the current front card to a pose, so the column is always correctly depth-sorted and any N works. z-index is set instantly at each swap (CSS can't depth-sort non-intersecting planes). Compose by editing the `cards` / `landings` DATA — never the slot/orchestration code.",
|
||||
"compose_by": ["theme", "cards", "landings", "yaw", "bgColor"],
|
||||
"extend": "recolor the whole deck via `theme` (cohesive ramp) or one card via its `color`; more cards = more `cards` entries (+ matching `landings`); change the read angle via `yaw`. Add a palette = add an entry to the THEMES table (bg + ink + a colors[] ramp). To change the deck LOOK (slot depths, card size, wipe angle) edit the SLOT table / CSS, not the program."
|
||||
},
|
||||
|
||||
"program_format": {
|
||||
"_": "`cards` is a JSON array of card objects; `landings` is a JSON array of absolute audio seconds, one per card (same length as `cards`).",
|
||||
"card": {
|
||||
"title": "string — the big CENTERED hero title (the only copy on the face)",
|
||||
"color": "string? — OPTIONAL solid face color (CSS color). Omit = next color from the theme ramp."
|
||||
},
|
||||
"landings": "number[] — abs seconds, one landing beat per card, in deck order (accelerating cadence recommended)"
|
||||
},
|
||||
|
||||
"reference_impl": "index.html",
|
||||
"program_data": "program.json (the default 6-card deck + landing schedule as standalone, agent-editable data)",
|
||||
"uses_primitives": [
|
||||
"18-3d_card_flip",
|
||||
"05-mask_reveal",
|
||||
"09-dolly_zoom",
|
||||
"content_swap",
|
||||
"negative_space_hold"
|
||||
],
|
||||
"uses_primitives_notes": "deck_advance / wipe_reveal / tumble_fall are PROPOSED custom phrases the impl defines (a per-onset one-slot forward roll of a stacked 3D depth column; an angled clip-path face reveal; a forward over-rotate + fall toward the lens). 18-3d_card_flip (#18) backs the 3D card transforms; 05-mask_reveal (#05) backs the angled clip-path wipe; 09-dolly_zoom (#09) is the perspective/depth feel; content_swap is the per-onset advance generalized to a depth column; negative_space_hold backs the static field.",
|
||||
|
||||
"bundled_assets": "assets/gsap.min.js (offline GSAP). No fonts bundled — uses a system grotesque stack ('Inter', 'Helvetica Neue', Arial). No remote assets.",
|
||||
|
||||
"transition_out": { "default": "fast_cut", "observed": "fast_cut" },
|
||||
|
||||
"reversed_from": [],
|
||||
"origin": "sandbox",
|
||||
"provenance": {
|
||||
"source": "bgm-golden-sample-reverse/gorup-by-group/card-flyby (Shader-Deck-style horizontal card-flyby SANDBOX)",
|
||||
"note": "Hand-authored design study, NOT reverse-engineered from a golden-sample group — there is no source audiomap / Gemini read. The match-face is therefore a HYPOTHESIS (which music this look fits), not a measured signature; `examples[].synthetic = true` flags the cadence as design-intent. The original sandbox is asset-free but used remote Google-Fonts Inter + a CDN GSAP AND a grab-bag of clashing per-card hexes; this promoted impl drops the remote deps (system fonts + bundled GSAP), makes the deck data-driven (`cards` / `landings`), and replaces the ad-hoc colors with a cohesive `theme` palette system (per-card color optional). Promote-time review should add a REAL example (and tighten `requires`) the first time this template is matched to an actual reversed group."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,527 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en"
|
||||
data-composition-variables='[
|
||||
{"id":"theme", "type":"string", "label":"Palette theme — aurora | ember | mono | slate", "default":"aurora"},
|
||||
{"id":"bgColor", "type":"color", "label":"Stage background override (empty = theme bg)", "default":""},
|
||||
{"id":"cards", "type":"string", "label":"Deck JSON — array of {tag,title,meta,color?}", "default":""},
|
||||
{"id":"landings", "type":"string", "label":"Landing beats JSON — abs seconds, one per card", "default":""},
|
||||
{"id":"yaw", "type":"number", "label":"Scene yaw (deg, side tilt of the whole deck)", "default":-12}
|
||||
]'
|
||||
>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>Card Flyby · accelerating 3D deck cascade — reference impl</title>
|
||||
<script src="./assets/gsap.min.js"></script>
|
||||
<style>
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
background: #06070d;
|
||||
overflow: hidden;
|
||||
}
|
||||
#root {
|
||||
position: relative;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
background: radial-gradient(1300px 820px at 50% 52%, #0d1018 0%, #06070d 70%, #04050a 100%);
|
||||
overflow: hidden;
|
||||
font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
|
||||
}
|
||||
/* .stage carries the perspective; .scene carries the static yaw. The cards' own
|
||||
rotateX drives the tumble-forward — the scene only holds the side tilt. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
perspective: 2400px;
|
||||
perspective-origin: 50% 55%;
|
||||
}
|
||||
.scene {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
transform-style: preserve-3d;
|
||||
transform: rotateY(-12deg);
|
||||
}
|
||||
.card {
|
||||
position: absolute;
|
||||
left: calc(50% - 700px);
|
||||
top: calc(50% - 395px);
|
||||
width: 1400px;
|
||||
height: 790px;
|
||||
border-radius: 32px;
|
||||
will-change: transform, opacity;
|
||||
--wipe: 0;
|
||||
--color: #444;
|
||||
transform-origin: 50% 50%;
|
||||
}
|
||||
/* Wireframe (always present, opacity tracks the slot). */
|
||||
.wire {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 28px;
|
||||
border: 1.5px solid rgba(255, 255, 255, 0.42);
|
||||
box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
|
||||
background: rgba(255, 255, 255, 0.012);
|
||||
overflow: hidden;
|
||||
}
|
||||
.wire .wire-label {
|
||||
position: absolute;
|
||||
left: 68px;
|
||||
top: 60px;
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
.wire .wire-corner {
|
||||
position: absolute;
|
||||
right: 68px;
|
||||
top: 60px;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border: 1.5px solid rgba(255, 255, 255, 0.32);
|
||||
border-radius: 50%;
|
||||
}
|
||||
.wire .wire-bar {
|
||||
position: absolute;
|
||||
left: 68px;
|
||||
right: 68px;
|
||||
bottom: 68px;
|
||||
height: 1.5px;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
/* Solid colored face — revealed via an angled clip-path wipe driven by --wipe.
|
||||
Polygon sweeps upper-left → lower-right at ~72°. wipe=0 collapsed off-element,
|
||||
wipe=1 covers the full card. */
|
||||
.solid {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 28px;
|
||||
/* gentle top→bottom tonal gradient (theme-derived shades) for depth */
|
||||
background: linear-gradient(
|
||||
158deg,
|
||||
var(--c1, var(--color)) 0%,
|
||||
var(--c2, var(--color)) 100%
|
||||
);
|
||||
box-shadow:
|
||||
0 34px 100px rgba(0, 0, 0, 0.55),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.14);
|
||||
overflow: hidden;
|
||||
/* the title is the hero — centered in the card */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 90px 104px;
|
||||
clip-path: polygon(
|
||||
0% 0%,
|
||||
calc(var(--wipe) * 200% - 30%) 0%,
|
||||
calc(var(--wipe) * 200% - 80%) 100%,
|
||||
0% 100%
|
||||
);
|
||||
}
|
||||
.solid::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 28px;
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
rgba(255, 255, 255, 0.13) 0%,
|
||||
rgba(255, 255, 255, 0.03) 40%,
|
||||
rgba(0, 0, 0, 0.14) 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
}
|
||||
.solid .title {
|
||||
font-size: 184px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.035em;
|
||||
line-height: 0.92;
|
||||
color: var(--ink, #ffffff);
|
||||
text-align: center;
|
||||
max-width: 100%;
|
||||
overflow-wrap: break-word;
|
||||
text-wrap: balance;
|
||||
}
|
||||
.solid .play {
|
||||
position: absolute;
|
||||
right: 68px;
|
||||
bottom: 70px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.28);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.solid .play::after {
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 22px solid #ffffff;
|
||||
border-top: 14px solid transparent;
|
||||
border-bottom: 14px solid transparent;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- duration 6.0s = a 6-card accelerating cascade (1 card lands per beat, dwells shrinking) -->
|
||||
<div
|
||||
data-hf-id="hf-cf-root"
|
||||
id="root"
|
||||
data-composition-id="card-flyby"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
data-start="0"
|
||||
data-duration="6.0"
|
||||
data-root="true"
|
||||
>
|
||||
<div data-hf-id="hf-cf-stage" class="stage">
|
||||
<div data-hf-id="hf-cf-scene" class="scene" id="scene"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
// ════════════════════════════════════════════════════════════════════
|
||||
// CARD FLYBY · accelerating 3D deck cascade
|
||||
// ────────────────────────────────────────────────────────────────────
|
||||
// A depth column of N cards rolls FORWARD. On each landing beat the next
|
||||
// card tumbles up into the front slot (s0) and WIPES in its solid colored
|
||||
// face (angled clip-path), the previous front card tumbles forward + falls
|
||||
// down toward the camera on exit, and every card behind advances one slot.
|
||||
// Dwells shrink card-to-card → the deck reads as an accelerating rush into
|
||||
// a held final card. Asset-free: wireframe + solid CSS cards, system fonts.
|
||||
//
|
||||
// COMPOSE BY DATA — `cards` (the deck) and `landings` (one beat per card)
|
||||
// are the two data surfaces. Card count is data: 3/6/9 cards all "just
|
||||
// work"; landings default to an accelerating schedule derived from count.
|
||||
// ════════════════════════════════════════════════════════════════════
|
||||
|
||||
window.__timelines = window.__timelines || {};
|
||||
// force3D is set per card tween/set below (NOT a global default — a global
|
||||
// would leak onto the plain-object padding tween and warn). It keeps a 3D
|
||||
// matrix on every transform so cards never collapse to 2D: a card whose
|
||||
// rotX/Y/Z all hit 0 (the front s0 pose) would otherwise drop out of the 3D
|
||||
// stacking context and paint in DOM order, letting back cards render on top.
|
||||
|
||||
// ── 1. Variables ──────────────────────────────────────────────────────
|
||||
var defaults = { theme: "aurora", bgColor: "", cards: "", landings: "", yaw: -12 };
|
||||
var vars = Object.assign(
|
||||
{},
|
||||
defaults,
|
||||
window.__hyperframes && window.__hyperframes.getVariables
|
||||
? window.__hyperframes.getVariables()
|
||||
: {},
|
||||
);
|
||||
|
||||
// ── Palette themes — each is a COHESIVE ramp (one temperature/saturation
|
||||
// family) so any card count reads as a designed set. card.color still
|
||||
// overrides per card. White-on-card stays AA at the card type sizes. ──
|
||||
var THEMES = {
|
||||
// cool jewel arc: teal → ocean → indigo → violet → plum
|
||||
aurora: {
|
||||
bg: "#06060e",
|
||||
ink: "#ffffff",
|
||||
colors: ["#0e5f63", "#15517e", "#283f86", "#4a3a83", "#6a3380", "#8a2e63"],
|
||||
},
|
||||
// warm sunset arc: wine → brick → rust → amber → ochre → bronze
|
||||
ember: {
|
||||
bg: "#0e0805",
|
||||
ink: "#fff6ee",
|
||||
colors: ["#5c2030", "#7e2828", "#9c3b1c", "#a9551a", "#8a5a1c", "#5f4626"],
|
||||
},
|
||||
// sleek monochrome blue staircase (dark → mid)
|
||||
mono: {
|
||||
bg: "#060912",
|
||||
ink: "#ffffff",
|
||||
colors: ["#11243f", "#16314f", "#1b3d63", "#214a78", "#27568d", "#2d63a2"],
|
||||
},
|
||||
// muted cool slate — understated / editorial
|
||||
slate: {
|
||||
bg: "#0b0e12",
|
||||
ink: "#eef2f6",
|
||||
colors: ["#232a33", "#2b3540", "#33414e", "#3b4c5c", "#43576a", "#4b6278"],
|
||||
},
|
||||
};
|
||||
var TH = THEMES[String(vars.theme || "").trim()] || THEMES.aurora;
|
||||
|
||||
// tiny hex helpers (deterministic, no deps) — derive shades + soft ink.
|
||||
function parseHex(h) {
|
||||
h = String(h || "")
|
||||
.trim()
|
||||
.replace(/^#/, "");
|
||||
if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
|
||||
if (h.length !== 6) return null;
|
||||
var n = parseInt(h, 16);
|
||||
return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255 };
|
||||
}
|
||||
function clamp8(v) {
|
||||
return Math.max(0, Math.min(255, Math.round(v)));
|
||||
}
|
||||
function toHex(c) {
|
||||
return (
|
||||
"#" +
|
||||
[c.r, c.g, c.b]
|
||||
.map(function (v) {
|
||||
return clamp8(v).toString(16).padStart(2, "0");
|
||||
})
|
||||
.join("")
|
||||
);
|
||||
}
|
||||
function mix(hex, t, amt) {
|
||||
var c = parseHex(hex);
|
||||
if (!c) return hex;
|
||||
return toHex({
|
||||
r: c.r + (t.r - c.r) * amt,
|
||||
g: c.g + (t.g - c.g) * amt,
|
||||
b: c.b + (t.b - c.b) * amt,
|
||||
});
|
||||
}
|
||||
var BLACK = { r: 0, g: 0, b: 0 },
|
||||
WHITE = { r: 255, g: 255, b: 255 };
|
||||
function darken(hex, amt) {
|
||||
return mix(hex, BLACK, amt);
|
||||
}
|
||||
function lighten(hex, amt) {
|
||||
return mix(hex, WHITE, amt);
|
||||
}
|
||||
|
||||
var DEFAULT_CARDS = [
|
||||
{ title: "FADEGLOW" },
|
||||
{ title: "SAUL BASS" },
|
||||
{ title: "EULER" },
|
||||
{ title: "HERMÈS" },
|
||||
{ title: "DOSSIER" },
|
||||
{ title: "BLACK HOLES" },
|
||||
];
|
||||
// landings tuned by hand on the sandbox: accelerating dwells, final card holds ~1.6s.
|
||||
var DEFAULT_LANDINGS = [0.4, 1.7, 2.7, 3.45, 4.0, 4.4];
|
||||
|
||||
var DUR = 6.0; // matches data-duration
|
||||
var YAW = Number(vars.yaw);
|
||||
if (!isFinite(YAW)) YAW = -12;
|
||||
|
||||
function parseJSON(v) {
|
||||
if (!v) return null;
|
||||
if (typeof v !== "string") return v;
|
||||
try {
|
||||
return JSON.parse(v);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var CARDS = parseJSON(vars.cards);
|
||||
if (!CARDS || !CARDS.length) CARDS = DEFAULT_CARDS;
|
||||
var N = CARDS.length;
|
||||
|
||||
// ── 2. Landing schedule (accelerating cascade) ─────────────────────────
|
||||
// gaps between landings shrink geometrically; the final card lands early
|
||||
// enough to hold a beat before the cut.
|
||||
function genLandings(n, total) {
|
||||
var start = 0.4;
|
||||
var hold = Math.min(1.6, total * 0.27);
|
||||
var end = Math.max(start + 0.3, total - hold);
|
||||
if (n <= 1) return [start];
|
||||
var ratio = 0.78,
|
||||
weights = [],
|
||||
sum = 0,
|
||||
i;
|
||||
for (i = 0; i < n - 1; i++) {
|
||||
var w = Math.pow(ratio, i);
|
||||
weights.push(w);
|
||||
sum += w;
|
||||
}
|
||||
var span = end - start,
|
||||
acc = start,
|
||||
times = [start];
|
||||
for (i = 0; i < n - 1; i++) {
|
||||
acc += (span * weights[i]) / sum;
|
||||
times.push(acc);
|
||||
}
|
||||
return times;
|
||||
}
|
||||
var LANDED = parseJSON(vars.landings);
|
||||
if (!LANDED || LANDED.length !== N) {
|
||||
LANDED = N === DEFAULT_CARDS.length ? DEFAULT_LANDINGS.slice() : genLandings(N, DUR);
|
||||
}
|
||||
// per-card transition duration derived from the gap into it (faster as we accelerate).
|
||||
function transDur(i) {
|
||||
var gap = i === 0 ? (N > 1 ? LANDED[1] - LANDED[0] : 0.4) : LANDED[i] - LANDED[i - 1];
|
||||
return Math.max(0.12, Math.min(0.42, gap * 0.32));
|
||||
}
|
||||
|
||||
// ── 3. Build the deck DOM from data ────────────────────────────────────
|
||||
var scene = document.getElementById("scene");
|
||||
scene.style.transform = "rotateY(" + YAW + "deg)";
|
||||
// bg: explicit bgColor override wins; else the theme's field color. The radial
|
||||
// lifts the centre slightly and sinks the edges, both derived from the bg.
|
||||
var BG = vars.bgColor && String(vars.bgColor).trim() ? vars.bgColor : TH.bg;
|
||||
document.documentElement.style.background = BG;
|
||||
document.body.style.background = BG;
|
||||
var rootEl = document.getElementById("root");
|
||||
rootEl.style.background =
|
||||
"radial-gradient(1300px 820px at 50% 52%, " +
|
||||
lighten(BG, 0.1) +
|
||||
" 0%, " +
|
||||
BG +
|
||||
" 70%, " +
|
||||
darken(BG, 0.4) +
|
||||
" 100%)";
|
||||
|
||||
function el(cls, parent) {
|
||||
var d = document.createElement("div");
|
||||
d.className = cls;
|
||||
if (parent) parent.appendChild(d);
|
||||
return d;
|
||||
}
|
||||
var cardEls = [];
|
||||
for (var i = 0; i < N; i++) {
|
||||
var c = CARDS[i] || {};
|
||||
var card = el("card", scene);
|
||||
card.id = "card-" + i;
|
||||
// color: per-card override, else cycle the cohesive theme ramp. A gentle
|
||||
// top→bottom shade pair (--c1/--c2) gives each face tonal depth.
|
||||
var col = c.color || TH.colors[i % TH.colors.length];
|
||||
card.style.setProperty("--color", col);
|
||||
card.style.setProperty("--c1", lighten(col, 0.05));
|
||||
card.style.setProperty("--c2", darken(col, 0.22));
|
||||
card.style.setProperty("--ink", TH.ink);
|
||||
|
||||
var wire = el("wire", card);
|
||||
var label = el("wire-label", wire);
|
||||
label.textContent = String(i + 1).padStart(3, "0");
|
||||
el("wire-corner", wire);
|
||||
el("wire-bar", wire);
|
||||
|
||||
var solid = el("solid", card);
|
||||
var title = el("title", solid);
|
||||
title.textContent = c.title || "";
|
||||
el("play", solid);
|
||||
|
||||
cardEls.push(card);
|
||||
}
|
||||
|
||||
// ── 4. SLOT poses ───────────────────────────────────────────────────────
|
||||
// rotX is the key. Cards behind tilt BACK (top edge away, +rotX); the front
|
||||
// is upright (rotX 0); on exit a card continues forward into a face-down
|
||||
// tumble (-rotX) while dropping down + toward camera. Depth from perspective
|
||||
// (Z) + the cards' rotateX, not a camera move.
|
||||
var SLOT = {
|
||||
far: { x: 360, y: 380, z: -1080, rotX: 84, scale: 0.74, opacity: 0, zi: 60 },
|
||||
s3: { x: 280, y: 290, z: -820, rotX: 66, scale: 0.8, opacity: 0.32, zi: 70 },
|
||||
s2: { x: 195, y: 200, z: -560, rotX: 46, scale: 0.86, opacity: 0.58, zi: 80 },
|
||||
s1: { x: 105, y: 105, z: -290, rotX: 22, scale: 0.93, opacity: 0.85, zi: 90 },
|
||||
s0: { x: 0, y: 0, z: 0, rotX: 0, scale: 1.0, opacity: 1.0, zi: 100 },
|
||||
exit: { x: -90, y: 620, z: 420, rotX: -88, scale: 1.1, opacity: 0, zi: 110 },
|
||||
};
|
||||
// pose for a card whose index is `rel` slots behind the current front card
|
||||
// (rel 0 = front, +ve = behind, -ve = already exiting / gone).
|
||||
function poseForRel(rel) {
|
||||
if (rel <= -1) return SLOT.exit;
|
||||
if (rel === 0) return SLOT.s0;
|
||||
if (rel === 1) return SLOT.s1;
|
||||
if (rel === 2) return SLOT.s2;
|
||||
if (rel === 3) return SLOT.s3;
|
||||
return SLOT.far;
|
||||
}
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
function poseTween(idx, slot, t, dur, ease) {
|
||||
// z-index is set instantly at the swap start so paint order matches the
|
||||
// slot — CSS can't reliably depth-sort non-intersecting planes.
|
||||
tl.set("#card-" + idx, { zIndex: slot.zi }, t);
|
||||
tl.to(
|
||||
"#card-" + idx,
|
||||
{
|
||||
x: slot.x,
|
||||
y: slot.y,
|
||||
z: slot.z,
|
||||
rotationX: slot.rotX,
|
||||
scale: slot.scale,
|
||||
opacity: slot.opacity,
|
||||
force3D: true,
|
||||
duration: dur,
|
||||
ease: ease || "power2.inOut",
|
||||
},
|
||||
t,
|
||||
);
|
||||
}
|
||||
|
||||
// ── 5. Initial pose (front index = -1: nothing landed yet) ─────────────
|
||||
// card j sits at rel = j + 1, so card0 starts at s1, card1 at s2, etc. Apply
|
||||
// via gsap.set (so the paused render at t=0 shows the staged stack) AND via
|
||||
// tl.set at 0 (so scrubbing back to 0 restores it).
|
||||
for (var j = 0; j < N; j++) {
|
||||
var s = poseForRel(j + 1);
|
||||
var props = {
|
||||
x: s.x,
|
||||
y: s.y,
|
||||
z: s.z,
|
||||
rotationX: s.rotX,
|
||||
scale: s.scale,
|
||||
opacity: s.opacity,
|
||||
zIndex: s.zi,
|
||||
force3D: true,
|
||||
"--wipe": 0,
|
||||
};
|
||||
gsap.set("#card-" + j, props);
|
||||
tl.set("#card-" + j, props, 0);
|
||||
}
|
||||
|
||||
// ── 6. Per-landing orchestration ───────────────────────────────────────
|
||||
// On landing i, card i becomes front. Tween the live window [i-1 .. i+4]:
|
||||
// i-1 tumbles to exit, i rolls into s0 (+ wipe), the rest advance toward
|
||||
// the front. Cards outside the window are already at rest (far / gone).
|
||||
for (var L = 0; L < N; L++) {
|
||||
var dur = transDur(L);
|
||||
var t = Math.max(0, LANDED[L] - dur);
|
||||
|
||||
for (var k = L - 1; k <= L + 4; k++) {
|
||||
if (k < 0 || k >= N) continue;
|
||||
var rel = k - L;
|
||||
var ease = rel === 0 ? "power3.out" : rel < 0 ? "power2.in" : "power2.inOut";
|
||||
poseTween(k, poseForRel(rel), t, dur, ease);
|
||||
}
|
||||
|
||||
// the landing card wipes in its solid face as it rolls up.
|
||||
tl.to(
|
||||
"#card-" + L,
|
||||
{
|
||||
"--wipe": 1,
|
||||
duration: dur * 0.85,
|
||||
ease: "power2.inOut",
|
||||
},
|
||||
t + dur * 0.15,
|
||||
);
|
||||
}
|
||||
|
||||
// pad the timeline so duration() >= data-duration.
|
||||
tl.to({}, { duration: DUR }, 0);
|
||||
tl.seek(0);
|
||||
|
||||
window.__timelines["card-flyby"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"_": "Default card-flyby program. `theme` picks a cohesive palette; `cards` is the deck (each card = a big centered title; `color` is OPTIONAL — omit it and the card takes the next color from the theme ramp); `landings` is one onset per card (accelerating cadence; omit to auto-derive). Pass these as the matching composition-variables; empty vars fall back to these values.",
|
||||
"theme": "aurora",
|
||||
"cards": [
|
||||
{ "title": "FADEGLOW" },
|
||||
{ "title": "SAUL BASS" },
|
||||
{ "title": "EULER" },
|
||||
{ "title": "HERMÈS" },
|
||||
{ "title": "DOSSIER" },
|
||||
{ "title": "BLACK HOLES" }
|
||||
],
|
||||
"landings": [0.4, 1.7, 2.7, 3.45, 4.0, 4.4]
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
# Held Message / Living Field
|
||||
|
||||
The first promoted Group Template. Reverse-engineered from **group_1** of the golden
|
||||
sample `bgm_test_2` (the "PREVIOUSLY ON / DUCKLIFE" recap card). Chinese name the user
|
||||
uses: 静止文字 · 活背景.
|
||||
|
||||
In `visual-plan-contract.md` / motion terms it is the **macro-stable + micro-volatile
|
||||
hold**: the message is frozen, the blurred field carries all the motion.
|
||||
|
||||
## When the Director picks it (match-face)
|
||||
|
||||
A group whose `GroupSignature` is **heavy-but-sparse with an onset desert**:
|
||||
`energy_level >= MEDIUM`, `density == sparse`, `onset_gap_bars >= 1.5`, steady grid.
|
||||
Mood fit: warm / dark / elegant / cinematic. See `card.json`.
|
||||
|
||||
The hold ends at the **first onset re-entry** (or a hard stop), snapped to the next
|
||||
downbeat — that is both the group boundary and the template's stop rule.
|
||||
|
||||
## What it renders (build-face)
|
||||
|
||||
- **message** (text) — `freeze_after_reveal`: a held title block (mark + title +
|
||||
tagline). Reveal (blur+scale settle, brief per-letter entrance) then dead still for the
|
||||
whole span. Three slots: `markText` (big) + `titleText` + `tagText`.
|
||||
- **field** (background) — `energy_envelope_breath`: a real-time WebGL flow field
|
||||
(fbm + curl noise). Colorful chromatic light-leak at entry, breathes up on the SURGE,
|
||||
then settles dark with a central glow for the hold.
|
||||
|
||||
## Files
|
||||
|
||||
- `card.json` — the spec (match-face + build-face).
|
||||
- `index.html` — the **generic `webgl-textures-playground`** reference implementation
|
||||
(asset-free, CDN three.js + GSAP, one paused timeline; passes lint + validate).
|
||||
Composition-variables == the card's `params`: `markText`, `titleText`, `tagText`,
|
||||
`bgColor/colorLow/colorMid/colorHigh/accentColor`, `flowSpeed`. The group_1 DUCKLIFE
|
||||
recap (kicker + hero, the warm light-leak settle) is one parameterization of this engine.
|
||||
|
||||
## Params → recolor / re-text
|
||||
|
||||
```bash
|
||||
npx hyperframes render --variables '{
|
||||
"markText":"DUCKLIFE","titleText":"PREVIOUSLY ON","tagText":"",
|
||||
"colorLow":"#100a2e","colorMid":"#d23b5e","colorHigh":"#ffd9c2","accentColor":"#ffb27a"
|
||||
}'
|
||||
```
|
||||
|
||||
## Provenance
|
||||
|
||||
Reversed via `skills/bgm-golden_sample_reverse/reverse-to-template.md` from
|
||||
`bgm-golden-sample-reverse/gorup-by-group/group_1` (audiomap + Gemini analysis). The
|
||||
reference impl here is the generic `group_1/webgl-textures-playground` (the user's chosen
|
||||
canonical impl); the DUCKLIFE-specific `recreate-webgl` was an earlier parameterization.
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"id": "held-message-living-field",
|
||||
"name": "Held Message / Living Field",
|
||||
"one_line": "A readable mark held dead still over a soft, color-shifting blurred field.",
|
||||
"status": "promoted",
|
||||
"created": "2026-06-17",
|
||||
|
||||
"match": {
|
||||
"structural_type": "sustained_hold",
|
||||
"requires": {
|
||||
"energy_level": ">=MEDIUM",
|
||||
"density": "sparse",
|
||||
"onset_gap_bars": ">=1.5",
|
||||
"has_steady_grid": true
|
||||
},
|
||||
"mood_fit": ["warm", "dark", "elegant", "cinematic"],
|
||||
"span_bars": [2, 8],
|
||||
"exit_trigger": ["first_onset_reentry", "hard_stop"]
|
||||
},
|
||||
|
||||
"examples": [
|
||||
{
|
||||
"sample": "bgm_test_2",
|
||||
"group": "g1",
|
||||
"bpm": 129.2,
|
||||
"energy": 0.8,
|
||||
"density": "sparse",
|
||||
"onset_gap_bars": 2.05,
|
||||
"span_sec": [0.0, 4.017]
|
||||
}
|
||||
],
|
||||
|
||||
"roles": {
|
||||
"message": {
|
||||
"kind": "message",
|
||||
"motion": "freeze_after_reveal",
|
||||
"anchor": "entry.downbeat",
|
||||
"notes": "a held title block (mark + title + tagline); reveal (blur+scale settle, brief per-letter entrance) then dead still for the whole span — no ongoing motion, there are no onsets"
|
||||
},
|
||||
"field": {
|
||||
"kind": "background",
|
||||
"motion": "energy_envelope_breath",
|
||||
"anchor": "energy",
|
||||
"notes": "the only thing moving; colorful chromatic light-leak at entry, breathes up on the SURGE, then a black mask settles it to near-black with a central glow for the hold"
|
||||
}
|
||||
},
|
||||
|
||||
"params": {
|
||||
"markText": { "type": "string", "maps_to": "message.mark", "default": "HF" },
|
||||
"titleText": { "type": "string", "maps_to": "message.title", "default": "HYPERFRAMES" },
|
||||
"tagText": { "type": "string", "maps_to": "message.tag", "default": "HTML · SHADERS · MP4" },
|
||||
"palette": {
|
||||
"type": "object",
|
||||
"keys": ["bgColor", "colorLow", "colorMid", "colorHigh", "accentColor"]
|
||||
},
|
||||
"flowSpeed": { "type": "number", "default": 1 },
|
||||
"duration": { "type": "number", "from": "group.span length" }
|
||||
},
|
||||
|
||||
"reference_impl": "index.html (generic webgl-textures-playground; the group_1 DUCKLIFE recreate is one parameterization)",
|
||||
"uses_primitives": ["blur_resolve", "negative_space_hold", "chromatic_pressure", "hard_cut"],
|
||||
|
||||
"transition_out": { "default": "fast_cut", "observed": "anticipation_glitch_cut" },
|
||||
|
||||
"reversed_from": ["bgm-golden-sample-reverse/gorup-by-group/group_1"]
|
||||
}
|
||||
@@ -0,0 +1,485 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en"
|
||||
data-composition-variables='[
|
||||
{"id":"bgColor", "type":"color", "label":"Page background", "default":"#050507"},
|
||||
{"id":"colorLow", "type":"color", "label":"Flow — shadow tone", "default":"#0a1430"},
|
||||
{"id":"colorMid", "type":"color", "label":"Flow — mid tone", "default":"#6a6f9e"},
|
||||
{"id":"colorHigh", "type":"color", "label":"Flow — highlight tone", "default":"#e8f0ff"},
|
||||
{"id":"accentColor","type":"color", "label":"Core / glow accent", "default":"#aee4ff"},
|
||||
{"id":"markText", "type":"string", "label":"Monogram", "default":"HF"},
|
||||
{"id":"titleText", "type":"string", "label":"Title", "default":"HYPERFRAMES"},
|
||||
{"id":"tagText", "type":"string", "label":"Tagline", "default":"HTML · SHADERS · MP4"},
|
||||
{"id":"flowSpeed", "type":"number", "label":"Flow speed", "default":1, "min":0.1, "max":3, "step":0.1}
|
||||
]'
|
||||
>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=1920, height=1080" />
|
||||
<title>WebGL Textures Playground — Template</title>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/three@0.147.0/build/three.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* --bg / --mark-top / --mark-bottom / --line are set from variables in JS */
|
||||
html,
|
||||
body {
|
||||
background: var(--bg, #050507);
|
||||
overflow: hidden;
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
}
|
||||
#root {
|
||||
position: relative;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow: hidden;
|
||||
background: var(--bg, #050507);
|
||||
}
|
||||
.sf-stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
.sf-canvas {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
display: block;
|
||||
}
|
||||
.sf-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 28px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
mix-blend-mode: screen;
|
||||
pointer-events: none;
|
||||
}
|
||||
.sf-mark {
|
||||
font-size: 280px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -18px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
gap: 0;
|
||||
opacity: 0;
|
||||
filter: drop-shadow(0 0 60px rgba(180, 220, 255, 0.4));
|
||||
}
|
||||
.sf-mark-letter {
|
||||
display: inline-block;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
var(--mark-top, #ffffff) 0%,
|
||||
var(--mark-bottom, #8aa9ff) 100%
|
||||
);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
transform: translateY(0);
|
||||
}
|
||||
.sf-rule {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
transparent 0%,
|
||||
var(--line, rgba(255, 255, 255, 0.9)) 50%,
|
||||
transparent 100%
|
||||
);
|
||||
opacity: 0;
|
||||
}
|
||||
.sf-title {
|
||||
font-size: 64px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 18px;
|
||||
opacity: 0;
|
||||
clip-path: inset(0 100% 0 0);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.sf-tag {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 8px;
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
opacity: 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.sf-grain {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0.06;
|
||||
mix-blend-mode: overlay;
|
||||
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
data-hf-id="hf-a0d4"
|
||||
id="root"
|
||||
data-composition-id="webgl-textures-playground"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
data-start="0"
|
||||
data-duration="12"
|
||||
data-root="true"
|
||||
>
|
||||
<div data-hf-id="hf-clsq" class="sf-stage">
|
||||
<canvas data-hf-id="hf-yk51" class="sf-canvas" width="1920" height="1080"></canvas>
|
||||
<div data-hf-id="hf-7z0g" class="sf-overlay">
|
||||
<div data-hf-id="hf-yo0z" class="sf-mark"><!-- letters injected from markText --></div>
|
||||
<div data-hf-id="hf-nig2" class="sf-rule"></div>
|
||||
<div data-hf-id="hf-gjx6" class="sf-title"></div>
|
||||
<div data-hf-id="hf-e7y8" class="sf-tag"></div>
|
||||
</div>
|
||||
<div data-hf-id="hf-ku55" class="sf-grain"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
// ── 1. Resolve variables (read ONCE during init) ──────────────────
|
||||
var defaults = {
|
||||
bgColor: "#050507",
|
||||
colorLow: "#0a1430",
|
||||
colorMid: "#6a6f9e",
|
||||
colorHigh: "#e8f0ff",
|
||||
accentColor: "#aee4ff",
|
||||
markText: "HF",
|
||||
titleText: "HYPERFRAMES",
|
||||
tagText: "HTML · SHADERS · MP4",
|
||||
flowSpeed: 1,
|
||||
};
|
||||
var vars = Object.assign(
|
||||
{},
|
||||
defaults,
|
||||
window.__hyperframes && window.__hyperframes.getVariables
|
||||
? window.__hyperframes.getVariables()
|
||||
: {},
|
||||
);
|
||||
|
||||
// sRGB hex -> linear-light vec3 (the shader works in linear space and
|
||||
// gamma-encodes at the end, so converting here makes the picked color
|
||||
// land close to what a color picker shows).
|
||||
function hexToLinear(hex) {
|
||||
var h = String(hex).replace("#", "").trim();
|
||||
if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
|
||||
var r = parseInt(h.substr(0, 2), 16) / 255;
|
||||
var g = parseInt(h.substr(2, 2), 16) / 255;
|
||||
var b = parseInt(h.substr(4, 2), 16) / 255;
|
||||
var lin = function (c) {
|
||||
return Math.pow(c, 2.2);
|
||||
};
|
||||
return new THREE.Vector3(lin(r), lin(g), lin(b));
|
||||
}
|
||||
|
||||
var root = document.getElementById("root");
|
||||
var canvas = root.querySelector(".sf-canvas");
|
||||
var W = 1920;
|
||||
var H = 1080;
|
||||
|
||||
// ── 2. Apply text + CSS-driven colors ─────────────────────────────
|
||||
var docEl = document.documentElement;
|
||||
docEl.style.setProperty("--bg", vars.bgColor);
|
||||
docEl.style.setProperty("--mark-top", vars.colorHigh);
|
||||
docEl.style.setProperty("--mark-bottom", vars.colorMid);
|
||||
docEl.style.setProperty("--line", vars.colorHigh);
|
||||
|
||||
var markEl = root.querySelector(".sf-mark");
|
||||
markEl.innerHTML = "";
|
||||
String(vars.markText)
|
||||
.split("")
|
||||
.forEach(function (ch) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "sf-mark-letter";
|
||||
span.textContent = ch;
|
||||
markEl.appendChild(span);
|
||||
});
|
||||
root.querySelector(".sf-title").textContent = vars.titleText;
|
||||
root.querySelector(".sf-tag").textContent = vars.tagText;
|
||||
|
||||
// ── 3. WebGL flow field ───────────────────────────────────────────
|
||||
var renderer = new THREE.WebGLRenderer({
|
||||
canvas: canvas,
|
||||
antialias: false,
|
||||
alpha: false,
|
||||
preserveDrawingBuffer: true,
|
||||
});
|
||||
renderer.setPixelRatio(1);
|
||||
renderer.setSize(W, H, false);
|
||||
|
||||
var scene = new THREE.Scene();
|
||||
var camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
||||
|
||||
var uniforms = {
|
||||
uTime: { value: 0.0 },
|
||||
uPhase: { value: 0.0 },
|
||||
uReveal: { value: 0.0 },
|
||||
uChromAb: { value: 0.0 },
|
||||
uVignette: { value: 0.0 },
|
||||
uIntensity: { value: 0.0 },
|
||||
uResolution: { value: new THREE.Vector2(W, H) },
|
||||
uSpeed: { value: Number(vars.flowSpeed) || 1.0 },
|
||||
// ── COLOR CONTROLS (driven by the composition variables) ──
|
||||
uColLow: { value: hexToLinear(vars.colorLow) },
|
||||
uColMid: { value: hexToLinear(vars.colorMid) },
|
||||
uColHigh: { value: hexToLinear(vars.colorHigh) },
|
||||
uAccent: { value: hexToLinear(vars.accentColor) },
|
||||
};
|
||||
|
||||
var vert = [
|
||||
"varying vec2 vUv;",
|
||||
"void main(){",
|
||||
" vUv = uv;",
|
||||
" gl_Position = vec4(position.xy, 0.0, 1.0);",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
var frag = [
|
||||
"precision highp float;",
|
||||
"varying vec2 vUv;",
|
||||
"uniform float uTime;",
|
||||
"uniform float uPhase;",
|
||||
"uniform float uReveal;",
|
||||
"uniform float uChromAb;",
|
||||
"uniform float uVignette;",
|
||||
"uniform float uIntensity;",
|
||||
"uniform float uSpeed;",
|
||||
"uniform vec2 uResolution;",
|
||||
"uniform vec3 uColLow;",
|
||||
"uniform vec3 uColMid;",
|
||||
"uniform vec3 uColHigh;",
|
||||
"uniform vec3 uAccent;",
|
||||
|
||||
"float hash21(vec2 p){",
|
||||
" p = fract(p * vec2(123.34, 456.21));",
|
||||
" p += dot(p, p + 45.32);",
|
||||
" return fract(p.x * p.y);",
|
||||
"}",
|
||||
|
||||
"float noise2(vec2 p){",
|
||||
" vec2 i = floor(p);",
|
||||
" vec2 f = fract(p);",
|
||||
" vec2 u = f * f * (3.0 - 2.0 * f);",
|
||||
" float a = hash21(i);",
|
||||
" float b = hash21(i + vec2(1.0, 0.0));",
|
||||
" float c = hash21(i + vec2(0.0, 1.0));",
|
||||
" float d = hash21(i + vec2(1.0, 1.0));",
|
||||
" return mix(mix(a,b,u.x), mix(c,d,u.x), u.y);",
|
||||
"}",
|
||||
|
||||
"float fbm(vec2 p){",
|
||||
" float v = 0.0;",
|
||||
" float a = 0.5;",
|
||||
" for(int i=0;i<5;i++){",
|
||||
" v += a * noise2(p);",
|
||||
" p *= 2.02;",
|
||||
" a *= 0.5;",
|
||||
" }",
|
||||
" return v;",
|
||||
"}",
|
||||
|
||||
"vec2 curl(vec2 p, float t){",
|
||||
" float e = 0.6;",
|
||||
" float n1 = fbm(p + vec2(0.0, e) + t*0.18);",
|
||||
" float n2 = fbm(p + vec2(0.0, -e) + t*0.18);",
|
||||
" float n3 = fbm(p + vec2( e, 0.0) + t*0.18);",
|
||||
" float n4 = fbm(p + vec2(-e, 0.0) + t*0.18);",
|
||||
" return vec2(n1 - n2, -(n3 - n4));",
|
||||
"}",
|
||||
|
||||
// 3-stop gradient palette built from the color variables.
|
||||
// t≈0 -> shadow, t≈0.5 -> mid, t≈1 -> highlight.
|
||||
"vec3 palette(float t){",
|
||||
" t = clamp(t, 0.0, 1.0);",
|
||||
" vec3 lowMid = mix(uColLow, uColMid, smoothstep(0.0, 0.5, t));",
|
||||
" return mix(lowMid, uColHigh, smoothstep(0.5, 1.0, t));",
|
||||
"}",
|
||||
|
||||
"vec3 sampleField(vec2 uv, float t, float energy){",
|
||||
" vec2 p = (uv - 0.5) * vec2(uResolution.x/uResolution.y, 1.0) * 2.4;",
|
||||
" vec2 c = curl(p * 0.9, t);",
|
||||
" vec2 q = p + c * (0.45 + 0.55 * energy);",
|
||||
|
||||
" float flow = fbm(q * 1.6 + vec2(t * 0.11, -t * 0.07));",
|
||||
" float bands = sin(flow * 14.0 + t * 1.1);",
|
||||
" bands = smoothstep(0.0, 1.0, 0.5 + 0.5 * bands);",
|
||||
|
||||
" float r = length(p);",
|
||||
" float core = smoothstep(1.5, 0.05, r) * (0.6 + 0.4 * energy);",
|
||||
" float glow = exp(-r * 1.6) * (0.55 + 0.45 * energy);",
|
||||
|
||||
" float k = clamp(flow * 0.85 + 0.15 * bands + 0.25 * core + 0.6 * glow, 0.0, 1.4);",
|
||||
" vec3 col = palette(k * 0.9 + 0.1 * sin(t * 0.4));",
|
||||
" col *= 0.7 + 0.6 * energy;",
|
||||
" col += uAccent * core * 0.55;",
|
||||
" return col;",
|
||||
"}",
|
||||
|
||||
"void main(){",
|
||||
" vec2 uv = vUv;",
|
||||
" float t = uTime * uSpeed;",
|
||||
" float e = uIntensity;",
|
||||
|
||||
" vec2 dir = normalize(uv - 0.5 + 1e-6);",
|
||||
" float ca = uChromAb * (0.004 + 0.012 * length(uv - 0.5));",
|
||||
" vec3 cR = sampleField(uv + dir * ca, t, e);",
|
||||
" vec3 cG = sampleField(uv, t, e);",
|
||||
" vec3 cB = sampleField(uv - dir * ca, t, e);",
|
||||
" vec3 col = vec3(cR.r, cG.g, cB.b);",
|
||||
|
||||
" float lum = dot(col, vec3(0.299, 0.587, 0.114));",
|
||||
" col = mix(vec3(lum), col, 1.05);",
|
||||
|
||||
" float rev = uReveal;",
|
||||
" float sweep = smoothstep(0.0, 0.6, rev) * (1.0 - smoothstep(0.6, 1.0, rev));",
|
||||
" col += uColHigh * sweep * 0.35;",
|
||||
|
||||
" vec3 phaseTint = mix(vec3(0.85, 0.92, 1.05), vec3(1.05, 0.95, 0.85), uPhase);",
|
||||
" col *= phaseTint;",
|
||||
|
||||
" float v = length(uv - 0.5);",
|
||||
" col *= 1.0 - smoothstep(0.45, 0.95, v) * uVignette;",
|
||||
|
||||
" col = col / (col + 1.0);",
|
||||
" col = pow(col, vec3(1.0/2.2));",
|
||||
|
||||
" gl_FragColor = vec4(col, 1.0);",
|
||||
"}",
|
||||
].join("\n");
|
||||
|
||||
var mat = new THREE.ShaderMaterial({
|
||||
uniforms: uniforms,
|
||||
vertexShader: vert,
|
||||
fragmentShader: frag,
|
||||
});
|
||||
var geo = new THREE.PlaneGeometry(2, 2);
|
||||
var mesh = new THREE.Mesh(geo, mat);
|
||||
scene.add(mesh);
|
||||
|
||||
function renderFrame() {
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
renderFrame();
|
||||
|
||||
// Continuous loop: ensures the WebGL backbuffer always has fresh
|
||||
// pixels when puppeteer takes a screenshot. All visible state comes
|
||||
// from uniforms driven by the GSAP timeline, so output is fully
|
||||
// determined by the timeline position (deterministic across renders).
|
||||
function loop() {
|
||||
renderFrame();
|
||||
window.requestAnimationFrame(loop);
|
||||
}
|
||||
window.requestAnimationFrame(loop);
|
||||
|
||||
// ── 4. Deterministic timeline (unchanged motion design) ───────────
|
||||
window.__timelines = window.__timelines || {};
|
||||
var tl = gsap.timeline({
|
||||
paused: true,
|
||||
onUpdate: renderFrame,
|
||||
});
|
||||
|
||||
tl.to(uniforms.uTime, { value: 12.0, duration: 12, ease: "none" }, 0);
|
||||
|
||||
tl.to(uniforms.uIntensity, { value: 0.55, duration: 3.0, ease: "sine.inOut" }, 0);
|
||||
tl.to(uniforms.uIntensity, { value: 1.0, duration: 1.2, ease: "power2.in" }, 3.0);
|
||||
tl.to(uniforms.uIntensity, { value: 0.55, duration: 3.0, ease: "power2.out" }, 4.2);
|
||||
tl.to(uniforms.uIntensity, { value: 0.3, duration: 4.8, ease: "sine.inOut" }, 7.2);
|
||||
|
||||
tl.fromTo(
|
||||
uniforms.uChromAb,
|
||||
{ value: 0.0 },
|
||||
{ value: 0.4, duration: 3.0, ease: "sine.in" },
|
||||
0,
|
||||
);
|
||||
tl.to(uniforms.uChromAb, { value: 1.6, duration: 1.0, ease: "power3.in" }, 3.0);
|
||||
tl.to(uniforms.uChromAb, { value: 0.25, duration: 1.5, ease: "power2.out" }, 4.0);
|
||||
tl.to(uniforms.uChromAb, { value: 0.18, duration: 6.5, ease: "sine.inOut" }, 5.5);
|
||||
|
||||
tl.fromTo(
|
||||
uniforms.uReveal,
|
||||
{ value: 0.0 },
|
||||
{ value: 1.0, duration: 1.2, ease: "none" },
|
||||
3.4,
|
||||
);
|
||||
tl.set(uniforms.uReveal, { value: 0.0 }, 4.6);
|
||||
|
||||
tl.to(uniforms.uPhase, { value: 0.6, duration: 5.0, ease: "sine.inOut" }, 1.5);
|
||||
tl.to(uniforms.uPhase, { value: 0.15, duration: 5.5, ease: "sine.inOut" }, 6.5);
|
||||
|
||||
tl.to(uniforms.uVignette, { value: 0.85, duration: 3.0, ease: "power2.out" }, 4.2);
|
||||
|
||||
var mark = root.querySelector(".sf-mark");
|
||||
var letters = root.querySelectorAll(".sf-mark-letter");
|
||||
var rule = root.querySelector(".sf-rule");
|
||||
var title = root.querySelector(".sf-title");
|
||||
var tag = root.querySelector(".sf-tag");
|
||||
|
||||
tl.fromTo(
|
||||
mark,
|
||||
{
|
||||
opacity: 0,
|
||||
scale: 1.18,
|
||||
filter: "blur(24px) drop-shadow(0 0 60px rgba(180,220,255,0.4))",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
scale: 1.0,
|
||||
filter: "blur(0px) drop-shadow(0 0 80px rgba(180,220,255,0.55))",
|
||||
duration: 0.9,
|
||||
ease: "power3.out",
|
||||
},
|
||||
3.6,
|
||||
);
|
||||
tl.fromTo(
|
||||
letters,
|
||||
{ y: 80 },
|
||||
{ y: 0, duration: 1.0, ease: "expo.out", stagger: 0.08 },
|
||||
3.6,
|
||||
);
|
||||
|
||||
tl.fromTo(
|
||||
rule,
|
||||
{ width: 0, opacity: 0 },
|
||||
{ width: 360, opacity: 0.85, duration: 0.8, ease: "power2.out" },
|
||||
5.1,
|
||||
);
|
||||
|
||||
tl.fromTo(
|
||||
title,
|
||||
{ opacity: 0, clipPath: "inset(0 100% 0 0)" },
|
||||
{ opacity: 1, clipPath: "inset(0 0% 0 0)", duration: 0.95, ease: "power3.out" },
|
||||
5.3,
|
||||
);
|
||||
|
||||
tl.fromTo(
|
||||
tag,
|
||||
{ opacity: 0, y: 12 },
|
||||
{ opacity: 0.7, y: 0, duration: 0.8, ease: "sine.out" },
|
||||
6.0,
|
||||
);
|
||||
|
||||
tl.to(mark, { scale: 1.04, duration: 5.0, ease: "sine.inOut" }, 7.0);
|
||||
|
||||
tl.to([mark, rule, title, tag], { opacity: 0, duration: 0.6, ease: "power1.in" }, 11.4);
|
||||
|
||||
window.__timelines["webgl-textures-playground"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,168 @@
|
||||
# held-text-strobe-burst (group template)
|
||||
|
||||
A reusable HyperFrames template for the **Held Text / Strobe Burst** pattern: a word
|
||||
held **dead still** in the center while its letterforms **flip through texture-filled
|
||||
frames** every ~3 frames, in short bursts pinned to a drum roll / fill. The default
|
||||
(and primary) look is the **Texture-Flip** technique — there is no shader and no video.
|
||||
All state lives on one paused GSAP timeline → deterministic and seek-safe.
|
||||
|
||||
Reversed from `../gruop_4.mp4` (see `../gruop_4.bg-flicker.gemini-analysis.md`, burst 2 —
|
||||
the "III" glyph whose interior style-transfers per beat). Sibling of **Held Message /
|
||||
Living Field** (`webgl-textures-playground`): message holds, background carries the
|
||||
motion — but here it _strobes_ in beat-quantized hits instead of breathing.
|
||||
|
||||
> Render at **24 fps** so the 0.125 s jumps land every 3 frames (the original cadence).
|
||||
|
||||
## The technique (Texture-Flip, foreground)
|
||||
|
||||
The word's letters are a **window**: `background-image: <solid-fill>, <texture-url>`
|
||||
with `background-blend-mode: multiply`, clipped to the text (`background-clip: text`).
|
||||
So each letter shows a **texture PNG tinted by a per-frame fill color**, over a solid
|
||||
per-frame **background color**. N such frames are stacked as full-frame layers; the
|
||||
strobe flips which one is visible (`tl.set(opacity)`, 0 ms — seek-safe). The texture
|
||||
fills the whole letterform (`line-height ≥ 1` keeps the glyph inside the background-paint
|
||||
box — with `line-height < 1` the cap tops/bottoms overflow it and leave untextured slivers).
|
||||
|
||||
A **persistent base** holds the word in a solid color on the idle (black) plate, so it
|
||||
never disappears — it is the anchor. The **base-template default plan flickers
|
||||
continuously across the whole clip and never stops**, so the idle base only shows if your
|
||||
plan leaves gaps (e.g. the gruop_4 two-burst variant).
|
||||
|
||||
Three things change per beat: **texture** (material), **fill** (foreground tint),
|
||||
**bg** (frame background). All snap to the strobe grid.
|
||||
|
||||
---
|
||||
|
||||
## What beat matches this template
|
||||
|
||||
The discriminator the Director uses — the **opposite** of a held pad (busy, not empty):
|
||||
|
||||
| Signature field | Strobe Burst wants | Why |
|
||||
| ----------------- | ---------------------------------- | --------------------------------------------------------------- |
|
||||
| `density` | **dense** | a strobe needs many hits to flip on |
|
||||
| `energy_level` | **≥ MEDIUM** (≥ HIGH in the burst) | flat-out hits, not a breath |
|
||||
| `onset_gap_bars` | **≤ ~0.5 bar** | no onset deserts — a hit every fraction of a beat |
|
||||
| `has_rolls` | **true** | a `rolls[]` run (accel-roll → SURGE, or a fill) is the _engine_ |
|
||||
| `has_steady_grid` | true | jumps must quantize to a stable grid |
|
||||
| `exit_trigger` | `hard_stop` or `surge` | the burst cuts clean to black, then the next section enters |
|
||||
| `span_bars` | 1–2 (each burst ~0.4–0.7 s) | a strobe that runs > 2–3 s tires the eye |
|
||||
|
||||
**Heuristic:** a high-hits/min roll inside a `dense` phase is a strobe-burst candidate.
|
||||
Pin one burst per roll/fill; bound it by the `hard_stop` / `SURGE` that follows.
|
||||
|
||||
**gruop_4 facts that fired it** (from `../audiomap.json`):
|
||||
|
||||
- BPM 129; downbeat 1.254; grid 0.743 / 1.254 / 1.718 / 2.183.
|
||||
- rolls: `0.09–0.79 accel-roll →SURGE`, `1.21–1.65 fill →DROP`, `1.93–3.00 accel-roll →SURGE`.
|
||||
- `hard_stop` @ 2 s; SURGE@1 (+0.21), DROP@2 (−0.28), SURGE@3 (+0.78).
|
||||
- Two bursts: **1.125–1.542 s** and **2.042–2.708 s**, jumps every 0.125 s.
|
||||
- Burst 1 starts ~2 frames _before_ downbeat 1.254 (lead the anchor); burst 2 opens on
|
||||
the 2 s `hard_stop` + 1.93 accel-roll, ends 1 frame before the 2.76 snare.
|
||||
|
||||
---
|
||||
|
||||
## How to change it
|
||||
|
||||
Everything is a **composition variable** — fill with `--variables` (no code edit).
|
||||
|
||||
### 1. The word (instant)
|
||||
|
||||
`markText` — the held word (always on screen; box never moves). `fontStyle`:
|
||||
`display` (Impact, bold condensed caps) or `serif` (Georgia italic). `markScale`
|
||||
(0.3–2) sizes it.
|
||||
|
||||
### 2. The texture frames — `frames` (the core content)
|
||||
|
||||
A JSON array of texture-flip frames, cycled by strobe-step index:
|
||||
|
||||
```jsonc
|
||||
[
|
||||
{ "texture": "tiles-138", "bg": "#ff70b0", "fill": "#f0a020", "ink": "#2a0f1d" },
|
||||
{ "texture": "lava", "bg": "#101127", "fill": "#ff5a2c" },
|
||||
{ "texture": "onyx", "bg": "#e8e2d6", "fill": "#3a3a44" },
|
||||
// texture = file name (no .png) from assets/texture-mask-text/masks/ (66 available)
|
||||
]
|
||||
```
|
||||
|
||||
- **Replace the texture image** → change `texture` (66 masks bundled: `tiles-138`,
|
||||
`lava`, `onyx`, `marble-016`, `wood-066`, `concrete`, `metal-041-a`, `bricks-075-a`,
|
||||
`grass-005`, `snow-015`, …). List them: `ls assets/texture-mask-text/masks/ | sed 's/\.png$//'`.
|
||||
- **Replace the foreground color** → change `fill` (multiplied INTO the texture inside
|
||||
the letters: light fill = bright/clear glyph, dark = moody, `#ffffff` = texture's own
|
||||
color). `ink` is optional (UI/decor color).
|
||||
- **Replace the frame background** → change `bg` (solid color behind the word that beat).
|
||||
- Empty `frames` → the built-in 7-frame texture-flip set.
|
||||
|
||||
`idleColor` / `idleInk` set the between-burst plate (default white word on black).
|
||||
`decor: yes` adds the blueprint grid + crop border per frame.
|
||||
|
||||
### 3. Match the changes to the beat — `strobePlan` (the core timing knob)
|
||||
|
||||
A JSON array of bursts; the template fires a **0 ms flip** at every jump time, cycling
|
||||
`frames` by a global step counter, and cuts back to the idle base at each `end` (unless
|
||||
the burst runs to the composition end → no terminal black, so the default never stops).
|
||||
|
||||
**Default (base template): one continuous burst the whole clip** — flicker, no stops:
|
||||
|
||||
```jsonc
|
||||
[{ "start": 0, "end": 3, "step": 0.125 }] // jump every 0.125 s, 0 → duration
|
||||
```
|
||||
|
||||
**gruop_4-faithful variant** (two bursts pinned to the rolls, black gaps between):
|
||||
|
||||
```jsonc
|
||||
[
|
||||
{ "start": 1.125, "end": 1.542, "step": 0.125 }, // jump every 0.125 s
|
||||
{
|
||||
"start": 2.042,
|
||||
"end": 2.708,
|
||||
"jumps": [
|
||||
2.042,
|
||||
2.167, // OR list exact times
|
||||
2.292,
|
||||
2.417,
|
||||
2.5,
|
||||
2.625,
|
||||
],
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
**Building `strobePlan` from an AudioMap:**
|
||||
|
||||
1. **Find the roll(s).** Each `rolls[]` entry (or dense onset cluster) → one burst.
|
||||
2. **Burst start = lead the anchor.** Open ~40–190 ms _before_ the kick/downbeat that
|
||||
launches the roll, so the first flip lands _on_ the hit (gruop_4 burst 1 leads 1.254
|
||||
by ~85 ms → start 1.125).
|
||||
3. **Jumps = the grid the roll plays.** A 449/min hi-hat roll ≈ every 0.125 s →
|
||||
`step:0.125`. Irregular roll → list the actual `events[].t` as `jumps[]` so every
|
||||
flip sits on a real onset.
|
||||
4. **Burst end = the stop.** End on the `hard_stop` / last snare / `SURGE` snapped to the
|
||||
next anchor; the template cuts to the held-word-on-black base there.
|
||||
5. **Order `frames` for accents.** Put the highest-contrast texture/bg on the index that
|
||||
lands on the downbeat/kick; a near-black `bg` frame reads as a 1–2 frame blink-off.
|
||||
|
||||
Rule of thumb (`motion-primitives.md`): hard hits are **0 ms** (all flips are `tl.set`,
|
||||
never tweened) and a dense strobe runs **≤ 2–3 s** — keep bursts short, let the
|
||||
`hard_stop` clear them.
|
||||
|
||||
---
|
||||
|
||||
## Files
|
||||
|
||||
- `index.html` — reference implementation (Texture-Flip default + beat-matched plan).
|
||||
`lint`: 0 errors (2 cosmetic warnings — `invalid_composition_variables_declaration`,
|
||||
shared with the base template; and `Impact` font, carried from texture-flip, Arial
|
||||
fallback). `validate`: 0 errors (the 5 WCAG 1:1 warnings are intrinsic to
|
||||
`background-clip:text` — the checker can't read texture-filled glyphs).
|
||||
- `assets/` — `gsap.min.js` + `texture-mask-text/masks/*.png` (66), copied from
|
||||
`../texture-flip` so the template is self-contained.
|
||||
- `card.json` — draft template card. `meta.json` — name / dims / 24 fps / 3 s.
|
||||
- `renders/proof.mp4` — proof render of the built-in config.
|
||||
|
||||
## Provenance
|
||||
|
||||
Reversed from `bgm-golden-sample-reverse/gorup-by-group/group_4` (`gruop_4.mp4`,
|
||||
`audiomap.json`, `gruop_4.bg-flicker.gemini-analysis.md`). Texture-Flip technique +
|
||||
assets from `group_4/texture-flip`. Timeline/overlay shape scaffolded on
|
||||
`group_1/webgl-textures-playground`.
|
||||
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 176 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 195 KiB |
|
After Width: | Height: | Size: 85 KiB |