A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的
JavaScript agent-skillsai-agentsai-short-filmai-videoanimationcanvasclaudeclaude-codeclaude-code-pluginclaude-code-skillcreative-codingffmpegfilmmakingmotion-graphicsopus-5-5prompt-librarytext-to-speechthreejsvideo-productionwebgl
Pictogram Motion: a new demo, "Left Behind", told with objects, transport, weather and signs
lemomo-ai0f38ee9913b4
diff --git a/.gitignore b/.gitignoreindex 0da12c5..76a54de 100644--- a/.gitignore+++ b/.gitignore@@ -26,8 +26,6 @@ styles/*/demo/music.wav*.log# 喊词是输入素材(只能在 macOS 上近似重建),要提交!styles/game-show/demo/voices/*.wav-# 赛事官方图,只作参考、不分发(片中标识怎么处理开源前再定)-styles/pictogram-motion/demo/ref/styles/*/demo/music/src/# ---- 2026-09-26 GitHub 发布前补充 ----diff --git a/styles/pictogram-motion/DEMO.md b/styles/pictogram-motion/DEMO.mdindex a873943..84ef86c 100644--- a/styles/pictogram-motion/DEMO.md+++ b/styles/pictogram-motion/DEMO.md@@ -2,183 +2,99 @@One example among many. Don't reuse its story, arc, shots, props or timings.-Demo: *Aichi-Nagoya 2026 — All 43 Sports* (EN-JP version, 163.6 s, 1920×1080 @ 60 fps, 150 BPM, 70 sport cards, no narration) · `pictogram-motion.mp4` · source in [`demo/`](demo/) · engine: Canvas2D (`engine.js` + `scenes.js` + `poses/*.js`), headless Chrome frame capture, numpy-synthesised score.+Demo: *Left Behind* 《被落下的伞》 (50.0 s, 1920×1080, 24 fps) · `pictogram-motion.mp4` · source in [`demo/`](demo/)--> **Rights note.** The demo is an unofficial fan-made promo for a real event, the 20th Asian Games Aichi-Nagoya 2026; the Aichi-Nagoya Asian Games Organising Committee and the Olympic Council of Asia did not make or endorse it. The red-sun-and-rings mark is drawn in code to imitate the official emblem, and the slogan is the official one, quoted; neither is ours to reuse. In a film of your own, replace both with original ones. The event name (AICHI-NAGOYA 2026 / THE 20TH ASIAN GAMES), the slogan (IMAGINE ONE ASIA / ここで、ひとつに。), the emblem-like red-sun-and-rings mark drawn in code, the five-colour palette and its colour names, and the grid pattern language all follow the organiser's identity. They belong to the organiser (Aichi-Nagoya Asian Games Organising Committee / Olympic Council of Asia). `demo/ref/` holds official images downloaded from the Games' website for reference only. They are never drawn into the film and must not be redistributed. **Any other film made from this code must replace all event-specific elements** (see [Replacing the event elements](#replacing-the-event-elements)).+A yellow umbrella is left on a city bus on a rainy morning. All day in the sun nobody needs it; at the end of the line it joins 312 other lost umbrellas on the depot's shelf. At rush hour the storm comes back, the depot opens every shelf, and 313 umbrellas go back out into the rain. The hero is an object, not a person: the cast is an umbrella, a bus, doors, stop signs, a clock, clouds, sun, moon, lightning, a lost-property sign and footprints, all built from the same round-capped geometry as the grid pattern. English narration (Kokoro `bf_emma`) with Chinese and English subtitles. Line 4, the street names, the depot and the number 313 are fiction.## Story & structure-A fan promo listing every sport of a multi-sport games, one card per sport, on the beat. How the demo used the style's native powers:--| Native power | Story use |-|---|---|-| **One card = one item** | Any list of 20–80 things: every event of a games, every tool in a kit, every station of a process. The count is the hook ("ALL 43 SPORTS"). |-| **Chapters = colours** | Group the list into 5–7 families. Each family gets a palette hue, so the viewer always knows where they are. |-| **Pictogram action** | Every item needs one *verb* that reads in 1.6 s (throw, jump, swing, pedal). If an item has no body action, give it a prop action (a gear turns, a cup pours). |-| **Pace ladder** | Normal cards are 4 beats (1.6 s). Sub-families become 2-beat rapid-fire runs (4 swim strokes, 4 cycling disciplines, the racket sports), which gives the film a second tempo without changing BPM. |-| **Long take** | The first and biggest chapter is one sideways camera move down a track: 14 stations one screen apart, with a whip-pan on each beat-cut. Use it for the "hero" family. |-| **Grand finale grid** | All items come back as a 9×5 icon wall, flip in, turn one colour, collapse into a single sun, then the slogan and the end card. |--**Story shape (demo):** heartbeat cold open (a red dot pulsing on ink, rings drawing around it) → title slam on a full five-colour pattern → three count-ups (43 SPORTS / 469 EVENTS / 16 DAYS) → "ON YOUR MARKS… SET…" with half a beat of silence → 7 chapters, 70 cards → icon-wall finale → slogan → end card → fade to black over the music's ring-out.--Adapting a topic: list the items; group them into 5–7 chapters; give every item a one-beat verb; pick one chapter for the long take; choose which runs go 2-beat; write a two-line slogan for the finale.--### The demo's look, as built+Hook: rain, and on the first beat a yellow umbrella snaps open (the only warm colour in a blue world) over a trail of wet footprints. Then the sun comes out, dry footprints step off the bus, the umbrella stays on its rail. Turn: half a beat of silence, thunder, and the umbrella that nobody needed in the sun becomes what the whole city needs. Landing: the shelf of 313 folded umbrellas opens at once and turns into the film's own pattern; the next morning at 07:42 it rains again and the footprints under the yellow umbrella are dry, answering the first shot.-A **catalogue film**: a set of N items (sports, products, features, dishes, steps) is shown one card at a time, fast, on the beat. Each card = **one pictogram doing one action + a huge title + a second-language line + a mono index "07 / 43"**. Cards are grouped into chapters. Each chapter owns one colour of a five-colour palette. A chapter card with a full-bleed pattern opens each group.+Candidate structures considered: a chain of shape changes (one disc becomes sun, wheel, clock, coin; no subject, no turn) and a countdown of ten city moments (a list again). One object's day won: it needs objects, vehicles, weather, signs and actions for real reasons, and the signature (the pattern) grows from one canopy to a shelf to the whole frame.-The recognisable ingredients are:-1. **The grid pattern** ("core graphic"): a 180 px square grid. Big discs and half-discs span cells. About half of the cells carry a small motif (fish-scale waves, dot scales, triangle scales, striped sunset, gear/sun wheel, crescent, concentric arcs, checker, gradient quarter-disc…). The pattern uses **5 tones of one hue**, and **whole rows are cut and shifted sideways**. The row shift is the signature: it drives the backgrounds, the chapter beats and the main transitions.-2. **The pictogram athlete**: flat, faceless, built from rounded bars with a disc head. The near-side limbs are drawn in the foreground colour and the far-side limbs in a colour 42 % mixed toward the background. Props are just as geometric: discs, rings, capsules, straight lines.-3. **Type as architecture**: a 900-weight grotesk title (Inter Tight) set 150–330 px tall, and a heavy CJK line (Noto Sans JP) under it. Small DM Mono meta text sits in the corners, as on a broadcast HUD.--The mood is premium sports-broadcast identity: flat colour, no gradients except one soft light sweep, no outlines, no textures except a very light film grain.+Native moves spent: *one verb per item* (the umbrella opens, furls, turns over, hooks on, drips), *chapter = colour* (navy rain, teal day, coral depot, ink storm, yellow bloom), *long take down a track* (the line, one stop per beat), *pace ladder* (one-second clock cards), *count-up slam* (313), *icon wall* (the shelf turns yellow), *split screen along a grid line* (wet stop / dry shelf), and one of our own: *the wall becomes the pattern* (313 canopies open into half-discs and the rows shift like the core graphic).## Shots-| # | Section | Camera / picture | Native move / note |-|---|---|---|---|-| 1 | Cold open | Locked frame: a red dot pulsing on ink like a heartbeat, rings drawing around it | the only `oBack` ease |-| 2 | Title | Slam on a full five-colour pattern; rows transition out | row-shift reveal |-| 3 | Count-ups | 43 SPORTS / 469 EVENTS / 16 DAYS, one bar each | count-up slam |-| 4 | "ON YOUR MARKS… SET…" | Locked; half a beat of silence before the first chapter | silence before a big hit |-| 5 | Athletics (chapter 1) | The long take: 14 stations one screen apart, whip on every cut | long take down a track |-| 6 | Chapters 2–7 | Locked cards, layouts A/B/C/M rotated per chapter, 2-beat runs for swim strokes, cycling and rackets | chapter = colour; pace ladder |-| 7 | Finale | 9×5 icon wall flips in, turns one colour, zooms to 0.9, tiles collapse into one red sun | icon wall; many become one |-| 8 | Slogan + end card | Sun and rings rise and shrink; slogan, title, dates, colour bars, credit line; fade to black over the ring-out | see End card |--The camera exists only in the **long take** (`trackScene`). There, 14 stations are laid one screen width apart. The camera drifts at 42 px/s and on every cut whips one full screen (`E.ioExp` from 0.14 s before the beat to 0.24 s after). Two background rows of 360 px motif cells scroll at parallax 0.28 and 0.42. The deep-red track (y 780) has cream lane lines, and dashes roll faster for running events (`RUNNING` speeds). An event spec (`100M`, `4×100M`, `7.26 KG`…) is painted on the track, sheared −0.35, at 12 % cream. Everywhere else the frame is locked and flat; energy comes from the row shifts, transitions and figure actions.+Film time; 120 BPM, beat 0.5 s, bar 2 s. Every shot starts on a beat or an eighth. HUD on every shot except the end card: `LINE 4` and the clock top left, chapter and weather (word + glyph) top right, a 12-tick bar = the 12 stops of Line 4.++| # | Time | Shot | Camera / transition | Native move / note |+|---|---|---|---|---|+| 1 | 0.0–2.5 | navy rain pattern; drops in the motif cells; the furled umbrella snaps open on 0.5 (the film's one back ease) over wet footprints, furls on 2.0 | locked, background scrolls with the walk | opening: a single motif becomes the frame |+| 2 | 2.5–4.0 | the same furled umbrella, now inside a bus window; it turns over and hooks onto the rail on 3.0; the bus brakes at stop 4 · ELM ST, bell on 3.5 | shape match cut, then pull back 4.1× → 1× along the grid | |+| 3 | 3.88–4.62 | rain → sun at the same moment: navy tiles flip to teal, a sun appears, `07:42` → `07:51` | 11×6 tile flip | weather as a chapter change |+| 4 | 4.5–6.5 | doors open; dry bare-foot prints walk out on 5.0, 5.5, 6.0; doors close on 6.0; the umbrella stays | locked wide, slight push | people only as traces |+| 5 | 6.5–10.5 | iris from the umbrella into the title card: umbrella on its rail over a seat on the stage disc (assembled from sliding bands); `LEFT / BEHIND`, 被落下的伞, tag `LOST ITEM · UMBRELLA, YELLOW` on 7.0; a drip on 9.0 and 10.0 | iris → locked | type as architecture |+| 6 | 10.5–13.5 | ALL DAY 一整天: the bus rides, stop signs 03–08 whip past one per beat | rows transition; lateral track, one-screen whip on 11.0–13.0, row parallax | long take down a track |+| 7 | 13.5–16.5 | three one-second cards 10:00 / 14:00 / 18:00 in teal, sky, coral: the stage disc is a clock, the sun walks its rim, the umbrella hangs dry beside it | falling columns between cards | pace ladder |+| 8 | 16.5–18.5 | stop 12 · DEPOT; the sun sinks behind the road, the moon rises | push in; then the frame slides up a screen (18.05–18.5) | |+| 9 | 18.5–21.5 | LOST & FOUND 失物招领 chapter band; our sign (umbrella + question mark) slams; the umbrella gets a tag `No. 313`; rows jump a quarter cell on 19.5–20.5 | locked | chapter card |+| 10 | 21.5–25.0 | quarter-discs open onto our umbrella in its cubby; pull back 4.2× → 0.62× to a shelf of 320 cubbies (313 umbrellas, a few gloves, keys, hats, a scarf); a panel counts 1 → 313, landing on 24.0 | quarter transition; long pull back | icon wall, count-up slam |+| 11 | 25.0–28.0 | push back in and drift along the shelf; DAY 02 … DAY 09, a sun per day; 26–28 only a clock ticks | slow drift | the breath; silence before the turn |+| 12 | 28.0–31.0 | thunder: the shelf splits along a zigzag; STORM 暴雨 on ink; lightning on 28.0 and 29.5; rows lurch half a cell on the beats | lightning split | |+| 13 | 31.0–34.0 | split screen: left, feet waiting at ELM ST in the rain (等车的人); right, the dry shelf (伞是干的, `313 DRY`) | halves drop and rise along x = 960 | split along a grid line, held 2.5 s |+| 14 | 34.0–36.5 | the depot shutter; the sign turns CLOSED 休息 → TAKE ONE 拿一把 on 34.5; the shutter rolls up a row per eighth (35.0–36.25); half a beat of silence | tile flip; locked | |+| 15 | 36.5–40.5 | BLOOM: all 313 open in a ripple from ours (≈0.2 s); the colours sweep to yellow row by row; rows shift half a cell on 39.0, 39.5, 40.0 and the wall becomes the pattern | slow pull back 1.1× → 0.8× | **the wall becomes the pattern** |+| 16 | 40.5–44.0 | EVERY STOP 每一站: Line 4 as a route; a stream of umbrellas runs from the depot and three open at each stop, one stop per eighth; the 12 HUD ticks light in step | quarter transition; pull back from the depot end | |+| 17 | 44.0–46.5 | the next morning, 07:42, the first shot again: rain, the yellow umbrella open, puddles everywhere except under it, dry footprints | rows transition; slow push | ending that echoes |+| 18 | 46.5–50.0 | end card | rows transition; pattern rows stop one by one | |++Narration (English voice, subtitles Chinese over English, one cue per line):++| Start | Line |+|---|---|+| 0.4 | Seven forty-two. Rain on Line Four. |+| 3.9 | Then the sun came out, and someone forgot their umbrella. |+| 11.0 | It rode the line all day. Nobody needs an umbrella in the sun. |+| 19.6 | At the end of the line, it joined three hundred and twelve others. |+| 28.4 | Then, at rush hour, the storm came back. |+| 33.9 | The depot opened every shelf. |+| 37.4 | Three hundred and thirteen umbrellas went back out into the rain. |+| 44.3 | Lost on a sunny day. Found on a rainy one. |-Intro and finale "camera": the finale wall zooms to 0.9 with 10 px gutters, then every tile collapses to the centre and a red sun grows out of it. The end card's sun and rings rise from the centre to y 330 as they shrink to 0.62×.+77 words in 31.5 s of speech (2.44 words/s; per-line Kokoro speed 0.66–0.84). Every line passes `asr_check.py` (the time is checked as Whisper writes it, "742"). Captions hold at least the line + 0.6 s (shortest 3.24 s); numbers are spelled out for the voice and written as digits in the captions.## Score structure-- **No narration.** The film is carried by type and music. The subtitle file is a title-card track only (see End card).-- **Score**: original, fully synthesised in `demo/music/music.py` (numpy + scipy; no samples). "Wadaiko × electronic", 150 BPM 4/4, D *miyako-bushi* (D Eb G A Bb) over D minor harmony, 101 bars = 161.6 s plus a 2 s ring-out. Instruments are synthesised: odaiko / nagado / shime taiko, *ka* rim clicks, kick, clap, snare, hats, shaker, crash, plus foley-like hits (splash, drop, pok, clank, crack). Shamisen and koto are Karplus-Strong plucks (`ks_render`, koto with pitch bends); there are also a synth bass, pads, detuned-saw chord stabs, risers and a drone.-- **Picture-locked by data**: `music.py` reads `music/timeline.json` (exported from `edl.js`). Every shot start gets an accent chosen by chapter (`card_accent`: splashes for aquatics, *pok* for rackets, odaiko + stab for combat, clank for power…). Chapter and finale starts get a `big_hit`, **preceded by a half-beat of silence** (drums and bass muted). The report checks each of the 79 shot onsets to within ±15 ms (demo: 79/79 pass, offsets ≤ 0.2 ms).-- **Master**: stems `music_bed.wav` + `sfx.wav`, a 2:1 glue compressor and a limiter, at −14 LUFS integrated and ≤ −1 dBTP (demo: −14.11 LUFS, −1.12 dBTP). `music/report.txt` holds loudness, band energy, onset and gap checks. Render time is about 30 s.-- **Section layout is hard-coded** in `compose()` (`EXPECTED = dict(intro=0, ath=12, …, finale=89)` in bars). If the EDL changes, the assert fires. For a new film, re-write `compose()` for the new chapter bars (hand it to a music sub-agent with `timeline.json` and this section) and keep `card_accent`, `big_hit` and the report as they are.+120 BPM, picture-locked: `mix.py` places every hit from the page's `window.EV` (exported to `events.json`), so cuts, slams, steps and stops land on their frames.-## Palette & props+- Instruments: a synthesised electronic kick under everything, sampled marimba (rain drips, ostinati, the count run), glockenspiel (bells, the sun going down, one note per stop), bowed vibraphone pads, electric bass, shaker (rain), hi-hat, claps, log drum and claves (the depot), frame drum (the storm), crash.+- Key follows the weather: D minor in the rain → F major when the sun comes out (a glockenspiel run on the flip) → D minor at the depot and in the storm → the film's first F♯ when the sign turns to TAKE ONE → D major for the bloom and the next morning.+- Silences: half a beat before the title (6.75–7.0), before the depot (18.25–18.5) and before the bloom (36.25–36.5); 26–28 a single ticking clock, then thunder as the first sound of the storm.+- Foley by event: canopy snap, wet and dry steps, furl, rail clink, air brakes, stop bell, tile clicks, door hiss, whips, drips, shutter clanks, a ripple of 14 canopy pops on the bloom, a pop per stop. Rain beds: bright outside, muffled while the camera is inside the bus, heavy in the storm.+- Voice compressed, then about 10 dB over the music by RMS; music ducks and dips 300 Hz–4 kHz under each line.+- Measured on the master: −14.0 LUFS integrated, true peak −4.0 dBTP.-**Canvas**: 1920×1080, grid `G.CELL = 180` (10.7 columns × 6 rows). Everything snaps to that grid: the chapter band is 2 rows tall, transitions cut by 180 px rows or 240 px columns, and the finale wall is 9×5.+## Palette & props-**Palette** (`engine.js` → `G.PAL`; each hue has five tones `t[0]` darkest → `t[4]` lightest; `t[2]` is the base). The demo's values were sampled from the official core graphic:+Five hues and a dark neutral, five tones each (`G.PAL` in `engine.js`, t0 darkest → t4 lightest; light hues take dark type):-| key | demo name | t[0] | t[1] | **t[2] base** | t[3] | t[4] | fg (type & figure) |+| key | name | t0 | t1 | **t2 base** | t3 | t4 | type ||---|---|---|---|---|---|---|---|-| red | Jonetsu Red | `#c21d15` | `#d22419` | **`#e83220`** | `#ec5a26` | `#f07a45` | cream `#fbf6ec` |-| purple | Kakitsubata Purple | `#231a6e` | `#2c2084` | **`#4e3a93`** | `#644d9d` | `#7a62a9` | cream |-| green | Shinrin Green | `#006d35` | `#008440` | **`#079a3e`** | `#2da547` | `#68b15d` | cream |-| gold | Kinshachi Gold | `#b48900` | `#c69b00` | **`#d5b102`** | `#debc2f` | `#e7d16c` | dark `#211904` |-| ochre | Dento Ocher | `#946a2e` | `#ac7d38` | **`#c18e46`** | `#d2a55c` | `#e0bf84` | dark `#1e1409` |-| ink | Sumi | `#0f0c15` | `#16121d` | **`#1e1a27`** | `#2a2535` | `#3a3447` | cream, accent = gold |+| navy | Rain Navy | `#13254a` | `#1a3263` | **`#24457d`** | `#3b5e95` | `#5d7cad` | cream `#fbf6ec` |+| teal | Tram Teal | `#00544c` | `#00685d` | **`#0b7f70`** | `#2e9686` | `#5fae9f` | cream |+| sky | Puddle Sky | `#4b95c4` | `#61a5d0` | **`#7ab6da`** | `#97c7e3` | `#b8daeb` | dark `#0f2036` |+| coral | Brick Coral | `#a93726` | `#c04731` | **`#d75d43`** | `#e2785c` | `#ea957a` | cream |+| yellow | Signal Yellow | `#d39400` | `#e4a608` | **`#f2ba1d`** | `#f6c94a` | `#f9d87e` | dark `#231902` |+| ink | Storm Ink | `#0c1018` | `#131924` | **`#1b2230`** | `#272f41` | `#374055` | cream, accent yellow |-Cream `G.CREAM = #fbf6ec`, ink `G.INK = #15111c`. **Gold and ochre take dark type and dark figures**; the others take cream. `G.CYCLE = ['red','purple','green','gold','ochre']` is the rotation used by multi-colour chapters and the intro pattern. On cards the pattern is drawn at `spread 0.42` (low contrast, so the type reads), and at `spread 0.95` on chapter cards (full contrast).+The umbrella is Signal Yellow t2 with a t0 gore: the only warm colour until the bloom. Grid cell 180 px (6 rows). The pattern draws from two motif sets: rain (half-discs, fish scales, dot scales, arcs, crescents, raindrop scales, clouds, rain strokes, small umbrellas) and sun (quarter discs, sunsets, sun wheels, fading bars, suns, wheels, wayfinding chevrons, checks). Props: bus (rounded body, five windows with seat backs and a rail, sliding doors, disc wheels), stop signs (route number, bus glyph, street), clock face on the stage disc, cubby shelf, shutter of grooved slats, lost-property sign, route line with stop discs.-**The pattern** (`G.pattern(palKey, seed, {spread, density})`): fill with `t[1]`. On each grid node, 34 % of the time place a disc of radius `CELL` in a random tone, and 16 % of the time a `t[3]` disc with a `t[0]` half-radius disc inside it. Then a fraction `density` of the cells get one of 14 motifs (`G.motif` kinds 0–13): quarter-disc, half-disc, disc + dot, striped sunset, *seigaiha* fish-scale waves, dot-scale disc, triangle scales, concentric arcs, sun wheel / gear, checker, crescent, S-wave, gradient quarter-disc, fading bars. Each motif is rotated by a random multiple of 90°. The canvas is 3 cells wider than the screen, so any row can shift ±1 cell. **All the motifs are generic geometry.** Do not draw event mascots, landmarks or products into cells.--**Pictogram figure** (`G.joints` + `G.drawFigure`): the unit is body height = 1 and the origin is the hip. Segment lengths are torso 0.30, neck 0.045, head radius 0.082, upper arm 0.16, forearm 0.15, thigh and shin 0.225. Widths are torso 0.145, arm 0.076, leg 0.094, all with round caps. The draw order is far leg, far arm (colour `far` = fg mixed 42 % toward the background), then torso, near leg, near arm, head (fg). A second person (opponent or partner) is drawn behind in `far2` (60 % mix). In cards the figure stands on a **sun disc** (r 360–380 px, tone `t[1]` on light-fg hues, `t[4]` on gold/ochre, `t[3]` on ink) with one slow 9 % white light sweep across it.--**Card layouts** (`layoutOf(s)`, rotated per chapter by an order string such as `ball: 'ACBAB'`):-- **A**: text block left (x 130, baseline 610); disc and figure right (centre 1290, or 1370 for horizontal swimmers); a 300 px outline index number bottom-right at 20 % opacity.-- **M**: mirror of A (figure left at 640, text right-aligned at 1800).-- **B**: the title **fills the frame** (330 px, colour `t[1]`/`t[4]` "ghost" tone, a single line fitted to 1760 px). The disc and figure sit *over* the title. A bottom info bar has the JP name at 80 px, the EN name at 44 px and the mono meta right-aligned. 2-beat racket runs always use B.-- **C**: a solid 820 px left panel (`t[0]` or `t[4]`) that wipes in, with a 90 px hairline grid at 10 % and the text block on it; the pattern, disc and figure are on the right (1370).--**Type** (`demo/fonts/`, all OFL):-- Title: Inter Tight 900, 170 px (150 in C, 160 on the track), letter-spacing −0.02 em, auto-fitted with `G.fitFont` to 820 px.-- Second language: Noto Sans JP 900 at 92 px (EN-JP) or Noto Sans SC 900 (ZH version, with an extra JP line at 28 px/500).-- Meta: DM Mono 500 22 px, letter-spacing 3 px, e.g. `ATHLETICS 01 / 43`. Tags: a mono chip (`5×5 · 3×3`, `NEW` in red).-- HUD (every card and chapter): DM Mono 17 px in all four corners (event line top-left, chapter top-right) and a **43-tick progress bar** at the bottom. The current item is a tall 4 px tick; done items are at 75 %, the rest at 28 %.--**Grain**: added only at mux time (`noise=c0s=4:c0f=t+u`). The canvas itself is clean.--### Motion, as built--- **Grid of time**: 150 BPM, 1 beat = 0.4 s, 1 bar = 1.6 s. Every shot starts on a beat (`edl.js`), and every key action in a pose lands on an integer beat `u` (release, contact, landing).-- **Easing**: `E.oExp` (exponential ease-out) for almost every entrance; `E.ioExp` for whip-pans and wipes; `E.o5`/`E.o3` for panels and discs; `E.oBack` only for the intro's first dot.-- **Type entrance**: `G.maskText` slides each line up from below a clip rectangle (title over 0–0.5 s, JP line at +0.08 s, tag at +0.2 s). Meta lines type on (`G.typeText`, no caret). 2-beat cards compress all timings by 0.7.-- **Figure assembly**: for the first 0.42 s (0.28 s on 2-beat cards) the figure layer is cut into 54 px horizontal bands that start offset alternately left and right by 90–250 px and slide into register (`stageFigure(..., asm)`). This echoes the pattern's row shift.-- **Backgrounds breathe**: odd rows drift right and even rows drift left at 26 px/s, plus a fixed sine offset per row. On chapter cards every row **jumps a quarter-cell on each beat of the second bar** (beats 4–7), in time with the drums.-- **Chapter card**: a 2-row solid band grows from the centre (`E.o5`). A 330 px outline chapter numeral rises into it, and the title and JP line slide up. Hairlines sit above and below the band.-- **Transitions** (`transType`, window 0.12 s before to 0.26 s after the cut): `rows` (6 rows slide in alternating directions, used into every chapter and out of the intro), `cols` (8 columns drop or rise, used after chapter cards and in 2-beat runs), `slide` (racket runs: a push with a thin shadow edge), `quarter` (quarter-discs grow from cell corners, used into the finale), `iris` (a circle opens from the previous card's figure centre, with a shrinking ring), `flip` (an 11×6 grid of tiles flips over). Normal cards rotate `['quarter','rows','iris','flip','cols'][ci % 5]`. Inside the athletics long take there is **no** transition: the camera whips instead.-- **Motion blur only where it moves**: `isFast(t)` is true in the transition windows, and then `G.renderFrame` averages 5 sub-frames over a 0.5/60 s shutter. Static card frames render once.+Type: Inter Tight 900 titles (150–270 px, −0.02 em), Noto Sans SC 900 second-language line, DM Mono 17–28 px for the HUD, tags and captions.## End card-- The type on the cards *is* the text layer; nothing extra is burned in. `pictogram-motion.srt` lists the title cards (intro lines, chapter titles, each card "01/43 ATHLETICS — SPRINT / 短距離", slogan, end card), generated from the EDL by `demo/srt.cjs`.-- **Bilingual rule**: EN is always the big title. The second language is chosen by `?lang=`: `ej` puts Japanese in the big second line (`s.jpBig || s.jp`) and drops the small JP line; without `?lang=ej` (the page's own fallback, `scenes.js`) Chinese is big and Japanese small. The render and still scripts pass `?lang=ej` unless `LANGQ=zh`, so the published film is the EN-JP version.-- **End sequence (demo)**: cream end card, red sun + five-colour rings → **IMAGINE ONE ASIA / ここで、ひとつに。** (the official slogan) → **AICHI-NAGOYA 2026**, the dates, five colour bars and the credit line → fade to black (the last 1.3 s) → 2 s black tail over the music's ring-out.-- **Credit line**: our library's demo ends with "LemoLab × Claude Opus 5.5". It sits on the end card, centred under the five colour bars: `G.maskText(ctx, 'LemoLab × Claude Opus 5.5', W / 2, 1000, F.mono(24), rgba(G.INK, 0.6), inv(0.6, 1.2, l), { ls: '4px', align: 'center' })` in `finaleScene` (right after the colour-bar loop). It slides up 0.6 s after the end card lands (just after the bars), holds for about 3.5 s and fades out with the card. It is quieter than the date line, so it never competes with the title. This sign-off belongs to this library's demo only; a user's film carries no LemoLab credit and no copy of this card (take the line out of `finaleScene` when you adapt the code).--## Build notes--```-styles/pictogram-motion/demo/- index.html loads fonts + edl.js + engine.js + poses/*.js + scenes.js; exposes window.render(t), DUR, READY- edl.js edit decision list: every intro/chapter/card/finale shot with beats, names (EN/ZH/JP), pose, flags- engine.js G: easing, rng, palette, grid pattern + motifs, pictogram skeleton, text helpers- poses/ base.js (pose API + props G.P) + one file per chapter: ath aqua ball combat power nature asia (70 poses)- scenes.js intro, chapter card, card layouts A/B/C/M, athletics long take, finale, HUD, transitions, motion blur- render.mjs headless-Chrome frame renderer (stills / video, N workers → seg_*.mp4 + list.txt)- shot.mjs quick JPEG stills (+ --sheet contact sheet via sheet.py)- lab.mjs lab.html pose check sheets; lab.mjs also screenshots cover.html / cover34.html (4:3 and 3:4 posters)- mux.sh concat segments → 2 s tail → grain → + music.wav → mp4- srt.cjs title-card .srt from the EDL- music/ music.py (score), export_timeline.cjs (EDL → timeline.json), timeline.json, report.txt- fonts/ Inter Tight, Noto Sans SC, Noto Sans JP, DM Mono (OFL)- ref/ official reference images (NOT used by the film, do not publish)-```+Navy pattern whose rows stop one by one, the yellow umbrella opening on its stage disc, and the type sliding up from 46.5 s, fully in place from about 47.5 s to 50.0 s: LEFT BEHIND / 被落下的伞, a hairline, PICTOGRAM MOTION 象形运动图形, and "LemoLab × Claude Opus 5.5". The last narration line runs under it at the bottom until 49.05 s. The sign-off belongs to this library's demo only; a user's film carries no LemoLab credit and no copy of this card.-All commands run from `styles/pictogram-motion/demo/`. Node uses the repo's `node_modules/playwright-core`, and Chrome is found by `core/render/browser.mjs` (the playwright headless shell or `PLAYWRIGHT_CHROME`). **The scripts default to EN-JP** (`LANGQ=ej`); set `LANGQ=zh` for the Chinese version.+## Build-```sh-cd styles/pictogram-motion/demo+`sh styles/pictogram-motion/demo/build.sh` (`WORKERS=3` for more render workers, `VOICE=1` to regenerate the narration, `sh demo/build.sh 28 36` for a span).-# 1. Edit → timeline for the music (re-run after every change to edl.js)-node music/export_timeline.cjs # → music/timeline.json--# 2. Score (≈30 s; writes music/music_bed.wav, sfx.wav, music.wav, report.txt)-../../../.venv/bin/python music/music.py-grep "shots pass" music/report.txt # expect 79/79--# 3. Pose check sheets and stills while working-node lab.mjs stills/lab_ath.png "p=sprint,hurdles,relay&n=8&beats=4"-node shot.mjs 24.8 63.2 104.9 153 --sheet # EN-JP stills → stills/t_*.jpg + stills/sheet.jpg-LANGQ=zh node shot.mjs 63.2 # Chinese version still--# 4a. Render — EN-JP (default): 9696 frames → out_ej/seg_*.mp4-node render.mjs video 12 # 12 workers ≈ 2 min on an M-series Mac; use 2–3 when sharing the machine-./mux.sh # → ../pictogram-motion.mp4 (163.6 s, 9816 frames)--# 4b. Render — Chinese version-LANGQ=zh node render.mjs video 12 # → out/seg_*.mp4-OUTDIR=out ./mux.sh # → out/pictogram-motion_zh.mp4--# Partial re-render (e.g. only the ending): START/END in seconds, into a separate folder-START=148.1333 END=161.6 OUTDIR=out_tail node render.mjs video 2--# 5. Subtitles and posters-node srt.cjs # → ../pictogram-motion.srt-node lab.mjs stills/cover_ej.png "lang=ej" cover.html # 2880×2160 poster-node lab.mjs stills/cover34_ej.png "lang=ej" cover34.html # 2160×2880 poster-```--How the two language versions differ: the only switch is the URL query `?lang=ej`. `render.mjs` and `shot.mjs` add it from `LANGQ` (default `ej`); `scenes.js` reads it into `G.EJ` and changes the second-language lines (intro title, count-up labels, ON YOUR MARKS, cards, chapter cards, end card). `render.mjs` writes EN-JP segments to `out_ej/` and ZH to `out/`; `mux.sh` reads `OUTDIR` (default `out_ej`). Picture timing and music are identical.--`render.mjs` pipes JPEG-100 screenshots into ffmpeg (`libx264 -crf 12`) per worker; `mux.sh` re-encodes the joined film at `-preset slow -crf 14`, 60 fps, GOP 120, AAC 320k, with a 2 s cloned tail so the music's ring-out plays over black.--Pitfalls we hit (several are tied to this demo's props):--- **Figure environments ate the type.** Water surfaces, ramps, fences and nets belong to the figure layer and spread into the text column. Fix: `stageFigure` renders into its own buffer and applies a `destination-in` gradient mask (`{x0|x1|y1, f}`) that fades the layer to zero 90–120 px before the text area.-- **Gold and ochre need dark type and dark figures** (`fg #211904 / #1e1409`), and their disc is the *lighter* tone `t[4]`. Cream on gold fails contrast.-- **The ink chapter's disc vanished** at `t[1]`. Use `t[3]` for the sun disc on ink.-- **Pattern canvases are big** (2520×1260 each, and every card uses a new seed). Cache them, but cap the cache: `G.pattern` keeps an LRU of about 10 entries. An unbounded cache eats memory fast when 12 browsers render at once.-- **zsh loops**: in `while read line` loops the variable does not word-split. Use `${=line}` when passing lists of times to `node shot.mjs`.-- **Horizontal poses** (swimming) need the stage moved right (`wide`: disc at 1370, text max width 700) or the arms cross the title.-- **Official identity**: the demo imitates a real event's identity closely. That is tolerable only in an unofficial fan piece; a film made from this code must replace it, see [Replacing the event elements](#replacing-the-event-elements).+- Needs the voice tier and three sample libraries: `sh plugin/skills/lemo-opuscar/scripts/setup.sh deps voice`, `sh tools/fetch.sh instruments vcsl`, `… vsco2ce`, `… freepats`. The three fonts are fetched into `demo/fonts/` on the first run (`tools/fetch_fonts.sh`).+- Steps: narration (`voice/lines.json` → Kokoro → `out/voice/`, `asr_check.py`), captions (`tools/cues.py`: line starts in `voice/vo.json` + clip lengths → `voice/cues.js` and `../pictogram-motion.srt`; it refuses a caption shorter than max(1.8 s, line + 0.6 s)), events, picture, `mix.py`, `mux.sh`, readcheck, poster and the gallery style frame (t = 9.2, rendered with `?nocap=1`).+- The page takes `?a=&b=` (render a span of the film; `render(t)` always draws film second a + t) and `?nocap=1`.+- `render(t)` keeps no state between frames. About 45 s for the whole film with two workers on an M-series Mac.+- `readcheck.mjs` passes everything except two known kinds: the three pace-ladder cards (13.5–16.5, one second each by design, the narration says the same thing) and the TAKE ONE sign (1.5 s; it reads as a pictogram and the line "The depot opened every shelf" plays over it).## Engine reference@@ -186,80 +102,37 @@ Pitfalls we hit (several are tied to this demo's props):| API | What it does ||---|---|-| `G.E.{lin,io,o2,o3,i3,io3,oExp,iExp,ioExp,oBack,o5}` | easings (input clamped 0..1) |-| `G.clamp, G.lerp, G.inv(a,b,x)` | `inv` = normalised progress of x between a and b, clamped; used for every timing |-| `G.rng(seed)` | deterministic mulberry-style RNG |-| `G.PAL[key]`, `G.CYCLE`, `G.CREAM`, `G.INK`, `G.mix(a,b,t)`, `G.rgba(hex,a)` | palette and colour helpers |-| `G.pattern(pk, seed, {spread=1, density=0.5, cell=180})` | returns a cached pattern canvas (3 cells wider than the screen) |-| `G.drawPattern(ctx, pat, offs(row)→px, {oy})` | draws the pattern with a per-row horizontal offset (clamped ±1 cell) |-| `G.motif(ctx, kind 0–13, x, y, size, [bg, main, sub, accent], rng)` | one patterned cell |-| `G.joints(pose)` → `{hip, neck, sho, head, up, aL, aR, lL, lR}` | skeleton from a pose object |-| `G.drawFigure(ctx, J, nearCol, farCol)` | draw the pictogram (unit = body height) |-| `G.keyPose(keys, u, loop?)`, `G.lerpPose(a,b,t)` | keyframed poses in beats; each key `{b, ...angles, e:'easing'}` |-| `G.runCycle(phase, k, {lean})`, `G.walkCycle(phase, k)` | procedural gait (phase in cycles) |-| `G.fitFont(ctx, text, 'en'/'zh'/'jp', weight, px, maxW, ls)` | shrink font size to fit |-| `G.maskText(ctx, text, x, y, font, col, p, {align, ls, dir})` | mask slide-up entrance, p 0→1 |-| `G.typeText(ctx, text, x, y, font, col, p, {align, ls, caret})` | typewriter |-| `G.hair(ctx, x, y, w, col, p, lw)` | hairline wipe |--**Pose angle convention**: `rot` = whole body (positive = pitch forward); `torso` = upper-body lean; `head` = nod. Limbs are measured from "straight down = 0°", with forward = 90°, overhead = 180° and backward negative. Arms are in torso space and legs in body space. `aR2` and `lR2` (forearm, shin) are absolute in the same frame, not relative to the upper segment. R = near side (bright), L = far side (dim). `x, y` move the hip.--### Pose definitions (`poses/*.js`, contract in `poses/base.js`)--```js-POSES.name = {- pose: (u) => ({...}), // or keys: [...] + loop: beats (u = beats since the card started)- back: (ctx, J, u, C) => {}, // props/environment behind the figure (unit = body height, origin = hip)- front: (ctx, J, u, C) => {}, // props in front (ball, racket, bow)- second: (u) => ({...}), secondX: [dx, dy], secondFace: -1, // opponent / partner, drawn in C.far2- fig: { s, x, y }, // scale/offset inside the stage- iconU: 0.6, // which beat to freeze for the finale icon wall-};-// C = { fg, far, far2, acc, bg, line } from G.colorsFor(pk, discColour)-// props: G.P.ball, G.P.racket, G.P.stick, G.P.ground, G.P.speed (speed lines), G.P.arc (flight arc)-```-Check poses with `node lab.mjs out.png "p=a,b,c&n=8&beats=4&pal=red"`: each row is one pose sampled at n moments over `beats`.+| `G.E.{lin,io,o3,i3,io3,oExp,iExp,ioExp,oBack,o5}` | easings (input clamped 0..1) |+| `G.clamp, G.lerp, G.inv(a,b,x)`, `G.rng(seed)`, `G.hash(n)` | maths; `inv` = progress of x between a and b, used for every timing |+| `G.PAL[key]` (`t`, `fg`, `far`), `G.CREAM`, `G.INK`, `G.UMB`, `G.mix(a,b,t)`, `G.rgba(hex,a)` | palette and colour helpers |+| `G.pattern(pk, seed, {spread, density, set})` | cached pattern canvas, 3 cells wider than the screen; `set` = `'rain'` or `'sun'` motif library |+| `G.drawPattern(ctx, pat, offs(row)→px)` | draws the pattern with a per-row horizontal offset (wraps, so rows can travel) |+| `G.motif(ctx, kind, x, y, size, [bg, main, sub], rng)` | one patterned cell (kinds 0–13 geometry, 14–20 pictogram cells) |+| `G.umbrella(ctx, x, y, R, open, rot, canopy, gore, shaft)` | umbrella; `open` 0 furled → 1 open; origin = canopy rim centre |+| `G.drop`, `G.cloud`, `G.sunIcon`, `G.moon`, `G.bolt`, `G.foot(…, mirror)`, `G.item(ctx, kind, …)` | weather, footprint and lost-item pictograms |+| `G.disc`, `G.seg`, `G.ring`, `G.poly`, `G.rrect`, `G.hair` | round-capped drawing primitives |+| `G.maskText(ctx, text, x, y, font, col, p, {align, ls})`, `G.typeText(…)` | mask slide-up entrance; typewriter |-### `edl.js`+### `film.js`-`chapter(id, no, en, zh, jp, palKey)` adds an 8-beat chapter card. `card(n, en, zh, jp, pose, {beats=4, sub, fam, jpBig, track, water, racket, family})` adds one item. `fam: true` means the big title is `sub` and `en` becomes the small family line. `track: true` puts a card into the long take (all track cards must be consecutive). `racket: true` gives 2-beat B-layout cards with slide transitions. `palKey 'multi'` rotates `G.CYCLE` per card. Intro and finale are `{kind:'intro'|'finale', beats: 48}`. The script computes `b0, t0, dur`, then `EDL.DUR` = total beats × 0.4 s.+`SHOTS` (film seconds and a `kind` per shot), `TRANS` (grid transition per shot boundary: `rows`, `cols`, `slide`, `split`, `quarter`, `flip`), `EV` (sound events). One function per kind (`rainOpen`, `busStop`, `titleCard`, `track`, `ladder`, `lastStop`, `lost`, `wall`, `storm`, `split`, `shutter`, `bloom`, `route`, `echo`, `endCard`); shared pieces `textBlock`, `chip`, `stopSign`, `drawBus`, `drawWall` (the shelf, with `open`, `sweep` and `shift` callbacks), `hud`, `subtitles`. `frame(t)` handles the boundary transitions and the custom ones (flip, iris, descent, lightning split); `render` averages five sub-frames inside the `FAST` windows.-### `scenes.js`--`G.renderFrame(ctx, t)` → `frame()` finds the shot by binary search, decides whether t is inside a transition window, renders A and B into offscreen buffers and composites them, then draws the HUD. Key functions: `cardScene` (layouts via `layoutOf`), `chapterScene`, `trackScene` (`trackCam`, `stationX`, `SPEC`, `RUNNING`), `introScene`, `finaleScene` (`GRID 9×5`, `rings()`), `hud`, `transType` / `composite`, `stageFigure(ctx, poseName, u, C, x, y, scalePx, asm, mask)`, `patBg`, `multiBg`, `textBlock`, `sun`, `bigNumber`.--### Minimal example — a new card and a new pose+### Minimal example: a new pictogram and a card```js-// poses/nature.js (or a new poses/xxx.js added to index.html)-POSES.kite = {- iconU: 1,- keys: [- { b: 0, torso: -6, aR1: 150, aR2: 160, aL1: 20, aL2: 40, lR1: 10, lL1: -12 },- { b: 1, torso: -12, aR1: 170, aR2: 175, aL1: 30, aL2: 60, lR1: 18, lL1: -20, e: 'oExp' }, // tug on the beat- ],- loop: 2,- front: (ctx, J, u, C) => { // string + diamond kite, all geometry- const h = J.aR[2], k = [h[0] + 0.55, h[1] - 0.75 + 0.04 * Math.sin(u * Math.PI)];- G.seg(ctx, h, k, 0.01, C.line);- G.poly(ctx, [[k[0], k[1] - 0.12], [k[0] + 0.08, k[1]], [k[0], k[1] + 0.12], [k[0] - 0.08, k[1]]], C.acc);- },+// engine.js: a kite, built from the same geometry+G.kite = (ctx, x, y, s, col, line) => {+ G.poly(ctx, [[x, y - s], [x + s * 0.6, y], [x, y + s], [x - s * 0.6, y]], col);+ G.seg(ctx, [x, y + s], [x - s * 0.3, y + s * 2.2], s * 0.06, line);};-// edl.js, inside a chapter-card(44, 'KITE FLYING', '放风筝', '凧揚げ', 'kite', { sub: 'NEW' }); // n = index shown as "44 / N"; update the total (see below)+// film.js: a card that uses it, entered with the shared text block+function kiteCard(ctx, t) {+ const P = PAL.sky, lt = t - 50;+ ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);+ G.drawPattern(ctx, G.pattern('sky', 7, { spread: 0.42, set: 'sun' }), rowDrift(lt, 1));+ stageDisc(ctx, 1290, 520, 360, P.t[4], lt);+ G.kite(ctx, 1290, 420 + Math.sin(lt * Math.PI) * 20, 140, G.UMB, P.fg); // tugs on the beat+ textBlock(ctx, lt, 130, 540, { title: 'WIND', px: 230, zh: '起风了', zpx: 70, fg: P.fg });+}```-Then: `node lab.mjs stills/lab_kite.png "p=kite&n=8&beats=4"` → `node music/export_timeline.cjs` → (update `compose()` if chapters moved) → `node shot.mjs <t>` → render.--### Replacing the event elements--| What | Where | Replace with |-|---|---|---|-| Event name, edition, host city, dates | `scenes.js` 372–373, 398–407, 417, 539–541, 562–566; `cover.html` 94–114; `cover34.html` 90–113 | your own title and date line |-| Slogan "IMAGINE ONE ASIA / ここで、ひとつに。/ 在这里,合而为一" | `scenes.js` 534–536; covers | your own two-line slogan |-| Emblem-like mark (red sun + five rings, `rings()`, `RINGS`) | `scenes.js` 341–352, intro 356–375, finale 509–531 | an original mark, e.g. your own shape built from the grid motifs |-| Palette names (Jonetsu Red, Kakitsubata Purple, Shinrin Green, Kinshachi Gold, Dento Ocher) and hexes | `engine.js` `PAL` (lines 45–51); the name is printed on chapter cards (`scenes.js` 246) | a custom five-hue set with 5 tones each; keep the dark-fg rule for light hues |-| Item list, counts "/ 43", 43 HUD ticks, "469 EVENTS / 16 DAYS", finale "2026" tile | `edl.js`; `scenes.js` 118, 184, 414–418, 512, 570 | your list and numbers (derive from `CARDS` instead of hard-coding 43) |-| Chapter layout in the score | `music/music.py` `EXPECTED` + `compose()` | re-composed sections |-| Official reference images | `demo/ref/` | never ship; collect your own references |--Keep the grammar: the grid pattern with row shifts, pictogram athletes, the bilingual mask-slide type, the HUD with index and progress, beat-locked cards with a pace ladder, one long take, and the icon-wall finale.+Then add `{ t0, kind: 'kite' }` to `SHOTS`, a case in `drawShot`, a transition in `TRANS` and its sound in `EV`.diff --git a/styles/pictogram-motion/STYLE.md b/styles/pictogram-motion/STYLE.mdindex a868835..def2fcf 100644--- a/styles/pictogram-motion/STYLE.md+++ b/styles/pictogram-motion/STYLE.md@@ -1,29 +1,31 @@# Pictogram Motion — Style Prompt-> A beat-locked flash-card film built from three things only: a **square-grid "core graphic"** of circles, half-discs and tiny patterned cells whose rows slide past each other; **geometric pictograms** made of round-capped bars and a disc head; and **bold bilingual type** that slides up out of masks. Every cut lands on a drum hit.+> A beat-locked film built from three things only: a **square-grid "core graphic"** of circles, half-discs and tiny patterned cells whose rows slide past each other; **geometric pictograms** (objects, vehicles, weather, signs, and a disc-headed figure when one is needed) made of round-capped bars, discs and capsules; and **bold bilingual type** that slides up out of masks. Every cut lands on a drum hit.> References (grammar only): Otl Aicher's 1972 Munich pictograms (geometric athletes); multi-sport-games "look of the games" identity systems (a modular pattern + a colour set used for everything); Swiss sports-broadcast graphics (mono meta text, tick-bar progress). Learn the grammar; never copy any real event's pictograms, emblem, slogan, pattern artwork or colour names, and never name them in the film.## 1. Essence, and what it is not-A **catalogue film**: N items (products, dishes, steps, species…) shown one card at a time, fast, on the beat. Each card = **one pictogram doing one action + a huge title + a second-language line + a mono index "07 / N"**. Cards group into chapters; each chapter owns one hue, opened by a full-bleed pattern card.+Either a **catalogue film**: N items (products, dishes, steps, species…) shown one card at a time, fast, on the beat; or a **story told in pictograms**: one pictogram as the hero (an object, a vehicle, a sign as often as a person), a goal, a turn, an ending, told through the same cards, walls and transitions. Each card = **one pictogram doing one action + a huge title + a second-language line + a mono index "07 / N"**. Cards group into chapters; each chapter owns one hue, opened by a full-bleed pattern card.What makes a frame read as this style at a glance:1. **The grid pattern**: big discs and half-discs spanning square cells, about half the cells carrying a small motif, all in **five tones of one hue**, with **whole rows cut and shifted sideways**: the signature that drives backgrounds and transitions.-2. **The pictogram figure**: flat, faceless, rounded bars and a disc head; far-side limbs mixed toward the background. Props are discs, rings, capsules, lines.+2. **The pictogram set**: objects, vehicles, weather and signs, and a human figure only when the film needs one, all flat and built from the same geometry: round-capped bars, discs, half-discs, rings, capsules. Pictograms combine and turn into one another (a canopy is a half-disc of the pattern, a clock face is the stage disc). A figure, when used, is faceless, rounded bars and a disc head, far-side limbs mixed toward the background.3. **Type as architecture**: a 900-weight grotesk title set very large, a heavy second-language line under it, small mono meta text in the corners like a broadcast HUD.4. **Beat lock**: every shot starts on a beat, every key action lands on a beat.Mood: premium broadcast identity; flat colour, light grain, one soft light sweep as the only gradient.-Not an isometric infographic (no depth, no 3D), not Swiss motion graphics (the figure and the pattern carry as much as the type), not a cartoon (figures never emote, have no faces), not a data film (numbers are labels, not charts).+Not an isometric infographic (no depth, no 3D), not Swiss motion graphics (the pictograms and the pattern carry as much as the type), not a cartoon (pictograms never emote, figures have no faces), not a data film (numbers are labels, not charts).## 2. Materials & rendering- **Flat Canvas2D**, rendered clean; grain only at mux time. **One square grid** (cell ≈ 1/6 of the frame height) rules bands, transitions and walls.- **Pattern model**: fill with a mid-dark tone; on grid nodes randomly place cell-radius discs in random tones and discs-with-inner-discs; then a fraction of cells get one motif from a library of generic geometry (quarter-discs, fish-scale waves, dot and triangle scales, concentric arcs, sun wheels, checkers, crescents…), rotated by multiples of 90°; never mascots, landmarks or logos. Draw it wider than the screen so any row can shift one cell.-- **Figure model**: unit = body height, origin at the hip; draw far limbs (mixed ~40 % toward the background), torso, near limbs, head. A second person sits behind, mixed further (~60 %).-- **Stage**: the figure stands on a large **sun disc** in a neighbouring tone, crossed by one faint light sweep.-- **Figure environments** (water, nets, ramps) live in the figure's own buffer, masked to zero before the text column.+- **Pictogram model**: one stroke weight family per film (round caps), solid fills, at most two tones per pictogram (a darker gore, a far side). Objects keep their silhouette at icon size; anything that cannot be read as a sign at 60 px is cut.+- **Figure model** (optional): unit = body height, origin at the hip; draw far limbs (mixed ~40 % toward the background), torso, near limbs, head. A second person sits behind, mixed further (~60 %). People can also appear only through their traces (footprints, a queue of feet).+- **Stage**: the hero pictogram (any object or figure) sits on a large **sun disc** in a neighbouring tone, crossed by one faint light sweep.+- **Environments** (water, nets, ramps, rails, rain) live in the hero's own buffer, masked to zero before the text column.+- **Frame rate**: 24 fps; motion blur by sub-frame averaging only inside transitions, whips and fast camera moves.## 3. Colour logic@@ -38,7 +40,7 @@ Not an isometric infographic (no depth, no 3D), not Swiss motion graphics (the f- Title: a 900-weight grotesk (e.g. Inter Tight), 150–330 px at 1080p, tight tracking, auto-fitted. Second language: a heavy face under it. Meta: a mono (e.g. DM Mono) ~22 px, wide tracking; tags as mono chips.- **HUD** on every card: mono corner text and a **progress bar of N ticks** (current tall, done dimmed, rest faint), N derived from the item list.- **Bilingual rule**: one language is always the big title; the second language is chosen per version by a switch, never by hand-editing cards.-- The card type *is* the text layer. With narration, captions are a mono line on a solid band in the chapter hue, bottom, never over the title; hold ≥ max(1.8 s, speech + 0.6 s). A card that must be read (a spec, a number) holds ≥ 1.6 s.+- The card type *is* the text layer. With narration, captions are two lines on a solid band in the chapter's darkest tone (an ink band on light hues), bottom left, never over the title: the second language in a heavy face over the English in mono; hold ≥ max(1.8 s, speech + 0.6 s). A card that must be read (a spec, a number) holds ≥ 1.6 s.- Deliver an `.srt` of the title cards, generated from the edit list.## 5. Motion quality@@ -47,7 +49,7 @@ Not an isometric infographic (no depth, no 3D), not Swiss motion graphics (the f- **Pace ladder**: normal cards last one bar; related sub-items become half-length rapid-fire runs. A second tempo comes from dividing the beat, never from changing tempo.- Easing: exponential ease-out for entrances, exponential in-out for whips and wipes; a back ease once at most.- **Type enters by mask slide-up**: title first, second line ~0.08 s later, tag after; meta lines type on without a caret. Short cards compress all timings.-- **Figure assembly**: the figure arrives as horizontal bands sliding into register from alternating sides.+- **Pictogram assembly**: the hero pictogram and its stage arrive as horizontal bands sliding into register from alternating sides.- **Backgrounds breathe**: rows drift in alternating directions; on chapter cards they jump a quarter-cell on beats.- **Transitions** snap to the grid: sliding rows, dropping columns, a push, quarter-discs from cell corners, an iris from the last figure, a tile flip. Rotate them; each lasts a few frames around the cut.- **Motion blur only where things move**: sub-frame averaging inside transition and whip windows; static frames render once.@@ -71,7 +73,7 @@ Framing: text and figure never overlap (one text column, one stage); horizontal## 7. Sound palette-- **Type and music can carry the film alone**; a voice is optional, calm, one line per chapter at most.+- **Type and music can carry the film alone**; a voice is optional, calm, one or two lines per chapter.- **Percussion is the spine**: choose a drum family that suits the topic (frame drums, taiko, marching snares, steel pans, body percussion, an electronic kit) plus rim clicks, claps, shakers and crashes.- Colour instruments on top: Karplus-Strong plucks (any lute, koto or harp-like voice, with pitch bends), mallets (marimba, glockenspiel), detuned-saw chord stabs, a synth bass, pads, risers and a drone.- **Per-family accents**: every shot onset gets a hit chosen by chapter (a splash, a pok, a clank, a crack, a whoosh, a sizzle): foley reads the chapter's matter.@@ -102,7 +104,7 @@ A menu: use the ones your film needs.## 10. Engine-In `demo/`: `engine.js` (`G.pattern`, `G.motif`, `G.joints` / `G.drawFigure`, `G.keyPose`, `G.maskText`, easings), `poses/base.js` (pose contract, props `G.P`), `edl.js` (edit list in beats), `scenes.js` (layouts, transitions, HUD, motion blur), `lab.mjs` (pose sheets), `music/music.py` (picture-locked score with onset report). API table, pose convention and a minimal example: [DEMO.md](DEMO.md#engine-reference).+In `demo/`: `engine.js` (palette, `G.pattern` / `G.drawPattern` with whole-row offsets, `G.motif`, pictograms such as `G.umbrella`, `G.drop`, `G.cloud`, `G.sunIcon`, `G.moon`, `G.bolt`, `G.foot`, `G.item`, `G.maskText`, easings), `film.js` (shot list in film seconds, sound events, scenes, HUD, captions, grid transitions, motion blur), `mix.py` (picture-locked score, foley and voice from the same events). API table and a minimal example: [DEMO.md](DEMO.md#engine-reference).## 11. Variation spacediff --git a/styles/pictogram-motion/demo/CREDITS b/styles/pictogram-motion/demo/CREDITSindex e5f2429..14b8c29 100644--- a/styles/pictogram-motion/demo/CREDITS+++ b/styles/pictogram-motion/demo/CREDITS@@ -1,35 +1,23 @@-Aichi-Nagoya 2026 — All 43 Sports (EN-JP version) — Pictogram Motion (Lemo-Opuscar demo)-LemoLab × Claude Opus 5.5 (credit line on the end card, 157.4–161.6 s)+LEFT BEHIND 被落下的伞 — Pictogram Motion (象形运动图形) demo of the Lemo-Opuscar library+LemoLab × Claude Opus 5.5-Imagery-- All pictures are generated by code in this folder (Canvas2D: engine.js, scenes.js, poses/*.js). No photos,- no AI-generated images, no stock footage.-- The pictogram athletes (70 poses), pattern motifs, layouts and transitions were written for this film.+Picture+- Made entirely in code (Canvas2D): engine.js, film.js. No generated images, no photos, no third-party artwork.+- No real event, city, brand, logo or slogan appears. "Line 4", the street names, the depot and the number 313 are fiction.-Third-party names and marks shown in the film (NOT covered by this repo's licence)-- "THE 20TH ASIAN GAMES", "AICHI-NAGOYA 2026", "第20回アジア競技大会 · 愛知・名古屋", the dates 2026.9.19 — 10.4,- the slogan "IMAGINE ONE ASIA / ここで、ひとつに。", the five-colour palette and its colour names- (Jonetsu Red, Kakitsubata Purple, Shinrin Green, Kinshachi Gold, Dento Ocher), the emblem-like red-sun-and-rings- mark and the grid "core graphic" pattern language follow the official identity of the 20th Asian Games.- They belong to the Aichi-Nagoya Asian Games Organising Committee / Olympic Council of Asia.- The film is an unofficial fan piece and is not endorsed by the organisers.-- ref/ contains official images downloaded from the Games' website (core graphic in 5 colours, emblem,- slogan, a press photo). They were used as colour/shape reference only, are not drawn into the film,- and must not be redistributed.--Fonts (SIL Open Font License 1.1; licence texts in fonts/OFL-*.txt)-- Inter Tight (variable) — Rasmus Andersson / The Inter Project Authors, via Google Fonts — fonts/InterTightwght.ttf-- Noto Sans SC (variable) — Google / Adobe (Noto CJK), via Google Fonts — fonts/NotoSansSCwght.ttf-- Noto Sans JP (variable) — Google / Adobe (Noto CJK), via Google Fonts — fonts/NotoSansJPwght.ttf-- DM Mono Medium / Regular — Colophon Foundry, via Google Fonts — fonts/DMMono-Medium.ttf, fonts/DMMono-Regular.ttf--Music & sound-- Original score "Wadaiko × Electronic", 150 BPM, D miyako-bushi — composed and synthesised entirely in- music/music.py (numpy + scipy; taiko, shamisen/koto Karplus-Strong plucks, bass, pads, stabs, SFX hits).- No samples, no third-party recordings.+Fonts (SIL Open Font License 1.1; licence texts in fonts/, files fetched by tools/fetch_fonts.sh)+- Inter Tight — The Inter Tight Project Authors (OFL)+- DM Mono — The DM Mono Project Authors (OFL)+- Noto Sans SC — Google / Adobe (OFL)Voice-- None (no narration, no TTS).+- Kokoro-82M v1.0 (hexgrad, Apache-2.0) via kokoro-onnx (MIT), voice bf_emma. Checked with faster-whisper (MIT), model base.en.++Music and sound+- Original score and foley (mix.py): numpy/scipy synthesis plus sampled instruments.+- Samples (CC0): FreePats project (freepats.zenvoid.org) — electric_bass, world_perc (claves);+ VS Chamber Orchestra: Community Edition (Versilian Studios) — crash, log_drum;+ Versilian Community Sample Library (Versilian Studios) — marimba, vibraphone_bowed, glockenspiel, shaker, hihat, claps, frame_drum.-Tools-- Headless Chrome (Playwright headless shell), ffmpeg / libx264, Python numpy / scipy / Pillow.+Facts+- None. The story is fiction; no statistic is claimed.diff --git a/styles/pictogram-motion/demo/build.sh b/styles/pictogram-motion/demo/build.shnew file mode 100755index 0000000..3b3267c--- /dev/null+++ b/styles/pictogram-motion/demo/build.sh@@ -0,0 +1,51 @@+#!/bin/sh+# One command: LEFT BEHIND 被落下的伞 (Pictogram Motion demo), 50 s, 1920×1080, 24 fps+# sh demo/build.sh fonts if missing, voice if missing + speech check, captions, events, picture, mix, master,+# subtitles, readcheck, poster and the gallery style frame+# VOICE=1 sh demo/build.sh regenerate the narration before the check+# WORKERS=3 sh demo/build.sh more render workers (default 2)+# sh demo/build.sh 28 36 only a span of the film (film seconds) → demo/out/film-28-36.mp4+# Needs the voice tier (Kokoro model, faster-whisper) and the VCSL, VSCO 2 CE and FreePats sample libraries:+# sh plugin/skills/lemo-opuscar/scripts/setup.sh deps voice+# sh tools/fetch.sh instruments vcsl; sh tools/fetch.sh instruments vsco2ce; sh tools/fetch.sh instruments freepats+set -e+HERE=$(cd "$(dirname "$0")" && pwd) # .../styles/pictogram-motion/demo+FILM=$(cd "$HERE/.." && pwd) # .../styles/pictogram-motion+LIB=${LIB:-$(cd "$HERE/../../.." && pwd)} # library root+export LIB+[ -f "$LIB/core/render/video.mjs" ] || { echo "set LIB to the library folder"; exit 1; }+PY=${PY:-"$LIB/.venv/bin/python"}+NAME=pictogram-motion+WORKERS=${WORKERS:-2}+A=${1:-0}; B=${2:-50}+cd "$LIB"+mkdir -p "$HERE/out/voice" "$HERE/stills"+sh "$HERE/tools/fetch_fonts.sh"++# narration: Kokoro bf_emma, one clip per line; every clip must pass the speech-to-text check+if [ "${VOICE:-0}" = "1" ] || [ ! -f "$HERE/out/voice/L8.wav" ]; then+ "$PY" core/tts/tts.py "$HERE/voice/lines.json" "$HERE/out/voice"+fi+"$PY" core/tts/asr_check.py "$HERE/voice/lines.json" "$HERE/out/voice" --lang en++if [ "$A" != 0 ] || [ "$B" != 50 ]; then # a span, for checking a part of the film+ "$PY" "$HERE/tools/cues.py" "$A" "$B" "$HERE/out/film-$A-$B.srt"+ node core/render/events.mjs "$HERE" --q "a=0&b=50"+ node core/render/video.mjs "$HERE" --q "a=$A&b=$B" --fps 24 --workers "$WORKERS" --out "$HERE/out/video-$A-$B.mp4"+ "$PY" "$HERE/mix.py" "$A" "$B"+ sh core/render/mux.sh "$HERE/out/video-$A-$B.mp4" "$HERE/out/mix.wav" "$HERE/out/film-$A-$B.mp4" 24 0+ echo "done: $HERE/out/film-$A-$B.mp4"; exit 0+fi++"$PY" "$HERE/tools/cues.py" # voice/cues.js + ../pictogram-motion.srt+node core/render/events.mjs "$HERE" # → events.json (film times)+node core/render/video.mjs "$HERE" --fps 24 --workers "$WORKERS" --out "$HERE/out/video.mp4"+"$PY" "$HERE/mix.py" # → out/mix.wav+sh core/render/mux.sh "$HERE/out/video.mp4" "$HERE/out/mix.wav" "$FILM/$NAME.mp4" 24 0++# checks, poster and the gallery style frame (the title card, without captions)+node core/render/readcheck.mjs "$HERE" --step 0.1 > "$HERE/out/readcheck.txt" && echo "readcheck ok" || { grep -v '^OK' "$HERE/out/readcheck.txt" | tail -8; echo "readcheck: see DEMO.md for the known entries"; }+node core/render/still.mjs "$HERE" 9.2 --q nocap=1 --out "$HERE/out/poster" > /dev/null+ffmpeg -v error -y -i "$HERE/out/poster/t_9.2.jpg" -q:v 3 "$FILM/poster.jpg"+cp "$FILM/poster.jpg" "$HERE/stills/styleframe.jpg"+echo "done: $FILM/$NAME.mp4"diff --git a/styles/pictogram-motion/demo/cover.html b/styles/pictogram-motion/demo/cover.htmldeleted file mode 100644index 06ada89..0000000--- a/styles/pictogram-motion/demo/cover.html+++ /dev/null@@ -1,120 +0,0 @@-<!doctype html>-<html><head><meta charset="utf-8">-<style>-@font-face { font-family: "Inter Tight"; src: url(fonts/InterTightwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans SC"; src: url(fonts/NotoSansSCwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans JP"; src: url(fonts/NotoSansJPwght.ttf); font-weight: 100 900; }-@font-face { font-family: "DM Mono"; src: url(fonts/DMMono-Medium.ttf); font-weight: 500; }-html,body { margin:0; background:#000; }-canvas { display:block; }-</style></head>-<body>-<canvas id="c" width="2880" height="2160"></canvas>-<script src="edl.js"></script>-<script src="engine.js"></script>-<script src="poses/base.js"></script>-<script src="poses/ath.js"></script>-<script src="poses/aqua.js"></script>-<script src="poses/ball.js"></script>-<script src="poses/combat.js"></script>-<script src="poses/power.js"></script>-<script src="poses/nature.js"></script>-<script src="poses/asia.js"></script>-<script src="scenes.js"></script>-<script>-// 4:3 cover, 2880×2160: an 8×4 grid on top (pictograms + core-graphic patterns + red sun), ink-coloured title area below-// cover.html?lang=ej → English/Japanese version; Chinese version by default-const EJ = new URLSearchParams(location.search).get('lang') === 'ej';-const cv = document.getElementById('c'), ctx = cv.getContext('2d');-const CW = 2880, CH = 2160, S = 360, COLS = 8, ROWS = 4;-const { PAL, mix, rgba, F } = G;--// Cells: p = pictogram (pose name + palette), m = pattern cell, sun = red sun-const T = [- ['p', 'sprint', 'red'], ['m', 4, 'purple'], ['p', 'free', 'purple'], ['p', 'football', 'gold'], ['m', 8, 'ochre'], ['p', 'judo', 'ochre'], ['p', 'taekwondo', 'ochre'], ['m', 3, 'green'],- ['m', 11, 'gold'], ['p', 'highjump', 'red'], ['p', 'basketball', 'gold'], ['sun'], ['sun2'], ['p', 'archery', 'ink'], ['m', 5, 'red'], ['p', 'surfing', 'green'],- ['p', 'badminton', 'gold'], ['m', 7, 'ochre'], ['p', 'weightlifting', 'ink'], ['sun3'], ['sun4'], ['p', 'cyc_road', 'green'], ['p', 'fencing', 'ochre'], ['m', 6, 'purple'],- ['p', 'diving', 'purple'], ['p', 'skate', 'gold'], ['m', 12, 'green'], ['p', 'breaking', 'red'], ['p', 'climbing', 'ochre'], ['m', 9, 'red'], ['p', 'esports', 'purple'], ['p', 'equestrian', 'green'],-];--function tile(i, j, t) {- const x = i * S, y = j * S;- ctx.save(); ctx.beginPath(); ctx.rect(x, y, S, S); ctx.clip();- if (t[0] === 'p') {- const pk = t[2], P = PAL[pk];- const bg = P.t[(i + j) % 2 ? 2 : 1];- ctx.fillStyle = bg; ctx.fillRect(x, y, S, S);- const def = POSES[t[1]];- const C = G.colorsFor(pk, bg);- ctx.save(); ctx.translate(x + S / 2, y + S * 0.52); const U = S * 0.62; ctx.scale(U, U);- G.drawFigUnits(ctx, def, def.iconU ?? 1, C);- ctx.restore();- } else if (t[0] === 'm') {- const P = PAL[t[2]], r = G.rng(i * 31 + j * 7 + t[1]);- G.motif(ctx, t[1], x, y, S, [P.t[1], P.t[3], P.t[4], P.t[0]], r);- }- ctx.restore();-}--function draw() {- ctx.fillStyle = PAL.ink.t[0]; ctx.fillRect(0, 0, CW, CH);- for (let j = 0; j < ROWS; j++) for (let i = 0; i < COLS; i++) tile(i, j, T[j * COLS + i]);- // The middle 2×2 merges into one big red-sun cell: red ground + off-white sun disc + five-colour rings- const sx = 3 * S, sy = 1 * S;- ctx.fillStyle = PAL.red.t[2]; ctx.fillRect(sx, sy, 2 * S, 2 * S);- const cx = sx + S, cy = sy + S;- const cols = ['red', 'purple', 'gold', 'green', 'ochre'];- for (let k = 4; k >= 0; k--) { G.ring(ctx, cx, cy, 168 + k * 38, 22, k === 0 ? G.CREAM : PAL[cols[k]].t[2]); }- G.disc(ctx, cx, cy, 136, G.CREAM);- G.disc(ctx, cx, cy, 108, PAL.red.t[2]);- ctx.font = F.en(900, 96); ctx.letterSpacing = '-3px'; ctx.textAlign = 'center'; ctx.fillStyle = G.CREAM;- ctx.fillText('43', cx, cy + 34);-- // Whole-row offset: shift row 1 and row 4 slightly out of line (the signature of the official core graphic)- // The half cell exposed by the shift is filled with a pattern cell, not wrapped around (otherwise the same person would appear at both ends)- const shift = (j, dx, kind, pk) => {- const tmp = G.canvas(CW, S); tmp.getContext('2d').drawImage(cv, 0, j * S, CW, S, 0, 0, CW, S);- const gx = dx < 0 ? CW + dx : 0;- ctx.save(); ctx.beginPath(); ctx.rect(gx, j * S, Math.abs(dx), S); ctx.clip();- const P = PAL[pk]; G.motif(ctx, kind, gx - (dx < 0 ? 0 : S / 2), j * S, S, [P.t[1], P.t[3], P.t[4], P.t[0]], G.rng(j + 99));- ctx.restore();- ctx.save(); ctx.beginPath(); ctx.rect(dx < 0 ? 0 : dx, j * S, CW - Math.abs(dx), S); ctx.clip();- ctx.drawImage(tmp, dx, j * S); ctx.restore();- };- shift(0, -S / 2, 1, 'gold'); shift(3, S / 2, 0, 'red');-- // Title area- const ty = ROWS * S; // 1440- ctx.fillStyle = PAL.ink.t[0]; ctx.fillRect(0, ty, CW, CH - ty);- // Five-colour bar- cols.forEach((k, n) => { ctx.fillStyle = PAL[k].t[2]; ctx.fillRect(n * CW / 5, ty, CW / 5, 18); });- const L = 150;- ctx.textAlign = 'left';- ctx.font = F.mono(40); ctx.letterSpacing = '12px'; ctx.fillStyle = rgba(G.CREAM, 0.72);- ctx.fillText('THE 20TH ASIAN GAMES · 2026.9.19 — 10.4', L, ty + 120);- ctx.font = F.en(900, 250); ctx.letterSpacing = '-7px'; ctx.fillStyle = G.CREAM;- ctx.fillText('AICHI-NAGOYA 2026', L - 8, ty + 370);- // Second line: language version- if (EJ) {- ctx.font = F.en(800, 104); ctx.letterSpacing = '-1px'; ctx.fillStyle = G.CREAM;- ctx.fillText('ALL 43 SPORTS', L, ty + 560);- const w = ctx.measureText('ALL 43 SPORTS').width;- ctx.font = F.jp(900, 96); ctx.letterSpacing = '6px'; ctx.fillStyle = PAL.gold.t[2];- ctx.fillText('全43競技を一気に', L + w + 60, ty + 558);- } else {- ctx.font = F.zh(900, 112); ctx.letterSpacing = '8px'; ctx.fillStyle = G.CREAM;- ctx.fillText('亚运会 43 个大项', L, ty + 560);- const w = ctx.measureText('亚运会 43 个大项').width;- ctx.fillStyle = PAL.gold.t[2];- ctx.fillText('一口气看完', L + w + 50, ty + 560);- }- // Small red sun in the bottom-right corner- G.disc(ctx, CW - 230, ty + 460, 72, PAL.red.t[2]);- ctx.font = F.mono(30); ctx.letterSpacing = '8px'; ctx.fillStyle = rgba(G.CREAM, 0.6); ctx.textAlign = 'right';- ctx.fillText('IMAGINE ONE ASIA', CW - 150, ty + 640);-}--Promise.all(['900 40px "Inter Tight"', '800 40px "Inter Tight"', '900 40px "Noto Sans SC"', '900 40px "Noto Sans JP"', '500 20px "DM Mono"']- .map((f) => document.fonts.load(f, 'Aa亚运会个大项一口气看完全競技を気に'))).then(() => { draw(); window.READY = true; });-</script>-</body></html>diff --git a/styles/pictogram-motion/demo/cover34.html b/styles/pictogram-motion/demo/cover34.htmldeleted file mode 100644index a7a99ba..0000000--- a/styles/pictogram-motion/demo/cover34.html+++ /dev/null@@ -1,119 +0,0 @@-<!doctype html>-<html><head><meta charset="utf-8">-<style>-@font-face { font-family: "Inter Tight"; src: url(fonts/InterTightwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans SC"; src: url(fonts/NotoSansSCwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans JP"; src: url(fonts/NotoSansJPwght.ttf); font-weight: 100 900; }-@font-face { font-family: "DM Mono"; src: url(fonts/DMMono-Medium.ttf); font-weight: 500; }-html,body { margin:0; background:#000; }-canvas { display:block; }-</style></head>-<body>-<canvas id="c" width="2160" height="2880"></canvas>-<script src="edl.js"></script>-<script src="engine.js"></script>-<script src="poses/base.js"></script>-<script src="poses/ath.js"></script>-<script src="poses/aqua.js"></script>-<script src="poses/ball.js"></script>-<script src="poses/combat.js"></script>-<script src="poses/power.js"></script>-<script src="poses/nature.js"></script>-<script src="poses/asia.js"></script>-<script src="scenes.js"></script>-<script>-// 4:3 cover, 2880×2160: an 8×4 grid on top (pictograms + core-graphic patterns + red sun), ink-coloured title area below-// cover.html?lang=ej → English/Japanese version; Chinese version by default-const EJ = new URLSearchParams(location.search).get('lang') === 'ej';-const cv = document.getElementById('c'), ctx = cv.getContext('2d');-// 3:4 portrait, 2160×2880: a 6×5 grid on top, title area below-const CW = 2160, CH = 2880, S = 360, COLS = 6, ROWS = 5;-const { PAL, mix, rgba, F } = G;-const T = [- ['p', 'sprint', 'red'], ['m', 4, 'purple'], ['p', 'free', 'purple'], ['p', 'football', 'gold'], ['m', 8, 'ochre'], ['p', 'taekwondo', 'ochre'],- ['p', 'highjump', 'red'], ['p', 'basketball', 'gold'], ['sun'], ['sun'], ['p', 'archery', 'ink'], ['m', 5, 'red'],- ['m', 11, 'gold'], ['p', 'badminton', 'gold'], ['sun'], ['sun'], ['p', 'surfing', 'green'], ['p', 'judo', 'ochre'],- ['p', 'weightlifting', 'ink'], ['m', 7, 'ochre'], ['p', 'cyc_road', 'green'], ['p', 'fencing', 'ochre'], ['m', 6, 'purple'], ['p', 'diving', 'purple'],- ['p', 'skate', 'gold'], ['m', 12, 'green'], ['p', 'breaking', 'red'], ['p', 'climbing', 'ochre'], ['p', 'esports', 'purple'], ['p', 'equestrian', 'green'],-];-function tile(i, j, t) {- const x = i * S, y = j * S;- ctx.save(); ctx.beginPath(); ctx.rect(x, y, S, S); ctx.clip();- if (t[0] === 'p') {- const pk = t[2], P = PAL[pk];- const bg = P.t[(i + j) % 2 ? 2 : 1];- ctx.fillStyle = bg; ctx.fillRect(x, y, S, S);- const def = POSES[t[1]];- const C = G.colorsFor(pk, bg);- ctx.save(); ctx.translate(x + S / 2, y + S * 0.52); const U = S * 0.62; ctx.scale(U, U);- G.drawFigUnits(ctx, def, def.iconU ?? 1, C);- ctx.restore();- } else if (t[0] === 'm') {- const P = PAL[t[2]], r = G.rng(i * 31 + j * 7 + t[1]);- G.motif(ctx, t[1], x, y, S, [P.t[1], P.t[3], P.t[4], P.t[0]], r);- }- ctx.restore();-}--function draw() {- ctx.fillStyle = PAL.ink.t[0]; ctx.fillRect(0, 0, CW, CH);- for (let j = 0; j < ROWS; j++) for (let i = 0; i < COLS; i++) tile(i, j, T[j * COLS + i]);- const sx = 2 * S, sy = 1 * S;- ctx.fillStyle = PAL.red.t[2]; ctx.fillRect(sx, sy, 2 * S, 2 * S);- const cx = sx + S, cy = sy + S;- const cols = ['red', 'purple', 'gold', 'green', 'ochre'];- for (let k = 4; k >= 0; k--) { G.ring(ctx, cx, cy, 168 + k * 38, 22, k === 0 ? G.CREAM : PAL[cols[k]].t[2]); }- G.disc(ctx, cx, cy, 136, G.CREAM);- G.disc(ctx, cx, cy, 108, PAL.red.t[2]);- ctx.font = F.en(900, 96); ctx.letterSpacing = '-3px'; ctx.textAlign = 'center'; ctx.fillStyle = G.CREAM;- ctx.fillText('43', cx, cy + 34);- // Whole-row offset: row 1 shifts left, row 5 shifts right; the exposed half cells are filled with patterns- const shift = (j, dx, kind, pk) => {- const tmp = G.canvas(CW, S); tmp.getContext('2d').drawImage(cv, 0, j * S, CW, S, 0, 0, CW, S);- const gx = dx < 0 ? CW + dx : 0;- ctx.save(); ctx.beginPath(); ctx.rect(gx, j * S, Math.abs(dx), S); ctx.clip();- const P = PAL[pk]; G.motif(ctx, kind, gx - (dx < 0 ? 0 : S / 2), j * S, S, [P.t[1], P.t[3], P.t[4], P.t[0]], G.rng(j + 99));- ctx.restore();- ctx.save(); ctx.beginPath(); ctx.rect(dx < 0 ? 0 : dx, j * S, CW - Math.abs(dx), S); ctx.clip();- ctx.drawImage(tmp, dx, j * S); ctx.restore();- };- shift(0, -S / 2, 1, 'gold'); shift(4, S / 2, 0, 'red');-- // Title area- const ty = ROWS * S; // 1800- ctx.fillStyle = PAL.ink.t[0]; ctx.fillRect(0, ty, CW, CH - ty);- cols.forEach((k, n) => { ctx.fillStyle = PAL[k].t[2]; ctx.fillRect(n * CW / 5, ty, CW / 5, 18); });- const L = 140, maxW = CW - 2 * L;- ctx.textAlign = 'left';- ctx.font = F.mono(36); ctx.letterSpacing = '11px'; ctx.fillStyle = rgba(G.CREAM, 0.72);- const oy = 115;- ctx.fillText('THE 20TH ASIAN GAMES · 2026.9.19 — 10.4', L, ty + 125 + oy);- const px = G.fitFont(ctx, 'AICHI-NAGOYA', 'en', 900, 330, maxW, -0.025);- ctx.font = F.en(900, px); ctx.letterSpacing = -0.025 * px + 'px'; ctx.fillStyle = G.CREAM;- ctx.fillText('AICHI-NAGOYA', L - 10, ty + 125 + oy + px * 0.95);- const y2 = ty + 125 + oy + px * 0.95 + px * 0.92;- ctx.fillText('2026', L - 10, y2);- const w26 = ctx.measureText('2026').width;- // Subtitle: to the right of 2026, two lines- const sx2 = L + w26 + 70;- if (EJ) {- ctx.font = F.en(800, 92); ctx.letterSpacing = '-1px'; ctx.fillStyle = G.CREAM;- ctx.fillText('ALL 43 SPORTS', sx2, y2 - px * 0.42);- ctx.font = F.jp(900, 86); ctx.letterSpacing = '6px'; ctx.fillStyle = PAL.gold.t[2];- ctx.fillText('全43競技を一気に', sx2, y2 - 6);- } else {- ctx.font = F.zh(900, 100); ctx.letterSpacing = '8px'; ctx.fillStyle = G.CREAM;- ctx.fillText('亚运会 43 个大项', sx2, y2 - px * 0.42);- ctx.fillStyle = PAL.gold.t[2];- ctx.fillText('一口气看完', sx2, y2 - 6);- }- // Bottom- G.disc(ctx, L + 44, CH - 150, 44, PAL.red.t[2]);- ctx.font = F.mono(32); ctx.letterSpacing = '9px'; ctx.fillStyle = rgba(G.CREAM, 0.6); ctx.textAlign = 'right';- ctx.fillText('IMAGINE ONE ASIA · ここで、ひとつに。', CW - L, CH - 138);-}--Promise.all(['900 40px "Inter Tight"', '800 40px "Inter Tight"', '900 40px "Noto Sans SC"', '900 40px "Noto Sans JP"', '500 20px "DM Mono"']- .map((f) => document.fonts.load(f, 'Aa亚运会个大项一口气看完全競技を気にここでひとつ'))).then(() => { draw(); window.READY = true; });-</script>-</body></html>diff --git a/styles/pictogram-motion/demo/edl.js b/styles/pictogram-motion/demo/edl.jsdeleted file mode 100644index 3fd879f..0000000--- a/styles/pictogram-motion/demo/edl.js+++ /dev/null@@ -1,129 +0,0 @@-// Edit list: 150 BPM, 1 beat = 0.4s, 1 bar = 4 beats = 1.6s. Every shot lands on a beat.-// In the browser it is window.EDL; in node, require/import it and export timeline.json for the score.-(function (root) {- const BPM = 150, BEAT = 60 / BPM, BAR = BEAT * 4;- // kind: intro/chapter/card/finale; beats = duration (beats)- // n = sport number (/43); sub = discipline- const S = [];- const add = (o) => S.push(o);-- add({ kind: 'intro', id: 'intro', beats: 48 });-- const chapter = (id, no, en, zh, jp, pal) => add({ kind: 'chapter', id, no, en, zh, jp, pal, beats: 8 });- const card = (n, en, zh, jp, pose, o = {}) => add({ kind: 'card', n, en, zh, jp, pose, beats: 4, ...o });-- // ── CH1 Athletics (red) ── horizontal long take: one track pushed from left to right- chapter('ath', '01', 'ATHLETICS', '田径', '陸上競技', 'red');- const A = (sub, zh, pose, jp) => card(1, 'ATHLETICS', zh, jp, pose, { sub, track: true, fam: true });- A('SPRINT', '短跑', 'sprint', '短距離');- A('HURDLES', '跨栏', 'hurdles', 'ハードル');- A('RELAY', '接力', 'relay', 'リレー');- A('MIDDLE & LONG', '中长跑', 'distance', '中長距離');- A('STEEPLECHASE', '障碍跑', 'steeple', '障害');- A('MARATHON', '马拉松', 'marathon', 'マラソン');- A('RACE WALK', '竞走', 'walk', '競歩');- A('HIGH JUMP', '跳高', 'highjump', '走高跳');- A('POLE VAULT', '撑竿跳高', 'polevault', '棒高跳');- A('LONG & TRIPLE JUMP', '跳远 · 三级跳远', 'longjump', '走幅跳・三段跳');- A('SHOT PUT', '铅球', 'shot', '砲丸投');- A('DISCUS', '铁饼', 'discus', '円盤投');- A('HAMMER', '链球', 'hammer', 'ハンマー投');- A('JAVELIN', '标枪', 'javelin', 'やり投');- // Combined events: the last cell closes out athletics- // (14 cells = 14 bars)-- // ── CH2 Aquatics (purple: kakitsubata irises, 燕子花, grow by the water) ──- chapter('aqua', '02', 'AQUATICS', '水上项目', '水泳', 'purple');- const Sw = (sub, zh, pose, jpBig) => card(2, 'SWIMMING', zh, '競泳', pose, { sub, beats: 2, water: true, fam: true, jpBig });- Sw('FREESTYLE', '自由泳', 'free', '自由形');- Sw('BREASTSTROKE', '蛙泳', 'breast', '平泳ぎ');- Sw('BACKSTROKE', '仰泳', 'back', '背泳ぎ');- Sw('BUTTERFLY', '蝶泳', 'fly', 'バタフライ');- card(2, 'DIVING', '跳水', '飛込', 'diving', { water: true });- card(2, 'ARTISTIC SWIMMING', '花样游泳', 'アーティスティックスイミング', 'artistic', { water: true });- card(2, 'WATER POLO', '水球', '水球', 'waterpolo', { water: true });-- // ── CH3 Ball games (gold) ──- chapter('ball', '03', 'BALL GAMES', '球类项目', '球技', 'gold');- card(3, 'FOOTBALL', '足球', 'サッカー', 'football');- card(4, 'BASKETBALL', '篮球', 'バスケットボール', 'basketball', { sub: '5×5 · 3×3' });- card(5, 'VOLLEYBALL', '排球', 'バレーボール', 'volleyball', { sub: 'INDOOR · BEACH' });- card(6, 'HANDBALL', '手球', 'ハンドボール', 'handball');- card(7, 'HOCKEY', '曲棍球', 'ホッケー', 'hockey');- card(8, 'RUGBY SEVENS', '七人制橄榄球', '7人制ラグビー', 'rugby');- card(9, 'BASEBALL · SOFTBALL', '棒球 · 垒球', '野球・ソフトボール', 'baseball');- card(10, 'CRICKET', '板球', 'クリケット', 'cricket', { sub: 'T20' });- card(11, 'GOLF', '高尔夫球', 'ゴルフ', 'golf');- // Racket sports: 2 beats per cell, the ball flies from cell to cell- const R = (n, en, zh, jp, pose, sub) => card(n, en, zh, jp, pose, { beats: 2, racket: true, sub });- R(12, 'BADMINTON', '羽毛球', 'バドミントン', 'badminton');- R(13, 'TABLE TENNIS', '乒乓球', '卓球', 'tabletennis');- R(14, 'TENNIS', '网球', 'テニス', 'tennis');- R(14, 'SOFT TENNIS', '软式网球', 'ソフトテニス', 'softtennis', 'TENNIS');- R(15, 'SQUASH', '壁球', 'スカッシュ', 'squash');- R(16, 'PADEL', '板式网球', 'パデル', 'padel', 'NEW');- card(17, 'TEQBALL', '泰克球', 'テックボール', 'teqball', { sub: 'NEW' });-- // ── CH4 Combat (ochre: tradition) ──- chapter('combat', '04', 'COMBAT', '格斗项目', '格闘技', 'ochre');- card(18, 'JUDO', '柔道', '柔道', 'judo');- card(19, 'KARATE', '空手道', '空手', 'karate');- card(20, 'TAEKWONDO', '跆拳道', 'テコンドー', 'taekwondo');- card(21, 'BOXING', '拳击', 'ボクシング', 'boxing');- card(22, 'WRESTLING', '摔跤', 'レスリング', 'wrestling');- card(23, 'FENCING', '击剑', 'フェンシング', 'fencing');- card(24, 'JU-JITSU', '柔术', '柔術', 'jujitsu', { family: 'COMBAT SPORTS' });- card(24, 'KURASH', '克拉什', 'クラッシュ', 'kurash', { family: 'COMBAT SPORTS' });- card(24, 'MMA', '综合格斗', '総合格闘技', 'mma', { family: 'COMBAT SPORTS' });-- // ── CH5 Power & precision (ink + gold) ──- chapter('power', '05', 'POWER & PRECISION', '力量与精准', '力と精度', 'ink');- card(25, 'WEIGHTLIFTING', '举重', 'ウエイトリフティング', 'weightlifting');- card(26, 'SHOOTING', '射击', '射撃', 'shooting');- card(27, 'ARCHERY', '射箭', 'アーチェリー', 'archery');- card(28, 'GYMNASTICS', '竞技体操', '体操競技', 'gym_art', { sub: 'ARTISTIC', fam: true });- card(28, 'GYMNASTICS', '艺术体操', '新体操', 'gym_rhythm', { sub: 'RHYTHMIC', fam: true });- card(28, 'GYMNASTICS', '蹦床', 'トランポリン', 'gym_tramp', { sub: 'TRAMPOLINE', fam: true });- card(29, 'MODERN PENTATHLON', '现代五项', '近代五種', 'pentathlon');-- // ── CH6 Land & sea (green) ──- chapter('nature', '06', 'LAND & SEA', '山海之间', '山と海', 'green');- card(30, 'ROWING', '赛艇', 'ボート', 'rowing');- card(31, 'CANOE', '皮划艇', 'カヌー', 'canoe', { sub: 'SPRINT · SLALOM' });- card(32, 'SAILING', '帆船', 'セーリング', 'sailing');- card(33, 'SURFING', '冲浪', 'サーフィン', 'surfing', { sub: 'NEW' });- card(34, 'TRIATHLON', '铁人三项', 'トライアスロン', 'triathlon');- const C = (sub, zh, pose, jpBig) => card(35, 'CYCLING', zh, '自転車', pose, { sub, beats: 2, fam: true, jpBig });- C('ROAD', '公路自行车', 'cyc_road', 'ロード');- C('TRACK', '场地自行车', 'cyc_track', 'トラック');- C('BMX', '小轮车', 'cyc_bmx', 'BMX');- C('MOUNTAIN BIKE', '山地自行车', 'cyc_mtb', 'マウンテンバイク');- card(36, 'EQUESTRIAN', '马术', '馬術', 'equestrian');-- // ── CH7 Asia · New wave (five colours) ──- chapter('asia', '07', 'ASIA & NEW WAVE', '亚洲特色 · 新浪潮', 'アジアと新時代', 'multi');- card(37, 'KABADDI', '卡巴迪', 'カバディ', 'kabaddi');- card(38, 'SEPAK TAKRAW', '藤球', 'セパタクロー', 'takraw');- card(39, 'WUSHU', '武术', '武術', 'wushu');- card(40, 'SKATEBOARDING', '滑板', 'スケートボード', 'skate');- card(41, 'SPORT CLIMBING', '攀岩', 'スポーツクライミング', 'climbing');- card(42, 'BREAKING', '霹雳舞', 'ブレイキン', 'breaking');- card(43, 'ESPORTS', '电子竞技', 'eスポーツ', 'esports');-- add({ kind: 'finale', id: 'finale', beats: 48 });-- // Timeline- let b = 0, chap = null, ci = 0;- for (const s of S) {- s.b0 = b; s.t0 = b * BEAT; s.dur = s.beats * BEAT; b += s.beats;- if (s.kind === 'chapter') { chap = s; ci = 0; }- if (s.kind === 'card') {- s.chap = chap.id; s.pal = chap.pal; s.ci = ci++;- // For display: title = big text / family = small family label / tag = corner tag- if (s.fam) { s.title = s.sub; s.family = s.en; }- else { s.title = s.en; s.tag = s.sub; }- }- }- const EDL = { BPM, BEAT, BAR, shots: S, beats: b, DUR: b * BEAT };- if (typeof module !== 'undefined') module.exports = EDL; else root.EDL = EDL;-})(this);diff --git a/styles/pictogram-motion/demo/engine.js b/styles/pictogram-motion/demo/engine.jsindex 38f58ed..d78e0c4 100644--- a/styles/pictogram-motion/demo/engine.js+++ b/styles/pictogram-motion/demo/engine.js@@ -1,24 +1,23 @@-// Engine: palettes, utilities, grid patterns in the style of the official core graphic, athlete skeleton, typography-// Everything hangs off window.G. Canvas is 1920×1080.+// Pictogram Motion engine (window.G): easing, rng, colour, the five-hue palette, the grid pattern with whole-row offsets,+// the motif library, the pictograms (umbrella, drop, cloud, sun, moon, bolt, footprint, lost items) and the mask-slide type.(function () {const W = 1920, H = 1080;const G = (window.G = { W, H });- // ───────── Maths / easing ─────────+ // ───────── maths / easing ─────────const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));const lerp = (a, b, t) => a + (b - a) * t;const inv = (a, b, x) => clamp((x - a) / (b - a));const E = {- lin: (t) => t,+ lin: (t) => clamp(t),io: (t) => 0.5 - 0.5 * Math.cos(Math.PI * clamp(t)),- o2: (t) => 1 - (1 - t) * (1 - t),o3: (t) => 1 - Math.pow(1 - clamp(t), 3),i3: (t) => Math.pow(clamp(t), 3),io3: (t) => (t = clamp(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2),oExp: (t) => (t = clamp(t), t >= 1 ? 1 : 1 - Math.pow(2, -10 * t)),iExp: (t) => (t = clamp(t), t <= 0 ? 0 : Math.pow(2, 10 * t - 10)),ioExp: (t) => (t = clamp(t), t <= 0 ? 0 : t >= 1 ? 1 : t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2),- oBack: (t, s = 1.4) => (t = clamp(t) - 1, t * t * ((s + 1) * t + s) + 1),+ oBack: (t, s = 1.7) => (t = clamp(t) - 1, t * t * ((s + 1) * t + s) + 1),o5: (t) => 1 - Math.pow(1 - clamp(t), 5),};const rng = (seed) => {@@ -30,286 +29,263 @@return ((t ^ (t >>> 14)) >>> 0) / 4294967296;};};- const D2R = Math.PI / 180;- Object.assign(G, { clamp, lerp, inv, E, rng, D2R });+ const hash = (n) => rng(n * 9301 + 49297)();+ Object.assign(G, { clamp, lerp, inv, E, rng, hash });- // ───────── Colour ─────────+ // ───────── colour ─────────const hex = (h) => [parseInt(h.slice(1, 3), 16), parseInt(h.slice(3, 5), 16), parseInt(h.slice(5, 7), 16)];const toHex = (c) => '#' + c.map((v) => Math.round(clamp(v, 0, 255)).toString(16).padStart(2, '0')).join('');const mix = (a, b, t) => { const A = hex(a), B = hex(b); return toHex(A.map((v, i) => lerp(v, B[i], t))); };const rgba = (h, a) => { const c = hex(h); return `rgba(${c[0]},${c[1]},${c[2]},${a})`; };G.mix = mix; G.rgba = rgba;- const CREAM = '#fbf6ec', INK = '#15111c';- // Each palette: t0 darkest → t4 lightest (sampled from the official core-graphic artwork), fg foreground (text + figure), fg2 secondary text+ // Five hues + one dark neutral, five tones each (t0 darkest → t4 lightest). Names are ours.+ const CREAM = '#fbf6ec', INK = '#111521';const PAL = {- red: { name: 'Jonetsu Red', t: ['#c21d15', '#d22419', '#e83220', '#ec5a26', '#f07a45'], fg: CREAM, dim: '#f6c7ae', deep: '#8e150f' },- purple: { name: 'Kakitsubata Purple', t: ['#231a6e', '#2c2084', '#4e3a93', '#644d9d', '#7a62a9'], fg: CREAM, dim: '#c9bde6', deep: '#170f4c' },- green: { name: 'Shinrin Green', t: ['#006d35', '#008440', '#079a3e', '#2da547', '#68b15d'], fg: CREAM, dim: '#c3e6c4', deep: '#004d25' },- gold: { name: 'Kinshachi Gold', t: ['#b48900', '#c69b00', '#d5b102', '#debc2f', '#e7d16c'], fg: '#211904', dim: '#6d5500', deep: '#8a6a00' },- ochre: { name: 'Dento Ocher', t: ['#946a2e', '#ac7d38', '#c18e46', '#d2a55c', '#e0bf84'], fg: '#1e1409', dim: '#5e4221', deep: '#6e4d1f' },- ink: { name: 'Sumi', t: ['#0f0c15', '#16121d', '#1e1a27', '#2a2535', '#3a3447'], fg: CREAM, dim: '#9a93a8', deep: '#08060b', accent: '#d5b102' },+ navy: { name: 'Rain Navy', t: ['#13254a', '#1a3263', '#24457d', '#3b5e95', '#5d7cad'], fg: CREAM },+ teal: { name: 'Tram Teal', t: ['#00544c', '#00685d', '#0b7f70', '#2e9686', '#5fae9f'], fg: CREAM },+ sky: { name: 'Puddle Sky', t: ['#4b95c4', '#61a5d0', '#7ab6da', '#97c7e3', '#b8daeb'], fg: '#0f2036' },+ coral: { name: 'Brick Coral', t: ['#a93726', '#c04731', '#d75d43', '#e2785c', '#ea957a'], fg: CREAM },+ yellow: { name: 'Signal Yellow', t: ['#d39400', '#e4a608', '#f2ba1d', '#f6c94a', '#f9d87e'], fg: '#231902' },+ ink: { name: 'Storm Ink', t: ['#0c1018', '#131924', '#1b2230', '#272f41', '#374055'], fg: CREAM, accent: '#f2ba1d' },};- for (const k in PAL) { PAL[k].key = k; PAL[k].base = PAL[k].t[2]; }- PAL.multi = PAL.purple; // Chapter 7 rotates palettes per card; this is only a placeholder+ for (const k in PAL) { PAL[k].key = k; PAL[k].base = PAL[k].t[2]; PAL[k].far = mix(PAL[k].fg, PAL[k].t[2], 0.42); }G.PAL = PAL; G.CREAM = CREAM; G.INK = INK;- G.CYCLE = ['red', 'purple', 'green', 'gold', 'ochre'];+ G.UMB = PAL.yellow.t[2]; // the umbrella: the only warm colour in a cold world+ G.UMB2 = PAL.yellow.t[0]; // its darker gore- // ───────── Canvas utilities ─────────+ // ───────── canvas helpers ─────────G.canvas = (w = W, h = H) => { const c = document.createElement('canvas'); c.width = w; c.height = h; return c; };G.disc = (ctx, x, y, r, col) => { if (r <= 0) return; ctx.fillStyle = col; ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.fill(); };G.seg = (ctx, a, b, w, col) => { ctx.strokeStyle = col; ctx.lineWidth = w; ctx.lineCap = 'round'; ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke(); };- G.ring = (ctx, x, y, r, w, col) => { ctx.strokeStyle = col; ctx.lineWidth = w; ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.stroke(); };+ G.ring = (ctx, x, y, r, w, col) => { if (r <= 0) return; ctx.strokeStyle = col; ctx.lineWidth = w; ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.stroke(); };G.poly = (ctx, pts, col) => { ctx.fillStyle = col; ctx.beginPath(); pts.forEach((p, i) => (i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]))); ctx.closePath(); ctx.fill(); };+ G.rrect = (ctx, x, y, w, h, r, col) => { ctx.fillStyle = col; ctx.beginPath(); ctx.roundRect(x, y, w, h, r); ctx.fill(); };- // ───────── Grid pattern (the language of the official core graphic) ─────────- // Large circles / half circles spanning several cells form the base; small cells carry motifs (scales, stripes, triangles, concentric arcs, sun discs…),- // and finally whole rows are cut and offset — this is the most recognisable feature of the core graphic.- const CELL = 180;- G.CELL = CELL;+ // ───────── pictograms (unit-sized, drawn under the current transform) ─────────+ // Raindrop: disc + pointed top. Origin = disc centre, r = disc radius.+ G.drop = (ctx, x, y, r, col) => {+ ctx.fillStyle = col; ctx.beginPath();+ ctx.moveTo(x, y - r * 2.5);+ ctx.quadraticCurveTo(x + r * 0.95, y - r * 0.9, x + r, y);+ ctx.arc(x, y, r, 0, Math.PI);+ ctx.quadraticCurveTo(x - r * 0.95, y - r * 0.9, x, y - r * 2.5);+ ctx.fill();+ };+ // Cloud: three discs on a flat base. (x, y) = base centre, s = half width.+ G.cloud = (ctx, x, y, s, col) => {+ ctx.fillStyle = col; ctx.beginPath();+ ctx.arc(x - s * 0.48, y - s * 0.32, s * 0.36, 0, Math.PI * 2);+ ctx.arc(x + s * 0.05, y - s * 0.52, s * 0.5, 0, Math.PI * 2);+ ctx.arc(x + s * 0.55, y - s * 0.28, s * 0.32, 0, Math.PI * 2);+ ctx.fill();+ ctx.beginPath(); ctx.roundRect(x - s * 0.84, y - s * 0.4, s * 1.7, s * 0.4, s * 0.2); ctx.fill();+ };+ // Sun: disc + 12 rounded rays.+ G.sunIcon = (ctx, x, y, r, col, spin = 0) => {+ G.disc(ctx, x, y, r, col);+ for (let i = 0; i < 12; i++) {+ const a = spin + (i / 12) * Math.PI * 2;+ G.seg(ctx, [x + Math.cos(a) * r * 1.35, y + Math.sin(a) * r * 1.35], [x + Math.cos(a) * r * 1.72, y + Math.sin(a) * r * 1.72], r * 0.2, col);+ }+ };+ // Footprint (one shoe sole). (x, y) = centre, s = length/2, ang = heading (radians, 0 = up).+ // Crescent moon (clip + even-odd, so it needs no background colour).+ G.moon = (ctx, x, y, r, col) => {+ ctx.save(); ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.clip();+ ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.arc(x + r * 0.5, y - r * 0.3, r * 0.86, 0, Math.PI * 2);+ ctx.fillStyle = col; ctx.fill('evenodd'); ctx.restore();+ };+ // Lightning bolt. (x, y) = top, s = height.+ G.bolt = (ctx, x, y, s, col) => G.poly(ctx, [[x + s * 0.12, y], [x - s * 0.22, y + s * 0.56], [x + 0.02 * s, y + s * 0.56], [x - s * 0.14, y + s],+ [x + s * 0.3, y + s * 0.38], [x + s * 0.06, y + s * 0.38], [x + s * 0.3, y]], col);+ // Small lost things for the shelf: glove, key, hat, scarf. (x, y) = centre, s = cell size.+ G.item = (ctx, kind, x, y, s, col) => {+ if (kind === 0) { // glove+ G.rrect(ctx, x - s * 0.17, y - s * 0.05, s * 0.34, s * 0.34, s * 0.08, col);+ for (let i = 0; i < 4; i++) G.seg(ctx, [x - s * 0.12 + i * s * 0.08, y - s * 0.05], [x - s * 0.12 + i * s * 0.08, y - s * 0.26 + Math.abs(i - 1.5) * s * 0.03], s * 0.07, col);+ G.seg(ctx, [x - s * 0.17, y + s * 0.08], [x - s * 0.3, y - s * 0.04], s * 0.08, col);+ } else if (kind === 1) { // key+ G.ring(ctx, x - s * 0.18, y, s * 0.12, s * 0.06, col);+ G.seg(ctx, [x - s * 0.06, y], [x + s * 0.3, y], s * 0.07, col);+ G.seg(ctx, [x + s * 0.2, y], [x + s * 0.2, y + s * 0.1], s * 0.06, col); G.seg(ctx, [x + s * 0.29, y], [x + s * 0.29, y + s * 0.12], s * 0.06, col);+ } else if (kind === 2) { // hat+ ctx.fillStyle = col; ctx.beginPath(); ctx.arc(x, y + s * 0.08, s * 0.22, Math.PI, 0); ctx.fill();+ G.seg(ctx, [x - s * 0.32, y + s * 0.1], [x + s * 0.32, y + s * 0.1], s * 0.07, col);+ } else { // scarf+ G.seg(ctx, [x - s * 0.26, y - s * 0.12], [x + s * 0.26, y - s * 0.12], s * 0.11, col);+ G.seg(ctx, [x + s * 0.14, y - s * 0.12], [x + s * 0.2, y + s * 0.26], s * 0.1, col);+ G.seg(ctx, [x + s * 0.02, y - s * 0.12], [x + s * 0.0, y + s * 0.22], s * 0.1, col);+ }+ };+ G.foot = (ctx, x, y, s, ang, col, mirror = 1) => {+ // bare footprint: sole + heel pad + five toe dots (the universal footprint sign)+ ctx.save(); ctx.translate(x, y); ctx.rotate(ang); ctx.scale(mirror, 1); ctx.fillStyle = col;+ ctx.beginPath(); ctx.ellipse(s * 0.04, -s * 0.12, s * 0.34, s * 0.46, 0.12, 0, Math.PI * 2); ctx.fill();+ ctx.beginPath(); ctx.ellipse(0, s * 0.5, s * 0.26, s * 0.3, 0, 0, Math.PI * 2); ctx.fill();+ ctx.beginPath(); ctx.rect(-s * 0.24, s * 0.1, s * 0.46, s * 0.4); ctx.fill();+ const toes = [[-0.26, -0.7, 0.13], [-0.06, -0.8, 0.11], [0.12, -0.78, 0.095], [0.27, -0.7, 0.085], [0.38, -0.56, 0.075]];+ for (const [tx, ty, tr] of toes) { ctx.beginPath(); ctx.arc(tx * s, ty * s, tr * s, 0, Math.PI * 2); ctx.fill(); }+ ctx.restore();+ };+ // Umbrella. Local frame: R = 1, origin = canopy rim centre, tip pointing up (-y).+ // o = 1 open, 0 closed (furled). col = canopy, col2 = centre gore, sh = shaft/handle colour.+ G.umbrella = (ctx, x, y, R, o, rot, col, col2, sh) => {+ o = clamp(o, 0, 1.15);+ const w = lerp(0.15, 1, o), h = lerp(1.12, 0.62, Math.min(o, 1)), ry = lerp(0.52, 0, Math.min(o, 1));+ const sc = 0.03 + 0.11 * Math.min(o, 1); // scallop depth+ ctx.save(); ctx.translate(x, y); ctx.rotate(rot || 0); ctx.scale(R, R);+ // shaft + handle (behind the canopy)+ const shaftEnd = lerp(0.98, 0.95, o);+ G.seg(ctx, [0, -h + ry - 0.16], [0, shaftEnd], 0.058, sh);+ ctx.strokeStyle = sh; ctx.lineWidth = 0.062; ctx.lineCap = 'round';+ ctx.beginPath(); ctx.arc(-0.13, shaftEnd, 0.13, 0, Math.PI, false); ctx.stroke();+ // canopy path+ const path = () => {+ ctx.beginPath();+ const N = 28;+ for (let i = 0; i <= N; i++) {+ const th = Math.PI + (i / N) * Math.PI; // π → 2π (top half)+ const px = w * Math.cos(th), py = ry + h * Math.sin(th);+ i ? ctx.lineTo(px, py) : ctx.moveTo(px, py);+ }+ // scalloped hem, right → left, four bays+ for (let k = 0; k < 4; k++) {+ const xa = w * (1 - k * 0.5), xb = w * (1 - (k + 1) * 0.5);+ ctx.quadraticCurveTo((xa + xb) / 2, ry - sc * 2, xb, ry);+ }+ ctx.closePath();+ };+ path(); ctx.fillStyle = col; ctx.fill();+ // centre gore+ ctx.save(); path(); ctx.clip();+ ctx.beginPath(); ctx.ellipse(0, ry, w * 0.36, h, 0, Math.PI, 0); ctx.closePath(); ctx.fillStyle = col2; ctx.fill();+ ctx.restore();+ // ferrule+ G.seg(ctx, [0, ry - h - 0.02], [0, ry - h - 0.14], 0.05, sh);+ ctx.restore();+ };+ // ───────── grid pattern ─────────+ const CELL = 180; G.CELL = CELL;function motif(ctx, kind, x, y, s, c, r) {- const [a, b, cc, d] = c; // background, main shape, secondary shape, accent+ const [a, b, cc] = c;ctx.save();ctx.beginPath(); ctx.rect(x, y, s, s); ctx.clip();ctx.fillStyle = a; ctx.fillRect(x, y, s, s);const rot = Math.floor(r() * 4);- ctx.translate(x + s / 2, y + s / 2); ctx.rotate(rot * Math.PI / 2); ctx.translate(-s / 2, -s / 2);+ const upright = kind >= 14; // pictogram motifs keep their orientation+ ctx.translate(x + s / 2, y + s / 2); if (!upright) ctx.rotate(rot * Math.PI / 2); ctx.translate(-s / 2, -s / 2);switch (kind) {- case 0: // quarter circle- G.disc(ctx, 0, 0, s, b); break;- case 1: // half circle- G.disc(ctx, s / 2, s, s / 2, b); break;- case 2: // circle + small circle- G.disc(ctx, s / 2, s / 2, s / 2, b); G.disc(ctx, s * 0.62, s * 0.42, s * 0.13, cc); break;- case 3: { // striped half circle (setting sun)- ctx.save(); ctx.beginPath(); ctx.arc(s / 2, s, s / 2, Math.PI, 0); ctx.clip();+ case 0: G.disc(ctx, 0, 0, s, b); break; // quarter disc+ case 1: G.disc(ctx, s / 2, s, s / 2, b); break; // half disc+ case 2: G.disc(ctx, s / 2, s / 2, s / 2, b); G.disc(ctx, s * 0.62, s * 0.42, s * 0.13, cc); break;+ case 3: { ctx.save(); ctx.beginPath(); ctx.arc(s / 2, s, s / 2, Math.PI, 0); ctx.clip();for (let i = 0; i < 7; i++) { ctx.fillStyle = i % 2 ? b : cc; ctx.fillRect(0, s / 2 + i * s / 14, s, s / 14); }- ctx.restore(); break;- }- case 4: { // seigaiha (青海波, overlapping wave-scale pattern)- const k = s / 4;+ ctx.restore(); break; }+ case 4: { const k = s / 4; // fish-scale wavesfor (let row = 0; row < 5; row++) for (let i = -1; i < 5; i++) {const cx = i * k + (row % 2 ? k / 2 : 0), cy = row * k * 0.5 + k * 0.5;- G.disc(ctx, cx, cy, k * 0.5, row % 2 ? b : cc);- G.disc(ctx, cx, cy, k * 0.3, a);- }- break;- }- case 5: { // dot scales- G.disc(ctx, s / 2, s / 2, s / 2, b);+ G.disc(ctx, cx, cy, k * 0.5, row % 2 ? b : cc); G.disc(ctx, cx, cy, k * 0.3, a);+ } break; }+ case 5: { G.disc(ctx, s / 2, s / 2, s / 2, b); // dot scalesctx.save(); ctx.beginPath(); ctx.arc(s / 2, s / 2, s / 2, 0, Math.PI * 2); ctx.clip();- const k = s / 6;- for (let j = 0; j < 7; j++) for (let i = 0; i < 7; i++) G.disc(ctx, i * k + (j % 2 ? k / 2 : 0), j * k, k * 0.36, cc);- ctx.restore(); break;- }- case 6: { // triangle scales (三角鳞文, uroko pattern)- const k = s / 5;- for (let j = 0; j < 3; j++) for (let i = 0; i < 6; i++) {- const ox = i * k + (j % 2 ? k / 2 : 0) - k / 2, oy = s * 0.35 + j * k * 0.8;- G.poly(ctx, [[ox, oy + k * 0.8], [ox + k / 2, oy], [ox + k, oy + k * 0.8]], j % 2 ? b : cc);- }- break;- }- case 7: // concentric arcs- for (let i = 5; i >= 1; i--) G.disc(ctx, 0, s, (s * i) / 5, i % 2 ? b : a);- break;- case 8: { // sun disc / gear- const R = s * 0.3;- ctx.fillStyle = b; ctx.beginPath();+ const k = s / 6; for (let j = 0; j < 7; j++) for (let i = 0; i < 7; i++) G.disc(ctx, i * k + (j % 2 ? k / 2 : 0), j * k, k * 0.36, cc);+ ctx.restore(); break; }+ case 7: for (let i = 5; i >= 1; i--) G.disc(ctx, 0, s, (s * i) / 5, i % 2 ? b : a); break; // concentric arcs+ case 8: { const R = s * 0.3; ctx.fillStyle = b; ctx.beginPath(); // sun wheelfor (let i = 0; i < 16; i++) { const t0 = (i / 16) * Math.PI * 2; ctx.moveTo(s / 2, s / 2); ctx.arc(s / 2, s / 2, R * 1.35, t0, t0 + Math.PI / 32); }- ctx.fill();- G.disc(ctx, s / 2, s / 2, R, b); G.disc(ctx, s / 2, s / 2, R * 0.55, cc);- break;- }- case 9: { // checks- G.disc(ctx, s, s, s * 0.9, b);- const k = s / 7;+ ctx.fill(); G.disc(ctx, s / 2, s / 2, R, b); G.disc(ctx, s / 2, s / 2, R * 0.55, cc); break; }+ case 9: { G.disc(ctx, s, s, s * 0.9, b); const k = s / 7; // checksfor (let j = 0; j < 7; j++) for (let i = 0; i < 7; i++) if ((i + j) % 2 === 0) { ctx.fillStyle = cc; ctx.fillRect(i * k + k * 0.2, j * k + k * 0.2, k * 0.6, k * 0.6); }- break;- }- case 10: // crescent- G.disc(ctx, s / 2, s / 2, s * 0.46, b); G.disc(ctx, s * 0.66, s * 0.38, s * 0.4, a); break;- case 11: // S wave- G.disc(ctx, 0, s / 2, s / 2, b); G.disc(ctx, s, s / 2, s / 2, cc); break;- case 12: { // gradient quarter circle (the sense of light in the official graphic)- const g = ctx.createLinearGradient(0, 0, s, s); g.addColorStop(0, cc); g.addColorStop(1, b);- ctx.fillStyle = g; ctx.beginPath(); ctx.moveTo(0, s); ctx.arc(0, s, s, -Math.PI / 2, 0); ctx.closePath(); ctx.fill();- break;- }- case 13: { // horizontal bars fading out- for (let i = 0; i < 9; i++) { ctx.globalAlpha = 1 - i / 10; ctx.fillStyle = b; ctx.fillRect(0, s * 0.1 + i * s * 0.09, s * (1 - i * 0.06), s * 0.045); }- ctx.globalAlpha = 1; break;- }+ break; }+ case 10: G.disc(ctx, s / 2, s / 2, s * 0.46, b); G.disc(ctx, s * 0.66, s * 0.38, s * 0.4, a); break; // crescent+ case 11: G.disc(ctx, 0, s / 2, s / 2, b); G.disc(ctx, s, s / 2, s / 2, cc); break; // S wave+ case 13: for (let i = 0; i < 9; i++) { ctx.globalAlpha = 1 - i / 10; ctx.fillStyle = b; ctx.fillRect(0, s * 0.1 + i * s * 0.09, s * (1 - i * 0.06), s * 0.045); } ctx.globalAlpha = 1; break;+ // ── this film's motifs ──+ case 14: { const k = s / 4; // raindrop scales+ for (let j = 0; j < 4; j++) for (let i = 0; i < 4; i++) G.drop(ctx, k * (i + 0.5) + (j % 2 ? k / 2 : 0) - k / 4, k * (j + 0.72), k * 0.17, (i + j) % 2 ? b : cc);+ break; }+ case 15: G.cloud(ctx, s / 2, s * 0.74, s * 0.46, b); break; // cloud+ case 16: { for (let i = 0; i < 5; i++) G.seg(ctx, [s * (0.12 + i * 0.2), s * 0.15 + (i % 2) * s * 0.18], [s * (0.04 + i * 0.2), s * 0.55 + (i % 2) * s * 0.18], s * 0.05, i % 2 ? b : cc); break; } // rain strokes+ case 17: G.sunIcon(ctx, s / 2, s / 2, s * 0.2, b); break; // sun+ case 18: G.umbrella(ctx, s / 2, s * 0.6, s * 0.4, 1, 0, b, cc, b); break; // umbrella (foreshadowing)+ case 19: G.disc(ctx, s / 2, s / 2, s * 0.4, b); G.disc(ctx, s / 2, s / 2, s * 0.24, a); G.disc(ctx, s / 2, s / 2, s * 0.08, cc); break; // wheel+ case 20: { ctx.lineJoin = 'round'; ctx.strokeStyle = b; ctx.lineWidth = s * 0.1; ctx.lineCap = 'round'; // chevrons (wayfinding)+ for (let i = 0; i < 2; i++) { ctx.beginPath(); ctx.moveTo(s * (0.28 + i * 0.24), s * 0.25); ctx.lineTo(s * (0.48 + i * 0.24), s * 0.5); ctx.lineTo(s * (0.28 + i * 0.24), s * 0.75); ctx.stroke(); }+ break; }}ctx.restore();}G.motif = motif;+ G.MOTIFS = {+ rain: [1, 4, 5, 7, 10, 11, 14, 14, 15, 16, 16, 4, 18],+ sun: [0, 1, 2, 3, 8, 11, 13, 17, 17, 19, 20, 9],+ };- // Build one pattern canvas (2 cells wider than the screen, so whole rows can be offset)const patCache = new Map();- G.pattern = function (palKey, seed = 1, o = {}) {- const spread = o.spread ?? 1; // 1 = the contrast of the official artwork; smaller is softer- const density = o.density ?? 0.5; // share of cells that get small motifs- const key = palKey + '|' + seed + '|' + spread + '|' + density + '|' + (o.cell || CELL);+ G.pattern = function (pk, seed = 1, o = {}) {+ const spread = o.spread ?? 1, density = o.density ?? 0.5, set = o.set || 'rain';+ const key = [pk, seed, spread, density, set].join('|');if (patCache.has(key)) { const v = patCache.get(key); patCache.delete(key); patCache.set(key, v); return v; }if (patCache.size > 10) patCache.delete(patCache.keys().next().value);- const S = o.cell || CELL;- const P = PAL[palKey];- const base = P.t[2];+ const S = CELL, P = PAL[pk], base = P.t[2];const T = P.t.map((c) => mix(base, c, spread));const cols = Math.ceil(W / S) + 3, rows = Math.ceil(H / S) + 1;const cv = G.canvas(cols * S, rows * S), ctx = cv.getContext('2d');const r = rng(seed * 7919 + 13);ctx.fillStyle = T[1]; ctx.fillRect(0, 0, cv.width, cv.height);- // Large shapes: circles / half circles on a 2×2 macro grid- for (let j = -1; j < rows; j += 1) for (let i = -1; i < cols; i += 1) {- const k = r();- const cx = i * S, cy = j * S;+ for (let j = -1; j < rows; j++) for (let i = -1; i < cols; i++) {+ const k = r(), cx = i * S, cy = j * S;if (k < 0.34) G.disc(ctx, cx + S, cy + S, S, T[Math.floor(r() * 4)]);else if (k < 0.5) { G.disc(ctx, cx + S, cy + S, S, T[3]); G.disc(ctx, cx + S, cy + S, S * 0.5, T[0]); }}+ const lib = G.MOTIFS[set];for (let j = 0; j < rows; j++) for (let i = 0; i < cols; i++) {if (r() > density) continue;const pick = () => T[Math.floor(r() * 5)];let a = pick(), b = pick(); while (b === a) b = pick();let cc = pick(); while (cc === b) cc = pick();- motif(ctx, Math.floor(r() * 14), i * S, j * S, S, [a, b, cc, T[4]], r);+ motif(ctx, lib[Math.floor(r() * lib.length)], i * S, j * S, S, [a, b, cc], r);}patCache.set(key, cv);return cv;};-- // Draw the pattern with whole-row offsets. offs(row) returns the pixel offset.+ // Pattern with whole-row offsets; offs(row) → px. dy shifts the whole pattern vertically (camera).G.drawPattern = function (ctx, pat, offs, o = {}) {- const S = o.cell || CELL;- const rows = Math.ceil(H / S);- const oy = o.oy || 0;+ const S = CELL, rows = Math.ceil(H / S);for (let j = 0; j < rows + 1; j++) {- const dx = clamp(offs ? offs(j) : 0, -S, S);- const y = j * S + oy;- if (y > H || y + S < 0) continue;- ctx.drawImage(pat, 0, j * S, pat.width, S, -S + dx, y, pat.width, S + 0.5);- }- };-- // ───────── Athlete skeleton (geometric pictogram) ─────────- // Units: height ≈ 1. Origin = hips. Faces +x.- // Angles: rot = whole body (positive = flipping forward / clockwise), torso = upper-body forward lean, head = nod;- // limbs a*/l* are measured as "straight down = 0°, forward = 90°, overhead = 180°, backward = negative";- // arms are in the torso's frame, legs in the whole-body frame; forearm / shin values are absolute angles in that same frame.- // R = near side (light), L = far side (dark).- const LEN = { torso: 0.3, neck: 0.045, head: 0.082, ua: 0.16, fa: 0.15, th: 0.225, sh: 0.225 };- const WID = { torso: 0.145, arm: 0.076, leg: 0.094 };- G.LEN = LEN; G.WID = WID;- const dirDown = (deg, frame) => { const a = (deg + 0) * D2R; const v = [Math.sin(a), Math.cos(a)]; return rot2(v, frame); };- const rot2 = (v, deg) => { const a = deg * D2R, c = Math.cos(a), s = Math.sin(a); return [v[0] * c - v[1] * s, v[0] * s + v[1] * c]; };- const add = (p, v, k) => [p[0] + v[0] * k, p[1] + v[1] * k];- G.rot2 = rot2;-- const DEF = { x: 0, y: 0, rot: 0, torso: 0, head: 0, aL1: -8, aL2: -4, aR1: 8, aR2: 12, lL1: -4, lL2: -4, lR1: 4, lR2: 4 };- G.POSE_DEFAULT = DEF;- G.joints = function (p) {- p = Object.assign({}, DEF, p);- const hip = [p.x, p.y];- const tf = p.rot + p.torso;- const up = rot2([0, -1], tf);- const neck = add(hip, up, LEN.torso);- const sho = add(hip, up, LEN.torso - 0.025);- const hup = rot2(up, p.head);- const head = add(neck, hup, LEN.neck + LEN.head);- const arm = (a1, a2) => { const e = add(sho, dirDown(a1, tf), LEN.ua); const h = add(e, dirDown(a2, tf), LEN.fa); return [sho, e, h]; };- const leg = (l1, l2) => { const k = add(hip, dirDown(l1, p.rot), LEN.th); const f = add(k, dirDown(l2, p.rot), LEN.sh); return [hip, k, f]; };- return { p, hip, neck, sho, head, up, aL: arm(p.aL1, p.aL2), aR: arm(p.aR1, p.aR2), lL: leg(p.lL1, p.lL2), lR: leg(p.lR1, p.lR2) };- };-- // Draw the figure. col = near-side colour, far = far-side colour. Under the current ctx transform (unit = body height).- G.drawFigure = function (ctx, J, col, far) {- const limb = (L, w, c) => { G.seg(ctx, L[0], L[1], w, c); G.seg(ctx, L[1], L[2], w * 0.92, c); };- limb(J.lL, WID.leg, far); limb(J.aL, WID.arm, far);- G.seg(ctx, J.hip, add(J.neck, J.up, -0.02), WID.torso, col);- limb(J.lR, WID.leg, col); limb(J.aR, WID.arm, col);- G.disc(ctx, J.head[0], J.head[1], LEN.head, col);- };-- // Interpolate between two poses (angles linearly)- G.lerpPose = function (a, b, t) {- const o = {};- const keys = new Set([...Object.keys(a), ...Object.keys(b)]);- for (const k of keys) {- const va = a[k] ?? DEF[k] ?? 0, vb = b[k] ?? DEF[k] ?? 0;- o[k] = typeof va === 'number' ? lerp(va, vb, t) : (t < 0.5 ? va : vb);+ let dx = offs ? offs(j) : 0;+ dx = ((dx % S) + S) % S - S; // wrap: rows can travel forever+ const y = j * S;+ ctx.drawImage(pat, 0, j * S, pat.width, S, dx, y, pat.width, S + 0.5);}- return o;- };- // Keyframes: keys = [{b: beat, ...pose, e: 'easing'}], loop = loop length (beats)- G.keyPose = function (keys, u, loop) {- if (loop) u = ((u % loop) + loop) % loop;- if (u <= keys[0].b) return keys[0];- for (let i = 0; i < keys.length - 1; i++) {- const a = keys[i], b = keys[i + 1];- if (u < b.b) return G.lerpPose(a, b, (E[b.e || 'io'])((u - a.b) / (b.b - a.b)));- }- const last = keys[keys.length - 1];- if (loop) { const a = last, b = keys[0]; return G.lerpPose(a, b, (E[b.e || 'io'])((u - a.b) / (loop - a.b + b.b))); }- return last;- };- // Run cycle: ph = phase (cycles), k = intensity 0..1- G.runCycle = function (ph, k = 1, o = {}) {- const s = Math.sin(ph * Math.PI * 2), c = Math.cos(ph * Math.PI * 2);- const sw = 55 * k, lean = o.lean ?? 12 * k;- const legR = s * sw, legL = -s * sw;- const knee = (l, cc) => l - (20 + 70 * k * Math.max(0, -cc) + 25 * k * (l < 0 ? 1 : 0.3));- return {- torso: lean, rot: 0, y: -Math.abs(c) * 0.03 * k,- lR1: legR, lR2: knee(legR, c), lL1: legL, lL2: knee(legL, -c),- aR1: -s * 60 * k, aR2: -s * 60 * k + 85, aL1: s * 60 * k, aL2: s * 60 * k + 85,- };- };- G.walkCycle = function (ph, k = 1) {- const s = Math.sin(ph * Math.PI * 2);- return { torso: 4, y: -Math.abs(Math.cos(ph * Math.PI * 2)) * 0.012, lR1: s * 28, lR2: s * 28 - 6, lL1: -s * 28, lL2: -s * 28 - 6, aR1: -s * 32, aR2: -s * 32 + 70, aL1: s * 32, aL2: s * 32 + 70 };};- // ───────── Text ─────────+ // ───────── type ─────────G.F = {en: (w, px) => `${w} ${px}px "Inter Tight"`,zh: (w, px) => `${w} ${px}px "Noto Sans SC"`,- jp: (w, px) => `${w} ${px}px "Noto Sans JP"`,mono: (px, w = 500) => `${w} ${px}px "DM Mono"`,};- // Auto-fit font size: no wider than maxW- G.fitFont = function (ctx, text, fam, weight, px, maxW, ls = 0) {- ctx.font = G.F[fam](weight, px);- ctx.letterSpacing = ls ? ls * px + 'px' : '0px';- const w = ctx.measureText(text).width;- return w > maxW ? Math.floor(px * maxW / w) : px;- };- // Mask slide-up entrance: p 0→1G.maskText = function (ctx, text, x, y, font, col, p, o = {}) {ctx.save();ctx.font = font; ctx.letterSpacing = o.ls || '0px'; ctx.textAlign = o.align || 'left'; ctx.textBaseline = 'alphabetic';const m = ctx.measureText(text);- const asc = o.asc ?? m.actualBoundingBoxAscent, desc = o.desc ?? m.actualBoundingBoxDescent;- const h = asc + desc;- ctx.beginPath();+ const asc = m.actualBoundingBoxAscent, desc = m.actualBoundingBoxDescent, h = asc + desc;const w = m.width + 40;const x0 = o.align === 'center' ? x - w / 2 : o.align === 'right' ? x - w : x - 20;- ctx.rect(x0, y - asc - 6, w, h + 12);- ctx.clip();- const dy = (1 - (o.ease || E.oExp)(p)) * (h + 16) * (o.dir || 1);- ctx.fillStyle = col;- ctx.fillText(text, x, y + dy);+ ctx.beginPath(); ctx.rect(x0, y - asc - 8, w, h + 16); ctx.clip();+ const dy = (1 - E.oExp(p)) * (h + 20);+ ctx.fillStyle = col; ctx.fillText(text, x, y + dy);ctx.restore();return m.width;};- // Typewriter (monospaced meta info)+ G.hair = (ctx, x, y, w, col, p = 1, lw = 2) => { ctx.fillStyle = col; ctx.fillRect(x, y, w * clamp(p), lw); };G.typeText = function (ctx, text, x, y, font, col, p, o = {}) {const n = Math.floor(text.length * clamp(p) + 0.001);ctx.save(); ctx.font = font; ctx.letterSpacing = o.ls || '0px'; ctx.fillStyle = col; ctx.textAlign = o.align || 'left';ctx.fillText(text.slice(0, n), x, y);- if (p > 0 && p < 1 && o.caret !== false) { const w = ctx.measureText(text.slice(0, n)).width; ctx.fillRect(x + w + 4, y - 18, 11, 22); }ctx.restore();};- G.hair = (ctx, x, y, w, col, p = 1, lw = 2) => { ctx.fillStyle = col; ctx.fillRect(x, y, w * clamp(p), lw); };})();diff --git a/styles/pictogram-motion/demo/events.json b/styles/pictogram-motion/demo/events.jsonnew file mode 100644index 0000000..e26a0c1--- /dev/null+++ b/styles/pictogram-motion/demo/events.json@@ -0,0 +1 @@+{"dur":50,"ev":[{"t":0,"type":"rain_on"},{"t":0.5,"type":"pop"},{"t":0.5,"type":"step_wet"},{"t":1,"type":"step_wet"},{"t":1.5,"type":"step_wet"},{"t":2,"type":"step_wet"},{"t":2,"type":"furl"},{"t":2.5,"type":"cut"},{"t":3,"type":"clink"},{"t":3,"type":"brake"},{"t":3.5,"type":"ding"},{"t":4,"type":"flip"},{"t":4,"type":"rain_off"},{"t":4.5,"type":"door_open"},{"t":5,"type":"step_dry"},{"t":5.5,"type":"step_dry"},{"t":6,"type":"step_dry"},{"t":6,"type":"door_close"},{"t":6.5,"type":"iris"},{"t":7,"type":"title"},{"t":9,"type":"drip"},{"t":10,"type":"drip"},{"t":10.5,"type":"rows"},{"t":11,"type":"whip"},{"t":11.5,"type":"whip"},{"t":12,"type":"whip"},{"t":12.5,"type":"whip"},{"t":13,"type":"whip"},{"t":13.5,"type":"card"},{"t":14.5,"type":"card"},{"t":15.5,"type":"card"},{"t":16.5,"type":"slide"},{"t":17,"type":"brake"},{"t":17.5,"type":"moon"},{"t":18.05,"type":"descend"},{"t":18.5,"type":"slam"},{"t":19.5,"type":"tag"},{"t":21.5,"type":"quarter"},{"t":24,"type":"count"},{"t":26,"type":"tick"},{"t":26.25,"type":"tick"},{"t":26.5,"type":"tick"},{"t":26.75,"type":"tick"},{"t":27,"type":"tick"},{"t":27.25,"type":"tick"},{"t":27.5,"type":"tick"},{"t":27.75,"type":"tick"},{"t":28,"type":"thunder"},{"t":29.5,"type":"thunder2"},{"t":31,"type":"split"},{"t":34,"type":"flipT"},{"t":34.5,"type":"signflip"},{"t":35,"type":"shutter"},{"t":35.25,"type":"shutter"},{"t":35.5,"type":"shutter"},{"t":35.75,"type":"shutter"},{"t":36,"type":"shutter"},{"t":36.25,"type":"shutter"},{"t":36.5,"type":"bloom"},{"t":39,"type":"rowshift"},{"t":39.5,"type":"rowshift"},{"t":40,"type":"rowshift"},{"t":40.5,"type":"quarter"},{"t":41,"type":"stop","i":0},{"t":41.25,"type":"stop","i":1},{"t":41.5,"type":"stop","i":2},{"t":41.75,"type":"stop","i":3},{"t":42,"type":"stop","i":4},{"t":42.25,"type":"stop","i":5},{"t":42.5,"type":"stop","i":6},{"t":42.75,"type":"stop","i":7},{"t":43,"type":"stop","i":8},{"t":43.25,"type":"stop","i":9},{"t":43.5,"type":"stop","i":10},{"t":43.75,"type":"stop","i":11},{"t":44,"type":"rows"},{"t":44.5,"type":"step_soft"},{"t":45,"type":"step_soft"},{"t":45.5,"type":"step_soft"},{"t":46,"type":"step_soft"},{"t":46.5,"type":"end"}]}\ No newline at end of filediff --git a/styles/pictogram-motion/demo/film.js b/styles/pictogram-motion/demo/film.jsnew file mode 100644index 0000000..1c885a0--- /dev/null+++ b/styles/pictogram-motion/demo/film.js@@ -0,0 +1,958 @@+// LEFT BEHIND — one timeline for the whole 50 s film (120 BPM: beat 0.5 s, bar 2 s).+// render(t) draws film second t; ?a=&b= renders a span of it, ?nocap=1 hides the subtitles.+(function () {+ const { W, H, E, PAL, clamp, lerp, inv, rgba, mix, CELL } = G;+ const F = G.F;+ const FULL = 50;++ // ───────── shot list (film seconds) ─────────+ const SHOTS = [+ { id: 'S1', t0: 0.0, kind: 'rainOpen' },+ { id: 'S2', t0: 2.5, kind: 'busStop' },+ { id: 'S5', t0: 6.5, kind: 'title' },+ { id: 'S6', t0: 10.5, kind: 'track' },+ { id: 'S7a', t0: 13.5, kind: 'ladder', i: 0 },+ { id: 'S7b', t0: 14.5, kind: 'ladder', i: 1 },+ { id: 'S7c', t0: 15.5, kind: 'ladder', i: 2 },+ { id: 'S8', t0: 16.5, kind: 'lastStop' },+ { id: 'S9', t0: 18.5, kind: 'lost' },+ { id: 'S10', t0: 21.5, kind: 'wall' },+ { id: 'S12', t0: 28.0, kind: 'storm' },+ { id: 'S13', t0: 31.0, kind: 'split' },+ { id: 'S14', t0: 34.0, kind: 'shutter' },+ { id: 'S15', t0: 36.5, kind: 'bloom' },+ { id: 'S16', t0: 40.5, kind: 'route' },+ { id: 'S17', t0: 44.0, kind: 'echo' },+ { id: 'S18', t0: 46.5, kind: 'end' },+ ];+ SHOTS.forEach((s, i) => (s.t1 = i + 1 < SHOTS.length ? SHOTS[i + 1].t0 : FULL));+ // grid transitions at shot boundaries (others are built into the shots: match cut 2.5, flip 4.0, iris 6.5,+ // descent 18.5, wall 21.5→28 is one camera move, lightning 28.0, shutter → wall 36.5)+ const TRANS = { 10.5: 'rows', 13.5: 'cols', 14.5: 'cols', 15.5: 'cols', 16.5: 'slide', 21.5: 'quarter', 31.0: 'split', 34.0: 'flip', 40.5: 'quarter', 44.0: 'rows', 46.5: 'rows' };++ // ───────── sound / cue events (film seconds) ─────────+ const EV = [+ { t: 0.0, type: 'rain_on' }, { t: 0.5, type: 'pop' },+ ...[0.5, 1.0, 1.5, 2.0].map((t) => ({ t, type: 'step_wet' })),+ { t: 2.0, type: 'furl' }, { t: 2.5, type: 'cut' }, { t: 3.0, type: 'clink' }, { t: 3.0, type: 'brake' }, { t: 3.5, type: 'ding' },+ { t: 4.0, type: 'flip' }, { t: 4.0, type: 'rain_off' }, { t: 4.5, type: 'door_open' },+ ...[5.0, 5.5, 6.0].map((t) => ({ t, type: 'step_dry' })),+ { t: 6.0, type: 'door_close' }, { t: 6.5, type: 'iris' }, { t: 7.0, type: 'title' }, { t: 9.0, type: 'drip' }, { t: 10.0, type: 'drip' },+ { t: 10.5, type: 'rows' }, ...[11.0, 11.5, 12.0, 12.5, 13.0].map((t) => ({ t, type: 'whip' })),+ ...[13.5, 14.5, 15.5].map((t) => ({ t, type: 'card' })),+ { t: 16.5, type: 'slide' }, { t: 17.0, type: 'brake' }, { t: 17.5, type: 'moon' }, { t: 18.05, type: 'descend' },+ { t: 18.5, type: 'slam' }, { t: 19.5, type: 'tag' }, { t: 21.5, type: 'quarter' }, { t: 24.0, type: 'count' },+ ...[26.0, 26.25, 26.5, 26.75, 27.0, 27.25, 27.5, 27.75].map((t) => ({ t, type: 'tick' })),+ { t: 28.0, type: 'thunder' }, { t: 29.5, type: 'thunder2' }, { t: 31.0, type: 'split' },+ { t: 34.0, type: 'flipT' }, { t: 34.5, type: 'signflip' },+ ...[35.0, 35.25, 35.5, 35.75, 36.0, 36.25].map((t) => ({ t, type: 'shutter' })),+ { t: 36.5, type: 'bloom' }, ...[39.0, 39.5, 40.0].map((t) => ({ t, type: 'rowshift' })),+ { t: 40.5, type: 'quarter' }, ...Array.from({ length: 12 }, (_, i) => ({ t: 41.0 + i * 0.25, type: 'stop', i })),+ { t: 44.0, type: 'rows' }, ...[44.5, 45.0, 45.5, 46.0].map((t) => ({ t, type: 'step_soft' })),+ { t: 46.5, type: 'end' },+ ];++ // ───────── helpers ─────────+ const rowDrift = (t, seed, sp = 26, amp = 22) => (j) => (j % 2 ? 1 : -1) * t * sp + Math.sin(j * 1.7 + seed) * amp;++ function stageDisc(ctx, x, y, r, col, lt) {+ G.disc(ctx, x, y, r, col);+ ctx.save(); ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.clip();+ const sx = x - r * 1.6 + E.o3(inv(0.1, 2.6, lt)) * r * 3.2;+ const g = ctx.createLinearGradient(sx - r * 0.5, y - r, sx + r * 0.5, y + r);+ g.addColorStop(0, 'rgba(255,255,255,0)'); g.addColorStop(0.5, 'rgba(255,255,255,0.09)'); g.addColorStop(1, 'rgba(255,255,255,0)');+ ctx.fillStyle = g; ctx.fillRect(x - r, y - r, r * 2, r * 2);+ ctx.restore();+ }++ // Rain: pictogram drops in columns. shelter(x, y) → true where a drop is hidden; roof(x) → y where drops splash.+ function rain(ctx, t, o = {}) {+ const v = o.v || 760, col = o.col, scroll = o.scroll || 0, r = o.r || 7.5;+ const n = 34, gap = W / n;+ for (let i = 0; i < n; i++) {+ const ph = G.hash(i + 3), jit = (G.hash(i + 77) - 0.5) * gap * 0.5;+ let x = ((i * gap + jit - scroll) % W + W) % W;+ const period = 0.25;+ const n0 = Math.floor((t - (H + 160) / v) / period) - 1, n1 = Math.floor(t / period) + 1;+ for (let k = n0; k <= n1; k++) {+ const ts = (k + ph) * period;+ const y = -60 + (t - ts) * v;+ if (y < -60 || y > H + 60) continue;+ const xx = x + (G.hash(k * 31 + i) - 0.5) * 18 - (o.slant ? (H - y) * o.slant : 0);+ const roofY = o.roof ? o.roof(xx) : null;+ if (roofY != null && y > roofY) {+ const since = (y - roofY) / v;+ if (since < 0.12) { // splash crown+ const p = since / 0.12, a = 1 - p;+ ctx.globalAlpha = a;+ G.disc(ctx, xx - 6 - 14 * p, roofY - 6 - 10 * p, 3.2, col);+ G.disc(ctx, xx + 6 + 14 * p, roofY - 6 - 10 * p, 3.2, col);+ ctx.globalAlpha = 1;+ }+ continue;+ }+ if (o.shelter && o.shelter(xx, y)) continue;+ G.drop(ctx, xx, y, r, col);+ }+ }+ }++ // ───────── S1 · rain, the umbrella pops open ─────────+ const S1 = { ux: 960, uy: 440, R: 290 };+ const s1Open = (t) => (t < 2 ? E.oBack(inv(0.5, 0.82, t)) : 1 - E.io3(inv(2.0, 2.45, t)));+ const s1Cam = (t) => 300 * Math.min(t, 2) + 75 * E.o3(inv(2, 2.5, t));+ function rainOpen(ctx, t) {+ const P = PAL.navy;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ const cam = s1Cam(t);+ const pop = (j) => (j % 2 ? 1 : -1) * CELL * 0.25 * E.oExp(inv(0.5, 0.8, t));+ const dr = rowDrift(t, 2);+ G.drawPattern(ctx, G.pattern('navy', 11, { spread: 0.55, density: 0.5, set: 'rain' }), (j) => dr(j) - cam * 0.35 + pop(j));+ stageDisc(ctx, S1.ux, S1.uy + 30, 430, P.t[0], t);+ // umbrella geometry+ const o = s1Open(t);+ const bob = 7 * [0.5, 1.0, 1.5, 2.0].reduce((a, b) => a + (t > b ? Math.exp(-(t - b) * 9) * Math.sin((t - b) * 18) : 0), 0);+ const ux = S1.ux, uy = S1.uy + bob, R = S1.R;+ const w = lerp(0.15, 1, Math.min(o, 1)) * R, h = lerp(1.12, 0.62, Math.min(o, 1)) * R, ry = uy + lerp(0.52, 0, Math.min(o, 1)) * R;+ const domeY = (x) => { const dx = (x - ux) / w; return Math.abs(dx) > 1 ? null : ry - h * Math.sqrt(1 - dx * dx); };+ rain(ctx, t, {+ col: P.t[4], scroll: cam * 0.6,+ roof: (x) => domeY(x),+ shelter: (x, y) => false,+ });+ // footprints under the umbrella (someone is walking)+ for (let k = -1; k < 4; k++) {+ const ts = 0.5 + k * 0.5;+ if (t < ts) continue;+ const wx = 1130 + 150 * k, sx = wx - cam, sy = k % 2 ? 848 : 796;+ const a = 1 - inv(ts + 0.6, ts + 1.6, t);+ if (a <= 0) continue;+ const s = 44 * E.oExp(inv(ts, ts + 0.12, t));+ ctx.globalAlpha = a; G.foot(ctx, sx, sy, s, Math.PI / 2 + (k % 2 ? 0.1 : -0.1), rgba(G.CREAM, 0.88), k % 2 ? 1 : -1);+ // a small splash ring on landing+ const rp = inv(ts, ts + 0.4, t);+ if (rp < 1) { ctx.globalAlpha = a * (1 - rp); G.ring(ctx, sx, sy, 22 + 44 * E.oExp(rp), 3, P.t[4]); }+ ctx.globalAlpha = 1;+ }+ G.umbrella(ctx, ux, uy, R, o, 0, G.UMB, G.UMB2, G.UMB);+ }++ // ───────── S2–S4 · the bus, the stop, the sun, the doors ─────────+ // World coordinates at scale 1 = the final wide frame.+ const BUS = { x: 140, y: 330, w: 1340, h: 490 };+ const RAIL_Y = 422, WIN = [[200, 380], [404, 584], [608, 788], [812, 992], [1016, 1196]];+ const DOOR = [1236, 1396];+ const HOOK = [698, RAIL_Y];+ const UR = 70; // umbrella size in the bus+ const C_HOOK = [-0.13, 0.98];+ const U_REST = [HOOK[0] - C_HOOK[0] * UR, HOOK[1] + C_HOOK[1] * UR]; // origin when hanging (rot = π)+ const busX = (t) => -540 * (1 - E.o3(inv(2.5, 3.5, t)));+ const doorO = (t) => E.oExp(inv(4.5, 4.78, t)) * (1 - E.io3(inv(6.0, 6.3, t)));+ function busCam(t) {+ // returns {k, cx, cy, ax, ay}: world (cx, cy) maps to screen (ax, ay), scale k+ const p = E.io3(inv(2.5, 3.45, t));+ const k0 = S1.R / UR;+ const bx = busX(t);+ let k = lerp(k0, 1, p), cx = lerp(U_REST[0] + bx, 960, p), cy = lerp(U_REST[1], 540, p), ax = lerp(S1.ux, 960, p), ay = lerp(S1.uy, 540, p);+ const q = E.io3(inv(6.0, 6.5, t)); // a small push toward the umbrella before the iris+ k *= 1 + 0.16 * q; cx = lerp(cx, U_REST[0], q * 0.5); cy = lerp(cy, U_REST[1], q * 0.5);+ return { k, cx, cy, ax, ay };+ }+ const toScreen = (c, x, y) => [(x - c.cx) * c.k + c.ax, (y - c.cy) * c.k + c.ay];+ function umbrellaPose(t) {+ // starts tip-up and furled (matching S1's last frame), turns over and hooks onto the rail on beat 3.0+ const p = E.io3(inv(2.55, 3.0, t));+ const rot = Math.PI * p + Math.sin(Math.PI * clamp((t - 3.0) / 0.5)) * 0.06 * Math.exp(-(t - 3.0) * 4) * (t > 3 ? 1 : 0);+ return { rot, x: U_REST[0], y: U_REST[1] };+ }++ function busStop(ctx, t, wx) {+ const P = wx === 'sun' ? PAL.teal : PAL.navy;+ const cream = G.CREAM, far = mix(cream, P.t[2], 0.42);+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ const c = busCam(t), bx = busX(t);+ const dr = rowDrift(t, 5);+ const pat = G.pattern(P.key, wx === 'sun' ? 21 : 12, { spread: 0.5, density: 0.48, set: wx === 'sun' ? 'sun' : 'rain' });+ G.drawPattern(ctx, pat, (j) => dr(j) + bx * 0.5);+ ctx.save();+ ctx.translate(c.ax, c.ay); ctx.scale(c.k, c.k); ctx.translate(-c.cx, -c.cy);+ // sun (after the flip)+ if (wx === 'sun') {+ stageDisc(ctx, 330, 190, 150, P.t[0], t - 4);+ G.sunIcon(ctx, 330, 190, 62, PAL.yellow.t[4], t * 0.25);+ }+ // road+ ctx.fillStyle = P.t[0]; ctx.fillRect(-3000, 860, 9000, 900);+ ctx.fillStyle = P.t[1]; ctx.fillRect(-3000, 868, 9000, 92);+ ctx.fillStyle = rgba(cream, 0.5); ctx.fillRect(-3000, 860, 9000, 4); ctx.fillRect(-3000, 958, 9000, 3);+ // rain behind the bus+ if (wx === 'rain') {+ ctx.restore(); ctx.save();+ const roof = (x) => { const [wx0] = toScreen(c, BUS.x + bx, 0), [wx1, wy] = toScreen(c, BUS.x + bx + BUS.w, BUS.y); return x > wx0 + 30 && x < wx1 - 30 ? wy : null; };+ const [, roadY] = toScreen(c, 0, 862);+ rain(ctx, t, { col: P.t[4], scroll: bx * 0.6, roof: (x) => roof(x) ?? roadY });+ ctx.translate(c.ax, c.ay); ctx.scale(c.k, c.k); ctx.translate(-c.cx, -c.cy);+ }+ // stop sign+ const sx = 1700;+ G.seg(ctx, [sx, 860], [sx, 420], 16, far);+ G.rrect(ctx, sx - 110, 250, 220, 220, 26, cream);+ ctx.fillStyle = P.t[2]; ctx.font = F.en(900, 132); ctx.textAlign = 'center'; ctx.letterSpacing = '0px';+ ctx.fillText('4', sx - 40, 405);+ G.rrect(ctx, sx + 20, 300, 64, 46, 12, P.t[2]); // tiny bus glyph+ G.disc(ctx, sx + 34, 350, 9, P.t[2]); G.disc(ctx, sx + 70, 350, 9, P.t[2]);+ ctx.font = F.mono(26); ctx.letterSpacing = '2px'; ctx.textAlign = 'center';+ ctx.fillText('ELM ST', sx, 452);+ ctx.save(); ctx.translate(bx, 0); drawBus(ctx, P, doorO(t), bx / 66, null); ctx.restore();+ // the umbrella (moves with the bus)+ const up = umbrellaPose(t);+ G.umbrella(ctx, up.x + bx, up.y, UR, 0, up.rot, G.UMB, G.UMB2, G.UMB);+ // footprints out of the door (dry, the sun is out)+ if (wx === 'sun') {+ const steps = [[1320, 890], [1470, 934], [1620, 890], [1770, 934], [1920, 890]];+ steps.forEach(([fx, fy], k) => {+ const ts = 5.0 + k * 0.5;+ if (t < ts) return;+ const s = 44 * E.oExp(inv(ts, ts + 0.12, t));+ G.foot(ctx, fx, fy, s, Math.PI / 2 + (k % 2 ? 0.1 : -0.1), rgba(cream, 0.94), k % 2 ? 1 : -1);+ });+ }+ ctx.restore();+ return c;+ }++ // ───────── S5 · LEFT BEHIND ─────────+ const ST = { x: 1330, y: 500, r: 370, hook: [1330, 262], R: 200 };+ const bandBuf = G.canvas();+ function titleStage(ctx, t, lt) {+ const P = PAL.teal, cream = G.CREAM, far = P.far;+ stageDisc(ctx, ST.x, ST.y, ST.r, P.t[1], lt);+ // grab rail + seat (side view)+ G.seg(ctx, [1060, ST.hook[1]], [1610, ST.hook[1]], 18, far);+ G.seg(ctx, [1060, ST.hook[1]], [1060, 180], 18, far);+ G.seg(ctx, [1610, ST.hook[1]], [1610, 180], 18, far);+ G.seg(ctx, [1500, 560], [1530, 760], 58, cream); // seat back+ G.seg(ctx, [1530, 778], [1190, 778], 58, cream); // seat+ G.seg(ctx, [1360, 800], [1360, 850], 30, far); // pedestal+ G.seg(ctx, [1290, 856], [1430, 856], 22, far);+ // umbrella hanging from the rail+ const R = ST.R, ox = ST.hook[0] - (-0.13) * R, oy = ST.hook[1] + 0.98 * R;+ const sway = Math.sin(lt * 2.4) * 0.025 * Math.exp(-lt * 0.6);+ ctx.save(); ctx.translate(ST.hook[0], ST.hook[1]); ctx.rotate(sway); ctx.translate(-ST.hook[0], -ST.hook[1]);+ G.umbrella(ctx, ox, oy, R, 0, Math.PI, G.UMB, G.UMB2, G.UMB);+ // drips from the ferrule+ const tip = [ox, oy + 0.74 * R + 6];+ for (const td of [9.0, 10.0]) {+ const grow = inv(td - 0.7, td, t), fall = inv(td, td + 0.24, t);+ if (grow <= 0 || fall >= 1) continue;+ const y = tip[1] + 10 + (778 - 29 - tip[1] - 10) * fall * fall;+ G.drop(ctx, tip[0], y, 9 * (0.4 + 0.6 * grow), PAL.sky.t[3]);+ }+ ctx.restore();+ for (const td of [9.0, 10.0]) {+ const sp = inv(td + 0.24, td + 0.7, t);+ if (sp <= 0 || sp >= 1) continue;+ ctx.globalAlpha = 1 - sp;+ G.disc(ctx, ox - 10 - 26 * sp, 742 - 22 * Math.sin(sp * Math.PI), 4.5, PAL.sky.t[3]);+ G.disc(ctx, ox + 10 + 26 * sp, 742 - 22 * Math.sin(sp * Math.PI), 4.5, PAL.sky.t[3]);+ ctx.globalAlpha = 1;+ }+ }+ function titleCard(ctx, t) {+ const lt = t - 6.5, P = PAL.teal, fg = P.fg;+ ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);+ const dr = rowDrift(lt, 9);+ G.drawPattern(ctx, G.pattern('teal', 31, { spread: 0.42, density: 0.42, set: 'sun' }), dr);+ // stage, assembled from horizontal bands sliding into register+ const asm = inv(0.0, 0.45, lt);+ if (asm >= 1) titleStage(ctx, t, lt);+ else {+ const b = bandBuf.getContext('2d'); b.setTransform(1, 0, 0, 1, 0, 0); b.clearRect(0, 0, W, H);+ titleStage(b, t, lt);+ const bh = 54;+ for (let j = 0; j * bh < H; j++) {+ const d = (j % 2 ? 1 : -1) * (90 + 160 * G.hash(j + 5)) * (1 - E.oExp(clamp(asm * 1.25 - (j % 5) * 0.04)));+ ctx.drawImage(bandBuf, 0, j * bh, W, bh, d, j * bh, W, bh);+ }+ }+ // type+ const x = 130;+ G.typeText(ctx, 'LINE 4 · STOP 03 / 12', x + 4, 236, F.mono(22), rgba(fg, 0.75), inv(0.15, 0.5, lt), { ls: '3px' });+ const k0 = 0.5; // title lands on beat 7.0+ const px = 214;+ G.maskText(ctx, 'LEFT', x - 6, 446, F.en(900, px), fg, inv(k0, k0 + 0.5, lt), { ls: -0.02 * px + 'px' });+ G.maskText(ctx, 'BEHIND', x - 6, 640, F.en(900, px), fg, inv(k0 + 0.08, k0 + 0.58, lt), { ls: -0.02 * px + 'px' });+ G.maskText(ctx, '被落下的伞', x, 744, F.zh(900, 74), fg, inv(k0 + 0.16, k0 + 0.66, lt), { ls: '6px' });+ // lost-property tag chip+ const tag = 'LOST ITEM · UMBRELLA, YELLOW';+ ctx.save(); ctx.font = F.mono(20); ctx.letterSpacing = '3px';+ const tw = ctx.measureText(tag).width + 30, p = E.oExp(inv(k0 + 0.25, k0 + 0.6, lt));+ ctx.fillStyle = fg; ctx.fillRect(x, 786, tw * p, 40);+ ctx.beginPath(); ctx.rect(x, 786, tw * p, 40); ctx.clip();+ ctx.fillStyle = P.t[1]; ctx.fillText(tag, x + 15, 813);+ ctx.restore();+ }+++ // ───────── shared pieces ─────────+ const pad2 = (n) => String(n).padStart(2, '0');+ function chip(ctx, x, y, text, fg, bg, p, px = 20) {+ if (p <= 0) return 0;+ ctx.save(); ctx.font = F.mono(px); ctx.letterSpacing = '3px'; ctx.textAlign = 'left';+ const tw = ctx.measureText(text).width + 30, h = Math.round(px * 2);+ ctx.fillStyle = bg; ctx.fillRect(x, y, tw * p, h);+ ctx.beginPath(); ctx.rect(x, y, tw * p, h); ctx.clip();+ ctx.fillStyle = fg; ctx.fillText(text, x + 15, y + px * 1.36);+ ctx.restore(); return tw;+ }+ // Title block: meta line, 1–2 title lines (mask slide-up), second-language line, tag chip. y = first title baseline.+ function textBlock(ctx, lt, x, y, o) {+ const k = o.k || 1, d0 = o.d0 || 0, fg = o.fg;+ const lines = Array.isArray(o.title) ? o.title : [o.title];+ let px = o.px;+ ctx.save(); ctx.font = F.en(900, px); ctx.letterSpacing = -0.02 * px + 'px';+ const wmax = Math.max(...lines.map((l) => ctx.measureText(l).width)); ctx.restore();+ if (o.maxW && wmax > o.maxW) px = Math.floor(px * o.maxW / wmax);+ const lh = o.lh || px * 0.92;+ if (o.meta) G.typeText(ctx, o.meta, x + 4, y - px * 0.74 - 34, F.mono(22), rgba(fg, 0.75), inv(d0, d0 + 0.35 * k, lt), { ls: '3px' });+ lines.forEach((ln, i) => G.maskText(ctx, ln, x - px * 0.03, y + i * lh, F.en(900, px), fg, inv(d0 + 0.08 * i * k, d0 + (0.5 + 0.08 * i) * k, lt), { ls: -0.02 * px + 'px' }));+ let yy = y + (lines.length - 1) * lh;+ if (o.zh) { yy += o.zpx + 28; G.maskText(ctx, o.zh, x, yy, F.zh(900, o.zpx), fg, inv(d0 + 0.16 * k, d0 + 0.66 * k, lt), { ls: '6px' }); }+ if (o.tag) chip(ctx, x, yy + 34, o.tag, o.tagFg, o.tagBg || fg, E.oExp(inv(d0 + 0.25 * k, d0 + 0.6 * k, lt)));+ }+ function roadBand(ctx, P, y) {+ ctx.fillStyle = P.t[0]; ctx.fillRect(0, y, W, H - y);+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, y + 8, W, 92);+ ctx.fillStyle = rgba(G.CREAM, 0.5); ctx.fillRect(0, y, W, 4); ctx.fillRect(0, y + 98, W, 3);+ }+ // Stop sign on its pole. (x, yBase) = foot of the pole, s = scale.+ function stopSign(ctx, x, yBase, num, name, P, s = 1) {+ const cream = G.CREAM, far = mix(cream, P.t[2], 0.42);+ ctx.save(); ctx.translate(x, yBase); ctx.scale(s, s);+ G.seg(ctx, [0, 0], [0, -440], 16, far);+ G.rrect(ctx, -110, -610, 220, 220, 26, cream);+ ctx.fillStyle = P.t[2]; ctx.textAlign = 'center'; ctx.letterSpacing = '0px';+ const big = String(num);+ ctx.font = F.en(900, big.length > 1 ? 104 : 132); ctx.fillText(big, big.length > 1 ? -32 : -40, -455);+ G.rrect(ctx, 26, -560, 58, 42, 11, P.t[2]); G.disc(ctx, 39, -514, 8, P.t[2]); G.disc(ctx, 71, -514, 8, P.t[2]);+ ctx.font = F.mono(name.length > 7 ? 21 : 26); ctx.letterSpacing = '2px'; ctx.fillText(name, 0, -408);+ ctx.restore();+ }+ // The bus, drawn in its world frame (BUS rect); dO = doors open, roll = wheel turn, uRot = the umbrella's rotation (null = none)+ function drawBus(ctx, P, dO, roll, uRot) {+ const cream = G.CREAM, far = mix(cream, P.t[2], 0.42), inside = P.t[0];+ const { x, y, w, h } = BUS;+ G.rrect(ctx, x, y, w, h, 64, cream);+ G.rrect(ctx, x, y + h - 84, w, 84, [0, 0, 64, 64], far);+ for (const [a, b] of WIN) {+ G.rrect(ctx, a, 380, b - a, 220, 22, inside);+ ctx.save(); ctx.beginPath(); ctx.roundRect(a, 380, b - a, 220, 22); ctx.clip();+ G.rrect(ctx, a + 30, 520, 46, 120, 23, mix(cream, inside, 0.62));+ G.rrect(ctx, a + 110, 520, 46, 120, 23, mix(cream, inside, 0.62));+ G.seg(ctx, [a - 10, RAIL_Y], [b + 10, RAIL_Y], 7, mix(cream, inside, 0.45));+ ctx.restore();+ }+ G.rrect(ctx, DOOR[0] - 8, 372, DOOR[1] - DOOR[0] + 16, 442, 18, far);+ ctx.save(); ctx.beginPath(); ctx.rect(DOOR[0], 380, DOOR[1] - DOOR[0], 434); ctx.clip();+ ctx.fillStyle = mix(inside, G.INK, 0.4); ctx.fillRect(DOOR[0], 380, DOOR[1] - DOOR[0], 434);+ const pw = (DOOR[1] - DOOR[0]) / 2;+ for (const side of [-1, 1]) {+ const px = (side < 0 ? DOOR[0] : DOOR[0] + pw) + side * pw * 0.92 * dO;+ G.rrect(ctx, px + 4, 384, pw - 8, 426, 12, cream);+ G.rrect(ctx, px + 16, 396, pw - 32, 200, 10, inside);+ G.rrect(ctx, px + 16, 612, pw - 32, 170, 10, inside);+ }+ ctx.restore();+ G.rrect(ctx, 1424, 380, 40, 260, [10, 30, 30, 10], inside);+ G.disc(ctx, 1458, 742, 14, PAL.yellow.t[4]);+ G.rrect(ctx, 200, 344, 110, 26, 8, inside);+ ctx.fillStyle = cream; ctx.font = F.mono(19); ctx.letterSpacing = '2px'; ctx.textAlign = 'left'; ctx.fillText('4', 214, 364);+ G.rrect(ctx, 236, 353, 62, 8, 4, PAL.yellow.t[4]);+ for (const wxp of [420, 1120]) {+ G.disc(ctx, wxp, 820, 72, P.t[0]); G.disc(ctx, wxp, 820, 62, G.INK); G.disc(ctx, wxp, 820, 28, far);+ G.disc(ctx, wxp + Math.cos(roll) * 16, 820 + Math.sin(roll) * 16, 7, G.INK);+ }+ if (uRot != null) G.umbrella(ctx, U_REST[0], U_REST[1], UR, 0, uRot, G.UMB, G.UMB2, G.UMB);+ }+ const busAt = (ctx, sx, sy, s) => { ctx.translate(sx, sy); ctx.scale(s, s); ctx.translate(-BUS.x, -BUS.y); };++ // ───────── S6 · ALL DAY: the bus rides, the stops whip past ─────────+ const STREETS = ['ELM ST', 'MILL RD', 'PARK AVE', 'RIVER ST', 'HILL RD', 'OAK LANE'];+ const WHIPS = [11.0, 11.5, 12.0, 12.5, 13.0];+ const trackCam = (t) => 42 * (t - 10.5) + WHIPS.reduce((a, b) => a + W * E.ioExp(inv(b - 0.14, b + 0.24, t)), 0);+ function track(ctx, t) {+ const P = PAL.teal, lt = t - 10.5, fg = P.fg, cam = trackCam(t);+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ const dr = rowDrift(lt, 7);+ G.drawPattern(ctx, G.pattern('teal', 41, { spread: 0.5, density: 0.46, set: 'sun' }), (j) => dr(j) - cam * (j % 2 ? 0.5 : 0.32));+ G.sunIcon(ctx, 1480 - cam * 0.03, 170, 46, PAL.yellow.t[4], lt * 0.4);+ roadBand(ctx, P, 860);+ for (let k = 0; k < 6; k++) { const x = 1560 + k * W - cam; if (x > -300 && x < W + 300) stopSign(ctx, x, 860, k + 3, STREETS[k], P, 0.8); }+ ctx.save(); busAt(ctx, 300, 500 + Math.sin(lt * 9) * 2, 0.62); drawBus(ctx, P, 0, cam / 41, Math.PI); ctx.restore();+ textBlock(ctx, lt, 130, 300, { meta: 'CH.02 · LINE 4', title: 'ALL DAY', px: 170, zh: '一整天', zpx: 66, fg, d0: 0.1, k: 0.8 });+ }++ // ───────── S7 · pace ladder: the clock runs, the umbrella stays ─────────+ const LAD = [+ { tm: '10:00', zh: '上午十点', pk: 'teal', tag: 'NOT NEEDED', stop: 9, h: 10 },+ { tm: '14:00', zh: '下午两点', pk: 'sky', tag: 'STILL HERE', stop: 10, h: 14 },+ { tm: '18:00', zh: '傍晚六点', pk: 'coral', tag: 'NO RAIN TODAY', stop: 11, h: 18 },+ ];+ function ladder(ctx, t, i) {+ const c = LAD[i], P = PAL[c.pk], lt = t - (13.5 + i), fg = P.fg, light = fg !== G.CREAM;+ ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);+ G.drawPattern(ctx, G.pattern(c.pk, 50 + i, { spread: 0.42, density: 0.42, set: 'sun' }), rowDrift(lt + i, 11 + i));+ const cx = 1260, cy = 540, r = 350;+ stageDisc(ctx, cx, cy, r, light ? P.t[4] : P.t[1], lt + 0.6);+ const h0 = i ? LAD[i - 1].h : 8.5, hh = lerp(h0, c.h, E.oExp(inv(0, 0.4, lt)));+ for (let k = 0; k < 12; k++) {+ const a = (k / 12) * Math.PI * 2;+ G.seg(ctx, [cx + Math.cos(a) * r * 0.8, cy + Math.sin(a) * r * 0.8], [cx + Math.cos(a) * r * 0.88, cy + Math.sin(a) * r * 0.88], 10, rgba(fg, 0.45));+ }+ const ha = ((hh % 12) / 12) * Math.PI * 2 - Math.PI / 2, ma = (hh % 1) * Math.PI * 2 - Math.PI / 2;+ G.seg(ctx, [cx, cy], [cx + Math.cos(ma) * r * 0.66, cy + Math.sin(ma) * r * 0.66], 18, rgba(fg, 0.8));+ G.seg(ctx, [cx, cy], [cx + Math.cos(ha) * r * 0.44, cy + Math.sin(ha) * r * 0.44], 32, fg);+ G.disc(ctx, cx, cy, 24, fg);+ // the sun walks the rim: 06:00 on the left, noon on top, 18:00 on the right+ const sa = Math.PI + ((hh - 6) / 12) * Math.PI;+ G.sunIcon(ctx, cx + Math.cos(sa) * (r + 4), cy + Math.sin(sa) * (r + 4), 38, PAL.yellow.t[4], lt);+ // the umbrella, still on its rail+ const far = light ? mix(fg, P.t[2], 0.55) : P.far, hk = [1630, 330], R = 150;+ G.seg(ctx, [1520, hk[1]], [1740, hk[1]], 14, far); G.seg(ctx, [1520, hk[1]], [1520, 260], 14, far); G.seg(ctx, [1740, hk[1]], [1740, 260], 14, far);+ G.umbrella(ctx, hk[0] + 0.13 * R, hk[1] + 0.98 * R, R, 0, Math.PI, G.UMB, G.UMB2, G.UMB);+ textBlock(ctx, lt, 130, 540, { meta: `LINE 4 · STOP ${pad2(c.stop)} / 12`, title: c.tm, px: 230, zh: c.zh, zpx: 70, tag: c.tag, tagFg: P.t[1], fg, k: 0.7, maxW: 760 });+ }++ // ───────── S8 · LAST STOP: the sun goes down, the moon comes up ─────────+ function lastStop(ctx, t) {+ const P = PAL.navy, lt = t - 16.5, fg = P.fg;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ G.drawPattern(ctx, G.pattern('navy', 61, { spread: 0.5, density: 0.44, set: 'sun' }), rowDrift(lt, 4));+ // sun sets behind the road, then the moon rises+ ctx.save(); ctx.beginPath(); ctx.rect(0, 0, W, 860); ctx.clip();+ const sy = lerp(240, 960, E.io3(inv(0.0, 0.9, lt)));+ G.sunIcon(ctx, 1330, sy, 58, PAL.yellow.t[4], lt * 0.3);+ ctx.restore();+ const mp = E.oExp(inv(1.0, 1.5, lt));+ if (mp > 0) { stageDisc(ctx, 1330, 230, 120 * mp, P.t[0], lt - 1.0); G.moon(ctx, 1330, 230, 56 * mp, PAL.yellow.t[4]); }+ roadBand(ctx, P, 860);+ stopSign(ctx, 1640, 860, 12, 'DEPOT', P, 1.0);+ const bx = lerp(-760, 300, E.o3(inv(0, 0.5, lt)));+ ctx.save(); busAt(ctx, bx, 500, 0.62); drawBus(ctx, P, 0, bx / 41, Math.PI); ctx.restore();+ }++ // ───────── S9 · LOST & FOUND chapter card ─────────+ function lostSign(ctx, x, y, s, P) { // our own lost-property sign: umbrella + question mark on a rounded square+ G.rrect(ctx, x - s / 2, y - s / 2, s, s, s * 0.14, G.CREAM);+ G.umbrella(ctx, x - s * 0.13, y - s * 0.02, s * 0.27, 1, 0, P.t[0], P.t[0], P.t[0]);+ ctx.save(); ctx.fillStyle = P.t[2]; ctx.font = F.en(900, s * 0.6); ctx.textAlign = 'center'; ctx.letterSpacing = '0px';+ ctx.fillText('?', x + s * 0.27, y + s * 0.23); ctx.restore();+ }+ function lost(ctx, t) {+ const P = PAL.coral, lt = t - 18.5, fg = P.fg;+ ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);+ const step = (j) => [19.5, 20.0, 20.5].reduce((a, b) => a + E.oExp(inv(b, b + 0.35, t)) * (j % 2 ? 1 : -1) * CELL * 0.25, 0);+ const dr = rowDrift(lt, 3, 30);+ G.drawPattern(ctx, G.pattern('coral', 71, { spread: 0.95, density: 0.55, set: 'sun' }), (j) => dr(j) + step(j));+ const bp = E.o5(inv(0.0, 0.4, lt)), by = 2 * CELL - 90, bh = 2 * CELL;+ ctx.fillStyle = P.t[0]; ctx.fillRect(W / 2 - (W / 2) * bp, by, W * bp, bh);+ ctx.save(); ctx.beginPath(); ctx.rect(0, by, W, bh); ctx.clip();+ const sc = lerp(1.4, 1, E.oExp(inv(0.05, 0.35, lt)));+ lostSign(ctx, 330, by + bh / 2, 250 * sc, P);+ G.typeText(ctx, 'CH.03 · DEPOT, LINE 4', 564, by + 70, F.mono(22), rgba(fg, 0.75), inv(0.15, 0.6, lt), { ls: '4px' });+ G.maskText(ctx, 'LOST & FOUND', 556, by + 222, F.en(900, 150), fg, inv(0.05, 0.45, lt), { ls: '-3px' });+ G.maskText(ctx, '失物招领', 562, by + 312, F.zh(900, 66), fg, inv(0.1, 0.5, lt), { ls: '6px' });+ ctx.restore();+ G.hair(ctx, W / 2 - (W / 2) * bp, by - 10, W * bp, rgba(fg, 0.5), 1, 2);+ G.hair(ctx, W / 2 - (W / 2) * bp, by + bh + 8, W * bp, rgba(fg, 0.5), 1, 2);+ // our umbrella gets its number+ const tp = E.oExp(inv(1.0, 1.3, lt));+ if (tp > 0) {+ G.seg(ctx, [330, by + bh + 8], [330, by + bh + 8 + 40 * tp], 4, fg);+ chip(ctx, 250, by + bh + 46, 'No. 313', P.t[0], G.CREAM, tp, 24);+ }+ }++ // ───────── S10–S11 · the shelf: pull back to all 313, then the days pass ─────────+ const WALL = { cols: 20, rows: 16, c: 90 };+ const OURS = [11, 7];+ const ITEMS = { '3,2': 0, '16,4': 1, '7,12': 2, '13,14': 3, '1,9': 0, '18,11': 2, '9,3': 1 };+ const LOSTCOLS = [PAL.ink.t[3], PAL.navy.t[3], PAL.teal.t[3], PAL.navy.t[4], PAL.coral.t[0], PAL.ink.t[4], PAL.sky.t[0], PAL.teal.t[1]];+ // o: { open(i,j) 0..1, sweep(i,j) 0..1 to yellow, shift(j) px, bg }+ function drawWall(ctx, cam, t, o = {}) {+ const c = WALL.c;+ ctx.save(); ctx.translate(cam.ax, cam.ay); ctx.scale(cam.k, cam.k); ctx.translate(-cam.cx, -cam.cy);+ const x0 = cam.cx - cam.ax / cam.k - c, x1 = cam.cx + (W - cam.ax) / cam.k + c, y0 = cam.cy - cam.ay / cam.k - c, y1 = cam.cy + (H - cam.ay) / cam.k + c;+ const coral = PAL.coral;+ for (let j = 0; j < WALL.rows; j++) {+ const sh = o.shift ? o.shift(j) : 0, cy = j * c;+ if (cy > y1 || cy + c < y0) continue;+ for (let i = -1; i <= WALL.cols; i++) {+ const ii = ((i % WALL.cols) + WALL.cols) % WALL.cols;+ const cx = i * c + sh;+ if (cx > x1 || cx + c < x0) continue;+ if ((i < 0 || i >= WALL.cols) && !sh) continue;+ const h = G.hash(ii * 31 + j * 7 + 5), sw = o.sweep ? o.sweep(ii, j) : 0;+ const yel = PAL.yellow.t[2 + Math.floor(h * 3)], op0 = o.open ? Math.min(1, o.open(ii, j)) : 0;+ const frameCol = mix(coral.t[0], PAL.yellow.t[0], sw);+ ctx.fillStyle = frameCol; ctx.fillRect(cx, cy, c + 0.5, c + 0.5);+ G.rrect(ctx, cx + 4, cy + 4, c - 8, c - 8, 8, mix(mix(coral.t[1], PAL.yellow.t[1], sw), frameCol, op0));+ const key = ii + ',' + j;+ const ours = ii === OURS[0] && j === OURS[1];+ if (ITEMS[key] != null) { G.item(ctx, ITEMS[key], cx + c / 2, cy + c / 2, c, mix(LOSTCOLS[Math.floor(h * 8)], yel, sw)); continue; }+ const op = o.open ? o.open(ii, j) : 0;+ const col = ours ? G.UMB : mix(LOSTCOLS[Math.floor(h * 8)], yel, sw), col2 = ours ? G.UMB2 : mix(col, '#000000', 0.22);+ const R = c * lerp(0.4, 0.8, Math.min(1, op));+ G.umbrella(ctx, cx + c / 2, cy + c * lerp(0.5, 0.62, Math.min(1, op)), R, op, 0, col, col2, col);+ }+ }+ ctx.restore();+ }+ const WALL_C = [WALL.cols * WALL.c / 2, WALL.rows * WALL.c / 2];+ const OURS_C = [(OURS[0] + 0.5) * WALL.c, (OURS[1] + 0.5) * WALL.c];+ function wallCam(t) {+ const p = E.io3(inv(21.65, 24.0, t));+ let k = lerp(4.2, 0.62, p), cx = lerp(OURS_C[0], WALL_C[0], p), cy = lerp(OURS_C[1], WALL_C[1], p), ax = lerp(1300, 1310, p), ay = lerp(520, 545, p);+ const q = E.io3(inv(25.0, 25.7, t)); // S11: push back in and drift along the shelf+ if (q > 0) {+ const drift = 46 * Math.max(0, Math.min(t, 27.5) - 25.0);+ k = lerp(k, 1.45, q); cx = lerp(cx, OURS_C[0] + 140 - drift, q); cy = lerp(cy, OURS_C[1] - 30, q); ax = lerp(ax, 1320, q); ay = lerp(ay, 470, q);+ }+ return { k, cx, cy, ax, ay };+ }+ function wall(ctx, t) {+ const P = PAL.coral, fg = P.fg, lt = t - 21.5;+ ctx.fillStyle = P.t[0]; ctx.fillRect(0, 0, W, H);+ drawWall(ctx, wallCam(t), t);+ // the counting panel+ const pp = E.o5(inv(0.5, 0.9, lt)), pw = 720;+ if (pp <= 0) return;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, pw * pp, H);+ ctx.fillStyle = rgba(fg, 0.35); ctx.fillRect(pw * pp - 3, 0, 3, H);+ ctx.save(); ctx.beginPath(); ctx.rect(0, 0, pw * pp, H); ctx.clip();+ const n = Math.max(1, Math.round(1 + 312 * E.o3(inv(22.1, 24.0, t))));+ const slam = t >= 24.0 ? 1 + 0.07 * Math.exp(-(t - 24.0) * 9) : 1;+ G.typeText(ctx, 'CH.03 · SHELF A–T', 94, 236, F.mono(22), rgba(fg, 0.75), inv(0.6, 1.0, lt), { ls: '3px' });+ ctx.save(); ctx.translate(90, 470); ctx.scale(slam, slam);+ ctx.font = F.en(900, 270); ctx.letterSpacing = '-8px'; ctx.fillStyle = fg; ctx.textAlign = 'left'; ctx.fillText(String(n), 0, 0);+ ctx.restore();+ const tp = inv(2.5, 3.0, lt);+ G.maskText(ctx, '把被落下的伞', 96, 552, F.zh(900, 56), fg, tp, { ls: '4px' });+ G.maskText(ctx, 'UMBRELLAS, LEFT ON SUNNY DAYS', 98, 610, F.mono(22), rgba(fg, 0.8), inv(2.6, 3.1, lt), { ls: '2px' });+ // S11: the days go by, all of them dry+ const days = [26.0, 26.25, 26.5, 26.75, 27.0, 27.25, 27.5, 27.75].filter((b) => t >= b).length;+ const dp = E.oExp(inv(24.85, 25.2, t));+ if (dp > 0) {+ G.hair(ctx, 96, 650, 540 * dp, rgba(fg, 0.45), 1, 2);+ for (let d = 0; d < days + 1; d++) {+ const ap = d === 0 ? dp : E.oExp(inv(25.75 + d * 0.25, 25.95 + d * 0.25, t));+ G.sunIcon(ctx, 116 + d * 62, 704, 13 * ap, PAL.yellow.t[4], 0);+ }+ G.maskText(ctx, 'DAY ' + pad2(days + 1) + ' · NO RAIN', 98, 776, F.mono(24), fg, dp, { ls: '2px' });+ G.maskText(ctx, '一直没下雨', 96, 836, F.zh(900, 40), fg, inv(24.85, 25.2, t), { ls: '4px' });+ }+ ctx.restore();+ }++ // ───────── S12 · STORM ─────────+ function storm(ctx, t) {+ const P = PAL.ink, lt = t - 28, fg = P.fg;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ const gust = (j) => [29.0, 29.5, 30.0, 30.5].reduce((a, b) => a + E.oExp(inv(b, b + 0.3, t)) * (j % 2 ? 1 : -1) * CELL * 0.5, 0);+ G.drawPattern(ctx, G.pattern('ink', 81, { spread: 1, density: 0.55, set: 'rain' }), (j) => (j % 2 ? 1 : -1) * lt * 90 + gust(j));+ stageDisc(ctx, 1330, 500, 370, P.t[3], lt);+ const fl = Math.max(Math.exp(-lt * 10) * (lt >= 0 ? 1 : 0), t >= 29.5 ? Math.exp(-(t - 29.5) * 10) : 0);+ if (fl > 0.05) G.bolt(ctx, 1316, 420, 380, rgba(PAL.yellow.t[2], Math.min(1, fl * 1.6)));+ G.cloud(ctx, 1330, 470, 250, mix(G.CREAM, P.t[3], 0.3));+ rain(ctx, t, { col: '#8e9ab3', v: 1100, slant: 0.22, r: 6.5 });+ textBlock(ctx, lt, 130, 560, { meta: 'CH.04 · 18:05 · RUSH HOUR', title: 'STORM', px: 250, zh: '暴雨', zpx: 96, fg, d0: 0.0, k: 0.8 });+ if (fl > 0.02) { ctx.fillStyle = rgba(G.CREAM, 0.45 * fl); ctx.fillRect(0, 0, W, H); }+ }++ // ───────── S13 · split: the wet stop and the dry shelf ─────────+ function split(ctx, t) {+ const lt = t - 31, P = PAL.ink, fg = P.fg;+ ctx.save(); ctx.beginPath(); ctx.rect(0, 0, W / 2, H); ctx.clip();+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W / 2, H);+ G.drawPattern(ctx, G.pattern('ink', 82, { spread: 0.8, density: 0.5, set: 'rain' }), (j) => (j % 2 ? 1 : -1) * (lt + 2) * 90);+ roadBand(ctx, P, 860);+ stopSign(ctx, 700, 860, 4, 'ELM ST', PAL.navy, 1.0);+ // people waiting: pairs of footprints facing the road, puddles round them+ const feet = [[150, 790], [300, 806], [450, 784], [560, 820]];+ feet.forEach(([x, y], k) => {+ for (let q = 0; q < 2; q++) {+ const pr = ((lt * 1.6 + G.hash(k * 5 + q)) % 1);+ ctx.globalAlpha = 1 - pr; G.ring(ctx, x + (q ? 46 : -46), y + 30, 14 + 50 * pr, 3, '#8e9ab3'); ctx.globalAlpha = 1;+ }+ G.foot(ctx, x - 20, y, 38, 0, rgba(G.CREAM, 0.9), -1); G.foot(ctx, x + 20, y, 38, 0, rgba(G.CREAM, 0.9), 1);+ });+ rain(ctx, t, { col: '#8e9ab3', v: 1100, slant: 0.22, r: 6.5 });+ chip(ctx, 64, 150, 'ELM ST · 18:07 · WAITING', P.t[1], G.CREAM, E.oExp(inv(0.1, 0.4, lt)), 22);+ G.maskText(ctx, '等车的人', 66, 260, F.zh(900, 48), fg, inv(0.1, 0.4, lt), { ls: '4px' });+ ctx.restore();+ // right: the shelf, dry+ ctx.save(); ctx.beginPath(); ctx.rect(W / 2, 0, W / 2, H); ctx.clip();+ ctx.fillStyle = PAL.coral.t[0]; ctx.fillRect(W / 2, 0, W / 2, H);+ drawWall(ctx, { k: 1.15, cx: OURS_C[0] - 60 + lt * 20, cy: OURS_C[1] + 40, ax: 1440, ay: 560 }, t);+ chip(ctx, W / 2 + 40, 150, 'DEPOT · 313 DRY', PAL.coral.t[0], G.CREAM, E.oExp(inv(0.15, 0.45, lt)), 22);+ G.maskText(ctx, '伞是干的', W / 2 + 42, 260, F.zh(900, 48), G.CREAM, inv(0.15, 0.45, lt), { ls: '4px' });+ ctx.restore();+ ctx.fillStyle = G.CREAM; ctx.fillRect(W / 2 - 3, 0, 6, H);+ }++ // ───────── S14 · the shutter rolls up, the sign turns ─────────+ const SHUT = [35.0, 35.25, 35.5, 35.75, 36.0, 36.25];+ const bloomCam = (t) => { const p = E.io3(inv(36.5, 40.5, t)); return { k: lerp(1.1, 0.8, p), cx: WALL_C[0], cy: WALL_C[1], ax: 960, ay: 540 }; };+ function shutter(ctx, t) {+ const lt = t - 34, P = PAL.ink, fg = P.fg;+ ctx.fillStyle = PAL.coral.t[0]; ctx.fillRect(0, 0, W, H);+ drawWall(ctx, bloomCam(36.5), t);+ const n = SHUT.reduce((a, b) => a + E.oExp(inv(b, b + 0.2, t)), 0);+ const off = -n * CELL;+ for (let j = 0; j < 6; j++) {+ const y = j * CELL + off;+ if (y + CELL < 0) continue;+ ctx.fillStyle = P.t[3]; ctx.fillRect(0, y, W, CELL);+ for (let g = 0; g < 3; g++) { ctx.fillStyle = P.t[1]; ctx.fillRect(0, y + 34 + g * 50, W, 14); }+ ctx.fillStyle = P.t[4]; ctx.fillRect(0, y, W, 4);+ }+ G.rrect(ctx, 0, 6 * CELL + off - 26, W, 26, 0, P.t[0]);+ // the sign: CLOSED turns to TAKE ONE on beat 34.0, then drops away as the last row goes up+ const sx = 400, drop = E.i3(inv(36.25, 36.5, t)) * 900;+ ctx.save(); ctx.translate(0, drop);+ G.seg(ctx, [sx, 1080], [sx, 600], 18, P.t[4]);+ const fp = inv(34.5, 34.8, t), sxs = Math.abs(Math.cos(fp * Math.PI)), back = fp >= 0.5;+ ctx.save(); ctx.translate(sx, 430); ctx.scale(Math.max(0.02, sxs), 1);+ if (!back) {+ G.rrect(ctx, -190, -190, 380, 380, 40, P.t[0]);+ ctx.fillStyle = G.CREAM; ctx.textAlign = 'center'; ctx.font = F.en(900, 84); ctx.letterSpacing = '-1px'; ctx.fillText('CLOSED', 0, 10);+ ctx.font = F.zh(900, 52); ctx.letterSpacing = '8px'; ctx.fillText('休息', 0, 100);+ } else {+ G.rrect(ctx, -190, -190, 380, 380, 40, PAL.yellow.t[2]);+ G.umbrella(ctx, -60, -40, 80, 1, 0, PAL.yellow.fg, PAL.yellow.fg, PAL.yellow.fg);+ G.seg(ctx, [40, -40], [120, -40], 22, PAL.yellow.fg);+ G.poly(ctx, [[150, -40], [110, -78], [110, -2]], PAL.yellow.fg);+ ctx.fillStyle = PAL.yellow.fg; ctx.textAlign = 'center'; ctx.font = F.en(900, 76); ctx.letterSpacing = '-1px'; ctx.fillText('TAKE ONE', 0, 110);+ ctx.font = F.zh(900, 44); ctx.letterSpacing = '6px'; ctx.fillText('拿一把', 0, 166);+ }+ ctx.restore(); ctx.restore();+ G.typeText(ctx, 'CH.04 · DEPOT, 18:10', 134, 236, F.mono(22), rgba(fg, 0.75), inv(0.1, 0.5, lt) * (1 - inv(35.0, 35.2, t)), { ls: '3px' });+ }++ // ───────── S15 · BLOOM: 313 umbrellas open at once and become the pattern ─────────+ function bloomOpen(i, j, t) { const d = 36.5 + Math.hypot(i - OURS[0], j - OURS[1]) * 0.014; return E.oExp(inv(d, d + 0.32, t)); }+ function bloomSweep(i, j, t) { const s = 37.5 + j * 0.07; return E.io3(inv(s, s + 0.3, t)); }+ const bloomShift = (t) => (j) => [39.0, 39.5, 40.0].reduce((a, b) => a + E.oExp(inv(b, b + 0.3, t)) * (j % 2 ? 1 : -1) * WALL.c * 0.5, 0);+ function bloom(ctx, t) {+ const lt = t - 36.5;+ ctx.fillStyle = PAL.yellow.t[0]; ctx.fillRect(0, 0, W, H);+ G.drawPattern(ctx, G.pattern('yellow', 91, { spread: 0.8, density: 0.5, set: 'rain' }), (j) => rowDrift(lt, 6)(j) + bloomShift(t)(j) * 0.74);+ drawWall(ctx, bloomCam(t), t, { open: (i, j) => bloomOpen(i, j, t), sweep: (i, j) => bloomSweep(i, j, t), shift: bloomShift(t) });+ rain(ctx, t, { col: PAL.sky.t[3], v: 900, r: 6.5 });+ }++ // ───────── S16 · EVERY STOP: the umbrellas run down Line 4 ─────────+ const RX = (i) => 180 + i * (1560 / 11), RY = 610;+ const reach = (i) => 41.0 + (11 - i) * 0.25; // stop index i (0 = stop 01) is reached at…+ function route(ctx, t) {+ const P = PAL.navy, lt = t - 40.5, fg = P.fg;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ G.drawPattern(ctx, G.pattern('navy', 101, { spread: 0.45, density: 0.44, set: 'rain' }), rowDrift(lt, 8));+ rain(ctx, t, { col: P.t[4], v: 800, r: 6 });+ const p = E.io3(inv(40.5, 41.8, t));+ const k = lerp(1.8, 1, p), cx = lerp(RX(11) - 80, 960, p), cy = lerp(RY, 540, p);+ ctx.save(); ctx.translate(960, 540); ctx.scale(k, k); ctx.translate(-cx, -cy);+ const far = P.far;+ G.seg(ctx, [RX(0), RY], [RX(11), RY], 22, far);+ const front = lerp(RX(11), RX(0), clamp((t - 41.0) / 2.75));+ if (t > 40.75) G.seg(ctx, [front, RY], [RX(11), RY], 22, PAL.yellow.t[2]);+ // the stream of umbrellas, running left along the line+ if (t > 40.75) for (let x = RX(11) - ((t * 280) % 42); x > front; x -= 42) G.umbrella(ctx, x, RY - 30, 17, 1, 0, PAL.yellow.t[3], PAL.yellow.t[1], PAL.yellow.t[3]);+ for (let i = 0; i < 12; i++) {+ const x = RX(i), r = reach(i), q = E.oExp(inv(r, r + 0.25, t));+ G.disc(ctx, x, RY, 26, q > 0 ? mix(G.CREAM, PAL.yellow.t[2], q) : G.CREAM); G.disc(ctx, x, RY, 11, P.t[0]);+ for (let u = 0; u < 3; u++) {+ const qq = E.oExp(inv(r + u * 0.06, r + u * 0.06 + 0.22, t));+ if (qq > 0) G.umbrella(ctx, x + (u - 1) * 30, RY - 66 - (u === 1 ? 16 : 0), 26 * qq, qq, 0, G.UMB, G.UMB2, G.UMB);+ }+ ctx.fillStyle = rgba(fg, 0.8); ctx.font = F.mono(20); ctx.letterSpacing = '2px'; ctx.textAlign = 'center';+ ctx.fillText(pad2(i + 1), x, RY + 64);+ if (i === 2 || i === 11) { ctx.fillStyle = fg; ctx.fillText(i === 2 ? 'ELM ST' : 'DEPOT', x, RY + 96); }+ }+ ctx.restore();+ textBlock(ctx, lt, 130, 300, { meta: 'CH.05 · LINE 4, ALL STOPS', title: 'EVERY STOP', px: 150, zh: '每一站', zpx: 60, fg, d0: 0.3 });+ }++ // ───────── S17 · the next morning, 07:42 again ─────────+ function echo(ctx, t) {+ const P = PAL.navy, lt = t - 44.0;+ const push = 1 + 0.05 * E.io(lt / 2.5);+ ctx.save(); ctx.translate(960, 540); ctx.scale(push, push); ctx.translate(-960, -540);+ ctx.fillStyle = P.t[1]; ctx.fillRect(-100, -100, W + 200, H + 200);+ const cam = 300 * lt;+ G.drawPattern(ctx, G.pattern('navy', 11, { spread: 0.55, density: 0.5, set: 'rain' }), (j) => rowDrift(lt, 2)(j) - cam * 0.35);+ stageDisc(ctx, S1.ux, S1.uy + 30, 430, P.t[0], lt);+ const steps = [44.5, 45.0, 45.5, 46.0];+ const bob = 7 * steps.reduce((a, b) => a + (t > b ? Math.exp(-(t - b) * 9) * Math.sin((t - b) * 18) : 0), 0);+ const ux = S1.ux, uy = S1.uy + bob, R = S1.R;+ const domeY = (x) => { const dx = (x - ux) / R; return Math.abs(dx) > 1 ? null : uy - 0.62 * R * Math.sqrt(1 - dx * dx); };+ // puddles all round, none under the umbrella+ for (let k = 0; k < 40; k++) {+ const ph = (lt * 2.2 + G.hash(k + 900)) % 1, n = Math.floor(lt * 2.2 + G.hash(k + 900));+ const x = 120 + G.hash(k * 13 + n * 7) * 1680, y = 760 + G.hash(k * 3 + n * 11) * 110;+ if (Math.abs(x - ux) < R * 1.05) continue;+ ctx.globalAlpha = 1 - ph; G.ring(ctx, x, y, 10 + 40 * ph, 3, P.t[4]); ctx.globalAlpha = 1;+ }+ rain(ctx, t, { col: P.t[4], scroll: cam * 0.6, roof: domeY });+ steps.forEach((ts, k) => {+ if (t < ts) return;+ const sy = k % 2 ? 848 : 796, x = 1000 - 300 * (t - ts);+ const a = 1 - inv(ts + 1.2, ts + 2.4, t);+ if (a <= 0) return;+ ctx.globalAlpha = a; G.foot(ctx, x, sy, 44 * E.oExp(inv(ts, ts + 0.12, t)), Math.PI / 2 + (k % 2 ? 0.1 : -0.1), rgba(G.CREAM, 0.92), k % 2 ? 1 : -1); ctx.globalAlpha = 1;+ });+ G.umbrella(ctx, ux, uy, R, 1, 0, G.UMB, G.UMB2, G.UMB);+ ctx.restore();+ }++ // ───────── S18 · end card ─────────+ function endCard(ctx, t) {+ const P = PAL.navy, lt = t - 46.5, fg = P.fg;+ ctx.fillStyle = P.t[1]; ctx.fillRect(0, 0, W, H);+ const dr = rowDrift(1, 2);+ G.drawPattern(ctx, G.pattern('navy', 11, { spread: 0.45, density: 0.5, set: 'rain' }), (j) => dr(j) + (j % 2 ? 1 : -1) * 26 * Math.min(lt, 0.2 + j * 0.18));+ stageDisc(ctx, 1330, 470, 330, P.t[0], lt + 0.5);+ G.umbrella(ctx, 1330, 450, 200, E.oExp(inv(0.1, 0.5, lt)), 0, G.UMB, G.UMB2, G.UMB);+ const x = 130;+ G.maskText(ctx, 'LEFT BEHIND', x - 4, 420, F.en(900, 150), fg, inv(0.0, 0.4, lt), { ls: '-3px' });+ G.maskText(ctx, '被落下的伞', x, 510, F.zh(900, 64), fg, inv(0.05, 0.45, lt), { ls: '6px' });+ G.hair(ctx, x, 562, 700, rgba(fg, 0.55), E.oExp(inv(0.3, 0.8, lt)), 2);+ G.maskText(ctx, 'PICTOGRAM MOTION', x, 624, F.mono(26), fg, inv(0.35, 0.8, lt), { ls: '3px' });+ ctx.save(); ctx.font = F.mono(26); ctx.letterSpacing = '3px'; const pw = ctx.measureText('PICTOGRAM MOTION').width; ctx.restore();+ G.maskText(ctx, '象形运动图形', x + pw + 28, 626, F.zh(700, 30), fg, inv(0.4, 0.85, lt), { ls: '3px' });+ G.maskText(ctx, 'LemoLab × Claude Opus 5.5', x, 690, F.mono(28), fg, inv(0.5, 0.95, lt), { ls: '2px' });+ }++ // ───────── HUD + subtitles ─────────+ function palAt(t) {+ if (t < 4.25) return PAL.navy;+ if (t < 12.5) return PAL.teal;+ if (t < 13.5) return PAL.teal;+ if (t < 16.5) return PAL[LAD[Math.min(2, Math.floor(t - 13.5))].pk];+ if (t < 18.5) return PAL.navy;+ if (t < 28) return PAL.coral;+ if (t < 37.7) return PAL.ink;+ if (t < 40.5) return PAL.yellow;+ return PAL.navy;+ }+ const CHS = [[0, '01', 'RAIN'], [10.5, '02', 'THE LINE'], [18.5, '03', 'LOST & FOUND'], [28, '04', 'STORM'], [36.5, '05', 'BLOOM'], [44, '06', 'RAIN']];+ function hudInfo(t) {+ if (t < 4.25) return { time: '07:42', wx: 'SHOWERS', g: 'cloud', cur: t < 3.5 ? 2 : 3 };+ if (t < 10.5) return { time: '07:51', wx: 'CLEARING', g: 'sun', cur: 3 };+ if (t < 13.5) return { time: '08:30', wx: 'SUNNY', g: 'sun', cur: 3 + WHIPS.filter((b) => t >= b).length };+ if (t < 16.5) { const c = LAD[Math.min(2, Math.floor(t - 13.5))]; return { time: c.tm, wx: 'SUNNY', g: 'sun', cur: c.stop }; }+ if (t < 18.5) return { time: '19:40', wx: 'DUSK', g: 'moon', cur: 12 };+ if (t < 25) return { time: '20:15', wx: 'CLEAR NIGHT', g: 'moon', cur: 12 };+ if (t < 28) return { time: 'DAY ' + pad2(1 + [26.0, 26.25, 26.5, 26.75, 27.0, 27.25, 27.5, 27.75].filter((b) => t >= b).length), wx: 'SUNNY', g: 'sun', cur: 12 };+ if (t < 40.5) return { time: t < 31 ? '18:05' : t < 34 ? '18:07' : t < 36.5 ? '18:10' : '18:12', wx: 'STORM', g: 'storm', cur: 12 };+ if (t < 44) return { time: '18:20', wx: 'STORM', g: 'storm', cur: 0, lit: (i) => t >= reach(i - 1) };+ return { time: '07:42', wx: 'SHOWERS', g: 'cloud', cur: 3 };+ }+ function hud(ctx, t, P) {+ if (t >= 46.5) return;+ const fg = P.fg, info = hudInfo(t), ch = CHS.filter((c) => c[0] <= t).pop();+ ctx.save();+ ctx.font = F.mono(17); ctx.letterSpacing = '3px'; ctx.fillStyle = rgba(fg, 0.8); ctx.textAlign = 'left';+ ctx.fillText('LINE 4', 64, 70); ctx.fillText(info.time, 64, 96);+ ctx.textAlign = 'right';+ ctx.fillText('CH.' + ch[1] + ' ' + ch[2], W - 64, 70); ctx.fillText(info.wx, W - 64, 96);+ ctx.font = F.mono(17); const ww = ctx.measureText(info.wx).width;+ const gx = W - 64 - ww - 26, col = rgba(fg, 0.8);+ if (info.g === 'cloud') G.cloud(ctx, gx, 100, 17, col);+ else if (info.g === 'sun') G.sunIcon(ctx, gx, 89, 7, col);+ else if (info.g === 'moon') G.moon(ctx, gx, 89, 10, col);+ else { G.cloud(ctx, gx, 96, 17, col); G.bolt(ctx, gx - 2, 92, 16, col); }+ const x0 = 64, x1 = W - 64, y = H - 58;+ for (let i = 1; i <= 12; i++) {+ const x = lerp(x0, x1, (i - 1) / 11);+ const now = info.lit ? info.lit(i) : i === info.cur, done = info.lit ? false : i < info.cur;+ ctx.fillStyle = rgba(fg, now ? 1 : done ? 0.75 : 0.28);+ ctx.fillRect(Math.round(x) - (now ? 2 : 1), y - (now ? 14 : 6), now ? 4 : 2, now ? 20 : 12);+ }+ ctx.restore();+ }+ function subtitles(ctx, t, P) {+ const c = (window.CUES || []).find((q) => t >= q.t0 - 0.01 && t < q.t1);+ if (!c) return;+ const lt = t - c.t0, out = c.t1 - t;+ const band = P.fg === G.CREAM ? P.t[0] : PAL.ink.t[1];+ ctx.save();+ ctx.font = F.zh(700, 36); ctx.letterSpacing = '1px';+ const wz = ctx.measureText(c.zh).width;+ ctx.font = F.mono(25); ctx.letterSpacing = '0.5px';+ const we = ctx.measureText(c.en).width;+ const bw = Math.max(wz, we) + 64, x = 64, y = 872, bh = 116;+ const p = E.oExp(inv(0, 0.22, lt)) * E.oExp(inv(0, 0.2, out));+ ctx.fillStyle = band; ctx.fillRect(x, y, bw * p, bh);+ ctx.beginPath(); ctx.rect(x, y, bw * p, bh); ctx.clip();+ G.maskText(ctx, c.zh, x + 32, y + 48, F.zh(700, 36), G.CREAM, inv(0.04, 0.3, lt), { ls: '1px' });+ G.maskText(ctx, c.en, x + 32, y + 94, F.mono(25), rgba(G.CREAM, 0.9), inv(0.08, 0.34, lt), { ls: '0.5px' });+ ctx.restore();+ }++ // ───────── transitions + frame ─────────+ const TA = 0.12, TB = 0.26;+ const bufA = G.canvas(), bufB = G.canvas(), bufSub = G.canvas();+ function shotIdx(t) { for (let i = SHOTS.length - 1; i >= 0; i--) if (t >= SHOTS[i].t0) return i; return 0; }+ function drawShot(ctx, s, t, wx) {+ ctx.save();+ switch (s.kind) {+ case 'rainOpen': rainOpen(ctx, t); break;+ case 'busStop': busStop(ctx, t, wx || (t < 4.25 ? 'rain' : 'sun')); break;+ case 'title': titleCard(ctx, t); break;+ case 'track': track(ctx, t); break;+ case 'ladder': ladder(ctx, t, s.i); break;+ case 'lastStop': lastStop(ctx, t); break;+ case 'lost': lost(ctx, t); break;+ case 'wall': wall(ctx, t); break;+ case 'storm': storm(ctx, t); break;+ case 'split': split(ctx, t); break;+ case 'shutter': shutter(ctx, t); break;+ case 'bloom': bloom(ctx, t); break;+ case 'route': route(ctx, t); break;+ case 'echo': echo(ctx, t); break;+ case 'end': endCard(ctx, t); break;+ }+ ctx.restore();+ }+ function composite(ctx, type, p, A, B) {+ const S = CELL;+ if (type === 'rows') {+ ctx.drawImage(A, 0, 0);+ for (let j = 0; j < 6; j++) {+ const pj = E.ioExp(clamp(p * 1.5 - j * 0.1)), dir = j % 2 ? 1 : -1;+ ctx.drawImage(A, 0, j * S, W, S, dir * W * 0.25 * pj, j * S, W, S);+ ctx.drawImage(B, 0, j * S, W, S, -dir * W * (1 - pj), j * S, W, S);+ }+ } else if (type === 'cols') {+ const cw = 240; ctx.drawImage(A, 0, 0);+ for (let i = 0; i < 8; i++) {+ const pj = E.ioExp(clamp(p * 1.5 - i * 0.07)), dir = i % 2 ? 1 : -1;+ ctx.drawImage(B, i * cw, 0, cw, H, i * cw, -dir * H * (1 - pj), cw, H);+ }+ } else if (type === 'slide') {+ const pj = E.ioExp(p);+ ctx.drawImage(A, -W * 0.3 * pj, 0); ctx.drawImage(B, W * (1 - pj), 0);+ ctx.fillStyle = `rgba(0,0,0,${0.15 * (1 - Math.abs(pj - 0.5) * 2)})`; ctx.fillRect(W * (1 - pj) - 8, 0, 8, H);+ } else if (type === 'split') {+ const pj = E.ioExp(p); ctx.drawImage(A, 0, 0);+ ctx.drawImage(B, 0, 0, W / 2, H, 0, -H * (1 - pj), W / 2, H);+ ctx.drawImage(B, W / 2, 0, W / 2, H, W / 2, H * (1 - pj), W / 2, H);+ } else if (type === 'quarter') {+ ctx.drawImage(A, 0, 0);+ ctx.save(); ctx.beginPath();+ for (let j = 0; j < 6; j++) for (let i = 0; i < 11; i++) {+ const d = (i + j) * 0.035, r = S * 1.42 * E.o3(clamp((p - d) / 0.55));+ if (r <= 0) continue;+ const corner = (i + j) % 4, cx = i * S + (corner === 1 || corner === 2 ? S : 0), cy = j * S + (corner >= 2 ? S : 0);+ ctx.moveTo(cx, cy); ctx.arc(cx, cy, r, 0, Math.PI * 2);+ }+ ctx.clip(); ctx.drawImage(B, 0, 0); ctx.restore();+ } else if (type === 'flip') flip(ctx, p, A, B);+ }+ function flip(ctx, p, A, B) {+ const cols = 11, rows = 6, S = CELL;+ ctx.drawImage(B, 0, 0); ctx.fillStyle = 'rgba(0,0,0,0.4)'; ctx.fillRect(0, 0, W, H);+ for (let j = 0; j < rows; j++) for (let i = 0; i < cols; i++) {+ const d = ((i * 0.6 + j) / (cols * 0.6 + rows)) * 0.5, pc = clamp((p - d) / 0.5);+ const src = pc < 0.5 ? A : B, sx = Math.abs(Math.cos(pc * Math.PI)), x = i * S, y = j * S, w = S * sx;+ ctx.drawImage(src, x, y, S, S, x + (S - w) / 2, y, Math.max(1, w), S);+ if (pc > 0 && pc < 1) { ctx.fillStyle = `rgba(0,0,0,${0.3 * (1 - sx)})`; ctx.fillRect(x + (S - w) / 2, y, w, S); }+ }+ }+ const buffers = () => { const ca = bufA.getContext('2d'), cb = bufB.getContext('2d'); ca.setTransform(1, 0, 0, 1, 0, 0); cb.setTransform(1, 0, 0, 1, 0, 0); return [ca, cb]; };+ function frame(ctx, t) {+ const i = shotIdx(t), s = SHOTS[i], nx = SHOTS[i + 1];+ let tr = null;+ if (nx && TRANS[nx.t0] && t >= nx.t0 - TA) tr = [s, nx];+ else if (i > 0 && TRANS[s.t0] && t < s.t0 + TB) tr = [SHOTS[i - 1], s];+ const [ca, cb] = buffers();+ if (tr) {+ const [a, b] = tr, p = clamp((t - (b.t0 - TA)) / (TA + TB));+ drawShot(ca, a, t); drawShot(cb, b, Math.max(t, b.t0));+ composite(ctx, TRANS[b.t0], p, bufA, bufB);+ } else if (s.kind === 'busStop' && t >= 3.88 && t < 4.62) {+ drawShot(ca, s, t, 'rain'); drawShot(cb, s, t, 'sun');+ flip(ctx, clamp((t - 3.88) / 0.74), bufA, bufB);+ } else if (t >= 6.38 && t < 6.78) {+ const c = busStop(ca, Math.min(t, 6.5), 'sun');+ titleCard(cb, Math.max(t, 6.5));+ const [cx, cy] = toScreen(c, U_REST[0], U_REST[1] + 10);+ const p = clamp((t - 6.38) / 0.4), r = 2300 * E.ioExp(p);+ ctx.drawImage(bufA, 0, 0);+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, Math.PI * 2); ctx.clip(); ctx.drawImage(bufB, 0, 0); ctx.restore();+ G.ring(ctx, cx, cy, r, 26 * (1 - p), PAL.yellow.t[2]);+ } else if (t >= 18.05 && t < 18.5) {+ // descent: the street slides up by grid rows, the depot rises from below+ const p = E.ioExp(inv(18.05, 18.5, t)), dy = Math.round(p * 6) / 6 * 0.25 + p * 0.75;+ lastStop(ca, t); lost(cb, 18.5);+ ctx.drawImage(bufA, 0, -H * dy); ctx.drawImage(bufB, 0, H * (1 - dy));+ } else if (t >= 28.0 && t < 28.36) {+ // lightning splits the shelf along a zigzag and the storm is underneath+ const p = E.ioExp(inv(28.0, 28.36, t));+ wall(ca, 27.99); storm(ctx, t);+ const zig = [[1180, -20], [1010, 300], [1120, 330], [880, 700], [990, 720], [760, 1100]];+ for (const side of [-1, 1]) {+ ctx.save(); ctx.translate(side * W * 0.6 * p, side * H * 0.1 * p); ctx.beginPath();+ ctx.moveTo(side < 0 ? -10 : W + 10, -20); zig.forEach(([x, y]) => ctx.lineTo(x, y)); ctx.lineTo(side < 0 ? -10 : W + 10, 1100); ctx.closePath();+ ctx.clip(); ctx.drawImage(bufA, 0, 0); ctx.restore();+ }+ if (p < 0.6) { ctx.strokeStyle = rgba(PAL.yellow.t[2], 1 - p / 0.6); ctx.lineWidth = 16; ctx.lineJoin = 'round'; ctx.beginPath(); zig.forEach(([x, y], k) => (k ? ctx.lineTo(x, y) : ctx.moveTo(x, y))); ctx.stroke(); }+ } else drawShot(ctx, s, t);+ const P = palAt(t);+ hud(ctx, t, P);+ if (!NOCAP) subtitles(ctx, t, P);+ }+ const FAST = [[0.45, 0.85], [1.95, 3.55], [3.88, 4.65], [4.45, 4.8], [5.95, 6.8], [6.95, 7.7], [10.38, 10.76], [10.8, 13.3], [13.38, 13.76], [14.38, 14.76], [15.38, 15.76],+ [16.38, 17.0], [18.0, 18.6], [18.5, 18.9], [21.45, 24.1], [25.0, 25.7], [28.0, 28.4], [30.88, 31.3], [33.88, 34.3], [34.95, 36.6], [36.5, 36.95], [38.95, 40.35], [40.38, 41.85], [43.88, 44.3], [46.38, 46.8]];+ const isFast = (t) => FAST.some(([a, b]) => t >= a && t < b);++ // ───────── page contract ─────────+ const Q = new URLSearchParams(location.search);+ const A = +(Q.get('a') ?? 0), B = +(Q.get('b') ?? FULL), NOCAP = Q.get('nocap') === '1';+ const ctxMain = document.getElementById('c').getContext('2d');+ window.DUR = B - A;+ window.EV = EV.filter((e) => e.t >= A && e.t < B).map((e) => ({ ...e, t: +(e.t - A).toFixed(4) }));+ window.SHOTS = SHOTS;+ window.render = (lt) => {+ const t = A + lt, ctx = ctxMain;+ ctx.setTransform(1, 0, 0, 1, 0, 0);+ if (!isFast(t)) { frame(ctx, t); return; }+ const N = 5, shutter = 0.45 / 24, sc = bufSub.getContext('2d'), i0 = shotIdx(t);+ for (let k = 0; k < N; k++) {+ sc.setTransform(1, 0, 0, 1, 0, 0);+ let ts = t - shutter / 2 + (shutter * k) / (N - 1);+ if (shotIdx(ts) !== i0) ts = t;+ frame(sc, ts);+ ctx.globalAlpha = 1 / (k + 1); ctx.drawImage(bufSub, 0, 0);+ }+ ctx.globalAlpha = 1;+ };+ // every text on screen, for readcheck: the titles and chips that must be read+ window.TEXTS = (lt) => {+ const t = A + lt, s = SHOTS[shotIdx(t)], out = [];+ const add = (id, text, x0, y0, x1, y1) => out.push({ id, text, x0, y0, x1, y1 });+ if (s.kind === 'title' && t > 7.66) { add('t1', 'LEFT BEHIND', 124, 280, 900, 650); add('t2', '被落下的伞', 124, 670, 900, 760); }+ if (s.kind === 'track' && t > 10.9) { add('a1', 'ALL DAY', 124, 170, 800, 310); add('a2', '一整天', 124, 330, 800, 420); }+ if (s.kind === 'ladder' && t - s.t0 > 0.55) add('l' + s.i, LAD[s.i].tm + ' ' + LAD[s.i].zh, 124, 330, 900, 700);+ if (s.kind === 'lost' && t > 19.02) { add('f1', 'LOST & FOUND', 550, 300, 1700, 450); add('f2', '失物招领', 550, 470, 1700, 600); }+ if (s.kind === 'wall' && t > 24.6) { add('c1', '313', 90, 250, 700, 480); add('c2', '把被落下的伞', 90, 500, 700, 560); }+ if (s.kind === 'wall' && t > 25.22) add('c3', '一直没下雨', 90, 790, 700, 850);+ if (s.kind === 'storm' && t > 28.5) { add('s1', 'STORM', 124, 360, 900, 570); add('s2', '暴雨', 124, 600, 900, 700); }+ if (s.kind === 'split' && t > 31.45) { add('w1', '等车的人', 60, 200, 900, 270); add('w2', '伞是干的', 1000, 200, 1900, 270); }+ if (s.kind === 'shutter' && t > 34.8 && t < 36.25) add('k1', 'TAKE ONE 拿一把', 210, 240, 590, 620);+ if (s.kind === 'route' && t > 41.2) { add('e1', 'EVERY STOP', 124, 170, 900, 310); add('e2', '每一站', 124, 330, 900, 380); }+ if (s.kind === 'end' && t > 46.96) { add('n1', 'LEFT BEHIND', 124, 300, 900, 430); add('n2', '被落下的伞', 124, 450, 900, 520); }+ return out;+ };+})();diff --git a/styles/pictogram-motion/demo/fonts/OFL-notosansjp.txt b/styles/pictogram-motion/demo/fonts/OFL-notosansjp.txtdeleted file mode 100644index 1c9f432..0000000--- a/styles/pictogram-motion/demo/fonts/OFL-notosansjp.txt+++ /dev/null@@ -1,93 +0,0 @@-Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'--This Font Software is licensed under the SIL Open Font License, Version 1.1.-This license is copied below, and is also available with a FAQ at:-https://scripts.sil.org/OFL---------------------------------------------------------------SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007--------------------------------------------------------------PREAMBLE-The goals of the Open Font License (OFL) are to stimulate worldwide-development of collaborative font projects, to support the font creation-efforts of academic and linguistic communities, and to provide a free and-open framework in which fonts may be shared and improved in partnership-with others.--The OFL allows the licensed fonts to be used, studied, modified and-redistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,-redistributed and/or sold with any software provided that any reserved-names are not used by derivative works. The fonts and derivatives,-however, cannot be released under any other type of license. The-requirement for fonts to remain under this license does not apply-to any document created using the fonts or their derivatives.--DEFINITIONS-"Font Software" refers to the set of files released by the Copyright-Holder(s) under this license and clearly marked as such. This may-include source files, build scripts and documentation.--"Reserved Font Name" refers to any names specified as such after the-copyright statement(s).--"Original Version" refers to the collection of Font Software components as-distributed by the Copyright Holder(s).--"Modified Version" refers to any derivative made by adding to, deleting,-or substituting -- in part or in whole -- any of the components of the-Original Version, by changing formats or by porting the Font Software to a-new environment.--"Author" refers to any designer, engineer, programmer, technical-writer or other person who contributed to the Font Software.--PERMISSION & CONDITIONS-Permission is hereby granted, free of charge, to any person obtaining-a copy of the Font Software, to use, study, copy, merge, embed, modify,-redistribute, and sell modified and unmodified copies of the Font-Software, subject to the following conditions:--1) Neither the Font Software nor any of its individual components,-in Original or Modified Versions, may be sold by itself.--2) Original or Modified Versions of the Font Software may be bundled,-redistributed and/or sold with any software, provided that each copy-contains the above copyright notice and this license. These can be-included either as stand-alone text files, human-readable headers or-in the appropriate machine-readable metadata fields within text or-binary files as long as those fields can be easily viewed by the user.--3) No Modified Version of the Font Software may use the Reserved Font-Name(s) unless explicit written permission is granted by the corresponding-Copyright Holder. This restriction only applies to the primary font name as-presented to the users.--4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font-Software shall not be used to promote, endorse or advertise any-Modified Version, except to acknowledge the contribution(s) of the-Copyright Holder(s) and the Author(s) or with their explicit written-permission.--5) The Font Software, modified or unmodified, in part or in whole,-must be distributed entirely under this license, and must not be-distributed under any other license. The requirement for fonts to-remain under this license does not apply to any document created-using the Font Software.--TERMINATION-This license becomes null and void if any of the above conditions are-not met.--DISCLAIMER-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM-OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/styles/pictogram-motion/demo/index.html b/styles/pictogram-motion/demo/index.htmlindex ec4549c..caee8c7 100644--- a/styles/pictogram-motion/demo/index.html+++ b/styles/pictogram-motion/demo/index.html@@ -3,31 +3,19 @@<style>@font-face { font-family: "Inter Tight"; src: url(fonts/InterTightwght.ttf); font-weight: 100 900; }@font-face { font-family: "Noto Sans SC"; src: url(fonts/NotoSansSCwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans JP"; src: url(fonts/NotoSansJPwght.ttf); font-weight: 100 900; }@font-face { font-family: "DM Mono"; src: url(fonts/DMMono-Medium.ttf); font-weight: 500; }html,body { margin:0; background:#000; overflow:hidden; }canvas { display:block; width:1920px; height:1080px; }</style></head><body><canvas id="c" width="1920" height="1080"></canvas>-<script src="edl.js"></script><script src="engine.js"></script>-<script src="poses/base.js"></script>-<script src="poses/ath.js"></script>-<script src="poses/aqua.js" onerror="0"></script>-<script src="poses/ball.js" onerror="0"></script>-<script src="poses/combat.js" onerror="0"></script>-<script src="poses/power.js" onerror="0"></script>-<script src="poses/nature.js" onerror="0"></script>-<script src="poses/asia.js" onerror="0"></script>-<script src="scenes.js"></script>+<script src="voice/cues.js"></script>+<script src="film.js"></script><script>-const ctx = document.getElementById('c').getContext('2d');-window.DUR = EDL.DUR;-window.render = (t) => G.renderFrame(ctx, t);+const zh = (window.CUES || []).map((c) => c.zh).join('') + '被落下的伞';Promise.all([- '900 40px "Inter Tight"', '800 40px "Inter Tight"', '500 40px "Noto Sans SC"', '900 40px "Noto Sans SC"', '700 40px "Noto Sans SC"',- '500 40px "Noto Sans JP"', '700 40px "Noto Sans JP"', '500 20px "DM Mono"',-].map((f) => document.fonts.load(f, 'Aa第届亚洲运动会競技ここで'))).then(() => { render(0); window.READY = true; });+ '900 40px "Inter Tight"', '900 40px "Noto Sans SC"', '700 40px "Noto Sans SC"', '500 20px "DM Mono"',+].map((f) => document.fonts.load(f, 'Aa×' + zh))).then(() => { render(0); window.READY = true; });</script></body></html>diff --git a/styles/pictogram-motion/demo/lab.html b/styles/pictogram-motion/demo/lab.htmldeleted file mode 100644index c72ad5b..0000000--- a/styles/pictogram-motion/demo/lab.html+++ /dev/null@@ -1,74 +0,0 @@-<!doctype html>-<html><head><meta charset="utf-8">-<style>-@font-face { font-family: "Inter Tight"; src: url(fonts/InterTightwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans SC"; src: url(fonts/NotoSansSCwght.ttf); font-weight: 100 900; }-@font-face { font-family: "Noto Sans JP"; src: url(fonts/NotoSansJPwght.ttf); font-weight: 100 900; }-@font-face { font-family: "DM Mono"; src: url(fonts/DMMono-Medium.ttf); font-weight: 500; }-html,body { margin:0; background:#111; }-canvas { display:block; }-</style></head>-<body>-<canvas id="c"></canvas>-<script src="engine.js"></script>-<script src="poses/base.js"></script>-<script src="poses/ath.js"></script>-<script src="poses/aqua.js" onerror="0"></script>-<script src="poses/ball.js" onerror="0"></script>-<script src="poses/combat.js" onerror="0"></script>-<script src="poses/power.js" onerror="0"></script>-<script src="poses/nature.js" onerror="0"></script>-<script src="poses/asia.js" onerror="0"></script>-<script>-// Pose check sheet: lab.html?p=sprint,hurdles&pal=red&n=8&beats=4-// One pose per row; time runs horizontally (0 → `beats` beats, split evenly into n cells)-const q = new URLSearchParams(location.search);-const names = (q.get('p') || Object.keys(POSES).join(',')).split(',').filter(Boolean);-const n = +(q.get('n') || 8), beats = +(q.get('beats') || 4);-const cw = 240, ch = 240, lab = 170;-const cv = document.getElementById('c');-cv.width = lab + cw * n; cv.height = ch * names.length;-const ctx = cv.getContext('2d');-function colors(pk) {- const P = G.PAL[pk];- return { fg: P.fg, far: G.mix(P.fg, P.t[2], 0.42), far2: G.mix(P.fg, P.t[2], 0.62), acc: P.key === 'gold' || P.key === 'ochre' ? P.deep : P.t[4], bg: P.t[2], line: G.mix(P.fg, P.t[2], 0.55) };-}-window.drawFig = function (ctx, def, u, C) {- const pz = def.pose ? def.pose(u) : G.keyPose(def.keys, u, def.loop);- const J = G.joints(pz);- ctx.save();- if (def.fig) { ctx.translate(def.fig.x || 0, def.fig.y || 0); if (def.fig.s) ctx.scale(def.fig.s, def.fig.s); }- if (def.back) def.back(ctx, J, u, C);- if (def.second) {- const p2 = def.second(u); const J2 = G.joints(p2);- ctx.save(); const o = def.secondX || [0, 0]; ctx.translate(o[0], o[1]); if (def.secondFace === -1) ctx.scale(-1, 1);- G.drawFigure(ctx, J2, C.far2, G.mix(C.far2, C.bg, 0.35)); ctx.restore();- }- G.drawFigure(ctx, J, C.fg, C.far);- if (def.front) def.front(ctx, J, u, C);- ctx.restore();- return J;-};-document.fonts.load('600 20px "DM Mono"').then(() => {- names.forEach((nm, r) => {- const pk = q.get('pal') || ['red', 'purple', 'gold', 'ochre', 'green', 'ink'][r % 6];- const C = colors(pk);- ctx.fillStyle = '#222'; ctx.fillRect(0, r * ch, lab, ch);- ctx.fillStyle = '#eee'; ctx.font = '500 18px "DM Mono"'; ctx.fillText(nm, 12, r * ch + 30);- for (let i = 0; i < n; i++) {- const u = beats * i / n;- const x = lab + i * cw, y = r * ch;- ctx.save(); ctx.beginPath(); ctx.rect(x, y, cw, ch); ctx.clip();- ctx.fillStyle = C.bg; ctx.fillRect(x, y, cw, ch);- ctx.strokeStyle = 'rgba(0,0,0,.25)'; ctx.strokeRect(x + .5, y + .5, cw - 1, ch - 1);- ctx.translate(x + cw / 2, y + ch * 0.52); ctx.scale(ch * 0.62, ch * 0.62);- const def = POSES[nm];- if (def) drawFig(ctx, def, u, C);- ctx.restore();- ctx.fillStyle = 'rgba(0,0,0,.5)'; ctx.font = '500 14px "DM Mono"'; ctx.fillText('u=' + u.toFixed(2), x + 6, y + ch - 8);- }- });- window.READY = true;-});-</script>-</body></html>diff --git a/styles/pictogram-motion/demo/lab.mjs b/styles/pictogram-motion/demo/lab.mjsdeleted file mode 100644index 4628858..0000000--- a/styles/pictogram-motion/demo/lab.mjs+++ /dev/null@@ -1,19 +0,0 @@-// Usage: node lab.mjs out.png "p=sprint,hurdles&n=8&beats=4"-// node lab.mjs out.png "pattern=1" (pattern check)-import { chromium } from 'playwright-core';-import path from 'path';-import { EXE } from '../../../core/render/browser.mjs';-// Cover: node lab.mjs stills/cover_ej.png "lang=ej" cover.html (cover34.html = 3:4 portrait)-const [out, qs = '', page_ = 'lab.html'] = process.argv.slice(2);-const b = await chromium.launch({ executablePath: EXE, args: ['--allow-file-access-from-files'] });-const p = await b.newPage({ viewport: { width: 1920, height: 1080 } });-p.on('pageerror', (e) => console.error('[pageerror]', e.message));-p.on('console', (m) => { if (m.type() === 'error' && !/ERR_FILE_NOT_FOUND/.test(m.text())) console.error('[page]', m.text()); });-await p.goto('file://' + path.resolve(page_) + '?' + qs);-await p.waitForFunction(() => window.READY === true, null, { timeout: 30000 });-const sz = await p.evaluate(() => { const c = document.querySelector('canvas'); return [c.width, c.height]; });-await p.setViewportSize({ width: sz[0], height: sz[1] });-await p.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));-await p.screenshot({ path: out, clip: { x: 0, y: 0, width: sz[0], height: sz[1] } });-await b.close();-console.log('ok', out);diff --git a/styles/pictogram-motion/demo/mix.py b/styles/pictogram-motion/demo/mix.pynew file mode 100644index 0000000..1ec225c--- /dev/null+++ b/styles/pictogram-motion/demo/mix.py@@ -0,0 +1,299 @@+"""LEFT BEHIND — score, foley and voice for the whole 50 s timeline, then the span [a, b] → out/mix.wav.+usage: mix.py [a b] (film seconds; a span shorter than the film gets a 0.3 s audio fade-out at its end)+Reads events.json (film times, exported with a=0&b=50), voice/vo.json (line starts) and out/voice/*.wav (Kokoro).+120 BPM: beat 0.5 s, bar 2 s."""+import os, sys, json+import numpy as np, soundfile as sf, soxr+HERE = os.path.dirname(os.path.abspath(__file__))+LIB = os.environ.get('LIB') or os.path.dirname(os.path.dirname(os.path.dirname(HERE)))+sys.path.insert(0, LIB)+from core.audio import sampler as S+from core.audio.sfx import SR, t_, env_exp, bp, lp, hp, noise, norm, compress, limit, add, whoosh, thump++FULL = 50.0+A = float(sys.argv[1]) if len(sys.argv) > 1 else 0.0+B = float(sys.argv[2]) if len(sys.argv) > 2 else FULL+rng = np.random.default_rng(42)+N = int((FULL + 3) * SR)+mus = np.zeros((N, 2), np.float32) # music+fx = np.zeros((N, 2), np.float32) # foley+amb = np.zeros((N, 2), np.float32) # ambience+EV = json.load(open(f'{HERE}/events.json'))['ev']++# ───────── score ─────────+score = []+def n(t, inst, p, d, v, pan=0.0, g=1.0, **kw): score.append(dict(t=t, inst=inst, pitch=p, dur=d, vel=v, pan=pan, gain=g, **kw))++# §1 rain, D minor (0–4): marimba drips, shaker rain, bowed-vibes pad; bass enters on the match cut (2.5)+drips = ['D5', None, 'A5', 'F5', None, 'C6', 'A5', None, 'D5', 'F5', None, 'A5', 'G5', None, 'F5', 'E5']+for i, p in enumerate(drips):+ if p: n(i * 0.25, 'marimba', p, 0.4, 0.34 + 0.08 * rng.random(), pan=float(rng.uniform(-.5, .5)), g=0.9)+n(0.0, 'vibraphone_bowed', 'D4', 4.0, 0.3, -0.2, 0.55, attack=0.6); n(0.0, 'vibraphone_bowed', 'A4', 4.0, 0.28, 0.2, 0.5, attack=0.6)+n(0.0, 'vibraphone_bowed', 'F4', 4.0, 0.26, 0.0, 0.5, attack=0.8)+for i in range(16): # shaker 16ths = rain+ n(i * 0.25, 'shaker', 'down' if i % 2 else 'up', None, 0.28 + (0.12 if i % 4 == 0 else 0), pan=0.3, g=0.55)+for t, p, d in [(2.5, 'D2', 0.45), (3.0, 'D2', 0.4), (3.5, 'A1', 0.45)]:+ n(t, 'electric_bass', p, d, 0.7, 0, 1.0)+# §2 sun, F major (4–6.75): the flip opens on a glockenspiel run, marimba brightens+for i, p in enumerate(['F5', 'A5', 'C6', 'F6']): n(4.0 + i * 0.0625, 'glockenspiel', p, 1.2, 0.5, pan=-0.3 + 0.2 * i, g=0.7)+sun = ['F5', 'A5', 'C6', 'A5', 'G5', 'C6', 'A5', 'F5', 'F5', 'C6']+for i, p in enumerate(sun): n(4.5 + i * 0.25, 'marimba', p, 0.35, 0.42, pan=float(rng.uniform(-.4, .4)), g=0.85)+n(4.0, 'vibraphone_bowed', 'F4', 2.6, 0.3, -0.2, 0.55, attack=0.3); n(4.0, 'vibraphone_bowed', 'C5', 2.6, 0.28, 0.2, 0.5, attack=0.3)+n(4.0, 'vibraphone_bowed', 'A4', 2.6, 0.26, 0, 0.5, attack=0.3)+for t, p, d in [(4.0, 'F2', 0.9), (5.0, 'C2', 0.9), (6.0, 'A1', 0.6)]: n(t, 'electric_bass', p, d, 0.72)+# 6.75–7.0: half a beat of nothing (drums and bass out) before the title+# §3 title, F major groove (7.0–): slam, then marimba ostinato+n(7.0, 'crash', None, None, 0.55, 0.0, 0.5)+for p in ['F4', 'A4', 'C5', 'F5']: n(7.0, 'marimba', p, 0.6, 0.75, 0, 0.8)+n(7.0, 'glockenspiel', 'F6', 1.5, 0.5, 0.2, 0.6)+osti = ['F5', 'C6', 'A5', 'C6', 'G5', 'C6', 'A5', 'C6', 'D5', 'A5', 'F5', 'A5', 'E5', 'C6', 'G5', 'C6']+for i in range(14):+ t = 7.5 + i * 0.25+ if t >= 10.75: break+ n(t, 'marimba', osti[(i + 2) % 16], 0.3, 0.36 + (0.08 if i % 2 == 0 else 0), pan=0.35 if i % 2 else -0.35, g=0.8)+for t, p, d in [(7.0, 'F1', 0.9), (8.0, 'F2', 0.4), (8.5, 'A1', 0.4), (9.0, 'D2', 0.9), (10.0, 'C2', 0.9)]:+ n(t, 'electric_bass', p, d, 0.75)+for t, ch in [(7.0, ['F4', 'A4', 'C5']), (9.0, ['D4', 'F4', 'A4']), (10.0, ['C4', 'E4', 'G4'])]:+ for j, p in enumerate(ch): n(t, 'vibraphone_bowed', p, 1.0 if t >= 9 else 2.0, 0.24, -0.2 + 0.2 * j, 0.45, attack=0.15)+for t in np.arange(7.5, 10.6, 1.0): n(float(t), 'claps', None, None, 0.35, 0.1, 0.5)+for t in np.arange(7.25, 10.6, 0.5): n(float(t), 'hihat', 'closed', None, 0.3, 0.25, 0.45)+for t in np.arange(1.0, 4.0, 0.5): n(float(t) + 0.25, 'hihat', 'closed', None, 0.22, 0.25, 0.35)++# §4 ALL DAY (10.5–16.5), F major, the day runs: marimba ostinato, walking bass, a clock ding per card+day = ['F5', 'C6', 'A5', 'C6', 'G5', 'C6', 'A5', 'F5', 'F5', 'A5', 'C6', 'A5', 'Bb5', 'G5', 'E5', 'G5']+for i in range(24):+ t = 10.5 + i * 0.25+ n(t, 'marimba', day[i % 16], 0.3, 0.34 + (0.1 if i % 4 == 0 else 0), pan=0.35 if i % 2 else -0.35, g=0.75)+for i, (p, ch) in enumerate([('F2', ['F4', 'A4', 'C5']), ('C2', ['E4', 'G4', 'C5']), ('Bb1', ['D4', 'F4', 'Bb4'])]):+ t = 10.5 + 2 * i+ n(t, 'electric_bass', p, 0.9, 0.72); n(t + 1.0, 'electric_bass', p, 0.4, 0.6); n(t + 1.5, 'electric_bass', p, 0.4, 0.55)+ for j, q in enumerate(ch): n(t, 'vibraphone_bowed', q, 1.9, 0.22, -0.2 + 0.2 * j, 0.42, attack=0.2)+for t in np.arange(11.0, 16.5, 1.0): n(float(t), 'claps', None, None, 0.32, 0.1, 0.45)+for t in np.arange(10.75, 16.5, 0.5): n(float(t), 'hihat', 'closed', None, 0.28, 0.25, 0.42)+for t, p in [(13.5, 'C6'), (14.5, 'E6'), (15.5, 'G6')]: n(t, 'glockenspiel', p, 1.0, 0.55, 0.2, 0.7)+# dusk (16.5–18.5): the sun goes down a scale, the moon is one high note, then half a beat of nothing+for i, p in enumerate(['C6', 'A5', 'F5', 'D5', 'C5']): n(16.5 + i * 0.125, 'glockenspiel', p, 0.8, 0.42, -0.2, 0.6)+n(16.5, 'electric_bass', 'D2', 1.4, 0.65); n(16.5, 'vibraphone_bowed', 'D4', 1.8, 0.24, -0.2, 0.45, attack=0.3); n(16.5, 'vibraphone_bowed', 'A4', 1.8, 0.22, 0.2, 0.45, attack=0.3)+n(16.5, 'vibraphone_bowed', 'F4', 1.8, 0.22, 0, 0.42, attack=0.3)+n(17.5, 'glockenspiel', 'A6', 1.2, 0.35, 0.3, 0.55)+for t, p in [(17.0, 'D5'), (17.5, 'F5'), (18.0, 'A4')]: n(t, 'marimba', p, 0.4, 0.3, -0.2, 0.7)+# §5 LOST & FOUND (18.5–28), D minor, wood: log drum and claves, low marimba+for p in ['D3', 'A3', 'D4', 'F4']: n(18.5, 'marimba', p, 0.8, 0.7, 0, 0.8)+n(18.5, 'log_drum', 'lo', None, 0.75, 0, 0.8); n(18.5, 'crash', None, None, 0.35, 0, 0.35)+wood = [('lo', 0), ('hi', 0.75), ('hi', 1.0), ('lo', 1.5)]+for bar in range(3):+ for v, o in wood: n(19.0 + bar * 2 + o, 'log_drum', v, None, 0.5, -0.2 if v == 'hi' else 0.1, 0.6)+for t in np.arange(19.25, 24.0, 0.5): n(float(t), 'world_perc', 'claves', None, 0.28, 0.3, 0.35)+for t, p in [(19.0, 'D2'), (20.0, 'A1'), (21.0, 'Bb1'), (22.0, 'A1'), (23.0, 'A1')]: n(t, 'electric_bass', p, 0.9, 0.68)+lowm = ['D4', 'F4', 'A4', 'F4', 'C4', 'E4', 'A4', 'E4']+for i in range(10): n(19.0 + i * 0.25, 'marimba', lowm[i % 8], 0.3, 0.3, pan=0.3 if i % 2 else -0.3, g=0.7)+# the count: a two-octave run that lands on 23.5+run = ['D4', 'E4', 'F4', 'G4', 'A4', 'Bb4', 'C5', 'D5', 'E5', 'F5', 'G5', 'A5', 'Bb5', 'C6', 'D6']+for i, p in enumerate(run): n(22.1 + i * (1.85 / 15), 'marimba', p, 0.2, 0.32 + i * 0.02, pan=-0.4 + i * 0.05, g=0.75)+n(24.0, 'crash', None, None, 0.5, 0, 0.45)+for p in ['D3', 'A3', 'D4', 'F4', 'A4']: n(24.0, 'marimba', p, 0.9, 0.75, 0, 0.75)+n(24.0, 'glockenspiel', 'D6', 1.5, 0.5, 0.2, 0.6); n(24.0, 'electric_bass', 'D1', 1.4, 0.8)+for j, q in enumerate(['D4', 'F4', 'A4']): n(24.0, 'vibraphone_bowed', q, 1.9, 0.22, -0.2 + 0.2 * j, 0.42, attack=0.4)+for t, p in [(24.5, 'A4'), (25.0, 'F4'), (25.5, 'D4')]: n(t, 'marimba', p, 0.4, 0.28, 0, 0.65)+# 26–28: one ticking clock and nothing else (the days pass)+# §6 STORM (28–36.5), D minor, driving+for p in ['D3', 'D4', 'F4', 'A4']: n(28.0, 'marimba', p, 0.6, 0.8, 0, 0.75)+n(28.0, 'crash', None, None, 0.6, 0, 0.5)+for t in np.arange(28.0, 34.0, 0.25):+ acc = (round((t - 28.0) / 0.25)) % 4 == 0+ n(float(t), 'frame_drum', 'large' if acc else 'small_muted', None, 0.55 if acc else 0.3, -0.15 if acc else 0.2, 0.7)+for t in np.arange(28.0, 34.0, 0.25): n(float(t), 'shaker', 'down', None, 0.35, 0.3, 0.5)+for i, t in enumerate(np.arange(28.0, 34.0, 0.5)): n(float(t), 'electric_bass', ['D2', 'D2', 'F2', 'D2', 'C2', 'D2', 'A1', 'D2'][i % 8], 0.4, 0.72)+storm_m = ['D5', 'F5', 'E5', 'D5', 'A4', 'C5', 'D5', 'E5']+for i in range(12): n(31.0 + i * 0.25, 'marimba', storm_m[i % 8], 0.3, 0.32, pan=0.3 if i % 2 else -0.3, g=0.7)+# the sign turns (34.5): first F sharp of the film; the shutter rises in six clanks; then silence+n(34.5, 'glockenspiel', 'F#6', 1.4, 0.55, 0.2, 0.65); n(34.5, 'glockenspiel', 'D6', 1.4, 0.45, -0.2, 0.55)+for j, q in enumerate(['D4', 'F#4', 'A4']): n(34.5, 'vibraphone_bowed', q, 1.7, 0.24, -0.2 + 0.2 * j, 0.45, attack=0.3)+for i, t in enumerate([35.0, 35.25, 35.5, 35.75, 36.0, 36.25]): n(t, 'marimba', ['A3', 'D4', 'F#4', 'A4', 'D5', 'F#5'][i], 0.25, 0.5, 0, 0.7)+# §7 BLOOM (36.5–44), D major, everything at once+n(36.5, 'crash', None, None, 0.7, 0, 0.55)+for i, p in enumerate(['D4', 'F#4', 'A4', 'D5', 'F#5', 'A5', 'D6', 'F#6']): n(36.5 + i * 0.03, 'marimba', p, 0.8, 0.7, -0.5 + i * 0.14, 0.75)+n(36.5, 'glockenspiel', 'A6', 2.0, 0.5, 0.3, 0.6); n(36.5, 'electric_bass', 'D1', 1.8, 0.85)+bloom_m = ['D5', 'A5', 'F#5', 'A5', 'E5', 'A5', 'F#5', 'D6', 'B4', 'F#5', 'D5', 'F#5', 'G4', 'D5', 'B4', 'D5']+for i in range(26):+ t = 37.0 + i * 0.25+ n(t, 'marimba', bloom_m[i % 16], 0.3, 0.38 + (0.1 if i % 4 == 0 else 0), pan=0.35 if i % 2 else -0.35, g=0.8)+for i, (p, ch) in enumerate([('D2', ['D4', 'F#4', 'A4']), ('A1', ['C#4', 'E4', 'A4']), ('B1', ['D4', 'F#4', 'B4']), ('G1', ['D4', 'G4', 'B4'])]):+ t = 36.5 + 2 * i+ if t >= 44: break+ n(t, 'electric_bass', p, 0.9, 0.75); n(t + 1.0, 'electric_bass', p, 0.4, 0.62); n(t + 1.5, 'electric_bass', p, 0.4, 0.6)+ for j, q in enumerate(ch): n(t, 'vibraphone_bowed', q, 1.9, 0.24, -0.2 + 0.2 * j, 0.45, attack=0.15)+for t in np.arange(37.0, 44.0, 1.0): n(float(t), 'claps', None, None, 0.36, 0.1, 0.5)+for t in np.arange(36.75, 44.0, 0.5): n(float(t), 'hihat', 'closed', None, 0.3, 0.25, 0.45)+scale = ['D5', 'E5', 'F#5', 'G5', 'A5', 'B5', 'C#6', 'D6', 'E6', 'F#6', 'G6', 'A6']+for i in range(12): n(41.0 + i * 0.25, 'glockenspiel', scale[i], 0.6, 0.45, 0.4 - i * 0.07, 0.55)+# §8 next morning (44–50): the opening drips again, now in D major, and the last chord+drips2 = ['D5', None, 'A5', 'F#5', None, 'D6', 'A5', None, 'D5', 'F#5', None, 'A5', 'B5', None, 'A5', 'F#5']+for i, p in enumerate(drips2[:10]):+ if p: n(44.0 + i * 0.25, 'marimba', p, 0.4, 0.32, pan=float(rng.uniform(-.5, .5)), g=0.85)+n(44.0, 'electric_bass', 'D2', 1.8, 0.6); n(45.5, 'electric_bass', 'G1', 0.9, 0.6)+for j, q in enumerate(['D4', 'F#4', 'A4']): n(44.0, 'vibraphone_bowed', q, 3.0, 0.24, -0.2 + 0.2 * j, 0.45, attack=0.5)+for p in ['D3', 'A3', 'D4', 'F#4', 'A4', 'D5']: n(46.5, 'marimba', p, 1.5, 0.6, 0, 0.7)+for j, q in enumerate(['D4', 'F#4', 'A4', 'E5']): n(46.5, 'vibraphone_bowed', q, 3.0, 0.26, -0.3 + 0.2 * j, 0.5, attack=0.1)+n(46.5, 'glockenspiel', 'D6', 3.0, 0.5, 0.2, 0.6); n(46.5, 'electric_bass', 'D1', 3.0, 0.75)+n(46.5, 'crash', None, None, 0.35, 0, 0.35)++mus += S.render(score, dur=N / SR, master=False)[:N]++# electronic kick (synthesised)+def kick(v=1.0):+ d = 0.4; tt = t_(d); f = 48 + 90 * np.exp(-tt / 0.03)+ x = np.sin(2 * np.pi * np.cumsum(f) / SR) * env_exp(d, 0.12)+ x += 0.25 * np.tanh(3 * x) # a little harmonic body so it speaks on small speakers+ return (norm(x) * v).astype(np.float32)+KICKS = [0.5, 2.0, 2.5, 3.5, 4.0, 5.0, 6.0] + [7.0 + 0.5 * i for i in range(8)]+KICKS += [10.5 + 0.5 * i for i in range(12)] + [18.5, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]+KICKS += [28.0 + 0.5 * i for i in range(12)] + [34.0, 34.5] + [36.5 + 0.5 * i for i in range(15)] + [44.0, 45.0, 46.0, 46.5]+KICKS = sorted(set(round(k, 3) for k in KICKS))+BIG = {7.0, 18.5, 24.0, 28.0, 36.5, 46.5}+for t in KICKS: add(mus, kick(0.8 if t in BIG else 0.55), t)+for t in BIG: add(mus, thump(0.55, 46), t) # low boom under every slam++# ───────── foley (picture-locked to events.json) ─────────+def splash(v):+ d = 0.16; x = bp(noise(d), 1200, 5200) * env_exp(d, 0.03) + 0.4 * lp(noise(d), 400) * env_exp(d, 0.012)+ return norm(x) * v+def tap(v):+ d = 0.08; tt = t_(d); x = hp(noise(d), 900) * env_exp(d, 0.006) + 0.6 * np.sin(2 * np.pi * 180 * tt) * env_exp(d, 0.015)+ return norm(x) * v+def fwump(v): # umbrella canopy snapping open+ d = 0.32; tt = t_(d)+ x = bp(noise(d), 200, 1800) * np.minimum(1, tt / 0.02) * env_exp(d, 0.06) + 0.7 * np.sin(2 * np.pi * 95 * tt) * env_exp(d, 0.05)+ return norm(x) * v+def clink(v):+ d = 0.5; tt = t_(d)+ x = sum(a * np.sin(2 * np.pi * f * tt) * env_exp(d, tau) for f, a, tau in [(2140, 1, .09), (3460, .6, .06), (5230, .4, .04), (1190, .3, .12)])+ return norm(x + 0.3 * hp(noise(d), 4000) * env_exp(d, .004)) * v+def hiss(d, v, lo=2500, hi=9000, att=0.01):+ tt = t_(d); return norm(bp(noise(d), lo, hi) * np.minimum(1, tt / att) * np.exp(-tt / (d * 0.45))) * v+def flipclicks(v):+ out = np.zeros(int(0.8 * SR))+ for k in range(14):+ s = int((0.5 * k / 14) * SR); d = 0.03; tt = t_(d)+ c = hp(noise(d), 2000) * env_exp(d, 0.003) + 0.5 * np.sin(2 * np.pi * (1500 + 90 * k) * tt) * env_exp(d, 0.006)+ out[s:s + len(c)] += c * (0.6 + 0.4 * rng.random())+ return norm(out) * v+def plink(v):+ d = 0.4; tt = t_(d); f = 1500 + 900 * (1 - np.exp(-tt / 0.02))+ return norm(np.sin(2 * np.pi * np.cumsum(f) / SR) * env_exp(d, 0.07)) * v+def busbell(v):+ d = 1.2; tt = t_(d)+ x = sum(a * np.sin(2 * np.pi * f * tt) * env_exp(d, tau) for f, a, tau in [(1760, 1, .4), (3520, .35, .2), (2637, .3, .3), (5280, .12, .08)])+ return norm(x) * v++def thunder(v, d=2.6):+ tt = t_(d)+ crack = hp(noise(d), 1500) * np.exp(-tt / 0.05)+ roll = lp(noise(d), 260) * np.minimum(1, tt / 0.08) * np.exp(-tt / 0.9) * (1 + 0.4 * np.sin(2 * np.pi * 3.3 * tt))+ return norm(crack * 0.7 + roll * 1.4) * v+def clank(v, f=180):+ d = 0.35; tt = t_(d)+ x = sum(a * np.sin(2 * np.pi * f * m * tt) * env_exp(d, tau) for m, a, tau in [(1, 1, .12), (2.76, .5, .07), (5.4, .3, .04)])+ return norm(x + 0.5 * bp(noise(d), 800, 4000) * env_exp(d, .01)) * v+def tick(v):+ d = 0.05; tt = t_(d); return norm(np.sin(2 * np.pi * 2600 * tt) * env_exp(d, 0.005) + 0.4 * hp(noise(d), 3000) * env_exp(d, 0.002)) * v++for e in EV:+ t, k = e['t'], e['type']+ if k == 'pop': add(fx, fwump(0.7), t)+ elif k == 'step_wet': add(fx, splash(0.32), t, pan=0.1)+ elif k == 'furl': add(fx, whoosh(0.4, 0.3), t - 0.05)+ elif k == 'clink': add(fx, clink(0.32), t, pan=-0.2)+ elif k == 'brake': add(fx, hiss(0.5, 0.16, 3000, 9000, 0.05), t + 0.1, pan=0.3)+ elif k == 'ding':+ add(fx, busbell(0.36), t, pan=0.2); add(fx, busbell(0.3), t + 0.25, pan=0.2)+ elif k == 'flip': add(fx, flipclicks(0.4), t - 0.1); add(fx, whoosh(0.5, 0.25), t - 0.12)+ elif k == 'door_open': add(fx, hiss(0.45, 0.32, 1800, 8000), t, pan=0.35); add(fx, thump(0.25, 120), t + 0.22, pan=0.35)+ elif k == 'step_dry': add(fx, tap(0.3), t, pan=0.45)+ elif k == 'door_close': add(fx, hiss(0.3, 0.22, 1800, 8000), t, pan=0.35); add(fx, thump(0.35, 110), t + 0.28, pan=0.35)+ elif k == 'iris': add(fx, whoosh(0.4, 0.3), t - 0.12)+ elif k == 'drip': add(fx, plink(0.3), t + 0.24, pan=-0.15)+ elif k in ('rows', 'quarter', 'slide', 'split', 'flipT'): add(fx, whoosh(0.35, 0.22), t - 0.12)+ elif k == 'whip': add(fx, whoosh(0.3, 0.28), t - 0.14, pan=0.3)+ elif k == 'card': add(fx, flipclicks(0.22), t - 0.08)+ elif k == 'moon': add(fx, plink(0.12), t, pan=0.3)+ elif k == 'descend': add(fx, whoosh(0.45, 0.3), t)+ elif k == 'slam': add(fx, clank(0.25, 140), t)+ elif k == 'tag': add(fx, clink(0.25), t, pan=-0.4)+ elif k == 'count': add(fx, fwump(0.3), t)+ elif k == 'tick': add(fx, tick(0.45), t, pan=0.15)+ elif k == 'thunder': add(fx, thunder(0.95), t)+ elif k == 'thunder2': add(fx, thunder(0.6, 2.0), t, pan=-0.3)+ elif k == 'signflip': add(fx, whoosh(0.25, 0.25), t - 0.05); add(fx, clink(0.3), t + 0.15)+ elif k == 'shutter': add(fx, clank(0.28, 150 + 30 * ((t - 35.0) / 0.25)), t, pan=float(rng.uniform(-.3, .3)))+ elif k == 'bloom':+ for q in range(14): add(fx, fwump(0.35), t + q * 0.016, pan=float(rng.uniform(-.8, .8)))+ elif k == 'rowshift': add(fx, whoosh(0.3, 0.22), t - 0.06, pan=-0.3 if (t * 2) % 2 else 0.3)+ elif k == 'stop': add(fx, fwump(0.18), t, pan=0.6 - e.get('i', 0) * 0.1)+ elif k == 'step_soft': add(fx, tap(0.22), t, pan=0.1)+ elif k == 'end': add(fx, whoosh(0.35, 0.2), t - 0.12)++# rain bed: bright outside (0–2.5), muffled inside the bus while the camera is close (2.5–3.2), outside again until the sun+def rainbed(d):+ x = bp(noise(d), 900, 7000) * 0.5 + lp(noise(d), 600) * 0.15+ ticks = np.zeros(len(x)); idx = rng.integers(0, len(ticks), int(d * 60)); ticks[idx] = rng.uniform(.3, 1, len(idx))+ return x + hp(np.convolve(ticks, np.exp(-np.arange(200) / 30), 'same'), 2000) * 0.6+rb = rainbed(4.6)+tt = t_(4.6)+inside = np.clip((tt - 2.45) / 0.1, 0, 1) * (1 - np.clip((tt - 3.0) / 0.5, 0, 1))+bed = rb * (1 - inside) * 0.9 + lp(rb, 900, 2) * inside * 1.4+bed *= np.minimum(1, tt / 0.15) * (1 - np.clip((tt - 4.0) / 0.35, 0, 1))+add(amb, norm(bed) * 0.07, 0.0, pan=-0.2); add(amb, norm(rainbed(4.6) * (1 - inside * 0.6)) * 0.05 * np.minimum(1, tt / .15) * (1 - np.clip((tt - 4.0) / .35, 0, 1)), 0.0, pan=0.5)+# daylight street air after the flip+d = 7.0; air = lp(noise(d), 500) * 0.6 + bp(noise(d), 1500, 4000) * 0.08+add(amb, norm(air) * 0.035 * np.minimum(1, t_(d) / 0.6), 4.0)++def rain_span(t0, t1, level, lo=900):+ d = t1 - t0; x = rainbed(d); tt = t_(d)+ if lo != 900: x = hp(x, lo)+ env = np.minimum(1, tt / 0.3) * np.minimum(1, (d - tt) / 0.4)+ add(amb, norm(x) * level * env, t0, pan=-0.2); add(amb, norm(rainbed(d)) * level * 0.7 * env, t0, pan=0.5)+rain_span(27.95, 36.4, 0.11) # the storm (it starts on the thunder, after the ticking)+rain_span(36.5, 44.0, 0.07) # rain on 313 canopies+rain_span(44.0, 49.9, 0.06) # the next morning++music = mus + fx + amb+# ───────── voice ─────────+vo = json.load(open(f'{HERE}/voice/vo.json'))+voice = np.zeros((N, 2), np.float32)+env = np.zeros(N, np.float32)+for v in vo:+ p = f"{HERE}/out/voice/{v['id']}.wav"+ if not os.path.exists(p): continue+ x, sr = sf.read(p, dtype='float32')+ if x.ndim > 1: x = x.mean(1)+ x = soxr.resample(x, sr, SR)+ x = hp(x, 90)+ x = compress(norm(x, 0.9), thr=0.22, ratio=3.0, att=0.005, rel=0.1)+ s = int(v['t'] * SR); e = min(N, s + len(x))+ lo, hi = max(0, s - int(0.6 * SR)), min(N, e + int(0.3 * SR))+ mr = np.sqrt(np.mean(music[s:e] ** 2)) + 1e-6+ vr = np.sqrt(np.mean(x[x != 0] ** 2)) + 1e-6+ g = (mr * 10 ** (10 / 20)) / vr+ g = float(np.clip(g, 0.2, 4.0))+ add(voice, x, v["t"], gain=g * 0.75)+ env[s:e] = 1+# ducking + 300 Hz–4 kHz dip in the music under the voice+from scipy.ndimage import uniform_filter1d+env = uniform_filter1d(uniform_filter1d(env, int(0.08 * SR)), int(0.08 * SR))+band = np.stack([bp(music[:, 0], 300, 4000), bp(music[:, 1], 300, 4000)], 1)+music = music * (1 - 0.3 * env[:, None]) - band * (0.45 * env[:, None])+mix = music + voice+mix = np.stack([limit(mix[:, 0], 0.95), limit(mix[:, 1], 0.95)], 1)++seg = mix[int(A * SR):int(B * SR)].copy()+f = int((0.3 if B < FULL else 0.8) * SR); seg[-f:] *= np.linspace(1, 0, f)[:, None]+os.makedirs(f'{HERE}/out', exist_ok=True)+sf.write(f'{HERE}/out/mix.wav', seg.astype(np.float32), SR, subtype='FLOAT')+# report: voice vs music level, cue list+def rms_db(x): return 20 * np.log10(np.sqrt(np.mean(x ** 2)) + 1e-9)+for v in vo:+ s, e = int(v['t'] * SR), int((v['t'] + 2) * SR)+ if v['t'] < B and v['t'] >= A: print(f"{v['id']}: voice {rms_db(voice[s:e]):.1f} dB, music {rms_db(music[s:e]):.1f} dB")+print('cues:', ' '.join(f"{e['type']}@{e['t']}" for e in EV if A <= e['t'] < B))+print('wrote out/mix.wav', round(len(seg) / SR, 3), 's')diff --git a/styles/pictogram-motion/demo/music/export_timeline.cjs b/styles/pictogram-motion/demo/music/export_timeline.cjsdeleted file mode 100644index 91351d3..0000000--- a/styles/pictogram-motion/demo/music/export_timeline.cjs+++ /dev/null@@ -1,17 +0,0 @@-// Export music/timeline.json from the edit list edl.js (the input for the scoring script music.py)-// Usage (from the demo/ folder): node music/export_timeline.cjs-const fs = require('fs'), path = require('path'), vm = require('vm');-const here = __dirname;-const sandbox = {};-vm.runInNewContext(fs.readFileSync(path.join(here, '..', 'edl.js'), 'utf8'), sandbox);-const E = sandbox.EDL;-const shots = E.shots.map((s) => ({- kind: s.kind,- id: s.kind === 'card' ? s.pose : s.id,- chap: s.kind === 'card' ? s.chap : s.kind === 'chapter' ? s.id : s.kind,- t0: Math.round(s.t0 * 1e6) / 1e6, b0: s.b0, beats: s.beats,-}));-const out = { bpm: E.BPM, beat: E.BEAT, total_beats: E.beats, duration: E.DUR, shots };-const dst = process.argv[2] || path.join(here, 'timeline.json');-fs.writeFileSync(dst, JSON.stringify(out, null, 1));-console.log('timeline', shots.length, 'shots', E.DUR.toFixed(2) + 's →', dst);diff --git a/styles/pictogram-motion/demo/music/music.py b/styles/pictogram-motion/demo/music/music.pydeleted file mode 100644index 68fd86c..0000000--- a/styles/pictogram-motion/demo/music/music.py+++ /dev/null@@ -1,1628 +0,0 @@-#!/usr/bin/python3-# -*- coding: utf-8 -*--"""-20th Asian Games Aichi-Nagoya 2026 - sports intro film, original score.-"Wadaiko x Electronic" | 150 BPM, 4/4 | D miyako-bushi (D Eb G A Bb) over D minor harmony-101 bars = 161.6 s (+2 s ring-out). Picture edit is read from timeline.json.--Run: /usr/bin/python3 music.py-Out: music_bed.wav, sfx.wav (48 kHz / 24-bit stems, unmastered, sum 1:1 = pre-master mix)- music.wav (master, -14 LUFS, TP <= -1 dBTP)- report.txt (loudness, band energy, onset check)-Everything is synthesized here - no samples.-"""-import json, os, time, wave, subprocess-import numpy as np-from scipy import signal-from scipy.ndimage import minimum_filter1d, uniform_filter1d--T_START = time.time()-HERE = os.path.dirname(os.path.abspath(__file__))-SR = 48000-TL = json.load(open(os.path.join(HERE, 'timeline.json')))-assert abs(TL['beat'] - 0.4) < 1e-9 and TL['bpm'] == 150-SPB = 19200 # samples per beat (0.4 s)-S16 = SPB // 4 # samples per 16th (0.1 s)-BARS = 4 * SPB # samples per bar (1.6 s)-N = int(round(163.6 * SR)) # render length (final hit rings ~2 s past 161.6)-MUSIC_END = int(round(TL['duration'] * SR))-FADE_START = int(round(161.0 * SR))-SHOTS = TL['shots']---def T(bar, step=0.0):- return int(round(bar * BARS + step * S16))---def mtof(m):- return 440.0 * 2 ** ((m - 69) / 12.0)---def log(*a):- print(f'[{time.time() - T_START:6.1f}s]', *a, flush=True)---# ---------------------------------------------------------------- DSP utils-_SOS = {}---def sos(kind, fc, order=2):- key = (kind, fc if np.isscalar(fc) else tuple(fc), order)- if key not in _SOS:- ny = SR / 2- if kind == 'bp':- _SOS[key] = signal.butter(order, [fc[0] / ny, fc[1] / ny], 'bandpass', output='sos')- elif kind == 'lp':- _SOS[key] = signal.butter(order, fc / ny, 'lowpass', output='sos')- else:- _SOS[key] = signal.butter(order, fc / ny, 'highpass', output='sos')- return _SOS[key]---def filt(x, kind, fc, order=2):- return signal.sosfilt(sos(kind, fc, order), x, axis=-1)---def tt(n):- return np.arange(n) / SR---def nz(n, seed):- return np.random.default_rng(seed).standard_normal(n)---def normp(x, p=1.0):- m = np.max(np.abs(x))- return x * (p / m) if m > 0 else x---def fade_end(x, sec=0.004):- k = min(x.shape[-1], int(sec * SR))- x[..., x.shape[-1] - k:] *= np.linspace(1, 0, k)- return x---def saw(f, n, ph0=0.0):- """PolyBLEP band-limited saw."""- dt = f / SR- ph = (ph0 + dt * np.arange(n)) % 1.0- y = 2 * ph - 1- m = ph < dt- x = ph[m] / dt- y[m] -= x + x - x * x - 1- m = ph > 1 - dt- x = (ph[m] - 1) / dt- y[m] -= x * x + x + x + 1- return y---def rbj(kind, fc, q):- w = 2 * np.pi * min(fc, SR * 0.45) / SR- al = np.sin(w) / (2 * q)- c = np.cos(w)- if kind == 'bp':- b = np.array([al, 0.0, -al])- else: # lp- b = np.array([(1 - c) / 2, 1 - c, (1 - c) / 2])- a = np.array([1 + al, -2 * c, 1 - al])- return b / a[0], a / a[0]---def tv_filter(x, fcs, q, kind='bp', block=128):- """Time-varying biquad (block-wise coefficient updates, state carried)."""- y = np.zeros_like(x)- zi = np.zeros(2)- for i in range(0, len(x), block):- fc = fcs[min(i + block // 2, len(x) - 1)]- b, a = rbj(kind, fc, q)- y[i:i + block], zi = signal.lfilter(b, a, x[i:i + block], zi=zi)- return y---def pan2(x, pan):- th = (np.clip(pan, -1, 1) + 1) * np.pi / 4- return np.vstack([x * np.cos(th), x * np.sin(th)]) * np.sqrt(2)---# ---------------------------------------------------------------- buses-BUS_NAMES = ['kick', 'taiko', 'perc', 'drumsF', 'bass', 'pad', 'sham', 'koto', 'fx', 'sfx']-BUS = {k: np.zeros((2, N), np.float32) for k in BUS_NAMES}---def add(bus, x, s, gain=1.0, pan=0.0):- if x.ndim == 1:- x = pan2(x, pan)- n = x.shape[1]- a, b, xa = s, s + n, 0- if a < 0:- xa, a = -a, 0- b = min(b, N)- if b <= a:- return- BUS[bus][:, a:b] += (x[:, xa:xa + (b - a)] * gain).astype(np.float32)---# ---------------------------------------------------------------- one-shot drum synthesis-def taiko(f0, f1, decay, tau_p=0.03, p2=1.5, p2amt=0.35, skin=0.5, stick=0.25,- skin_band=(120, 1600), seed=0):- """Pitched membrane: sine with fast pitch drop + 2nd/3rd modes, skin noise, stick transient."""- n = int(decay * 6 * SR)- t = tt(n)- f = f1 + (f0 - f1) * np.exp(-t / tau_p)- ph = 2 * np.pi * np.cumsum(f) / SR- x = np.sin(ph) * np.exp(-t / decay)- x += p2amt * np.sin(p2 * ph + 0.3) * np.exp(-t / (decay * 0.3))- x += 0.12 * np.sin(2.7 * ph + 1.1) * np.exp(-t / (decay * 0.12))- w = nz(n, seed)- x += filt(w, 'bp', skin_band) * np.exp(-t / 0.03) * skin- x += filt(w, 'hp', 2500) * np.exp(-t / 0.004) * stick- return normp(np.tanh(1.3 * normp(x)))---def ka_click(seed):- n = int(0.12 * SR)- t = tt(n)- x = filt(nz(n, seed), 'bp', (1800, 5000)) * np.exp(-t / 0.006)- x += 0.5 * np.sin(2 * np.pi * 1100 * t) * np.exp(-t / 0.012)- return normp(x)---def kick(seed):- n = int(0.7 * SR)- t = tt(n)- f = 46 + (170 - 46) * np.exp(-t / 0.035)- ph = 2 * np.pi * np.cumsum(f) / SR- x = np.sin(ph) * np.exp(-t / 0.22)- x += filt(nz(n, seed), 'hp', 3000) * np.exp(-t / 0.0025) * 0.35- x += 0.3 * np.sin(2 * np.pi * 1200 * t) * np.exp(-t / 0.004)- return normp(np.tanh(1.6 * x))---def clap(seed):- n = int(0.45 * SR)- t = tt(n)- w = filt(nz(n, seed), 'bp', (900, 3200))- env = np.zeros(n)- for d in (0.0, 0.009, 0.018):- env += np.where(t >= d, np.exp(-(t - d) / 0.006), 0)- env += 0.6 * np.where(t >= 0.024, np.exp(-(t - 0.024) / 0.12), 0)- return normp(w * env)---def snare(seed):- n = int(0.5 * SR)- t = tt(n)- x = 0.6 * np.sin(2 * np.pi * 190 * t) * np.exp(-t / 0.07)- x += filt(nz(n, seed), 'bp', (1200, 9000)) * np.exp(-t / 0.13)- return normp(x)---def hat(decay, seed):- n = int(max(0.2, decay * 6) * SR)- t = tt(n)- rng = np.random.default_rng(seed)- fr = np.array([205.3, 304.4, 369.6, 522.7, 540.0, 800.0]) * rng.uniform(0.98, 1.02)- sq = sum(np.sign(np.sin(2 * np.pi * f * t + rng.random() * 6.28)) for f in fr)- x = filt(sq, 'hp', 7000, 4) * 0.5 + filt(nz(n, seed + 99), 'hp', 9000) * 0.4- return normp(x * np.exp(-t / decay))---def shaker(seed):- n = int(0.12 * SR)- t = tt(n)- env = np.minimum(1, t / 0.006) * np.exp(-t / 0.035)- return normp(filt(nz(n, seed), 'bp', (4000, 10000)) * env)---def crash(seed, decay=1.5):- n = int(decay * 4 * SR)- t = tt(n)- rng = np.random.default_rng(seed)- x = filt(nz(n, seed), 'hp', 3000) * 0.7- fr = rng.uniform(3000, 11000, 30)- m = sum(np.sin(2 * np.pi * f * t + rng.random() * 6.28) for f in fr) / np.sqrt(30) * 0.5- x = (x + filt(m, 'hp', 2500)) * np.exp(-t / decay)- x += filt(nz(n, seed + 1), 'bp', (800, 4000)) * np.exp(-t / 0.03) * 0.8- return normp(x)---def tick(f, seed):- n = int(0.06 * SR)- t = tt(n)- x = np.sin(2 * np.pi * f * t) * np.exp(-t / 0.004) + filt(nz(n, seed), 'hp', 4000) * np.exp(-t / 0.0015) * 0.6- return normp(x)---def pok(seed):- n = int(0.15 * SR)- t = tt(n)- x = np.sin(2 * np.pi * 1350 * t) * np.exp(-t / 0.03) + 0.35 * np.sin(2 * np.pi * 2650 * t) * np.exp(-t / 0.01)- x += 0.4 * np.sin(2 * np.pi * 780 * t) * np.exp(-t / 0.02)- x += filt(nz(n, seed), 'hp', 3000) * np.exp(-t / 0.0015) * 0.5- return normp(x)---def clank(seed):- n = int(1.4 * SR)- t = tt(n)- x = np.zeros(n)- for r, d, a in zip([1, 2.76, 5.40, 8.93, 13.34], [0.9, 0.5, 0.3, 0.15, 0.08], [1, .6, .4, .3, .2]):- x += a * np.sin(2 * np.pi * 420 * r * t) * np.exp(-t / d)- x += filt(nz(n, seed), 'bp', (1500, 7000)) * np.exp(-t / 0.004)- return normp(x)---def splash(seed):- n = int(0.8 * SR)- t = tt(n)- x = filt(nz(n, seed), 'bp', (700, 6000)) * np.minimum(1, t / 0.002) * np.exp(-t / 0.15)- rng = np.random.default_rng(seed)- for k in range(4):- d = rng.uniform(0.01, 0.12)- f = 600 + 1400 * (1 - np.exp(-np.maximum(t - d, 0) / 0.02))- x += 0.3 * np.where(t >= d, np.sin(2 * np.pi * np.cumsum(f) / SR) * np.exp(-(t - d) / 0.03), 0)- return normp(x)---def drop(seed):- rng = np.random.default_rng(seed)- n = int(0.25 * SR)- t = tt(n)- f0 = rng.uniform(650, 1100)- f = f0 + f0 * 1.8 * (1 - np.exp(-t / 0.02))- return normp(np.sin(2 * np.pi * np.cumsum(f) / SR) * np.exp(-t / 0.05))---def pulse(seed):- n = int(0.5 * SR)- t = tt(n)- x = np.sin(2 * np.pi * 58 * t) * np.exp(-t / 0.15) + 0.4 * np.sin(2 * np.pi * 116 * t) * np.exp(-t / 0.08)- x += filt(nz(n, seed), 'bp', (200, 800)) * np.exp(-t / 0.01) * 0.3- return normp(x)---def crack(seed):- n = int(0.08 * SR)- t = tt(n)- x = np.tanh(3 * filt(nz(n, seed), 'hp', 1200) * np.exp(-t / 0.006))- x += 0.4 * np.sin(2 * np.pi * 2300 * t) * np.exp(-t / 0.008)- return normp(x)---def tile(seed):- n = int(0.1 * SR)- t = tt(n)- x = filt(nz(n, seed), 'bp', (2000, 7000)) * np.exp(-t / 0.008) + 0.5 * np.sin(2 * np.pi * 1900 * t) * np.exp(-t / 0.012)- return normp(x)---log('building one-shot bank')-BANK = {- 'nagado': [taiko(140 * r, 60 * r, 0.36, p2amt=.5, skin=.65, stick=.35, seed=i) for i, r in enumerate([1.0, .96, 1.04, .93, 1.07])],- 'odaiko': [taiko(108 * r, 46 * r, 0.8, tau_p=0.05, p2=1.45, p2amt=.3, skin=.55, stick=.12,- skin_band=(80, 900), seed=20 + i) for i, r in enumerate([1.0, .95, 1.05])],- 'shime': [taiko(560 * r, 430 * r, 0.07, tau_p=.008, p2=1.62, p2amt=.45, skin=.9, stick=.7,- skin_band=(1200, 6000), seed=40 + i) for i, r in enumerate([1.0, 1.03, .97])],- 'ka': [ka_click(60 + i) for i in range(3)],- 'kick': [kick(70 + i) for i in range(2)],- 'clap': [clap(80 + i) for i in range(3)],- 'snare': [snare(90 + i) for i in range(3)],- 'hat': [hat(0.035, 100 + i) for i in range(4)],- 'ohat': [hat(0.28, 110 + i) for i in range(2)],- 'shaker': [shaker(120 + i) for i in range(4)],- 'crash': [crash(130 + i) for i in range(2)],- 'tick': [tick(3200, 140 + i) for i in range(2)],- 'tock': [tick(2350, 145 + i) for i in range(2)],- 'pok': [pok(150 + i) for i in range(3)],- 'clank': [clank(160 + i) for i in range(2)],- 'splash': [splash(170 + i) for i in range(3)],- 'drop': [drop(180 + i) for i in range(6)],- 'pulse': [pulse(190)],- 'tile': [tile(200 + i) for i in range(3)],- 'crack': [crack(210 + i) for i in range(3)],-}-IG = dict(kick=.9, odaiko=.95, nagado=.75, shime=.32, ka=.28, clap=.42, snare=.45, hat=.13, ohat=.10,- shaker=.07, crash=.28, tick=.22, tock=.16, pok=.40, clank=.30, splash=.30, drop=.14, pulse=.35, tile=.24, crack=.30)-DEFAULT_BUS = dict(kick='kick', odaiko='taiko', nagado='taiko', shime='taiko', ka='taiko')--# ---------------------------------------------------------------- event store-EV = {} # (inst, sample, slot, bus) -> [vel, pan]-SHAM, KOTO, BASS, STABS, IMPACTS, RISERS, DRONES, GAPS = [], [], [], [], [], [], [], []---def hit(inst, s, vel=1.0, pan=0.0, bus=None, slot=0):- if s < 0 or s >= N or vel <= 0:- return- key = (inst, int(s), slot, bus or DEFAULT_BUS.get(inst, 'perc'))- if key in EV:- EV[key][0] = max(EV[key][0], vel)- else:- EV[key] = [vel, pan]---def pat(inst, bar, p, vel=1.0, pan=0.0, bus=None, slot=0, alt_pan=0.0):- j = 0- for k, c in enumerate(p):- if c == '.':- continue- v = 1.0 if c == 'X' else 0.6 if c == 'x' else int(c) / 9- hit(inst, T(bar, k), v * vel, pan + (alt_pan if j % 2 else -alt_pan), bus, slot)- j += 1---# ---------------------------------------------------------------- harmony-PROG = {}---def setp(b0, seq):- for i, c in enumerate(seq):- PROG[b0 + i] = c---L4 = ['Dm', 'Bb', 'Gm', 'Asus']-setp(0, ['D5'] * 4 + L4 + ['Bb', 'Gm', 'Eb', 'Asus'])-setp(12, L4 * 4)-setp(28, ['Bb', 'Gm', 'Dm', 'Eb', 'Bb', 'Gm', 'Asus'])-setp(35, L4 * 3 + ['Eb', 'Gm', 'Asus'])-setp(50, ['Dm', 'Dm', 'Eb', 'Dm'] * 2 + ['Bb', 'Eb', 'Asus'])-setp(61, ['D5', 'D5', 'Deb', 'D5', 'Gm', 'Gm', 'Eb', 'Eb', 'Asus'])-setp(70, L4 * 2 + ['Eb', 'Asus'])-setp(80, L4 * 2 + ['Eb'])-setp(89, L4 + ['Dm', 'Bb', 'Gm', 'Eb', 'Asus'] + ['D5'] * 3)-assert sorted(PROG) == list(range(101))--ROOT = dict(Dm=38, Bb=34, Gm=31, Asus=33, Eb=39, D5=38, Deb=38)-PAD_V = dict(Dm=[50, 57, 62, 65, 69], Bb=[53, 58, 62, 65, 70], Gm=[55, 58, 62, 67, 70],- Asus=[52, 57, 62, 64, 69], Eb=[51, 58, 63, 67, 70], D5=[50, 57, 62, 69],- Deb=[50, 57, 63, 69])-ARP = dict(Dm=[62, 69, 70, 74, 81], Bb=[58, 62, 67, 70, 74], Gm=[55, 62, 67, 70, 74],- Asus=[57, 62, 67, 69, 74], Eb=[63, 67, 70, 75, 79], D5=[62, 69, 74, 81, 86],- Deb=[62, 63, 69, 74, 75])-SEQ = [0, 1, 2, 3, 4, 3, 2, 1]--# the hook: 2-bar shamisen motif (A+B), answered by A + C. (step16, midi, vel, len16)-HOOK = {- 'A': [(0, 74, 1.0, 3), (3, 74, .8, 3), (6, 69, .85, 2), (8, 70, .9, 2), (10, 69, .75, 2), (12, 67, .8, 2), (14, 69, .7, 2)],- 'B': [(0, 74, 1.0, 3), (3, 75, .85, 3), (6, 74, .85, 2), (8, 70, .9, 2), (10, 69, .75, 2), (12, 67, .9, 4)],- 'C': [(0, 69, .9, 3), (3, 69, .7, 3), (6, 67, .8, 2), (8, 69, .85, 2), (10, 74, .9, 2), (12, 75, .8, 1),- (13, 74, .7, 1), (14, 70, .75, 1), (15, 69, .7, 1)],-}-PHRASE = ['A', 'B', 'A', 'C']-COUNTER = {- 'Dm': [(0, 81, 6, ('from', 2, .12)), (8, 79, 4, None), (12, 81, 4, None)],- 'Bb': [(0, 82, 8, None), (8, 81, 8, ('vib',))],- 'Gm': [(0, 79, 8, None), (8, 82, 4, None), (12, 81, 4, None)],- 'Asus': [(0, 81, 8, ('vib',)), (8, 86, 8, ('from', 1, .1))],- 'Eb': [(0, 79, 8, None), (8, 82, 8, ('vib',))],-}-COMBAT_RIFF = [(0, 62, 1.0, 2), (2, 62, .6, 1), (3, 74, .8, 1), (4, 62, .7, 2), (6, 63, .8, 1), (7, 62, .6, 1),- (8, 62, .9, 2), (10, 67, .8, 1), (11, 69, .8, 1), (12, 62, .7, 2), (14, 70, .8, 1), (15, 69, .7, 1)]---def sham_notes(bar, notes, trans=0, vel=1.0, pan=0.1):- for st, m, v, l in notes:- SHAM.append((T(bar, st), m + trans, v * vel, l * 0.1, pan))---def koto_notes(bar, notes, trans=0, vel=1.0, pan=-0.15):- for nt in notes:- st, m, v, l = nt[:4]- bend = nt[4] if len(nt) > 4 else None- KOTO.append((T(bar, st), m + trans, v * vel, l * 0.1, pan, bend))---def hook_bar(bar, part, inst='sham', oct=0, vel=1.0):- if inst == 'sham':- sham_notes(bar, HOOK[part], 12 * oct, vel)- else:- koto_notes(bar, HOOK[part], 12 * oct, vel, pan=-0.25)---def koto_arp(bar, rate=1, oct=0, vel=0.3, spread=0.5):- tones = ARP[PROG[bar]]- for j, k in enumerate(range(0, 16, rate)):- m = tones[SEQ[j % 8]] + 12 * oct- acc = 1.0 if k % 4 == 0 else 0.75- KOTO.append((T(bar, k), m, vel * acc, rate * 0.15, spread if j % 2 else -spread, None))---def koto_counter(bar, vel=0.5):- for st, m, l, bend in COUNTER[PROG[bar]]:- KOTO.append((T(bar, st), m, vel, l * 0.1, 0.3, bend))---def bass_bar(bar, patt, vel=1.0, soft=False):- r = ROOT[PROG[bar]]- for st, l, o in patt:- BASS.append((T(bar, st), r + 12 * o, vel, l * 0.1 - 0.012, soft))---DRIVE = [(0, 3, 0), (3, 3, 0), (6, 2, 1), (8, 3, 0), (11, 3, 0), (14, 2, 1)]-HALF = [(0, 6, 0), (10, 4, 0)]-GROOVE = [(0, 2, 0), (3, 2, 1), (6, 3, 0), (10, 2, 0), (11, 2, 1), (13, 3, 0)]-COMBAT = [(0, 5, 0), (6, 2, 0), (8, 5, 0), (14, 2, 1)]-ROLL = [(k, 2, (k // 2) % 2) for k in range(0, 16, 2)]-FIN = [(0, 4, 0), (4, 4, 0), (8, 4, 0), (12, 4, 0)]-SUST = [(0, 16, 0)]---# ---------------------------------------------------------------- drum grooves-def fill_taiko(bar, big=1.0):- for k, (st, v) in enumerate(zip([8, 10, 12, 13, 14, 15], [.55, .65, .7, .8, .9, 1.0])):- hit('nagado', T(bar, st), v * big, -.35 if k % 2 else .35, slot=1)- for st, v in zip([12, 13, 14, 15], [.4, .55, .7, .85]):- hit('shime', T(bar, st), v)- hit('odaiko', T(bar, 8), .7)---def fill_soft(bar):- for st, v in zip([12, 14, 15], [.35, .45, .55]):- hit('nagado', T(bar, st), v, .2 if st % 2 else -.2, slot=1)- koto_notes(bar, [(12, 62, .4, 1), (13, 67, .42, 1), (14, 69, .45, 1), (15, 74, .5, 1)])---def fill_tick(bar):- for st in range(8, 16):- hit('tick', T(bar, st), .3 + .6 * (st - 8) / 7, .3 if st % 2 else -.3)- hit('odaiko', T(bar, 12), .6)- hit('nagado', T(bar, 14), .6, slot=1)- hit('nagado', T(bar, 15), .8, slot=1)---def fill_heavy(bar):- hit('odaiko', T(bar, 8), .9)- hit('odaiko', T(bar, 12), 1.0, slot=1)- for st in range(8, 16):- hit('nagado', T(bar, st), .5 + .5 * (st - 8) / 7, -.3 if st % 2 else .3, slot=1)- for st in range(12, 16):- hit('snare', T(bar, st), .4 + .5 * (st - 12) / 3)---def groove_half(bar):- pat('kick', bar, 'X.........X.....')- pat('snare', bar, '........X.......', .9)- pat('hat', bar, '5.3.5.3.5.3.5.3.')- pat('nagado', bar, 'X.....6.......5.')- pat('ka', bar, '....5.......5...')- pat('shaker', bar, '2323232323232323')---def groove_drive(bar, i, strong=False, fill=False):- h = 8 if fill else 16- pat('kick', bar, 'X...X...X...X...')- pat('clap', bar, '....X.......X...', .85)- pat('hat', bar, '4262426242624262')- pat('ohat', bar, '..6...6...6...6.')- pat('nagado', bar, 'X.....7...8...6.'[:h])- pat('ka', bar, '...5.......5....'[:h])- if strong or i % 2 == 0:- pat('odaiko', bar, ('X.......' + ('....6...' if strong else '........'))[:h])- if strong:- pat('shime', bar, '3232323232323232'[:h], alt_pan=.2)- if fill:- fill_taiko(bar)---def groove_ball(bar, fill=False):- h = 8 if fill else 16- pat('kick', bar, 'X..8..7...X..6..')- pat('clap', bar, '....X.......X...', .85)- pat('hat', bar, '4262426242624262')- pat('ohat', bar, '..........6.....')- pat('shaker', bar, '3232323232323232')- pat('nagado', bar, 'X......6...5..6.'[:h])- pat('ka', bar, '..5...5.....5...'[:h])- if fill:- fill_taiko(bar)---def rackets_drums(bar):- pat('kick', bar, 'X.......X.......')- pat('hat', bar, '4262426242624262')- pat('ohat', bar, '..5.......5.....')- pat('nagado', bar, '......5.......5.', alt_pan=.4)- pat('clap', bar, '....7.......7...')- pat('shaker', bar, '3232323232323232')- pat('shime', bar, '......4.......4.')---def aqua_drums(bar, fill=False):- pat('kick', bar, 'X.........X.....', .8, bus='drumsF')- pat('shaker', bar, '4545454545454545', 1.3, bus='drumsF')- pat('hat', bar, '..5...5...5...5.', bus='drumsF')- pat('ka', bar, '....6.......6...', bus='drumsF')- pat('nagado', bar, '........5.......', .6, bus='drumsF')- if fill:- fill_soft(bar)---def combat_drums(bar, fill=False):- h = 8 if fill else 16- pat('odaiko', bar, 'X.......X.......'[:h])- pat('nagado', bar, 'X..6.7X.X..6.7X8'[:h], alt_pan=.3)- pat('shime', bar, '5.3.5.3.5.3.5.3.'[:h])- pat('kick', bar, 'X.....7.X..7....')- pat('snare', bar, '....X.......X...', .9)- pat('hat', bar, '..5...5...5...5.')- pat('ka', bar, '..6.......6.....')- if fill:- fill_heavy(bar)---def roll_drums(bar, i, fill=False):- h = 8 if fill else 16- pat('nagado', bar, 'X.5.8.5.X.5.8.5.'[:h], alt_pan=.3)- pat('odaiko', bar, 'X...............')- pat('shime', bar, '3333333333333333'[:h], .8, alt_pan=.2)- if i >= 4:- pat('kick', bar, 'X...X...X...X...')- pat('clap', bar, '....X.......X...', .8)- if i >= 6:- pat('hat', bar, '4262426242624262')- pat('ohat', bar, '..5...5...5...5.')- if fill:- fill_taiko(bar)---def finale_beats(bar):- pat('kick', bar, 'X...X...X...X...')- pat('nagado', bar, 'X...X...X...X...', alt_pan=.3)- pat('tile', bar, 'X...X...X...X...', alt_pan=.5)- pat('odaiko', bar, 'X.......X.......')- pat('clap', bar, '....X.......X...')- pat('hat', bar, '4262426242624262')- pat('ohat', bar, '..6...6...6...6.')- pat('shime', bar, '3434343434343434', alt_pan=.2)---def shime_roll(bar, steps, v0, v1, snare_too=False):- for k, st in enumerate(steps):- v = v0 + (v1 - v0) * k / max(1, len(steps) - 1)- hit('shime', T(bar, st), v, .25 if k % 2 else -.25)- if snare_too:- hit('snare', T(bar, st), v * .6)---# ---------------------------------------------------------------- accents & big hits-def big_hit(s, size=1.0, crash_=True, sub=True, stab=None, gap=True):- ens = [('odaiko', -.35, 1.0), ('odaiko', .35, .95), ('nagado', -.55, .9), ('nagado', 0, 1.0),- ('nagado', .55, .9), ('shime', .2, .6)]- for k, (inst, pan, v) in enumerate(ens):- hit(inst, s, v * min(size, 1.2), pan, bus='fx', slot=10 + k)- hit('kick', s, 1.0)- hit('crack', s, 1.0, slot=20)- IMPACTS.append((s, size, crash_, sub))- if stab:- STABS.append((s, stab, min(size, 1.2)))- if gap:- GAPS.append(s)---def card_accent(sh, idx):- s = sh['b0'] * SPB- assert abs(s - sh['t0'] * SR) < 2, sh- chap, two = sh['chap'], sh['beats'] == 2- pan = .25 if idx % 2 else -.25- hit('kick', s, 1.0)- hit('nagado', s, 1.0, 0, slot=2)- hit('crack', s, 1.0, -pan)- bar = sh['b0'] // 4- if chap == 'ath':- hit('crash', s, .3, pan)- hit('ka', s, .6)- elif chap == 'aqua':- hit('splash', s, .9 if two else .7, pan)- hit('drop', s, .6, -pan * 2)- elif chap == 'ball':- if two:- hit('pok', s, 1.0, pan * 2.4)- hit('shime', s, .6)- else:- hit('clap', s, .8)- hit('ohat', s, .5)- elif chap == 'combat':- hit('odaiko', s, 1.0)- hit('snare', s, .7)- STABS.append((s, PROG[bar], .8))- elif chap == 'power':- hit('odaiko', s, .9)- hit('clank', s, .8, pan)- elif chap == 'nature':- if two:- hit('crash', s, .35, pan * 2)- hit('shime', s, .7)- else:- hit('ohat', s, .6)- hit('odaiko', s, .6)- elif chap == 'asia':- hit('crash', s, .45, pan)- hit('odaiko', s, .8)---# ---------------------------------------------------------------- composition-SEC_START = {'intro': 0}-for sh in SHOTS:- if sh['kind'] in ('chapter', 'finale'):- SEC_START[sh['chap']] = sh['b0'] // 4-EXPECTED = dict(intro=0, ath=12, aqua=28, ball=35, combat=50, power=61, nature=70, asia=80, finale=89)-assert SEC_START == EXPECTED, f'timeline section layout changed: {SEC_START}'-SEC_OF = {}-for name, b0 in sorted(SEC_START.items(), key=lambda kv: kv[1]):- for b in range(b0, 101):- SEC_OF[b] = name---def compose():- rng = np.random.default_rng(7)- # ---------- INTRO (bars 0-11)- DRONES.append((0, T(4) + int(0.4 * SR), 1.0))- IMPACTS.append((0, 0.5, False, True)) # red sun ignites: sub bloom under the heartbeat- for bar in (0, 1, 2):- pat('odaiko', bar, 'X..5....7..4....')- pat('odaiko', 3, 'X..4..5.7.5.7.6.', .85)- pat('nagado', 3, '........4.5.6.7.')- RISERS.append((T(4), 3.2, 'swell', 0.55))- SHAM.extend([(T(2, 0), 74, .55, .6, .2), (T(2, 8), 69, .4, .4, -.2),- (T(3, 0), 74, .5, .3, .1), (T(3, 3), 74, .4, .3, .1), (T(3, 6), 69, .45, .4, .1)])- KOTO.append((T(3, 10), 74, .4, .6, -.3, ('up', 1, .12, .1)))- big_hit(T(4), 1.0, stab='Dm')- teaser_sham = {4: [(0, 74, 1, 3), (3, 74, .8, 3), (6, 69, .85, 4)],- 5: [(0, 70, .9, 3), (3, 69, .8, 3), (6, 67, .8, 4)],- 6: [(0, 74, 1, 3), (3, 74, .8, 3), (6, 69, .85, 2), (8, 70, .9, 2), (10, 69, .75, 2), (12, 67, .8, 4)],- 7: [(0, 67, .9, 3), (3, 69, .8, 5)]}- teaser_koto = {4: [(12, 70, .6, 2), (14, 69, .55, 2)], 5: [(12, 62, .55, 4, ('from', 2, .15))],- 6: [], 7: [(8, 69, .5, 2, ('up', 1, .05, .08)), (12, 62, .45, 1), (13, 67, .5, 1), (14, 69, .55, 1), (15, 74, .6, 1)]}- for bar in range(4, 8):- groove_half(bar)- bass_bar(bar, HALF)- sham_notes(bar, teaser_sham[bar], vel=.9)- koto_notes(bar, teaser_koto[bar])- koto_arp(bar, 2, 0, .22, .45)- pat('nagado', 7, '............567.', alt_pan=.3)- for bar in (8, 9, 10):- big_hit(T(bar), 0.85, crash_=True, sub=True, stab=PROG[bar], gap=False)- bass_bar(bar, SUST, .8)- pat('pulse', bar, '....X...X...X...', .6)- pat('hat', 8, '..4...4...4...4.')- koto_arp(8, 2, 0, .28)- pat('hat', 9, '2424242424242424')- pat('ka', 9, '....5.......5...')- koto_arp(9, 1, 0, .28)- pat('hat', 10, '3535353535353535')- pat('ohat', 10, '..4...4...4...4.')- pat('kick', 10, '........X.......')- pat('nagado', 10, '........6...6.6.', alt_pan=.3)- koto_arp(10, 1, 1, .3)- # bar 11: build - accelerating shime/snare roll + riser; last half-beat silent (gap from big_hit at 12)- roll_steps = [0, 2, 4, 5, 6, 7, 8, 8 + 2 / 3, 8 + 4 / 3, 10, 10 + 2 / 3, 10 + 4 / 3, 12, 12.5, 13, 13.5]- shime_roll(11, roll_steps, .3, 1.0, snare_too=True)- pat('kick', 11, 'X...X...X...X...', .85)- for st in range(14):- hit('hat', T(11, st), .2 + .5 * st / 13)- SHAM.append((T(11, st), 74, .22 + .05 * st, .1, .1 if st % 2 else -.1))- bass_bar(11, [(0, 14, 0)], .85)- RISERS.append((T(12), 1.6, 'build', 1.0))-- # ---------- CH1 ATHLETICS (12-27): the drop, main theme- for bar in range(12, 28):- i = bar - 12- groove_drive(bar, i, strong=(i >= 12), fill=(i == 1))- bass_bar(bar, DRIVE)- hook_bar(bar, PHRASE[i % 4], vel=1.0)- if 4 <= i < 8:- koto_arp(bar, 1, 0, .24)- elif 8 <= i < 12:- koto_counter(bar, .5)- elif i >= 12:- hook_bar(bar, PHRASE[i % 4], inst='koto', oct=1, vel=.38)- koto_arp(bar, 2, 1, .16)- hit('crash', T(20), .45, -.3)- hit('crash', T(24), .5, .3)- RISERS.append((T(28), 1.6, 'sweep', .5))-- # ---------- CH2 AQUATICS (28-34): flowing, filtered drums, koto arps, water- for bar in range(28, 35):- i = bar - 28- aqua_drums(bar, fill=(i == 1))- bass_bar(bar, SUST, .55, soft=True)- koto_arp(bar, 1, 0 if i % 2 == 0 else 1, .38, .65)- for st in rng.choice(np.arange(1, 16), 3, replace=False):- hit('drop', T(bar, int(st)), rng.uniform(.4, .8), rng.uniform(-.7, .7))- koto_notes(32, [(0, 74, .55, 6, ('vib',)), (8, 75, .45, 4), (12, 74, .45, 4)], pan=.1)- koto_notes(33, [(0, 70, .55, 8), (8, 69, .5, 8, ('vib',))], pan=.1)- koto_notes(34, [(0, 67, .5, 4, ('up', 2, .1, .15)), (8, 69, .5, 8)], pan=.1)- RISERS.append((T(35), 1.6, 'sweep', .45))-- # ---------- CH3 BALL GAMES (35-49): groovy, call & response, rackets 46-48- for bar in range(35, 50):- i = bar - 35- if 11 <= i <= 13:- rackets_drums(bar)- bass_bar(bar, [(0, 3, 0), (8, 3, 0)])- else:- groove_ball(bar, fill=(i == 1))- bass_bar(bar, GROOVE)- if i in (0, 1):- sham_notes(bar, [(2, 62, .55, 1), (6, 62, .45, 1), (10, 62, .55, 1), (14, 69, .5, 1)])- elif i == 2:- hook_bar(bar, 'A')- elif i == 3:- hook_bar(bar, 'C')- elif 4 <= i <= 7:- hook_bar(bar, PHRASE[i - 4])- elif i == 8 or i == 10:- hook_bar(bar, 'A')- elif i == 9: # koto answers with oshide bends- koto_notes(bar, [(0, 74, .7, 3), (3, 74, .6, 3, ('up', 1, .05, .06)), (6, 74, .6, 2), (8, 70, .65, 2),- (10, 69, .55, 2), (12, 67, .65, 4, ('vib',))], pan=-.3)- elif 11 <= i <= 13: # rackets: ping-pong pings on every 2-beat cut- hi_, lo_ = (81, 74) if bar % 2 else (74, 81)- sham_notes(bar, [(0, hi_, .8, 1), (8, lo_, .8, 1)], pan=.35 if bar % 2 else -.35)- koto_notes(bar, [(4, 86, .28, 2), (12, 81, .28, 2)], pan=-.4 if bar % 2 else .4)- elif i == 14:- hook_bar(bar, 'C')- if 4 <= i <= 10:- koto_arp(bar, 2, 1, .18)- RISERS.append((T(50), 1.6, 'sweep', .55))-- # ---------- CH4 COMBAT (50-60): heaviest taiko, stabs- for bar in range(50, 61):- i = bar - 50- combat_drums(bar, fill=(i == 1))- bass_bar(bar, COMBAT)- tr = {'Eb': 1, 'Bb': -4, 'Asus': -5}.get(PROG[bar], 0)- sham_notes(bar, COMBAT_RIFF, tr, .8, pan=-.1)- RISERS.append((T(61), 1.6, 'rev', .6))-- # ---------- CH5 POWER & PRECISION (61-69): breakdown, clock ticks, suspense- for bar in range(61, 70):- i = bar - 61- if i == 0:- pat('tick', bar, '........7...7...')- pat('tock', bar, '..........4...4.')- elif i == 1:- pat('tick', bar, '7...7...')- pat('tock', bar, '..4...4.')- fill_tick(bar)- else:- pat('tick', bar, '7...7...7...7...', alt_pan=.15)- pat('tock', bar, '..4...4...4...4.', alt_pan=.15)- pat('pulse', bar, 'X...X...X...X...', .8)- bass_bar(bar, SUST, .6, soft=True)- if i >= 6:- pat('hat', bar, '2323232323232323', (i - 5) * .35)- if i == 8:- pat('kick', bar, 'X...X...X...X...', .8)- shime_roll(bar, [8, 9, 10, 11, 12, 13], .3, .9)- koto_notes(63, [(0, 74, .5, 8, ('up', 1, .25, .2))], pan=.3)- koto_notes(65, [(0, 69, .45, 8, ('vib',))], pan=-.3)- koto_notes(67, [(0, 70, .5, 8, ('up', -1, .3, .25))], pan=.3)- koto_notes(69, [(0, 75, .5, 4), (8, 74, .5, 4)], pan=-.2)- for bar in (64, 66, 68):- sham_notes(bar, [(8, 62, .5, 2)], pan=-.2)- RISERS.append((T(70), 3.2, 'sweep', .65))-- # ---------- CH6 LAND & SEA (70-79): rebuild, rolling momentum- for bar in range(70, 80):- i = bar - 70- roll_drums(bar, i, fill=(i == 1))- bass_bar(bar, SUST if i < 2 else ROLL, .85 if i < 2 else 1.0, soft=(i < 2))- koto_arp(bar, 2, 0 if i < 4 else 1, .28)- if i == 2:- hook_bar(bar, 'A', inst='koto', vel=.55)- elif i == 3:- hook_bar(bar, 'C', inst='koto', vel=.55)- elif 4 <= i <= 7:- hook_bar(bar, PHRASE[i - 4])- elif i == 8:- hook_bar(bar, 'B')- elif i == 9:- hook_bar(bar, 'C')- RISERS.append((T(80), 1.6, 'sweep', .6))-- # ---------- CH7 ASIA & NEW WAVE (80-88): peak, final chorus- for bar in range(80, 89):- i = bar - 80- groove_drive(bar, i, strong=True, fill=(i == 1))- bass_bar(bar, DRIVE + [(15, 1, 1)])- if i < 8:- hook_bar(bar, PHRASE[i % 4])- if i >= 4:- hook_bar(bar, PHRASE[i % 4], oct=-1, vel=.45)- else:- hook_bar(bar, 'B')- if i < 4:- hook_bar(bar, PHRASE[i % 4], inst='koto', oct=1, vel=.38)- elif i < 8:- koto_counter(bar, .5)- koto_arp(bar, 1, 1, .15)- else:- koto_arp(bar, 1, 1, .2)- hit('crash', T(84), .5, .3)- RISERS.append((T(89), 1.6, 'build', .8))-- # ---------- FINALE (89-100)- for bar in range(89, 93):- i = bar - 89- finale_beats(bar)- bass_bar(bar, FIN)- hook_bar(bar, PHRASE[i])- hook_bar(bar, PHRASE[i], oct=-1, vel=.45)- hook_bar(bar, PHRASE[i], inst='koto', oct=1, vel=.4)- RISERS.append((T(93), 1.6, 'rev', .7))- big_hit(T(93), 1.25, stab='Dm')- KOTO.append((T(93), 86, .5, 3.0, .2, ('vib',)))- BASS.append((T(93), 38, .9, 3.0, True))- outro = {94: [(0, 74, .6, 6), (6, 75, .45, 2), (8, 74, .5, 4, ('vib',)), (12, 70, .45, 4)],- 95: [(0, 67, .55, 8, ('up', 2, .15, .2)), (8, 67, .45, 4), (12, 69, .45, 4)],- 96: [(0, 70, .55, 6), (6, 69, .4, 2), (8, 67, .5, 8, ('vib',))],- 97: [(0, 69, .55, 8, ('vib',)), (8, 74, .5, 4), (12, 75, .5, 2), (14, 74, .5, 2)]}- for bar in range(94, 98):- i = bar - 94- koto_notes(bar, outro[bar], vel=1.0, pan=.05)- bass_bar(bar, SUST, .6, soft=True)- pat('odaiko', bar, 'X...............', .55)- if i % 2 == 1:- pat('nagado', bar, '........4.......')- pat('odaiko', 97, '...4....', .55)- shime_roll(97, [8, 9, 10, 11, 12, 13], .2, .7)- RISERS.append((T(98), 1.6, 'swell', .55))- big_hit(T(98), 1.3, stab='D5')- for k, m in enumerate([62, 69, 74, 81, 86]):- KOTO.append((T(98) + k * int(0.012 * SR), m, .55, 4.0, -.5 + .25 * k, None))- SHAM.append((T(98), 62, .7, 1.0, 0.0))- BASS.append((T(98), 38, .9, 4.2, True))-- # ---------- per-shot accents from the locked edit- for idx, sh in enumerate(SHOTS):- s = sh['b0'] * SPB- if sh['kind'] == 'intro':- hit('odaiko', s, 1.0)- hit('nagado', s, .7, slot=2)- elif sh['kind'] in ('chapter', 'finale'):- size = 1.1 if sh['kind'] == 'finale' else 1.0- big_hit(s, size, stab=('Dm' if sh['chap'] == 'combat' else None))- else:- card_accent(sh, idx)---# ---------------------------------------------------------------- tonal synthesis-def ks_render(curve, f0, s_w, rho, excite):- """Karplus-Strong, vectorised per period; pitch set exactly (and bent) by resampled read-out."""- Nn = max(2, int(np.floor(SR / f0 - (1 - s_w))))- fv = SR / (Nn + (1 - s_w))- ratio = f0 * 2 ** (curve / 12) / fv- pos = np.concatenate(([0.0], np.cumsum(ratio[:-1])))- L = int(pos[-1]) + Nn + 4- y = np.zeros(L)- y[:Nn] = excite(Nn)- k = Nn- while k < L:- b = min(k + Nn, L)- m = b - k- a_ = y[k - Nn:k - Nn + m]- c_ = y[k - Nn - 1:k - Nn - 1 + m] if k - Nn - 1 >= 0 else np.concatenate(([0.0], y[0:m - 1]))- y[k:b] = rho * (s_w * a_ + (1 - s_w) * c_)- k = b- return np.interp(pos, np.arange(L), y)---def bend_curve(n, spec):- t = tt(n)- c = np.zeros(n)- if spec is None:- return c- kind = spec[0]- if kind == 'up': # oshide: pluck then press the string (semis may be negative = release)- semis, t0, tl = spec[1:]- x = np.clip((t - t0) / tl, 0, 1)- c = semis * (0.5 - 0.5 * np.cos(np.pi * x))- elif kind == 'from': # pre-pressed, slides into pitch- semis, tl = spec[1:]- x = np.clip(t / tl, 0, 1)- c = -semis * (0.5 + 0.5 * np.cos(np.pi * x))- elif kind == 'vib': # yuri- c = 0.2 * np.sin(2 * np.pi * 5.5 * t) * np.clip((t - 0.25) / 0.3, 0, 1)- return c---_KS_CACHE = {}---def sham_note(midi, dur, seed):- key = ('s', midi, round(dur, 2), seed % 3)- if key in _KS_CACHE:- return _KS_CACHE[key]- rng = np.random.default_rng(seed)- f0 = mtof(midi)- n = int((dur + 0.35) * SR)- t = tt(n)-- def ex(m):- e = rng.uniform(-1, 1, m)- return e - np.roll(e, max(1, int(m * 0.13))) # plucked near the bridge: bright- y = ks_render(np.zeros(n), f0, 0.85, 0.994, ex)- env = np.exp(-t / 0.30) * np.where(t > dur, np.exp(-(t - dur) / 0.04), 1.0)- y = normp(y * env)- buzz = filt(np.tanh(4 * y), 'hp', 1800) * np.exp(-t / 0.12) * 0.35 # sawari buzz- click = filt(nz(n, seed + 5), 'hp', 3000) * np.exp(-t / 0.0015) * 0.5 # bachi strike- body = filt(y, 'bp', (900, 3500)) * 0.4 # nasal skin body- x = normp(fade_end(filt(y + buzz + body + click, 'hp', 150)))- _KS_CACHE[key] = x- return x---def koto_note(midi, dur, seed, bend):- key = ('k', midi, round(dur, 2), bend, seed % 3)- if key in _KS_CACHE:- return _KS_CACHE[key]- rng = np.random.default_rng(seed)- f0 = mtof(midi)- n = int((dur + 1.2) * SR)- t = tt(n)-- def ex(m):- e = signal.lfilter([0.5], [1, -0.5], rng.uniform(-1, 1, m))- return e - np.roll(e, max(1, int(m * 0.22)))- y = ks_render(bend_curve(n, bend), f0, 0.64, 0.9982, ex)- env = np.exp(-t / 1.4) * np.where(t > dur + 0.25, np.exp(-(t - dur - 0.25) / 0.3), 1.0)- y = normp(y * env)- pick = filt(nz(n, seed + 7), 'hp', 2500) * np.exp(-t / 0.002) * 0.3- body = filt(y, 'bp', (150, 500)) * 0.5- x = normp(fade_end(filt(y + pick + body, 'hp', 110)))- _KS_CACHE[key] = x- return x---def bass_note(m, dur, soft):- n = int((dur + 0.06) * SR)- t = tt(n)- f = mtof(m)- ph = 2 * np.pi * f * t- h2, h3, drive = (0.3, 0.12, 1.2) if soft else (0.5, 0.3, 1.8)- x = np.sin(ph) + h2 * np.sin(2 * ph) + h3 * np.sin(3 * ph)- env = np.minimum(1, t / 0.002) * np.exp(-t / 1.4) * np.where(t > dur, np.exp(-(t - dur) / 0.015), 1.0)- x = np.tanh(drive * x * env) / np.tanh(drive)- if not soft:- x += 0.15 * filt(nz(n, 3), 'bp', (800, 3000)) * np.exp(-t / 0.004)- return fade_end(filt(x, 'lp', 1800))---def pad_seg(notes, dur, attack, release, cutoff, seed):- rng = np.random.default_rng(seed)- n = int((dur + release) * SR)- t = tt(n)- out = np.zeros((2, n))- for m in notes:- if m < 48:- continue- for v, det in enumerate((-13, -6, 0, 6, 13)):- w = saw(mtof(m) * 2 ** (det / 1200), n, rng.random())- th = (((v - 2) / 2 * 0.85) + 1) * np.pi / 4- out[0] += w * np.cos(th)- out[1] += w * np.sin(th)- out = filt(filt(out, 'lp', cutoff), 'lp', cutoff * 1.3)- rms = np.sqrt(np.mean(out ** 2)) + 1e-9- env = np.minimum(1, t / max(attack, 0.005)) ** 1.5- env *= np.where(t > dur, np.cos(np.clip((t - dur) / release, 0, 1) * np.pi / 2), 1.0)- return out / rms * env---def stab_sig(chd, seed):- rng = np.random.default_rng(seed)- n = int(1.4 * SR)- t = tt(n)- x = np.zeros(n)- for m in [q for q in PAD_V[chd] if q < 72][:4]:- for det in (-9, 0, 9):- x += saw(mtof(m) * 2 ** (det / 1200), n, rng.random())- x = filt(x, 'lp', 3200)- x = normp(x) + 0.8 * np.sin(2 * np.pi * mtof(ROOT[chd] + 12) * t)- env = np.minimum(1, t / 0.002) * np.exp(-t / 0.3)- x = np.tanh(1.5 * normp(x) * env)- x += filt(nz(n, seed), 'bp', (600, 5000)) * np.exp(-t / 0.04) * 0.5- return normp(x)---def impact_sig(size, crash_, sub, seed):- n = int(4.5 * SR)- t = tt(n)- out = np.zeros((2, n))- if sub: # sub-drop- f = 30 + (100 - 30) * np.exp(-t / 0.3)- ph = 2 * np.pi * np.cumsum(f) / SR- s = np.sin(ph) * np.exp(-t / 1.2) + 0.3 * np.sin(2 * ph) * np.exp(-t / 0.5)- out += s * 0.9- out += filt(nz(n, seed), 'lp', 300) * np.exp(-t / 0.18) * 0.6- if crash_:- for ch in range(2):- w = nz(n, seed + 11 + ch)- out[ch] += filt(w, 'hp', 2000) * np.exp(-t / 1.0) * 0.35 + filt(w, 'bp', (500, 3000)) * np.exp(-t / 0.08) * 0.4- return out * size---def riser_sig(kind, length, seed):- n = int(length * SR)- t = tt(n)- x = t / length- out = np.zeros((2, n))- if kind == 'rev': # reversed cymbal swell- for ch in range(2):- out[ch] = crash(seed + ch, decay=length / 2.2)[:n][::-1]- out *= x ** 1.2- else:- f_end, curve = {'sweep': (9000, 2.2), 'build': (11000, 2.0), 'swell': (5000, 1.5)}[kind]- fcs = 250 * (f_end / 250) ** (x ** 1.3)- for ch in range(2):- out[ch] = tv_filter(nz(n, seed + ch), fcs, 1.4)- out = normp(out) * x ** curve- if kind == 'build': # pitched riser: detuned saws D3 -> D5- f = mtof(50) * 2 ** (2 * x)- ph0 = np.cumsum(f) / SR- p = sum(((ph0 * r) % 1.0) * 2 - 1 for r in (1.0, 1.006, 0.994))- p = tv_filter(p, 400 + 5000 * x ** 2, 0.8, kind='lp')- out += normp(p) * x ** 2 * 0.6- if kind == 'swell':- rv = crash(seed + 5, decay=length / 2.5)[:n][::-1]- out += normp(rv) * x ** 1.5 * 0.5- out = normp(out)- k = int(0.03 * SR)- out[:, -k:] *= np.linspace(1, 0.3, k) ** 2- return fade_end(out, 0.002)---def drone_sig(dur, seed):- n = int(dur * SR)- t = tt(n)- rng = np.random.default_rng(seed)- x = np.zeros((2, n))- for ch in range(2):- d = (ch - 0.5)- s = saw(mtof(38) * (1 + 0.001 * d), n, rng.random()) + 0.7 * saw(mtof(45) * (1 - 0.0012 * d), n, rng.random())- s += 0.4 * saw(mtof(50) * (1 + 0.002 * d), n, rng.random())- s = filt(filt(s, 'lp', 320), 'lp', 320)- s = normp(s) + 0.35 * np.sin(2 * np.pi * mtof(26) * t)- w = filt(nz(n, seed + ch), 'bp', (250, 900)) * (0.5 + 0.5 * np.sin(2 * np.pi * 0.2 * t + ch)) * 0.15- x[ch] = s + w- env = np.minimum(1, t / 1.2) * np.where(t > dur - 0.6, np.clip((dur - t) / 0.6, 0, 1), 1)- return normp(x * env)---# ---------------------------------------------------------------- reverb-def make_ir(t60, length, seed, predelay=0.012):- n = int(length * SR)- t = tt(n)- rng = np.random.default_rng(seed)- ir = np.zeros((2, n))- pd = int(predelay * SR)- for ch in range(2):- w = rng.standard_normal(n)- lo = filt(w, 'lp', 450)- hi = filt(w, 'hp', 3500)- mid = w - lo - hi- r = lo * np.exp(-6.91 * t / (t60 * 1.15)) + mid * np.exp(-6.91 * t / t60) + hi * np.exp(-6.91 * t / (t60 * 0.45))- r *= np.minimum(1, t / 0.008)- er = np.zeros(n)- for k in range(10):- er[int(rng.uniform(0.004, 0.07) * SR)] += rng.uniform(-1, 1) * (1 - k / 12) * 3- r = r + er- r = np.concatenate((np.zeros(pd), r))[:n]- ir[ch] = r / np.sqrt(np.sum(r ** 2))- return ir---def convolve_st(mono, ir):- return np.vstack([signal.oaconvolve(mono, ir[ch])[:N] for ch in range(2)])---# ---------------------------------------------------------------- render-def render():- log('rendering drum events:', len(EV))- kick_imp = np.zeros(N)- for (inst, s, slot, bus), (vel, pan) in EV.items():- bank = BANK[inst]- smp = bank[(s // S16 + slot) % len(bank)]- add(bus, smp, s, vel * IG[inst], pan)- if inst == 'kick':- kick_imp[s] += vel- BUS['drumsF'][:] = filt(BUS['drumsF'], 'lp', 1100).astype(np.float32)-- log('shamisen notes:', len(SHAM))- for k, (s, m, v, d, p) in enumerate(SHAM):- add('sham', sham_note(m, d, k), s, v * 0.5, p)- log('koto notes:', len(KOTO))- for k, (s, m, v, d, p, bend) in enumerate(KOTO):- add('koto', koto_note(m, d, k, bend), s, v * 0.33, p)- log('bass notes:', len(BASS))- for s, m, v, d, soft in BASS:- add('bass', bass_note(m, d, soft), s, v * 0.55)- for s, dur_end, g in DRONES:- add('bass', drone_sig((dur_end - s) / SR, 5), s, g * 0.3)- for k, (s, chd, v) in enumerate(STABS):- add('fx', stab_sig(chd, 300 + k), s, v * 0.35, 0)- for k, (s, size, cr, sub) in enumerate(IMPACTS):- add('fx', impact_sig(size, cr, sub, 400 + k), s, 0.8)- for k, (s_end, length, kind, g) in enumerate(RISERS):- x = riser_sig(kind, length, 500 + k)- add('fx', x, s_end - x.shape[1], g * 0.25)-- log('pads')- PAD_STYLE = dict(intro=(.5, 1500, .3, .4), ath=(.5, 2400, .08, .55), aqua=(.6, 1500, .4, .3),- ball=(.5, 2200, .08, .5), combat=(.45, 1400, .05, .5), power=(.6, 950, .5, 0.0),- nature=(.55, 2000, .15, .45), asia=(.7, 3000, .08, .55), finale=(.7, 3000, .08, .55))- style = {}- for b in range(4, 101):- st = PAD_STYLE[SEC_OF[b]]- if b == 93:- st = (.6, 2200, .02, 0)- elif 94 <= b <= 97:- st = (.75, 1800, .6, 0)- elif b >= 98:- st = (.7, 2000, .05, 0)- style[b] = st- segs, b = [], 4- while b < 101:- e = b + 1- while e < 101 and PROG[e] == PROG[b] and style[e] == style[b] and SEC_OF[e] == SEC_OF[b] and e not in (93, 94, 98):- e += 1- segs.append((b, e))- b = e- for k, (b0, b1) in enumerate(segs):- lvl, cut, att, _ = style[b0]- s0 = T(b0)- if b1 >= 101:- dur, rel = (FADE_START - s0) / SR, 2.6- else:- dur, rel = (T(b1) - s0) / SR, 0.35- add('pad', pad_seg(PAD_V[PROG[b0]], dur, att, rel, cut, 600 + k), s0, lvl * 0.05)-- # sidechain pump (kick-driven) on pad, lighter on bass- kern_n = int(0.5 * SR)- kt = tt(kern_n)- kern = np.minimum(1, kt / 0.004) * np.exp(-kt / 0.14)- duck = np.clip(signal.oaconvolve(kick_imp, kern)[:N], 0, 1)- depth = np.zeros(N)- for b in range(101):- depth[T(b):T(b + 1)] = style.get(b, (0, 0, 0, 0))[3]- BUS['pad'] *= (1 - depth * duck).astype(np.float32)- bk = np.exp(-kt / 0.06) * np.minimum(1, kt / 0.002)- duck_b = np.clip(signal.oaconvolve(kick_imp, bk)[:N], 0, 1)- BUS['bass'] *= (1 - 0.3 * duck_b).astype(np.float32)-- # pre-hit gaps: drums & bass drop out for the half-beat before each big hit- gate = np.ones(N, np.float32)- for s in GAPS:- a = s - int(0.2 * SR)- fo = int(0.004 * SR)- gate[a - fo:a] = np.minimum(gate[a - fo:a], np.linspace(1, 0, fo))- gate[a:s - 48] = 0- gate[s - 48:s] = np.minimum(gate[s - 48:s], np.linspace(0, 1, 48))- for b in ('kick', 'taiko', 'perc', 'drumsF', 'bass', 'sham'):- BUS[b] *= gate- BUS['koto'] *= 0.25 + 0.75 * gate- BUS['pad'] *= 0.35 + 0.65 * gate- return gate---# ---------------------------------------------------------------- SFX layer-def whoosh(length, seed, direction):- n = int(length * SR)- t = tt(n)- x = t / length- fcs = 500 * (4500 / 500) ** (x ** 1.6)- y = 0.7 * tv_filter(nz(n, seed), fcs, 0.9) + 0.3 * tv_filter(nz(n, seed + 1), fcs * 1.3, 1.5)- env = x ** 2.5- p = direction * (-0.6 + 1.2 * x)- th = (p + 1) * np.pi / 4- out = normp(np.vstack([y * env * np.cos(th), y * env * np.sin(th)]))- k = int(0.02 * SR)- out[:, -k:] *= np.linspace(1, 0.3, k) ** 2- return fade_end(out, 0.0015)---def rev_swell(length, seed, ir):- n = int(length * SR)- x = tt(n) / length- hitsig = BANK['nagado'][0][:int(1.0 * SR)]- tail = np.vstack([signal.oaconvolve(hitsig, ir[ch]) for ch in range(2)])[:, :n]- tail = normp(tail[:, ::-1])- cr = np.vstack([crash(700 + seed + ch, decay=length / 2.2)[:n][::-1] for ch in range(2)])- out = normp((0.6 * tail + 0.5 * normp(cr)) * x ** 1.3)- k = int(0.02 * SR)- out[:, -k:] *= np.linspace(1, 0.3, k) ** 2- return fade_end(out, 0.0015)---def sfx_impact(seed, size, ir):- n = int(3.5 * SR)- t = tt(n)- f = 32 + (70 - 32) * np.exp(-t / 0.25)- boom = np.sin(2 * np.pi * np.cumsum(f) / SR) * np.exp(-t / 0.9)- crack = np.tanh(3 * filt(nz(n, seed), 'hp', 1000) * np.exp(-t / 0.012)) * 0.6- body = filt(nz(n, seed + 1), 'bp', (150, 1200)) * np.exp(-t / 0.12) * 0.6- dry = 0.45 * boom + crack + body- wet = np.vstack([signal.oaconvolve(crack + body, ir[ch])[:n] for ch in range(2)])- return normp(np.vstack([dry, dry]) + 0.5 * normp(wet)) * size---def build_sfx(ir_hall, ir_big):- events = []- for k, sh in enumerate(SHOTS):- s = sh['b0'] * SPB- if s == 0:- add('sfx', sfx_impact(900, 0.5, ir_hall), 0)- events.append(0)- continue- prev = SHOTS[k - 1]- d = 1 if k % 2 else -1- if sh['kind'] in ('chapter', 'finale'):- x = rev_swell(1.4, k, ir_big)- add('sfx', x, s - x.shape[1], 0.7)- add('sfx', sfx_impact(900 + k, 1.0, ir_hall), s)- w = whoosh(0.34 if prev['beats'] >= 4 else 0.24, 800 + k, d)- add('sfx', w, s - w.shape[1], 0.6 if sh['kind'] == 'card' else 0.5)- events.append(s)- for k, (bar, size) in enumerate([(4, .9), (93, 1.1), (98, 1.2)]):- s = T(bar)- x = rev_swell(1.4, 50 + k, ir_big)- add('sfx', x, s - x.shape[1], 0.7)- add('sfx', sfx_impact(950 + k, size, ir_hall), s)- events.append(s)- return events---# ---------------------------------------------------------------- analysis helpers-BANDS = [(20, 120), (120, 500), (500, 2000), (2000, 6000), (6000, 16000)]---def band_table(x):- f, P = signal.welch(x.astype(np.float64), SR, nperseg=16384, axis=-1)- P = P.sum(0)- tot = P[(f >= 20) & (f <= 20000)].sum()- return [10 * np.log10(P[(f >= lo) & (f < hi)].sum() / tot + 1e-20) for lo, hi in BANDS]---def kw(x):- b1 = [1.53512485958697, -2.69169618940638, 1.19839281085285]- a1 = [1.0, -1.69065929318241, 0.73248077421585]- b2 = [1.0, -2.0, 1.0]- a2 = [1.0, -1.99004745483398, 0.99007225036621]- return signal.lfilter(b2, a2, signal.lfilter(b1, a1, x, axis=-1), axis=-1)---def lufs(x):- b1 = [1.53512485958697, -2.69169618940638, 1.19839281085285]- a1 = [1.0, -1.69065929318241, 0.73248077421585]- b2 = [1.0, -2.0, 1.0]- a2 = [1.0, -1.99004745483398, 0.99007225036621]- y = signal.lfilter(b2, a2, signal.lfilter(b1, a1, x.astype(np.float64), axis=-1), axis=-1)- blk, hop = int(0.4 * SR), int(0.1 * SR)- cs = np.cumsum(np.pad(y ** 2, ((0, 0), (1, 0))), axis=1)- st = np.arange(0, y.shape[1] - blk + 1, hop)- z = ((cs[:, st + blk] - cs[:, st]) / blk).sum(0)- l = -0.691 + 10 * np.log10(z + 1e-20)- g1 = l > -70- rel = -0.691 + 10 * np.log10(z[g1].mean()) - 10- g2 = g1 & (l > rel)- return -0.691 + 10 * np.log10(z[g2].mean())---def true_peak_db(x):- xo = signal.resample_poly(x.astype(np.float64), 4, 1, axis=1)- return 20 * np.log10(np.max(np.abs(xo)) + 1e-12)---def glue(x, ratio=2.0, knee=6.0):- p = (x.astype(np.float64) ** 2).mean(0)- a = np.exp(-1 / (0.03 * SR))- env = signal.lfilter([1 - a], [1, -a], p)- lvl = 10 * np.log10(env + 1e-12)- thr = np.percentile(lvl[lvl > -60], 95) - 1.0- over = lvl - thr- gr = np.where(over > knee / 2, (1 - 1 / ratio) * over,- np.where(over > -knee / 2, (1 - 1 / ratio) * (over + knee / 2) ** 2 / (2 * knee), 0.0))- a2 = np.exp(-1 / (0.1 * SR))- gr = signal.lfilter([1 - a2], [1, -a2], gr)- return x * 10 ** (-gr / 20), float(np.max(gr)), float(np.mean(gr[lvl > thr - 10]))---def limiter(x, ceiling_db, look=0.003, release=0.08):- c = 10 ** (ceiling_db / 20)- n = x.shape[1]- xo = signal.resample_poly(x, 4, 1, axis=1)- pk = np.max(np.abs(xo), axis=0)[:4 * n].reshape(n, 4).max(1)- pk = np.maximum(pk, np.max(np.abs(x), axis=0))- g = np.minimum(1.0, c / np.maximum(pk, 1e-9))- L = int(look * SR)- h = minimum_filter1d(g, size=2 * L + 1)- B = 16- nb = int(np.ceil(n / B))- hb = np.pad(h, (0, nb * B - n), constant_values=1.0).reshape(nb, B).min(1)- rc = 1 - np.exp(-B / (release * SR))- r = np.empty(nb)- cur = 1.0- for i in range(nb):- cur = cur + (1 - cur) * rc- if hb[i] < cur:- cur = hb[i]- r[i] = cur- r = np.repeat(r, B)[:n]- r = uniform_filter1d(r, size=L)- r = np.minimum(r, h)- return x * r---def write24(path, x):- y = np.clip(np.asarray(x, np.float64), -1.0, 1.0 - 1.0 / 8388608)- i = np.ascontiguousarray(np.round(y.T * 8388607).astype('<i4'))- b = i.view(np.uint8).reshape(-1, 4)[:, :3].tobytes()- with wave.open(path, 'wb') as w:- w.setnchannels(2)- w.setsampwidth(3)- w.setframerate(SR)- w.writeframes(b)---def onset_check(x, times):- """Onset = strongest energy rise in the transient band (1.5-12 kHz, 2 ms window vs preceding 5 ms)- within +/-30 ms of the cut. Also reports the low-band (40-200 Hz, 10 ms windows) rise = body weight."""- m = x.astype(np.float64).mean(0)- hb = signal.sosfiltfilt(sos('bp', (1500, 12000), 2), m)- lb = signal.sosfiltfilt(sos('bp', (40, 200), 2), m)- ch = np.concatenate(([0.0], np.cumsum(hb ** 2)))- cl = np.concatenate(([0.0], np.cumsum(lb ** 2)))- res = []- for s in times:- if s == 0: # start of file: onset = first sample above -40 dBFS- first = np.argmax(np.abs(m[:int(0.05 * SR)]) > 0.01)- res.append((first / SR * 1000, 99.0, 99.0, first / SR * 1000))- continue- idx = np.arange(s - int(0.03 * SR), min(N - 480, s + int(0.03 * SR)))- d = 10 * np.log10(((ch[idx + 96] - ch[idx]) / 96 + 1e-12) / ((ch[idx] - ch[idx - 240]) / 240 + 1e-12))- j = int(np.argmax(d))- e_f = (cl[s + 480] - cl[s]) / 480- e_p = (cl[s - 240] - cl[s - 720]) / 480- low_rise = 10 * np.log10((e_f + 1e-12) / (e_p + 1e-12))- seg = np.abs(m[s - int(0.005 * SR): s + int(0.04 * SR)])- pk = (int(np.argmax(seg)) - int(0.005 * SR)) / SR * 1000- res.append(((idx[j] - s) / SR * 1000, float(d[j]), float(low_rise), pk))- return res---# ---------------------------------------------------------------- main-def main():- compose()- log(f'composed: {len(EV)} drum events, {len(SHAM)} shamisen, {len(KOTO)} koto, {len(BASS)} bass')- gate = render()-- log('reverbs')- ir_room = make_ir(0.9, 1.4, 11)- ir_hall = make_ir(2.4, 3.5, 12)- ir_big = make_ir(4.2, 6.0, 13)- BG = dict(kick=.5, taiko=.5, perc=.9, drumsF=.45, bass=.6, pad=3.5, sham=2.2, koto=3.6, fx=.6)- SENDS = {'room': ({'taiko': .30, 'perc': .12, 'drumsF': .25, 'sham': .20}, ir_room, .8, 200),- 'hall': ({'koto': .40, 'pad': .22, 'sham': .14, 'taiko': .10, 'fx': .12}, ir_hall, .8, 200),- 'big': ({'fx': .45, 'koto': .08}, ir_big, .7, 90)}- rets = {}- for name, (amts, ir, g, hp) in SENDS.items():- mono = sum(BUS[b].astype(np.float64).mean(0) * a * BG[b] for b, a in amts.items())- mono = filt(mono, 'hp', hp)- rets[name] = convolve_st(mono, ir) * g- log(' reverb', name)-- drums = sum(BUS[b].astype(np.float64) * BG[b] for b in ('kick', 'taiko', 'perc', 'drumsF'))- ref = np.percentile(np.abs(drums), 99.95) + 1e-9- drums = np.tanh(1.1 * drums / ref) / np.tanh(1.1) * ref # gentle drum-bus saturation- def widen(x, k): # mid/side width- mid = (x[0] + x[1]) / 2- side = (x[0] - x[1]) / 2 * k- return np.vstack([mid + side, mid - side])- WIDTH = dict(pad=1.6, koto=1.4)- bed = drums.copy()- for b in ('bass', 'pad', 'sham', 'koto', 'fx'):- v = BUS[b].astype(np.float64) * BG[b]- bed += widen(v, WIDTH[b]) if b in WIDTH else v- for r in rets.values():- bed += widen(r, 1.3)-- # per-bus diagnostics (section RMS)- diag = []- secs = [('intro', 0, 12), ('ath', 12, 28), ('aqua', 28, 35), ('ball', 35, 50), ('combat', 50, 61),- ('power', 61, 70), ('nature', 70, 80), ('asia', 80, 89), ('finale', 89, 101)]- stems = {'drums': drums, 'bass': BUS['bass'] * BG['bass'], 'pad': BUS['pad'] * BG['pad'],- 'sham': BUS['sham'] * BG['sham'], 'koto': BUS['koto'] * BG['koto'],- 'fx': BUS['fx'] * BG['fx'], 'reverb': sum(rets.values())}- hdr = 'section ' + ''.join(f'{k:>8}' for k in stems)- diag.append(hdr)- for nm, b0, b1 in secs:- a, b = T(b0), min(T(b1), N)- row = f'{nm:<9}'- for k, v in stems.items():- seg = kw(np.asarray(v[:, a:b], np.float64))- rms = np.sqrt(np.mean(seg ** 2)) + 1e-12- row += f'{20 * np.log10(rms):8.1f}'- diag.append(row)- lowsum = {}- for k, v in stems.items():- lb = signal.sosfilt(sos('lp', 120, 4), np.asarray(v, np.float64), axis=-1)- lowsum[k] = np.mean(lb ** 2)- tot_low = sum(lowsum.values())- diag.append('share of 20-120 Hz energy: ' + ', '.join(f'{k} {100 * v / tot_low:.0f}%' for k, v in lowsum.items()))- print('\n'.join(diag))-- # mix automation (dB per bar): lighter aquatics / breakdown / outro, lift for the final chorus.- # Changes ramp inside the 0.2 s pre-hit gap (or 50 ms before the bar) so they are masked.- AUTO = {}- for b in range(101):- sec = SEC_OF[b]- AUTO[b] = {'intro': 0.0, 'ath': -0.5, 'aqua': -2.5, 'ball': -0.5, 'combat': 0.0, 'power': -2.0,- 'nature': -0.5, 'asia': 1.0, 'finale': 1.0}[sec]- for b in range(46, 49):- AUTO[b] = 1.5- AUTO[69] = -1.0- for b in (70, 71, 72, 73):- AUTO[b] = -1.0- AUTO[93] = 0.5- for b in range(94, 98):- AUTO[b] = -2.5- for b in range(98, 101):- AUTO[b] = 0.0- auto = np.zeros(N)- auto[:] = AUTO[0]- for b in range(1, 101):- if AUTO[b] == AUTO[b - 1]:- auto[T(b):] = AUTO[b]- continue- s1 = T(b)- s0 = s1 - (int(0.2 * SR) if s1 in GAPS else int(0.05 * SR))- auto[s0:s1] = np.linspace(AUTO[b - 1], AUTO[b], s1 - s0)- auto[s1:] = AUTO[b]- bed *= 10 ** (auto / 20)- drums *= 10 ** (auto / 20)- bt0 = band_table(bed)- # SFX stem- sfx_events = build_sfx(ir_hall, ir_big)- sfx = BUS['sfx'].astype(np.float64)- # calibrate sfx ~6 dB under the drums at the transition points- w = int(0.1 * SR)- dr, sf = [], []- for s in sfx_events:- a, b = max(0, s - w), min(N, s + w)- dr.append(np.mean(drums[:, a:b] ** 2))- sf.append(np.mean(sfx[:, a:b] ** 2))- diff = 10 * np.log10(np.mean(sf) / np.mean(dr))- g_sfx = 10 ** ((-6.0 - diff) / 20)- sfx *= g_sfx- log(f'sfx gain {20 * np.log10(g_sfx):+.1f} dB (sfx vs drums at transitions: -6.0 dB)')-- # low-band rebalance: zero-phase split at 120 Hz, scale low band of BOTH stems so the- # combined mix has 20-120 Hz at ~-3 dB of total (same linear op on each stem keeps them summable)- low_b = signal.sosfiltfilt(sos('lp', 120, 2), bed, axis=-1)- low_s = signal.sosfiltfilt(sos('lp', 120, 2), sfx, axis=-1)- tot = bed + sfx- low_t = low_b + low_s- lo_g, hi_g = 0.1, 1.5- for _ in range(14):- g = (lo_g + hi_g) / 2- v = band_table(tot + (g - 1) * low_t)[0]- if v > -3.0:- hi_g = g- else:- lo_g = g- g_low = (lo_g + hi_g) / 2- bed = bed + (g_low - 1) * low_b- sfx = sfx + (g_low - 1) * low_s- del low_b, low_s, low_t, tot- bt1 = band_table(bed)- log(f'low band (bed) {bt0[0]:.1f} dB -> {bt1[0]:.1f} dB (low gain {20 * np.log10(g_low):+.1f} dB)')-- fade = np.ones(N)- fade[FADE_START:] = np.cos(np.linspace(0, np.pi / 2, N - FADE_START)) ** 2- bed *= fade- sfx *= fade- mix = bed + sfx-- # stems: common gain so each stem and their 1:1 sum stay <= -1 dBFS- c = 10 ** (-1 / 20) / max(np.max(np.abs(mix)), np.max(np.abs(bed)), np.max(np.abs(sfx)))- write24(os.path.join(HERE, 'music_bed.wav'), bed * c)- write24(os.path.join(HERE, 'sfx.wav'), sfx * c)- log(f'stems written (common stem gain {20 * np.log10(c):+.1f} dB)')-- # master: glue compression -> loudness -> true-peak limiter (iterate to -14 LUFS)- y, gr_max, gr_avg = glue(mix * c)- y = y * 10 ** ((-14 - lufs(y)) / 20)- ceiling = -1.3- for it in range(6):- z = limiter(y, ceiling)- L = lufs(z)- tp = true_peak_db(z)- log(f' master iter {it}: {L:.2f} LUFS, TP {tp:.2f} dBTP')- if tp > -1.05:- ceiling -= 0.2- continue- if abs(L + 14) < 0.05:- break- y = y * 10 ** ((-14 - L) / 20)- master = z- write24(os.path.join(HERE, 'music.wav'), master)- log('master written')-- # ------------------------------------------------ report- def ff(path):- r = subprocess.run(['ffmpeg', '-hide_banner', '-nostats', '-i', path, '-af',- 'loudnorm=I=-14:TP=-1:print_format=json', '-f', 'null', '-'],- capture_output=True, text=True)- txt = r.stderr- j = json.loads(txt[txt.rfind('{'):txt.rfind('}') + 1])- return j- fm = ff(os.path.join(HERE, 'music.wav'))- fb = ff(os.path.join(HERE, 'music_bed.wav'))- fs = ff(os.path.join(HERE, 'sfx.wav'))-- R = []- R.append('ASIAD 2026 - ORIGINAL SCORE - RENDER REPORT')- R.append('=' * 64)- R.append(f'150 BPM, 4/4, beat 0.4 s; 101 bars = 161.6 s; files {N / SR:.1f} s @ 48 kHz / 24-bit stereo')- R.append(f'Shots in timeline: {len(SHOTS)} gaps (pre-hit silences): {len(GAPS)}')- R.append('')- R.append('LOUDNESS (ffmpeg loudnorm analysis, first pass)')- for nm, j in (('music.wav (master)', fm), ('music_bed.wav', fb), ('sfx.wav', fs)):- R.append(f' {nm:<20} I = {float(j["input_i"]):6.2f} LUFS TP = {float(j["input_tp"]):6.2f} dBTP '- f'LRA = {float(j["input_lra"]):5.2f} LU')- R.append(f' internal BS.1770 meter on master: {lufs(master):.2f} LUFS, true peak (4x) {true_peak_db(master):.2f} dBTP')- R.append(f' glue compressor: 2:1, max GR {gr_max:.1f} dB, avg GR on loud passages {gr_avg:.1f} dB; limiter ceiling {ceiling:.1f} dBTP')- R.append(f' stem peaks: bed {20 * np.log10(np.max(np.abs(bed * c))):.1f} dBFS, sfx {20 * np.log10(np.max(np.abs(sfx * c))):.1f} dBFS '- '(stems summed 1:1 = pre-master mix)')- R.append(f' stereo: master L/R correlation {np.corrcoef(master[0], master[1])[0, 1]:.2f}, side/mid '- f'{20 * np.log10(np.std(master[0] - master[1]) / np.std(master[0] + master[1])):.1f} dB')- R.append(f' sfx level: set so sfx RMS is 6.0 dB under the drum bus in +/-100 ms around each transition')- R.append('')- R.append('BAND ENERGY (dB relative to total 20 Hz-20 kHz energy)')- R.append(' band bed(pre-EQ) bed sfx master')- btm = band_table(master)- bts = band_table(sfx)- for k, (lo, hi) in enumerate(BANDS):- R.append(f' {lo:>5}-{hi:<6} Hz {bt0[k]:7.1f} {bt1[k]:7.1f} {bts[k]:7.1f} {btm[k]:7.1f}')- R.append(f' low-band rebalance applied to both stems: {20 * np.log10(g_low):+.1f} dB below 120 Hz (zero-phase split)')- R.append('')- R.append('SECTION LEVEL BY BUS (K-weighted RMS dB, pre-master, before section automation, diagnostic)')- R.extend(' ' + d for d in diag)- R.append('')- R.append('ONSET CHECK on music.wav: for each shot t0, strongest transient-band (1.5-12 kHz) energy rise within +/-30 ms')- R.append(' onset = measured onset - t0 (2 ms window vs preceding 5 ms); pass = |onset| <= 15 ms and rise >= 6 dB')- R.append(' low dB = 40-200 Hz energy in the 10 ms after t0 vs the 10 ms ending 5 ms before t0 (body weight of the hit)')- R.append(' peak = position of max |x| within t0-5..+40 ms')- R.append(f' {"#":>3} {"id":<14}{"kind":<8}{"t0 (s)":>8}{"onset ms":>10}{"rise dB":>9}{"low dB":>8}{"peak ms":>9} status')- res = onset_check(master, [sh['b0'] * SPB for sh in SHOTS])- misses = []- for k, (sh, (off, rise, lowr, pk)) in enumerate(zip(SHOTS, res)):- ok = abs(off) <= 15 and rise >= 6- if not ok:- misses.append(sh['id'])- R.append(f' {k:>3} {sh["id"]:<14}{sh["kind"]:<8}{sh["t0"]:8.2f}{off:10.1f}{rise:9.1f}{lowr:8.1f}{pk:9.1f} {"OK" if ok else "MISS"}')- R.append(f' => {len(SHOTS) - len(misses)}/{len(SHOTS)} shots pass' + (f'; misses: {", ".join(misses)}' if misses else '; no misses'))- R.append('')- R.append('EXTRA HITS (not shots): title slam bar 4, number accents bars 8/9/10, huge hit bar 93, final hit bar 98')- extra = [4, 8, 9, 10, 93, 98]- for bar, (off, rise, lowr, pk) in zip(extra, onset_check(master, [T(b) for b in extra])):- R.append(f' bar {bar:>3} t={T(bar) / SR:7.2f}s onset {off:6.1f} ms rise {rise:5.1f} dB low {lowr:5.1f} dB')- R.append('')- R.append('PRE-HIT GAPS (bed RMS in the 0.2 s before each big hit vs the 0.4 s before that; drums+bass muted)')- for s in sorted(GAPS):- a1, b1 = s - int(0.18 * SR), s - int(0.02 * SR)- a0, b0 = s - int(0.6 * SR), s - int(0.22 * SR)- r1 = np.sqrt(np.mean(bed[:, a1:b1] ** 2)) + 1e-12- r0 = np.sqrt(np.mean(bed[:, a0:b0] ** 2)) + 1e-12- R.append(f' hit @ {s / SR:7.2f}s (bar {s // BARS:>3}) gap level {20 * np.log10(r1 / r0):6.1f} dB vs groove')- R.append('')- R.append('NOTES')- R.append(' * Timeline has the cycling 2-beat cards at beats 308-314 = bars 77-78 (brief said 76-77); accents follow the timeline.')- R.append(' * Shot 0 (t=0) cannot carry a lead-in whoosh; it gets an sfx impact + odaiko heartbeat at sample 0 instead.')- R.append(f' * Render time {time.time() - T_START:.0f} s.')- open(os.path.join(HERE, 'report.txt'), 'w').write('\n'.join(R) + '\n')- log('report written')- print('\n'.join(R))---if __name__ == '__main__':- main()diff --git a/styles/pictogram-motion/demo/music/timeline.json b/styles/pictogram-motion/demo/music/timeline.jsondeleted file mode 100644index 5aa0d94..0000000--- a/styles/pictogram-motion/demo/music/timeline.json+++ /dev/null@@ -1,640 +0,0 @@-{- "bpm": 150,- "beat": 0.4,- "total_beats": 404,- "duration": 161.60000000000002,- "shots": [- {- "kind": "intro",- "id": "intro",- "chap": "intro",- "t0": 0,- "b0": 0,- "beats": 48- },- {- "kind": "chapter",- "id": "ath",- "chap": "ath",- "t0": 19.2,- "b0": 48,- "beats": 8- },- {- "kind": "card",- "id": "sprint",- "chap": "ath",- "t0": 22.4,- "b0": 56,- "beats": 4- },- {- "kind": "card",- "id": "hurdles",- "chap": "ath",- "t0": 24,- "b0": 60,- "beats": 4- },- {- "kind": "card",- "id": "relay",- "chap": "ath",- "t0": 25.6,- "b0": 64,- "beats": 4- },- {- "kind": "card",- "id": "distance",- "chap": "ath",- "t0": 27.2,- "b0": 68,- "beats": 4- },- {- "kind": "card",- "id": "steeple",- "chap": "ath",- "t0": 28.8,- "b0": 72,- "beats": 4- },- {- "kind": "card",- "id": "marathon",- "chap": "ath",- "t0": 30.4,- "b0": 76,- "beats": 4- },- {- "kind": "card",- "id": "walk",- "chap": "ath",- "t0": 32,- "b0": 80,- "beats": 4- },- {- "kind": "card",- "id": "highjump",- "chap": "ath",- "t0": 33.6,- "b0": 84,- "beats": 4- },- {- "kind": "card",- "id": "polevault",- "chap": "ath",- "t0": 35.2,- "b0": 88,- "beats": 4- },- {- "kind": "card",- "id": "longjump",- "chap": "ath",- "t0": 36.8,- "b0": 92,- "beats": 4- },- {- "kind": "card",- "id": "shot",- "chap": "ath",- "t0": 38.4,- "b0": 96,- "beats": 4- },- {- "kind": "card",- "id": "discus",- "chap": "ath",- "t0": 40,- "b0": 100,- "beats": 4- },- {- "kind": "card",- "id": "hammer",- "chap": "ath",- "t0": 41.6,- "b0": 104,- "beats": 4- },- {- "kind": "card",- "id": "javelin",- "chap": "ath",- "t0": 43.2,- "b0": 108,- "beats": 4- },- {- "kind": "chapter",- "id": "aqua",- "chap": "aqua",- "t0": 44.8,- "b0": 112,- "beats": 8- },- {- "kind": "card",- "id": "free",- "chap": "aqua",- "t0": 48,- "b0": 120,- "beats": 2- },- {- "kind": "card",- "id": "breast",- "chap": "aqua",- "t0": 48.8,- "b0": 122,- "beats": 2- },- {- "kind": "card",- "id": "back",- "chap": "aqua",- "t0": 49.6,- "b0": 124,- "beats": 2- },- {- "kind": "card",- "id": "fly",- "chap": "aqua",- "t0": 50.4,- "b0": 126,- "beats": 2- },- {- "kind": "card",- "id": "diving",- "chap": "aqua",- "t0": 51.2,- "b0": 128,- "beats": 4- },- {- "kind": "card",- "id": "artistic",- "chap": "aqua",- "t0": 52.8,- "b0": 132,- "beats": 4- },- {- "kind": "card",- "id": "waterpolo",- "chap": "aqua",- "t0": 54.4,- "b0": 136,- "beats": 4- },- {- "kind": "chapter",- "id": "ball",- "chap": "ball",- "t0": 56,- "b0": 140,- "beats": 8- },- {- "kind": "card",- "id": "football",- "chap": "ball",- "t0": 59.2,- "b0": 148,- "beats": 4- },- {- "kind": "card",- "id": "basketball",- "chap": "ball",- "t0": 60.8,- "b0": 152,- "beats": 4- },- {- "kind": "card",- "id": "volleyball",- "chap": "ball",- "t0": 62.4,- "b0": 156,- "beats": 4- },- {- "kind": "card",- "id": "handball",- "chap": "ball",- "t0": 64,- "b0": 160,- "beats": 4- },- {- "kind": "card",- "id": "hockey",- "chap": "ball",- "t0": 65.6,- "b0": 164,- "beats": 4- },- {- "kind": "card",- "id": "rugby",- "chap": "ball",- "t0": 67.2,- "b0": 168,- "beats": 4- },- {- "kind": "card",- "id": "baseball",- "chap": "ball",- "t0": 68.8,- "b0": 172,- "beats": 4- },- {- "kind": "card",- "id": "cricket",- "chap": "ball",- "t0": 70.4,- "b0": 176,- "beats": 4- },- {- "kind": "card",- "id": "golf",- "chap": "ball",- "t0": 72,- "b0": 180,- "beats": 4- },- {- "kind": "card",- "id": "badminton",- "chap": "ball",- "t0": 73.6,- "b0": 184,- "beats": 2- },- {- "kind": "card",- "id": "tabletennis",- "chap": "ball",- "t0": 74.4,- "b0": 186,- "beats": 2- },- {- "kind": "card",- "id": "tennis",- "chap": "ball",- "t0": 75.2,- "b0": 188,- "beats": 2- },- {- "kind": "card",- "id": "softtennis",- "chap": "ball",- "t0": 76,- "b0": 190,- "beats": 2- },- {- "kind": "card",- "id": "squash",- "chap": "ball",- "t0": 76.8,- "b0": 192,- "beats": 2- },- {- "kind": "card",- "id": "padel",- "chap": "ball",- "t0": 77.6,- "b0": 194,- "beats": 2- },- {- "kind": "card",- "id": "teqball",- "chap": "ball",- "t0": 78.4,- "b0": 196,- "beats": 4- },- {- "kind": "chapter",- "id": "combat",- "chap": "combat",- "t0": 80,- "b0": 200,- "beats": 8- },- {- "kind": "card",- "id": "judo",- "chap": "combat",- "t0": 83.2,- "b0": 208,- "beats": 4- },- {- "kind": "card",- "id": "karate",- "chap": "combat",- "t0": 84.8,- "b0": 212,- "beats": 4- },- {- "kind": "card",- "id": "taekwondo",- "chap": "combat",- "t0": 86.4,- "b0": 216,- "beats": 4- },- {- "kind": "card",- "id": "boxing",- "chap": "combat",- "t0": 88,- "b0": 220,- "beats": 4- },- {- "kind": "card",- "id": "wrestling",- "chap": "combat",- "t0": 89.6,- "b0": 224,- "beats": 4- },- {- "kind": "card",- "id": "fencing",- "chap": "combat",- "t0": 91.2,- "b0": 228,- "beats": 4- },- {- "kind": "card",- "id": "jujitsu",- "chap": "combat",- "t0": 92.8,- "b0": 232,- "beats": 4- },- {- "kind": "card",- "id": "kurash",- "chap": "combat",- "t0": 94.4,- "b0": 236,- "beats": 4- },- {- "kind": "card",- "id": "mma",- "chap": "combat",- "t0": 96,- "b0": 240,- "beats": 4- },- {- "kind": "chapter",- "id": "power",- "chap": "power",- "t0": 97.6,- "b0": 244,- "beats": 8- },- {- "kind": "card",- "id": "weightlifting",- "chap": "power",- "t0": 100.8,- "b0": 252,- "beats": 4- },- {- "kind": "card",- "id": "shooting",- "chap": "power",- "t0": 102.4,- "b0": 256,- "beats": 4- },- {- "kind": "card",- "id": "archery",- "chap": "power",- "t0": 104,- "b0": 260,- "beats": 4- },- {- "kind": "card",- "id": "gym_art",- "chap": "power",- "t0": 105.6,- "b0": 264,- "beats": 4- },- {- "kind": "card",- "id": "gym_rhythm",- "chap": "power",- "t0": 107.2,- "b0": 268,- "beats": 4- },- {- "kind": "card",- "id": "gym_tramp",- "chap": "power",- "t0": 108.8,- "b0": 272,- "beats": 4- },- {- "kind": "card",- "id": "pentathlon",- "chap": "power",- "t0": 110.4,- "b0": 276,- "beats": 4- },- {- "kind": "chapter",- "id": "nature",- "chap": "nature",- "t0": 112,- "b0": 280,- "beats": 8- },- {- "kind": "card",- "id": "rowing",- "chap": "nature",- "t0": 115.2,- "b0": 288,- "beats": 4- },- {- "kind": "card",- "id": "canoe",- "chap": "nature",- "t0": 116.8,- "b0": 292,- "beats": 4- },- {- "kind": "card",- "id": "sailing",- "chap": "nature",- "t0": 118.4,- "b0": 296,- "beats": 4- },- {- "kind": "card",- "id": "surfing",- "chap": "nature",- "t0": 120,- "b0": 300,- "beats": 4- },- {- "kind": "card",- "id": "triathlon",- "chap": "nature",- "t0": 121.6,- "b0": 304,- "beats": 4- },- {- "kind": "card",- "id": "cyc_road",- "chap": "nature",- "t0": 123.2,- "b0": 308,- "beats": 2- },- {- "kind": "card",- "id": "cyc_track",- "chap": "nature",- "t0": 124,- "b0": 310,- "beats": 2- },- {- "kind": "card",- "id": "cyc_bmx",- "chap": "nature",- "t0": 124.8,- "b0": 312,- "beats": 2- },- {- "kind": "card",- "id": "cyc_mtb",- "chap": "nature",- "t0": 125.6,- "b0": 314,- "beats": 2- },- {- "kind": "card",- "id": "equestrian",- "chap": "nature",- "t0": 126.4,- "b0": 316,- "beats": 4- },- {- "kind": "chapter",- "id": "asia",- "chap": "asia",- "t0": 128,- "b0": 320,- "beats": 8- },- {- "kind": "card",- "id": "kabaddi",- "chap": "asia",- "t0": 131.2,- "b0": 328,- "beats": 4- },- {- "kind": "card",- "id": "takraw",- "chap": "asia",- "t0": 132.8,- "b0": 332,- "beats": 4- },- {- "kind": "card",- "id": "wushu",- "chap": "asia",- "t0": 134.4,- "b0": 336,- "beats": 4- },- {- "kind": "card",- "id": "skate",- "chap": "asia",- "t0": 136,- "b0": 340,- "beats": 4- },- {- "kind": "card",- "id": "climbing",- "chap": "asia",- "t0": 137.6,- "b0": 344,- "beats": 4- },- {- "kind": "card",- "id": "breaking",- "chap": "asia",- "t0": 139.2,- "b0": 348,- "beats": 4- },- {- "kind": "card",- "id": "esports",- "chap": "asia",- "t0": 140.8,- "b0": 352,- "beats": 4- },- {- "kind": "finale",- "id": "finale",- "chap": "finale",- "t0": 142.4,- "b0": 356,- "beats": 48- }- ]-}\ No newline at end of filediff --git a/styles/pictogram-motion/demo/mux.sh b/styles/pictogram-motion/demo/mux.shdeleted file mode 100755index 7ba3a66..0000000--- a/styles/pictogram-motion/demo/mux.sh+++ /dev/null@@ -1,15 +0,0 @@-#!/bin/zsh-# Concatenate segments → light grain → mix in the score → final film-# Usage: ./mux.sh [output path]-# OUTDIR=out_ej (default, English/Japanese version) → default output ../pictogram-motion.mp4 (= styles/pictogram-motion/pictogram-motion.mp4)-# OUTDIR=out (Chinese version) → default output out/pictogram-motion_zh.mp4-set -e-cd "${0:A:h}"-SEG="${OUTDIR:-out_ej}"-if [[ "$SEG" == "out_ej" ]]; then DEF="../pictogram-motion.mp4"; else DEF="$SEG/pictogram-motion_zh.mp4"; fi-OUT="${1:-$DEF}"-ffmpeg -y -loglevel error -f concat -safe 0 -i $SEG/list.txt -i music/music.wav \- -vf "tpad=stop_duration=2:stop_mode=clone,noise=c0s=4:c0f=t+u,format=yuv420p" \- -c:v libx264 -preset slow -crf 14 -profile:v high -r 60 -g 120 \- -c:a aac -b:a 320k -ar 48000 -map 0:v -map 1:a -shortest -movflags +faststart "$OUT"-ffprobe -v error -show_entries format=duration,size -of default=nw=1 "$OUT"diff --git a/styles/pictogram-motion/demo/poses/aqua.js b/styles/pictogram-motion/demo/poses/aqua.jsdeleted file mode 100644index 3344e97..0000000--- a/styles/pictogram-motion/demo/poses/aqua.js+++ /dev/null@@ -1,246 +0,0 @@-// Aquatics, 7 events: four strokes (2-beat cards, one full stroke cycle per 2 beats) + diving, artistic swimming, water polo-// Swimming figures are horizontal: rot = 90 head to the right, face down; rot = -90 head to the left, face up.-// Arm angles in this local frame: 180 = pointing past the head, 90 = belly side, 0 = pointing to the feet, -90 = back side.-(function () {- const G = window.G, P = G.P, POSES = window.POSES;- const mod = (u, L) => ((u % L) + L) % L;- const TAU = Math.PI * 2;- const fly = (p0, v, g, t) => [p0[0] + v[0] * t, p0[1] + v[1] * t + 0.5 * g * t * t];-- // Water: back() draws the underwater scale pattern, front() lays a semi-transparent water body + wave crests on top- const crests = (ctx, y, u, C, flow) => {- const k = 0.13, off = mod(u * flow, k);- ctx.fillStyle = C.line;- for (let x = -1.8 - off; x < 1.8; x += k) { ctx.beginPath(); ctx.arc(x, y, k * 0.28, Math.PI, 0); ctx.fill(); }- };- const waterBack = (ctx, y, u, C, flow = 0.5) => {- crests(ctx, y, u, C, flow);- ctx.save(); ctx.globalAlpha = 0.35; ctx.strokeStyle = C.line; ctx.lineWidth = 0.01;- const k = 0.16, off = mod(u * flow * 0.5, k);- for (let r = 0; r < 4; r++) for (let x = -1.8 - off; x < 1.8; x += k) {- ctx.beginPath(); ctx.arc(x + (r % 2 ? k / 2 : 0), y + 0.16 + r * 0.1, k * 0.45, Math.PI, 0); ctx.stroke();- }- ctx.restore();- };- const waterFront = (ctx, y, u, C, o = {}) => {- ctx.fillStyle = G.rgba(C.bg, o.alpha ?? 0.42);- ctx.fillRect(-2, y, 4, 2.5);- ctx.fillStyle = C.line; ctx.fillRect(-2, y - 0.006, 4, 0.012);- if (o.crests) crests(ctx, y, u, C, o.flow ?? 0.5);- };- // Wake lines behind the body- const wake = (ctx, x, y, u, C) => {- ctx.save();- for (let i = 0; i < 4; i++) {- const L = 0.25 + 0.2 * ((i * 37) % 10) / 10;- const ox = x - mod(u * 0.9 + i * 0.37, 1) * 0.5;- ctx.globalAlpha = 0.7 * (1 - mod(u * 0.9 + i * 0.37, 1));- ctx.fillStyle = C.fg; ctx.fillRect(ox - L, y - 0.02 + (i % 2) * 0.03, L, 0.014);- }- ctx.restore();- };- const flutter = (ph, amp = 11) => {- const s = Math.sin(TAU * 3 * ph);- return { lR1: amp * s, lR2: amp * s - 14 * Math.max(0, Math.sin(TAU * 3 * ph + 1)), lL1: -amp * s, lL2: -amp * s - 14 * Math.max(0, Math.sin(TAU * 3 * ph + 1 + Math.PI)) };- };- const SURF = 0.03; // strokes: body centre line sits slightly above the water so it reads clearly-- // ───────── Freestyle: arms alternate, one arm enters the water per beat ─────────- const freeArm = (a) => {- a = ((a + 180) % 360 + 360) % 360 - 180; // (-180, 180]- if (a >= 0) return [a, a + 32 * Math.sin(Math.PI * a / 180)]; // underwater catch- return [a, a - 105 * Math.sin(Math.PI * -a / 180)]; // high-elbow recovery in the air- };- POSES.free = {- iconU: 0.4,- pose: (u) => {- const ph = mod(u, 2) / 2;- const aN = freeArm(180 - 360 * ph), aF = freeArm(-360 * ph);- return { rot: 90, x: -0.06, y: 0.0, torso: 0, head: 6, aR1: aN[0], aR2: aN[1], aL1: aF[0], aL2: aF[1], ...flutter(ph) };- },- back: (ctx, J, u, C) => waterBack(ctx, SURF, u, C, 1),- front: (ctx, J, u, C) => { waterFront(ctx, SURF, u, C, { flow: 1 }); wake(ctx, -0.55, SURF, u, C); },- };-- // ───────── Breaststroke: pull and lift head to breathe → draw legs up → kick and squeeze → glide ─────────- const breastKeys = [- { b: 0, rot: 90, x: -0.04, y: 0.0, torso: 0, head: 0, aR1: 178, aR2: 180, aL1: 172, aL2: 176, lR1: 2, lR2: 0, lL1: -2, lL2: -4 },- { b: 0.55, rot: 84, x: -0.04, y: -0.04, torso: -20, head: -14, aR1: 116, aR2: 168, aL1: 110, aL2: 162, lR1: 34, lR2: -48, lL1: 30, lL2: -52 },- { b: 0.95, rot: 86, x: -0.04, y: -0.03, torso: -6, head: -4, aR1: 168, aR2: 176, aL1: 162, aL2: 170, lR1: 72, lR2: -44, lL1: 68, lL2: -48 },- { b: 1.3, rot: 90, x: -0.04, y: 0.0, torso: 0, head: 2, aR1: 178, aR2: 180, aL1: 172, aL2: 176, lR1: 8, lR2: 2, lL1: 4, lL2: -2, e: 'o3' },- { b: 2, rot: 90, x: -0.04, y: 0.0, torso: 0, head: 0, aR1: 178, aR2: 180, aL1: 172, aL2: 176, lR1: 2, lR2: 0, lL1: -2, lL2: -4 },- ];- POSES.breast = {- iconU: 0.55,- pose: (u) => G.keyPose(breastKeys, mod(u, 2)),- back: (ctx, J, u, C) => waterBack(ctx, SURF, u, C, 0.6),- front: (ctx, J, u, C) => {- waterFront(ctx, SURF, u, C, { flow: 0.6 });- const t = mod(u, 2);- if (t > 1.2 && t < 2) wake(ctx, -0.5, SURF, u, C);- },- };-- // ───────── Backstroke: head to the left, face up, straight arm out of the water ─────────- const backArm = (a) => {- a = ((a % 360) + 360) % 360;- if (a <= 180) return [a, a]; // straight arm in the air- return [a, a + 55 * Math.sin(Math.PI * (a - 180) / 180)]; // bent arm pushing underwater- };- POSES.back = {- iconU: 0.5,- pose: (u) => {- const ph = mod(u, 2) / 2;- const aN = backArm(360 * ph + 90), aF = backArm(360 * ph + 270);- const f = flutter(ph, 10);- return { rot: -90, x: 0.06, y: 0.0, torso: 0, head: -6, aR1: aN[0], aR2: aN[1], aL1: aF[0], aL2: aF[1], lR1: f.lR1, lR2: f.lR1 + 10 * Math.max(0, Math.sin(TAU * 3 * ph + 1)), lL1: f.lL1, lL2: f.lL1 + 10 * Math.max(0, Math.sin(TAU * 3 * ph + 1 + Math.PI)) };- },- back: (ctx, J, u, C) => waterBack(ctx, SURF, -u, C, 1),- front: (ctx, J, u, C) => {- waterFront(ctx, SURF, -u, C, { flow: 1 });- ctx.save(); ctx.scale(-1, 1); wake(ctx, -0.55, SURF, u, C); ctx.restore();- },- };-- // ───────── Butterfly: both arms together, body undulates ─────────- POSES.fly = {- iconU: 1.5,- pose: (u) => {- const ph = mod(u, 2) / 2;- let a = freeArm(180 - 360 * ph);- if (a[0] < 0) a = [a[0], a[0] + 10];- const s = Math.sin(TAU * ph), k = Math.sin(TAU * 2 * ph);- return {- rot: 90 + 9 * s, x: -0.06, y: -0.06 * Math.max(0, -s), torso: -14 * Math.max(0, -Math.sin(TAU * ph + 0.3)), head: -6 * Math.max(0, -s),- aR1: a[0], aR2: a[1], aL1: a[0] - 8, aL2: a[1] - 8,- lR1: 18 * k, lR2: 18 * k - 34 * Math.max(0, Math.sin(TAU * 2 * ph + 1.2)), lL1: 18 * k - 4, lL2: 18 * k - 4 - 34 * Math.max(0, Math.sin(TAU * 2 * ph + 1.2)),- };- },- back: (ctx, J, u, C) => waterBack(ctx, SURF, u, C, 0.9),- front: (ctx, J, u, C) => { waterFront(ctx, SURF, u, C, { flow: 0.9 }); wake(ctx, -0.55, SURF, u, C); },- };-- // ───────── Diving: takeoff on beat 1, tucked one-and-a-half somersault in the air, vertical entry on beat 3 ─────────- const DV_SURF = 0.55, DV_BOARD = -0.415;- const dvKeys = [- { b: 0, x: -0.8, y: -0.865, torso: 0, head: 0, aR1: 4, aR2: 6, aL1: -4, aL2: -2, lR1: 2, lR2: 2, lL1: -2, lL2: -2 },- { b: 0.55, x: -0.8, y: -0.9, torso: -2, head: -6, aR1: 176, aR2: 178, aL1: 170, aL2: 174, lR1: 2, lR2: 0, lL1: -2, lL2: -4 },- { b: 0.85, x: -0.8, y: -0.79, torso: 22, head: 0, aR1: -48, aR2: -40, aL1: -54, aL2: -46, lR1: 58, lR2: -44, lL1: 54, lL2: -48, e: 'io' },- { b: 1.0, x: -0.76, y: -0.98, torso: 0, head: -4, aR1: 178, aR2: 180, aL1: 172, aL2: 176, lR1: 2, lR2: 0, lL1: -4, lL2: -6, e: 'o3' },- { b: 1.3, x: -0.62, y: -1.15, rot: 80, torso: 16, head: 10, aR1: 96, aR2: 158, aL1: 92, aL2: 152, lR1: 124, lR2: -14, lL1: 118, lL2: -20, e: 'o2' },- { b: 1.9, x: -0.42, y: -1.1, rot: 300, torso: 16, head: 10, aR1: 96, aR2: 158, aL1: 92, aL2: 152, lR1: 124, lR2: -14, lL1: 118, lL2: -20, e: 'lin' },- { b: 2.35, x: -0.24, y: -0.75, rot: 450, torso: 0, head: 0, aR1: 178, aR2: 180, aL1: 176, aL2: 178, lR1: 2, lR2: 0, lL1: -2, lL2: -2, e: 'lin' },- { b: 3.0, x: -0.12, y: -0.035, rot: 540, torso: 0, head: 0, aR1: 180, aR2: 180, aL1: 178, aL2: 178, lR1: 0, lR2: 0, lL1: -1, lL2: -1, e: 'i3' },- { b: 3.5, x: -0.12, y: 1.1, rot: 540, torso: 0, head: 0, aR1: 180, aR2: 180, aL1: 178, aL2: 178, lR1: 0, lR2: 0, lL1: -1, lL2: -1, e: 'lin' },- { b: 4.0, x: -0.12, y: 1.6, rot: 540 },- ];- POSES.diving = {- iconU: 1.6,- fig: { s: 0.6, y: 0.15, x: 0.12 },- pose: (u) => G.keyPose(dvKeys, mod(u, 4)),- back: (ctx, J, u, C) => {- // Platform + support pillar- ctx.fillStyle = C.line; ctx.fillRect(-1.42, DV_BOARD + 0.05, 0.1, DV_SURF - DV_BOARD);- ctx.fillStyle = C.acc; ctx.fillRect(-1.55, DV_BOARD, 0.86, 0.06);- waterBack(ctx, DV_SURF, u, C, 0.3);- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- // Water body: fully covers the figure after entry (fading horizontal bars are an element of the official graphic)- ctx.fillStyle = C.bg; ctx.fillRect(-2, DV_SURF, 4, 2);- ctx.fillStyle = C.line;- for (let i = 0; i < 6; i++) { ctx.globalAlpha = 1 - i / 6; ctx.fillRect(-1.6, DV_SURF + 0.04 + i * 0.07, 3.2, 0.018); }- ctx.globalAlpha = 1;- ctx.fillRect(-2, DV_SURF - 0.008, 4, 0.016);- // Entry: vertical splash + spreading ripples- const t = u - 3.0;- if (t > 0 && t < 1) {- const x = -0.12;- ctx.save(); ctx.globalAlpha = 1 - t;- for (let i = 0; i < 7; i++) {- const vx = (i - 3) * 0.1, p = fly([x, DV_SURF], [vx, -1.6 - (3 - Math.abs(i - 3)) * 0.35], 5, t);- G.disc(ctx, p[0], Math.min(p[1], DV_SURF), 0.03, C.acc);- }- ctx.strokeStyle = C.fg; ctx.lineWidth = 0.02;- for (let r = 0; r < 2; r++) { const k = G.E.o3(G.clamp(t * 1.4 - r * 0.2)); ctx.beginPath(); ctx.ellipse(x, DV_SURF, 0.1 + 0.55 * k, 0.03 + 0.07 * k, 0, 0, Math.PI * 2); ctx.stroke(); }- ctx.restore();- }- },- };-- // ───────── Artistic swimming (mirrored pair): beat 1 lift out of the water in a V, beat 3 inverted leg lift ─────────- const AS_SURF = 0.1;- const asKeys = [- { b: 0, x: -0.26, y: 0.42, torso: 0, head: 0, aR1: 62, aR2: 84, aL1: 54, aL2: 74, lR1: 56, lR2: -30, lL1: 36, lL2: -52 },- { b: 1.0, x: -0.26, y: 0.08, torso: -4, head: -14, aR1: 154, aR2: 160, aL1: 144, aL2: 150, lR1: 4, lR2: 0, lL1: -4, lL2: -6, e: 'o3' },- { b: 1.6, x: -0.26, y: 0.6, torso: 0, head: 0, aR1: 172, aR2: 176, aL1: 168, aL2: 172, lR1: 0, lR2: 0, lL1: 0, lL2: 0, e: 'i3' },- { b: 2.1, x: -0.26, y: 0.66, rot: 180, torso: 0, head: 0, aR1: 176, aR2: 178, aL1: 172, aL2: 176, lR1: 2, lR2: 2, lL1: -2, lL2: -2 },- { b: 3.0, x: -0.26, y: 0.13, rot: 180, torso: 0, head: 0, aR1: 150, aR2: 170, aL1: 140, aL2: 160, lR1: 0, lR2: 0, lL1: 88, lL2: 90, e: 'o3' },- { b: 3.5, x: -0.26, y: 0.1, rot: 180, torso: 0, head: 0, aR1: 150, aR2: 170, aL1: 140, aL2: 160, lR1: 0, lR2: 0, lL1: 2, lL2: 2 },- { b: 4.0, x: -0.26, y: 0.1, rot: 180, torso: 0, head: 0, aR1: 150, aR2: 170, aL1: 140, aL2: 160, lR1: 0, lR2: 0, lL1: 2, lL2: 2 },- ];- const asPose = (u) => G.keyPose(asKeys, mod(u, 4));- POSES.artistic = {- iconU: 3.6,- pose: asPose,- second: asPose, secondX: [0, 0], secondFace: -1,- back: (ctx, J, u, C) => waterBack(ctx, AS_SURF, u, C, 0.2),- front: (ctx, J, u, C) => {- waterFront(ctx, AS_SURF, u, C, { flow: 0.2, alpha: 0.7 });- // Splash at the moment of the lift / leg lift- const t = mod(u, 4);- for (const [t0, xs] of [[1.0, [-0.26, 0.26]], [3.0, [-0.26, 0.26]]]) {- const k = t - t0 + 0.15;- if (k < 0 || k > 0.7) continue;- ctx.save(); ctx.globalAlpha = 1 - k / 0.7;- for (const x of xs) for (let i = 0; i < 5; i++) {- const p = fly([x, AS_SURF], [(i - 2) * 0.25, -0.8 - (2 - Math.abs(i - 2)) * 0.2], 4, k);- G.disc(ctx, p[0], Math.min(p[1], AS_SURF), 0.022, C.acc);- }- ctx.restore();- }- },- };-- // ───────── Water polo: egg-beater → wind up → shot on beat 2 ─────────- const WP_SURF = -0.04;- const eggbeater = (u) => ({ lR1: 56 + 14 * Math.sin(TAU * u), lR2: -30 + 22 * Math.sin(TAU * u + 1), lL1: 50 - 14 * Math.sin(TAU * u), lL2: -40 - 22 * Math.sin(TAU * u + 1) });- const wpKeys = [- { b: 0, x: -0.2, y: 0.24, torso: 10, head: -2, aR1: 190, aR2: 226, aL1: 78, aL2: 88 },- { b: 1.4, x: -0.22, y: 0.12, torso: -6, head: -6, aR1: 204, aR2: 252, aL1: 86, aL2: 92 },- { b: 2.0, x: -0.16, y: 0.15, torso: 22, head: 0, aR1: 132, aR2: 130, aL1: 40, aL2: 60, e: 'iExp' },- { b: 2.5, x: -0.14, y: 0.18, torso: 30, head: 4, aR1: 72, aR2: 74, aL1: 30, aL2: 50, e: 'o3' },- { b: 3.3, x: -0.16, y: 0.24, torso: 12, head: -4, aR1: 150, aR2: 160, aL1: 70, aL2: 84 },- { b: 4.0, x: -0.18, y: 0.24, torso: 10, head: -4, aR1: 172, aR2: 190, aL1: 76, aL2: 88 },- ];- const wpPose = (u) => ({ ...G.keyPose(wpKeys, mod(u, 4)), ...eggbeater(u) });- const WP_REL = G.joints(wpPose(2)).aR[2];- const wpBall = (ctx, p, C) => {- G.disc(ctx, p[0], p[1], 0.064, C.acc);- ctx.strokeStyle = C.bg; ctx.lineWidth = 0.01;- ctx.beginPath(); ctx.arc(p[0] - 0.09, p[1], 0.09, -0.6, 0.6); ctx.stroke();- ctx.beginPath(); ctx.arc(p[0] + 0.09, p[1], 0.09, Math.PI - 0.6, Math.PI + 0.6); ctx.stroke();- };- POSES.waterpolo = {- iconU: 1.4,- pose: wpPose,- back: (ctx, J, u, C) => {- // Goal: posts + crossbar + net grid- ctx.fillStyle = C.fg; ctx.fillRect(0.6, -0.44, 0.03, 0.42); ctx.fillRect(0.6, -0.44, 0.5, 0.03);- ctx.strokeStyle = C.line; ctx.lineWidth = 0.008;- for (let i = 1; i < 6; i++) { ctx.beginPath(); ctx.moveTo(0.63 + i * 0.07, -0.41); ctx.lineTo(0.63 + i * 0.07 + 0.05, WP_SURF); ctx.stroke(); }- for (let j = 1; j < 5; j++) { ctx.beginPath(); ctx.moveTo(0.63, -0.41 + j * 0.08); ctx.lineTo(1.1, -0.41 + j * 0.08); ctx.stroke(); }- waterBack(ctx, WP_SURF, u, C, 0.2);- },- front: (ctx, J, u, C) => {- const t = mod(u, 4) - 2;- waterFront(ctx, WP_SURF, u, C, { flow: 0.2, alpha: 0.62 });- if (t < 0) wpBall(ctx, J.aR[2], C);- else if (t < 0.55) wpBall(ctx, fly(WP_REL, [1.1, 0.1], 0.6, t), C);- else { // after going in, it drops into the net- const p = fly(WP_REL, [1.1, 0.1], 0.6, 0.55);- wpBall(ctx, [p[0] + (t - 0.55) * 0.08, Math.min(WP_SURF - 0.07, p[1] + (t - 0.55) * 0.6)], C);- }- },- };-})();diff --git a/styles/pictogram-motion/demo/poses/asia.js b/styles/pictogram-motion/demo/poses/asia.jsdeleted file mode 100644index ca7e1ad..0000000--- a/styles/pictogram-motion/demo/poses/asia.js+++ /dev/null@@ -1,461 +0,0 @@-// Chapter 7 Asia · New wave: kabaddi, sepak takraw, wushu, skateboarding, sport climbing, breaking, esports-(function () {- const G = window.G, P = G.P, POSES = window.POSES, L = G.LEN, D2R = G.D2R;- const R2D = 180 / Math.PI;- const { lerp, clamp, E } = G;- const fract = (x) => x - Math.floor(x);-- // ── Inverse kinematics (same scheme as nature.js, solved per frame) ──- function ik(A, T, L1, L2, bend) {- const dx = T[0] - A[0], dy = T[1] - A[1];- let d = Math.hypot(dx, dy);- d = clamp(d, Math.abs(L1 - L2) + 1e-4, L1 + L2 - 1e-4);- const base = Math.atan2(dx, dy);- const b = Math.acos(clamp((L1 * L1 + d * d - L2 * L2) / (2 * L1 * d), -1, 1));- const a1 = base + bend * b;- const K = [A[0] + Math.sin(a1) * L1, A[1] + Math.cos(a1) * L1];- return [a1 * R2D, Math.atan2(T[0] - K[0], T[1] - K[1]) * R2D];- }- function solve(base, T) {- const p = Object.assign({ x: 0, y: 0, rot: 0, torso: 0, head: 0 }, base);- const hip = [p.x, p.y], tf = p.rot + p.torso, sl = L.torso - 0.025;- const sho = [hip[0] + Math.sin(tf * D2R) * sl, hip[1] - Math.cos(tf * D2R) * sl];- const leg = (t, k) => { const [a, b] = ik(hip, t, L.th, L.sh, k); return [a + p.rot, b + p.rot]; };- const arm = (t, k) => { const [a, b] = ik(sho, t, L.ua, L.fa, k); return [a + tf, b + tf]; };- if (T.fR) [p.lR1, p.lR2] = leg(T.fR, T.kR ?? 1);- if (T.fL) [p.lL1, p.lL2] = leg(T.fL, T.kL ?? 1);- if (T.hR) [p.aR1, p.aR2] = arm(T.hR, T.eR ?? -1);- if (T.hL) [p.aL1, p.aL2] = arm(T.hL, T.eL ?? -1);- return p;- }- // Keyframe interpolation: numbers linearly, [x,y] per component; each segment can carry an easing e- function keyAt(keys, u) {- if (u <= keys[0].b) return keys[0];- for (let i = 0; i < keys.length - 1; i++) {- const a = keys[i], b = keys[i + 1];- if (u < b.b) {- const t = (E[b.e || 'io'])((u - a.b) / (b.b - a.b));- const o = {};- for (const k in b) {- if (k === 'e' || k === 'b') continue;- const va = a[k] ?? b[k], vb = b[k];- o[k] = Array.isArray(vb) ? [lerp(va[0], vb[0], t), lerp(va[1], vb[1], t)] : typeof vb === 'number' ? lerp(va, vb, t) : vb;- }- return o;- }- }- return keys[keys.length - 1];- }- const fromKey = (k) => solve({ x: k.hip[0], y: k.hip[1], rot: k.rot || 0, torso: k.torso || 0, head: k.head || 0 },- { fR: k.fR, fL: k.fL, hR: k.hR, hL: k.hL, kR: k.kR ?? 1, kL: k.kL ?? 1, eR: k.eR ?? -1, eL: k.eL ?? -1 });- const burst = (ctx, x, y, t, r, C, n = 8) => {- if (t < 0 || t > 1) return;- ctx.save(); ctx.globalAlpha = 1 - t;- G.ring(ctx, x, y, r * (0.3 + E.o3(t)), 0.014, C.acc);- for (let i = 0; i < n; i++) { const a = (i / n) * Math.PI * 2 + 0.3; const r0 = r * (0.55 + E.o3(t) * 0.6), r1 = r0 + r * 0.3 * (1 - t); G.seg(ctx, [x + Math.cos(a) * r0, y + Math.sin(a) * r0], [x + Math.cos(a) * r1, y + Math.sin(a) * r1], 0.014, C.fg); }- ctx.restore();- };-- // ── Kabaddi: the raider stays low, reaches out on beat 2 to touch a defender, then pulls back; one chant per beat ──- const KAB = [- { b: 0, hip: [-0.3, 0.13], torso: 42, head: -24, fR: [-0.1, 0.46], fL: [-0.5, 0.46], hR: [-0.02, 0.14], hL: [-0.4, 0.02] },- { b: 0.5, hip: [-0.26, 0.08], torso: 36, head: -24, fR: [-0.02, 0.44], fL: [-0.48, 0.46], hR: [0.04, 0.1], hL: [-0.36, 0.0] },- { b: 1.0, hip: [-0.2, 0.1], torso: 38, head: -24, fR: [0.02, 0.46], fL: [-0.38, 0.45], hR: [0.1, 0.12], hL: [-0.34, 0.02] },- { b: 1.4, hip: [-0.16, 0.13], torso: 34, head: -22, fR: [0.06, 0.46], fL: [-0.36, 0.46], hR: [0.12, 0.08], hL: [-0.3, -0.02] },- { b: 2.0, hip: [0.08, 0.16], torso: 46, head: -30, fR: [0.4, 0.46], fL: [-0.36, 0.46], hR: [0.56, 0.16], hL: [-0.24, -0.08], e: 'oExp' },- { b: 2.3, hip: [0.02, 0.14], torso: 30, head: -18, fR: [0.36, 0.46], fL: [-0.4, 0.46], hR: [0.36, 0.1], hL: [-0.3, -0.06] },- { b: 3.0, hip: [-0.36, 0.06], torso: 18, head: -10, fR: [-0.14, 0.46], fL: [-0.58, 0.43], hR: [-0.1, -0.12], hL: [-0.46, -0.1], e: 'o3' },- { b: 4.0, hip: [-0.3, 0.13], torso: 42, head: -24, fR: [-0.1, 0.46], fL: [-0.5, 0.46], hR: [-0.02, 0.14], hL: [-0.4, 0.02] },- ];- // Defender (local coordinates, facing +x; mirrored to the right when drawn)- const KABD = [- { b: 0, hip: [0.0, 0.12], torso: 40, head: -26, fR: [0.2, 0.46], fL: [-0.22, 0.46], hR: [0.26, 0.02], hL: [0.2, -0.04] },- { b: 2.05, hip: [0.0, 0.13], torso: 40, head: -26, fR: [0.2, 0.46], fL: [-0.22, 0.46], hR: [0.26, 0.02], hL: [0.2, -0.04] },- { b: 2.5, hip: [0.2, 0.18], torso: 58, head: -34, fR: [0.46, 0.46], fL: [-0.16, 0.46], hR: [0.62, 0.16], hL: [0.56, 0.1], e: 'o3' },- { b: 3.2, hip: [0.1, 0.14], torso: 44, head: -28, fR: [0.34, 0.46], fL: [-0.14, 0.46], hR: [0.38, 0.1], hL: [0.3, 0.02] },- { b: 4.0, hip: [0.0, 0.12], torso: 40, head: -26, fR: [0.2, 0.46], fL: [-0.22, 0.46], hR: [0.26, 0.02], hL: [0.2, -0.04] },- ];- POSES.kabaddi = {- iconU: 2,- pose: (u) => fromKey(keyAt(KAB, u)),- second: (u) => fromKey(keyAt(KABD, u)),- secondX: [0.8, 0], secondFace: -1,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Centre line (half-court divider): a thick line on the ground + a vertical dashed line- ctx.fillStyle = C.acc; ctx.fillRect(0.22, 0.46, 0.03, 0.08);- for (let i = 0; i < 9; i++) { ctx.fillStyle = C.line; ctx.fillRect(0.228, 0.4 - i * 0.12, 0.014, 0.06); }- },- front: (ctx, J, u, C) => {- // One chant of "kabaddi" per beat: two sound-wave arcs in front of the mouth- const f = fract(u);- if (f < 0.6) {- const k = f / 0.6, h = J.head, a = (J.p.torso + J.p.head) * D2R;- const dir = [Math.cos(a), Math.sin(a)];- ctx.save(); ctx.globalAlpha = 1 - k; ctx.strokeStyle = C.fg; ctx.lineWidth = 0.014; ctx.lineCap = 'round';- for (let i = 0; i < 2; i++) { const r = 0.1 + i * 0.05 + k * 0.08; ctx.beginPath(); ctx.arc(h[0], h[1], r, a - 0.5, a + 0.5); ctx.stroke(); }- ctx.restore();- }- // Touch on beat 2- burst(ctx, J.aR[2][0] + 0.04, J.aR[2][1], (u - 1.95) / 0.5, 0.16, C);- },- };-- // ── Sepak takraw: bicycle kick (back to the net, flips backwards, foot spikes the ball over the head), contact on beat 2 ──- const TK = [- { b: 0, hip: [0.05, 0.02], rot: 0, torso: 6, head: -8, fR: [0.18, 0.46], fL: [-0.1, 0.46], hR: [0.25, -0.02], hL: [-0.2, -0.02] },- { b: 1.0, hip: [0.05, 0.12], rot: 0, torso: 22, head: -30, fR: [0.2, 0.46], fL: [-0.12, 0.46], hR: [0.2, 0.1], hL: [-0.28, 0.1] },- { b: 1.35, hip: [0.0, -0.22], rot: -30, torso: -4, head: -30, fR: [0.25, 0.1], fL: [-0.05, 0.22], hR: [0.3, -0.35], hL: [-0.3, -0.25], e: 'o2' },- { b: 2.0, hip: [-0.04, -0.52], rot: -135, torso: 0, head: 10, fR: null, fL: null, hR: [0.3, -0.28], hL: [0.2, -0.2], e: 'io' },- { b: 2.6, hip: [-0.1, -0.3], rot: -260, torso: 10, head: 0, fR: null, fL: null, hR: null, hL: null, e: 'io' },- { b: 3.2, hip: [-0.12, 0.14], rot: -360, torso: 30, head: -20, fR: [0.05, 0.46], fL: [-0.28, 0.46], hR: [0.05, 0.12], hL: [-0.36, 0.0], e: 'o3' },- { b: 4.0, hip: [-0.1, 0.04], rot: -360, torso: 10, head: -8, fR: [0.06, 0.46], fL: [-0.24, 0.46], hR: [0.14, -0.02], hL: [-0.3, -0.02] },- ];- function takrawPose(u) {- const k = keyAt(TK, u);- const p = fromKey({ ...k, fR: k.fR || [0, 0], fL: k.fL || [0, 0], hR: k.hR || [0, 0], hL: k.hL || [0, 0] });- // Airborne stretch: angles written directly (body coordinates): the spiking leg whips over the head, the other leg scissors the opposite way- const air = clamp((u - 1.3) / 0.35) * (1 - clamp((u - 2.8) / 0.4));- if (air > 0) {- const kick = u < 2 ? E.io(clamp((u - 1.3) / 0.7)) : 1 - E.io(clamp((u - 2.0) / 0.9));- const A = {- lR1: lerp(20, 128, kick), lR2: lerp(10, 132, kick),- lL1: lerp(-10, -40, kick), lL2: lerp(-40, -70, kick),- aR1: lerp(40, 60, kick), aR2: lerp(80, 40, kick), aL1: lerp(60, -70, kick), aL2: lerp(90, -40, kick),- };- for (const key in A) p[key] = lerp(p[key], A[key], air);- }- return p;- }- const BALL_R = 0.075;- function takrawBall(u) {- const Jc = G.joints(takrawPose(2.0));- const pc = Jc.lR[2];- const hit = [pc[0] - 0.02, pc[1] - 0.07];- if (u < 2) {- // Tossed in from the right (the set)- const t = clamp((u - 0.2) / 1.8);- const p0 = [1.25, 0.05];- return { p: [lerp(p0[0], hit[0], t), lerp(p0[1], hit[1], t) - 0.9 * 4 * t * (1 - t) * 0.5], show: u > 0.2 };- }- const t = (u - 2) / 0.35;- return { p: [lerp(hit[0], -1.5, t), lerp(hit[1], 0.5, t)], show: t < 1.2, fast: true, hit };- }- function drawRattan(ctx, x, y, r, C, spin) {- G.disc(ctx, x, y, r, C.acc);- ctx.save(); ctx.translate(x, y); ctx.rotate(spin);- for (let i = 0; i < 6; i++) { const a = (i / 6) * Math.PI * 2; G.disc(ctx, Math.cos(a) * r * 0.55, Math.sin(a) * r * 0.55, r * 0.2, C.bg); }- G.disc(ctx, 0, 0, r * 0.2, C.bg);- ctx.restore();- }- POSES.takraw = {- fig: { s: 0.88, x: 0.08, y: 0.06 },- iconU: 2,- pose: takrawPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.8, 1.8);- // Net: behind (to the left)- const nx = -0.66;- G.seg(ctx, [nx, 0.46], [nx, -0.46], 0.022, C.fg);- ctx.fillStyle = G.rgba(C.fg, 0.14); ctx.fillRect(nx - 0.5, -0.42, 0.5, 0.26);- ctx.strokeStyle = C.line; ctx.lineWidth = 0.006;- for (let i = 0; i <= 10; i++) { ctx.beginPath(); ctx.moveTo(nx - 0.5 + i * 0.05, -0.42); ctx.lineTo(nx - 0.5 + i * 0.05, -0.16); ctx.stroke(); }- for (let j = 0; j <= 5; j++) { ctx.beginPath(); ctx.moveTo(nx - 0.5, -0.42 + j * 0.052); ctx.lineTo(nx, -0.42 + j * 0.052); ctx.stroke(); }- ctx.fillStyle = C.fg; ctx.fillRect(nx - 0.5, -0.43, 0.5, 0.02);- },- front: (ctx, J, u, C) => {- const b = takrawBall(u);- if (b.fast) {- // Spike trail- const t0 = Math.max(2, u - 0.12);- const bt = takrawBall(t0).p;- ctx.save(); ctx.globalAlpha = 0.5; G.seg(ctx, bt, b.p, BALL_R * 1.6, C.acc); ctx.restore();- burst(ctx, b.hit[0], b.hit[1], (u - 2) / 0.45, 0.22, C, 10);- }- if (b.show) drawRattan(ctx, b.p[0], b.p[1], BALL_R, C, u * 5);- },- };-- // ── Wushu (sword routine): bow stance thrust → circling sword → leap → drop stance ──- const WS = [- { b: 0, hip: [-0.02, 0.1], rot: 0, torso: 10, head: -6, fR: [0.34, 0.46], fL: [-0.42, 0.46], hR: [0.52, -0.16], hL: [-0.3, -0.46], sw: 0 },- { b: 0.6, hip: [-0.02, 0.1], rot: 0, torso: 10, head: -6, fR: [0.34, 0.46], fL: [-0.42, 0.46], hR: [0.54, -0.17], hL: [-0.3, -0.47], sw: 0 },- { b: 1.0, hip: [0.0, 0.0], rot: 0, torso: -10, head: 12, fR: [0.18, 0.46], fL: [-0.2, 0.46], hR: [0.08, -0.72], hL: [0.34, -0.3], sw: -70, e: 'o3' },- { b: 1.35, hip: [0.02, 0.1], rot: 0, torso: 14, head: -4, fR: [0.18, 0.46], fL: [-0.16, 0.46], hR: [-0.22, -0.38], hL: [0.3, -0.12], sw: -140 },- { b: 2.0, hip: [0.04, -0.34], rot: -6, torso: 4, head: -10, fR: [0.46, -0.52], fL: [-0.06, -0.08], kL: 1, hR: [-0.18, -0.78], hL: [0.42, -0.52], sw: -30, e: 'o3' },- { b: 2.45, hip: [0.0, -0.08], rot: 0, torso: 14, head: -8, fR: [0.2, 0.3], fL: [-0.1, 0.36], hR: [0.1, -0.5], hL: [0.3, -0.3], sw: -10, e: 'i3' },- { b: 3.0, hip: [-0.2, 0.28], rot: 0, torso: 26, head: -12, fR: [0.32, 0.46], fL: [-0.22, 0.46], hR: [0.34, 0.1], hL: [-0.34, -0.42], sw: 8, e: 'oExp' },- { b: 4.0, hip: [-0.21, 0.29], rot: 0, torso: 27, head: -12, fR: [0.32, 0.46], fL: [-0.22, 0.46], hR: [0.35, 0.11], hL: [-0.34, -0.43], sw: 8 },- ];- const wushuPose = (u) => fromKey(keyAt(WS, u));- function swordTip(u) {- const k = keyAt(WS, u), J = G.joints(wushuPose(u));- const h = J.aR[2], e = J.aR[1];- const d = [h[0] - e[0], h[1] - e[1]], n = Math.hypot(d[0], d[1]);- const v = G.rot2([d[0] / n, d[1] / n], k.sw || 0);- return { h, tip: [h[0] + v[0] * 0.62, h[1] + v[1] * 0.62], v };- }- POSES.wushu = {- iconU: 3,- pose: wushuPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Sword light: the fan swept by the blade over the past 0.3 beats- const N = 10;- for (let i = N; i >= 1; i--) {- const a = swordTip(u - (i - 1) * 0.022), b = swordTip(u - i * 0.022);- ctx.fillStyle = G.rgba(C.acc, 0.32 * (1 - i / N));- ctx.beginPath(); ctx.moveTo(a.h[0], a.h[1]); ctx.lineTo(a.tip[0], a.tip[1]); ctx.lineTo(b.tip[0], b.tip[1]); ctx.lineTo(b.h[0], b.h[1]); ctx.fill();- }- },- front: (ctx, J, u, C) => {- const s = swordTip(u);- // Blade + guard + tassel- G.seg(ctx, s.h, s.tip, 0.018, C.fg);- const g0 = [s.h[0] + s.v[0] * 0.04, s.h[1] + s.v[1] * 0.04];- G.seg(ctx, [g0[0] - s.v[1] * 0.05, g0[1] + s.v[0] * 0.05], [g0[0] + s.v[1] * 0.05, g0[1] - s.v[0] * 0.05], 0.022, C.acc);- const pom = [s.h[0] - s.v[0] * 0.06, s.h[1] - s.v[1] * 0.06];- const lag = swordTip(u - 0.12);- const tail = [pom[0] - (s.h[0] - lag.h[0]) * 1.4 - s.v[0] * 0.12, pom[1] - (s.h[1] - lag.h[1]) * 1.4 - s.v[1] * 0.12 + 0.08];- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.02; ctx.lineCap = 'round';- ctx.beginPath(); ctx.moveTo(pom[0], pom[1]); ctx.quadraticCurveTo((pom[0] + tail[0]) / 2 + 0.04, (pom[1] + tail[1]) / 2, tail[0], tail[1]); ctx.stroke();- G.disc(ctx, tail[0], tail[1], 0.022, C.acc);- // Drop-stance landing: a ring of dust- burst(ctx, J.lR[2][0], 0.46, (u - 2.95) / 0.6, 0.18, C);- },- };-- // ── Skateboarding: ollie + kickflip over a box, landing on beat 2 ──- function skateState(u) {- // Board centre, board angle, flip phase, crouch amount- let y = 0, ang = 0, flip = 0, crouch = 0.1;- if (u < 1) { crouch = lerp(0.06, 0.2, E.io(u)); }- else if (u < 2) {- const t = u - 1;- y = -0.4 * Math.sin(Math.PI * t) * (t < 0.5 ? E.o2(t * 2) ** 0.4 : 1);- ang = t < 0.12 ? lerp(0, -28, t / 0.12) : t < 0.45 ? lerp(-28, 0, (t - 0.12) / 0.33) : t < 0.85 ? 0 : lerp(0, 4, (t - 0.85) / 0.15);- flip = clamp((t - 0.15) / 0.5);- crouch = t < 0.1 ? lerp(0.2, 0.06, t / 0.1) : t < 0.5 ? lerp(0.06, 0.24, E.o2((t - 0.1) / 0.4)) : lerp(0.24, 0.12, (t - 0.5) / 0.5);- } else {- const t = u - 2;- crouch = t < 0.25 ? lerp(0.12, 0.26, E.o3(t / 0.25)) : lerp(0.26, 0.04, E.io((t - 0.25) / 1.4));- if (t > 1.7) crouch = lerp(0.04, 0.08, (t - 1.7) / 0.3);- }- return { c: [0, 0.4 + y], ang, flip, crouch };- }- POSES.skate = {- fig: { s: 0.92, x: 0, y: 0.04 },- iconU: 1.45,- pose: (u) => {- const s = skateState(u);- const bp = (lx, ly) => { const v = G.rot2([lx, ly], s.ang); return [s.c[0] + v[0], s.c[1] + v[1]]; };- const air = u > 1.1 && u < 1.95;- const lift = air ? 0.02 : 0;- const hip = [s.c[0] - 0.03, s.c[1] - 0.42 + s.crouch];- const arm = air ? 1 : 0;- return solve({ x: hip[0], y: hip[1], torso: 10 + s.crouch * 60, head: -8 },- { fR: bp(0.17, -0.03 - lift), fL: bp(-0.2, -0.03 - lift), kR: 1, kL: 1, hR: [hip[0] + 0.3, hip[1] - 0.05 - arm * 0.1], hL: [hip[0] - 0.34, hip[1] - 0.15 - arm * 0.12], eR: -1, eL: 1 });- },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.47, C, -1.6, 1.6);- // Box: under the board at beat 1.5- const x = (1.5 - u) * 0.9;- for (const ox of [x, x + 3.6]) {- ctx.fillStyle = C.far2; ctx.fillRect(ox - 0.28, 0.25, 0.56, 0.22);- ctx.fillStyle = C.fg; ctx.fillRect(ox - 0.28, 0.24, 0.56, 0.025);- }- const s = skateState(u);- if (u > 1.05 && u < 1.9) P.speed(ctx, -0.35, s.c[1] - 0.3, 0.6, 4, C, 0.7);- },- front: (ctx, J, u, C) => {- const s = skateState(u);- ctx.save(); ctx.translate(s.c[0], s.c[1] + 0.02); ctx.rotate(s.ang * D2R);- const f = Math.cos(s.flip * Math.PI * 2); // kickflip: the board spins once around its long axis- ctx.scale(1, f === 0 ? 0.001 : f);- // Deck + raised nose and tail- ctx.fillStyle = f > 0 ? C.fg : C.acc;- ctx.beginPath(); ctx.moveTo(-0.26, -0.012); ctx.lineTo(0.26, -0.012); ctx.lineTo(0.34, -0.06); ctx.lineTo(0.36, -0.045); ctx.lineTo(0.27, 0.012); ctx.lineTo(-0.27, 0.012); ctx.lineTo(-0.36, -0.045); ctx.lineTo(-0.34, -0.06); ctx.closePath(); ctx.fill();- // Trucks + wheels- G.disc(ctx, -0.19, 0.045, 0.03, C.acc); G.disc(ctx, 0.19, 0.045, 0.03, C.acc);- ctx.fillStyle = C.fg; ctx.fillRect(-0.22, 0.01, 0.06, 0.02); ctx.fillRect(0.16, 0.01, 0.06, 0.02);- ctx.restore();- // Pop on takeoff, landing- burst(ctx, -0.34, 0.47, (u - 1.0) / 0.4, 0.12, C, 6);- burst(ctx, 0.0, 0.47, (u - 2.0) / 0.5, 0.2, C, 8);- },- };-- // ── Sport climbing (front view): frog-style three-point stance → sink to load → dyno to a high hold on beat 2 → wall scrolls down ──- const CL_D = 0.42;- const CLK = [- { b: 0, hip: [0.0, 0.08], torso: 0, head: -6, fR: [0.22, 0.4], fL: [-0.22, 0.42], hR: [0.26, -0.6], hL: [-0.26, -0.54] },- { b: 1.0, hip: [0.02, 0.14], torso: 0, head: -18, fR: [0.22, 0.4], fL: [-0.22, 0.42], hR: [0.26, -0.6], hL: [-0.26, -0.54] },- { b: 1.45, hip: [0.02, 0.22], torso: 0, head: -24, fR: [0.22, 0.4], fL: [-0.22, 0.42], hR: [0.26, -0.6], hL: [-0.26, -0.54], e: 'io' },- { b: 2.0, hip: [0.1, -0.3], torso: 6, head: -24, fR: [0.2, 0.14], fL: [-0.16, 0.2], hR: [0.26, -1.04], hL: [-0.18, -0.64], e: 'oExp' },- { b: 2.5, hip: [0.08, -0.26], torso: 2, head: -12, fR: [0.24, 0.06], fL: [-0.1, 0.18], hR: [0.26, -1.04], hL: [-0.18, -0.64] },- { b: 3.0, hip: [0.02, -0.33], torso: 0, head: -6, fR: [0.24, -0.02], fL: [-0.22, 0.0], hR: [0.26, -1.04], hL: [-0.26, -0.96], e: 'o3' },- { b: 4.0, hip: [0.02, -0.34], torso: 0, head: -6, fR: [0.24, -0.02], fL: [-0.22, 0.0], hR: [0.26, -1.04], hL: [-0.26, -0.96] },- ];- const clScroll = (u) => CL_D * E.io(clamp((u - 2.8) / 1.2));- // Front view: right hand / right foot bend outwards (+x), the left side bends to -x- const climbPose = (u) => {- const k = keyAt(CLK, u), s = clScroll(u);- const sh = (p) => [p[0], p[1] + s];- return fromKey({ ...k, hip: sh(k.hip), fR: sh(k.fR), fL: sh(k.fL), hR: sh(k.hR), hL: sh(k.hL), kR: 1, kL: -1, eR: -1, eL: 1 });- };- const HOLDS = [- // [x, y, shape, size]: 0 circle, 1 half circle, 2 triangle, 3 crescent- [0.26, -0.6, 0, 0.07], [-0.26, -0.54, 1, 0.08], [0.22, 0.44, 1, 0.07], [-0.22, 0.46, 0, 0.06],- [0.26, -1.04, 3, 0.09], [-0.26, -0.96, 0, 0.065], [0.24, 0.02, 2, 0.07], [-0.22, 0.04, 0, 0.06],- [-0.62, -0.3, 2, 0.08], [0.64, -0.12, 0, 0.1], [0.58, -0.8, 1, 0.07], [-0.6, 0.3, 3, 0.08], [0.62, 0.5, 2, 0.07], [-0.55, -1.2, 0, 0.07],- [0.0, -1.35, 1, 0.08], [0.02, 0.72, 0, 0.07], [-0.02, -0.2, 3, 0.05],- ];- function hold(ctx, x, y, kind, r, col, hi) {- ctx.fillStyle = col;- ctx.beginPath();- if (kind === 0) ctx.arc(x, y, r, 0, Math.PI * 2);- else if (kind === 1) ctx.arc(x, y + r * 0.3, r, Math.PI, 0);- else if (kind === 2) { ctx.moveTo(x - r, y + r * 0.6); ctx.lineTo(x, y - r * 0.8); ctx.lineTo(x + r, y + r * 0.6); }- else { ctx.arc(x, y, r, 0.2, Math.PI - 0.2); }- ctx.fill();- G.disc(ctx, x, y, 0.012, hi);- }- POSES.climbing = {- fig: { s: 0.82, x: 0, y: 0.1 },- iconU: 2.0,- pose: climbPose,- back: (ctx, J, u, C) => {- const s = clScroll(u);- // Panel seams + bolt-hole grid- ctx.fillStyle = G.rgba(C.fg, 0.12);- for (let i = -3; i <= 3; i++) ctx.fillRect(i * 0.42 - 0.004, -1.6, 0.008, 3.2);- const oy = fract(s / CL_D) * CL_D;- for (let j = -5; j <= 4; j++) ctx.fillRect(-1.5, j * CL_D + oy - 0.004, 3, 0.008);- for (let j = -5; j <= 4; j++) for (let i = -4; i <= 4; i++) G.disc(ctx, i * 0.21 + 0.105, j * 0.21 + ((s % 0.21) + 0.21) % 0.21, 0.008, C.far2);- HOLDS.forEach((h, i) => hold(ctx, h[0], h[1] + s, h[2], h[3], i < 8 ? C.acc : C.far2, C.bg));- // The instant a hold is caught: light it up- burst(ctx, 0.26, -1.04 + s, (u - 2.0) / 0.5, 0.2, C);- },- };-- // ── Breaking: toprock → go down → one-hand freeze on beat 2 → flip and spin → baby freeze on beat 3 ──- const BK = [- { b: 0, hip: [-0.05, 0.02], rot: 0, torso: 4, head: -4, fR: [0.12, 0.46], fL: [-0.2, 0.46], hR: [0.18, -0.12], hL: [-0.02, -0.22] },- { b: 0.5, hip: [0.02, 0.04], rot: 0, torso: 8, head: 6, fR: [0.26, 0.4], fL: [-0.12, 0.46], hR: [0.3, -0.4], hL: [-0.24, -0.1] },- { b: 1.0, hip: [0.05, 0.02], rot: 0, torso: 2, head: -4, fR: [0.18, 0.46], fL: [-0.12, 0.46], hR: [0.12, -0.2], hL: [-0.1, -0.1] },- { b: 1.5, hip: [0.0, 0.22], rot: 0, torso: 52, head: -20, fR: [0.2, 0.46], fL: [-0.24, 0.46], hR: [0.24, 0.46], hL: [-0.1, 0.2] },- { b: 2.0, hip: [0.02, -0.06], rot: 152, torso: 0, head: -10, fR: [-0.28, -0.46], fL: [0.2, -0.52], hR: [0.18, 0.46], hL: [-0.18, 0.38], kR: -1, kL: 1, eR: 1, e: 'oExp' },- { b: 2.35, hip: [0.02, -0.08], rot: 156, torso: 0, head: -10, fR: [-0.3, -0.48], fL: [0.2, -0.54], hR: [0.18, 0.46], hL: [-0.18, 0.38], kR: -1, kL: 1, eR: 1 },- { b: 2.7, hip: [0.0, -0.3], rot: 330, torso: -10, head: 0, fR: [-0.1, -0.62], fL: [0.3, -0.5], hR: [0.3, -0.1], hL: [-0.2, -0.1] },- { b: 3.0, hip: [-0.06, 0.12], rot: 468, torso: 0, head: 0, fR: [-0.42, 0.02], fL: [-0.28, 0.2], hR: [0.3, 0.46], hL: [0.18, 0.46], kR: -1, kL: -1, eR: 1, eL: 1, e: 'oExp' },- { b: 4.0, hip: [-0.07, 0.12], rot: 470, torso: 0, head: 0, fR: [-0.43, 0.0], fL: [-0.28, 0.19], hR: [0.3, 0.46], hL: [0.18, 0.46], kR: -1, kL: -1, eR: 1, eL: 1 },- ];- POSES.breaking = {- iconU: 2.2,- pose: (u) => {- const k = keyAt(BK, u);- // Flip stretch: the limb angles of the keyframes at either end don't interpolate well as target points, so use V-shaped legs directly- const p = fromKey(k);- const spin = clamp((u - 2.4) / 0.55) * (1 - clamp((u - 2.9) / 0.1));- if (spin > 0) {- const V = { lR1: 40, lR2: 40, lL1: -40, lL2: -40, aR1: 120, aR2: 150, aL1: -110, aL2: -140 };- const w = Math.sin(Math.PI * clamp((u - 2.4) / 0.6));- for (const key in V) p[key] = lerp(p[key], V[key], w);- }- return p;- },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Dance floor: a diamond-shaped light patch on the ground- ctx.fillStyle = G.rgba(C.fg, 0.08);- ctx.beginPath(); ctx.ellipse(0, 0.5, 0.8, 0.07, 0, 0, Math.PI * 2); ctx.fill();- // Arc of the flip- const t = (u - 2.35) / 0.8;- if (t > 0 && t < 1) {- ctx.save(); ctx.globalAlpha = 1 - t; ctx.strokeStyle = C.acc; ctx.lineWidth = 0.03; ctx.lineCap = 'round';- ctx.beginPath(); ctx.arc(0, -0.08, 0.55, -Math.PI * 0.9, -Math.PI * 0.9 + Math.PI * 1.6 * E.o3(t * 1.4)); ctx.stroke();- ctx.restore();- }- },- front: (ctx, J, u, C) => {- burst(ctx, 0.18, 0.46, (u - 2.0) / 0.5, 0.18, C);- burst(ctx, 0.24, 0.46, (u - 3.0) / 0.5, 0.22, C, 10);- },- };-- // ── Esports: wearing a headset in a gaming chair, a geometric HUD on the screen pulses on the beat ──- const ES_Y = 0.18;- POSES.esports = {- fig: { s: 0.8, x: -0.3, y: -0.08 },- iconU: 2,- pose: (u) => {- const q = fract(u * 2), s16 = Math.sin(u * Math.PI * 8);- const flick = Math.exp(-q * 8) * (Math.floor(u * 2) % 2 ? 1 : -1);- const nod = Math.exp(-fract(u) * 6);- const Y = ES_Y;- return solve({ x: 0, y: Y, torso: 24 + nod * 3, head: -14 + nod * 8 },- { fR: [0.3, 0.46], fL: [0.27, 0.46], kR: 1, kL: 1, hR: [0.4 + flick * 0.04, Y - 0.05 - Math.abs(flick) * 0.01], hL: [0.3, Y - 0.055 + Math.max(0, s16) * 0.014], eR: -1, eL: -1 });- },- back: (ctx, J, u, C) => {- // Floor- P.ground(ctx, 0.46, C, -1.2, 1.4);- ctx.save(); ctx.translate(0, ES_Y);- // Chair: backrest + seat + column + five-star base- G.seg(ctx, [-0.13, 0.02], [-0.2, -0.5], 0.13, C.far2);- G.disc(ctx, -0.2, -0.52, 0.075, C.far2);- G.seg(ctx, [-0.16, 0.08], [0.16, 0.08], 0.06, C.far2);- G.seg(ctx, [0.0, 0.1], [0.0, 0.22], 0.03, C.far2);- G.seg(ctx, [-0.16, 0.23], [0.16, 0.23], 0.03, C.far2);- G.disc(ctx, -0.16, 0.255, 0.028, C.far2); G.disc(ctx, 0.16, 0.255, 0.028, C.far2);- // Desk- ctx.fillStyle = C.fg; ctx.fillRect(0.24, -0.03, 0.9, 0.03);- ctx.fillRect(1.04, 0.0, 0.03, 0.46 - ES_Y);- // Monitor- const sx = 0.56, sy = -0.66, sw = 0.56, sh = 0.36;- G.seg(ctx, [sx + sw * 0.55, -0.03], [sx + sw * 0.55, sy + sh], 0.03, C.fg);- ctx.fillStyle = C.fg; ctx.fillRect(sx + sw * 0.4, -0.05, sw * 0.3, 0.02);- ctx.fillStyle = C.fg; ctx.fillRect(sx - 0.02, sy - 0.02, sw + 0.04, sh + 0.04);- const scr = G.mix(C.bg, '#000000', 0.45);- ctx.fillStyle = scr; ctx.fillRect(sx, sy, sw, sh);- // Screen light: falling on the player's face- ctx.fillStyle = G.rgba(C.acc, 0.12 + Math.exp(-fract(u) * 5) * 0.12);- ctx.beginPath(); ctx.moveTo(sx, sy + 0.02); ctx.lineTo(sx, sy + sh - 0.02); ctx.lineTo(0.1, -0.1); ctx.lineTo(0.1, -0.6); ctx.fill();- // HUD: crosshair, target, health bar- ctx.save(); ctx.beginPath(); ctx.rect(sx, sy, sw, sh); ctx.clip();- const cx = sx + sw * 0.5, cy = sy + sh * 0.5, pulse = Math.exp(-fract(u) * 5);- // Grid floor- ctx.strokeStyle = G.rgba(C.acc, 0.35); ctx.lineWidth = 0.004;- for (let i = 0; i < 7; i++) { const yy = cy + 0.04 + i * i * 0.006; ctx.beginPath(); ctx.moveTo(sx, yy); ctx.lineTo(sx + sw, yy); ctx.stroke(); }- for (let i = -5; i <= 5; i++) { ctx.beginPath(); ctx.moveTo(cx + i * 0.02, cy + 0.04); ctx.lineTo(cx + i * 0.09, sy + sh); ctx.stroke(); }- // Target: a new position every beat, bursts when hit- const bt = Math.floor(u), ft = fract(u);- const tx = cx + Math.sin(bt * 2.3) * 0.16, ty = cy - 0.03 + Math.cos(bt * 1.7) * 0.06;- if (ft < 0.55) G.disc(ctx, tx, ty, 0.028 * (1 - ft), C.acc);- burst(ctx, tx, ty, ft / 0.6, 0.07, C, 6);- // Crosshair (jumps with the target)- const px = lerp(cx + Math.sin((bt - 1) * 2.3) * 0.16, tx, E.oExp(clamp(ft * 4))), py = lerp(cy - 0.03 + Math.cos((bt - 1) * 1.7) * 0.06, ty, E.oExp(clamp(ft * 4)));- G.ring(ctx, px, py, 0.04 + pulse * 0.02, 0.006, C.fg);- G.seg(ctx, [px - 0.07, py], [px - 0.03, py], 0.006, C.fg); G.seg(ctx, [px + 0.03, py], [px + 0.07, py], 0.006, C.fg);- G.seg(ctx, [px, py - 0.07], [px, py - 0.03], 0.006, C.fg); G.seg(ctx, [px, py + 0.03], [px, py + 0.07], 0.006, C.fg);- // Health bar / score- ctx.fillStyle = C.fg; ctx.fillRect(sx + 0.03, sy + 0.03, 0.16 * (1 - u * 0.05), 0.014);- ctx.fillStyle = C.acc; ctx.fillRect(sx + sw - 0.19, sy + 0.03, 0.16 * (0.9 - bt * 0.2), 0.014);- ctx.restore();- ctx.restore();- },- front: (ctx, J, u, C) => {- // Keyboard + mouse- ctx.fillStyle = C.acc; ctx.fillRect(0.25, ES_Y - 0.06, 0.12, 0.03);- G.disc(ctx, J.aR[2][0] + 0.015, ES_Y - 0.05, 0.022, C.acc);- // Headset: headband + ear cups + microphone- const h = J.head, a = (J.p.torso + J.p.head) * D2R;- ctx.save(); ctx.translate(h[0], h[1]); ctx.rotate(a);- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.022; ctx.lineCap = 'round';- ctx.beginPath(); ctx.arc(0, 0, 0.1, Math.PI * 1.08, Math.PI * 1.92); ctx.stroke();- G.disc(ctx, -0.02, 0.0, 0.05, C.acc);- G.seg(ctx, [-0.02, 0.02], [0.08, 0.08], 0.012, C.acc);- G.disc(ctx, 0.08, 0.08, 0.014, C.acc);- ctx.restore();- },- };-})();diff --git a/styles/pictogram-motion/demo/poses/ath.js b/styles/pictogram-motion/demo/poses/ath.jsdeleted file mode 100644index 4a83533..0000000--- a/styles/pictogram-motion/demo/poses/ath.js+++ /dev/null@@ -1,494 +0,0 @@-// Athletics, 14 events-(function () {- const G = window.G, P = G.P, POSES = window.POSES;-- POSES.sprint = {- iconU: 0.25,- pose: (u) => ({ ...G.runCycle(u / 1.0, 1, { lean: 16 }), head: -6 }),- back: (ctx, J, u, C) => { P.speed(ctx, -0.35, -0.05, 0.9, 5, C, 0.8); },- };-- // Hurdles: one hurdle every 2 beats, airborne on beat 1- POSES.hurdles = {- iconU: 0.62,- pose: (u) => {- const k = G.keyPose([- { b: 0, ...G.runCycle(0.25, 1, { lean: 14 }) },- { b: 0.55, torso: 38, y: -0.12, lR1: 92, lR2: 92, lL1: -60, lL2: -150, aR1: -40, aR2: 20, aL1: 120, aL2: 95, e: 'o3' },- { b: 1.2, torso: 26, y: -0.08, lR1: 40, lR2: 10, lL1: 20, lL2: -80, aR1: -10, aR2: 60, aL1: 70, aL2: 90 },- { b: 2, ...G.runCycle(0.25, 1, { lean: 14 }), e: 'io' },- ], u, 2);- return { ...k, head: -8 };- },- back: (ctx, J, u, C) => {- // Hurdles slide from right to left, passing exactly under the body at beat 0.55- const ph = ((u % 2) + 2) % 2;- const x = (0.62 - ph) * 1.1; // moves 2.2 every 2 beats = one hurdle spacing; at u=0.62 the hurdle is directly below- ctx.fillStyle = C.acc;- for (const ox of [x - 2.2, x, x + 2.2]) {- ctx.fillRect(ox - 0.14, 0.12, 0.28, 0.035);- ctx.fillRect(ox - 0.13, 0.12, 0.018, 0.34);- ctx.fillRect(ox + 0.112, 0.12, 0.018, 0.34);- }- P.ground(ctx, 0.46, C, -1.6, 1.6);- },- };-- // ───────── Shared helpers ─────────- const mod = (u, L) => ((u % L) + L) % L;- const mixP = G.lerpPose;- const R2D = 180 / Math.PI;- // World direction → limb angle in that frame (inverse of dirDown)- const angTo = (dir, frame) => { const l = G.rot2(dir, -frame); return Math.atan2(l[0], l[1]) * R2D; };- // Parabola: p0 start, v initial velocity (per beat), g gravity (per beat²), t beats- const fly = (p0, v, g, t) => [p0[0] + v[0] * t, p0[1] + v[1] * t + 0.5 * g * t * t];- // Blend gradually from running into a keyframe- const runInto = (u, ph, k, lean, key, t0, t1) => mixP({ ...G.runCycle(ph, k, { lean }) }, key, G.E.io(G.inv(t0, t1, u)));- // Ground tick marks (lane markings), moving left with speed- const dashes = (ctx, y, u, speed, C, gap = 0.5) => {- ctx.fillStyle = C.line;- const off = mod(u * speed, gap);- for (let x = -1.6 - off; x < 1.6; x += gap) ctx.fillRect(x, y, gap * 0.45, 0.012);- };-- // ───────── Relay: baton handover on beat 2 ─────────- const relayMain = (u) => {- const x = u < 2 ? G.lerp(-0.5, -0.26, G.E.io(u / 2)) : G.lerp(-0.26, -0.48, G.E.io((u - 2) / 2));- const k = u < 2 ? 1 : G.lerp(1, 0.55, G.E.io((u - 2) / 2));- const p = { ...G.runCycle(u, k, { lean: 14 }), x, head: -6 };- const reach = G.E.io(G.inv(1.2, 1.8, u)) * (1 - G.E.io(G.inv(2.15, 2.7, u)));- p.aR1 = G.lerp(p.aR1, 82, reach); p.aR2 = G.lerp(p.aR2, 88, reach);- return p;- };- const relaySecond = (u) => {- const x = u < 2 ? G.lerp(0.06, 0.02, G.E.io(u / 2)) : G.lerp(0.02, 0.42, G.E.i3((u - 2) / 2) * 0.6 + (u - 2) / 2 * 0.4);- const p = { ...G.runCycle(u + 0.5, u < 2 ? 0.8 : 1, { lean: 16 }), x, head: -4 };- const back = 1 - G.E.io(G.inv(2.05, 2.5, u));- p.aR1 = G.lerp(p.aR1, -72, back); p.aR2 = G.lerp(p.aR2, -58, back);- return p;- };- POSES.relay = {- iconU: 2,- fig: { x: 0.07 },- pose: relayMain,- second: relaySecond, secondX: [0.24, 0],- back: (ctx, J, u, C) => { dashes(ctx, 0.46, u, 0.9, C, 0.42); },- front: (ctx, J, u, C) => {- // Handover: before beat 2 the baton is in the hand of the runner behind, after it in the hand of the runner ahead- const J2 = G.joints(relaySecond(u));- const h2 = [J2.aR[2][0] + 0.24, J2.aR[2][1]];- const h1 = J.aR[2];- const t = G.E.io(G.inv(1.92, 2.08, u));- const c = [G.lerp(h1[0], h2[0], t), G.lerp(h1[1], h2[1], t)];- G.seg(ctx, [c[0] - 0.07, c[1] + 0.012], [c[0] + 0.07, c[1] - 0.012], 0.04, C.acc);- },- };-- // ───────── Middle & long distance: two runners in a pack, same cadence, smaller amplitude ─────────- POSES.distance = {- iconU: 0.25,- fig: { x: 0.18 },- pose: (u) => ({ ...G.runCycle(u, 0.72, { lean: 8 }), head: -2 }),- second: (u) => ({ ...G.runCycle(u + 0.5, 0.72, { lean: 8 }), head: -2 }),- secondX: [-0.46, 0.0],- back: (ctx, J, u, C) => {- dashes(ctx, 0.46, u, 0.7, C, 0.5);- P.ground(ctx, 0.46, C, -1.6, 1.6);- },- };-- // ───────── Steeplechase: step onto the barrier, jump into the water pit ─────────- const steepleKeys = [- { b: 0.75, torso: 16, y: -0.1, lR1: 45, lR2: -35, lL1: -35, lL2: -100, aR1: -35, aR2: 25, aL1: 55, aL2: 110 },- { b: 1.0, torso: 22, y: -0.22, lR1: 62, lR2: -8, lL1: -40, lL2: -105, aR1: -45, aR2: 5, aL1: 70, aL2: 110, e: 'o3' },- { b: 1.55, torso: 16, y: -0.2, lR1: -40, lR2: -70, lL1: 70, lL2: 30, aR1: 60, aR2: 100, aL1: -40, aL2: 0 },- { b: 2.0, torso: 24, y: 0.03, lR1: -45, lR2: -105, lL1: 32, lL2: 8, aR1: 40, aR2: 90, aL1: -55, aL2: -10, e: 'i3' },- { b: 2.5, torso: 18, y: -0.02, ...(() => { const r = G.runCycle(0.25, 1, { lean: 16 }); delete r.torso; delete r.y; return r; })() },- ];- POSES.steeple = {- iconU: 1.0,- pose: (u) => {- u = mod(u, 4);- if (u < 0.75) return runInto(u, u * 1.33 - 0.75, 1, 14, steepleKeys[0], 0.35, 0.75);- if (u < 2.5) return G.keyPose(steepleKeys, u);- return runInto(u, u - 2.25, 1, 14, G.runCycle(u - 2.25, 1, { lean: 14 }), 0, 1);- },- back: (ctx, J, u, C) => {- u = mod(u, 4);- const x = (1 - u) * 0.85 + 0.12; // at u=1 the barrier is under the front foot- // Water pit- ctx.fillStyle = C.line; ctx.fillRect(x + 0.18, 0.47, 1.0, 0.1);- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.012;- for (let i = 0; i < 6; i++) { ctx.beginPath(); ctx.arc(x + 0.28 + i * 0.16, 0.5, 0.06, Math.PI, 0); ctx.stroke(); }- P.ground(ctx, 0.46, C, -1.6, x + 0.18); P.ground(ctx, 0.46, C, x + 1.18, 1.8);- // Barrier: thick beam + two legs- ctx.fillStyle = C.acc;- ctx.fillRect(x - 0.24, 0.13, 0.48, 0.07);- ctx.fillRect(x - 0.2, 0.2, 0.035, 0.26); ctx.fillRect(x + 0.165, 0.2, 0.035, 0.26);- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- const t = u - 2;- if (t < 0 || t > 0.9) return;- const x0 = (1 - u) * 0.85 + 0.12 + 0; // splash point moves with the water pit- const fx = J.lL[2][0];- ctx.save(); ctx.globalAlpha = 1 - t / 0.9;- for (let i = 0; i < 7; i++) {- const a = (-150 + i * 20) * G.D2R;- const p = fly([fx, 0.46], [Math.cos(a) * 0.55, -0.7 - (i % 3) * 0.12], 2.6, t);- G.disc(ctx, p[0], Math.min(p[1], 0.47), 0.022 - i * 0.001, C.acc);- }- ctx.restore();- },- };-- // ───────── Marathon: relaxed stride, 3 gait cycles in 4 beats; kilometre markers slide past ─────────- POSES.marathon = {- iconU: 1.0,- pose: (u) => {- const p = G.runCycle(u * 0.75, 0.58, { lean: 7 });- p.aR2 = p.aR1 + 100; p.aL2 = p.aL1 + 100; p.head = 2;- return p;- },- back: (ctx, J, u, C) => {- // Road centre line- ctx.fillStyle = C.line;- const off = mod(u * 0.55, 0.36);- for (let x = -1.6 - off; x < 1.6; x += 0.36) ctx.fillRect(x, 0.54, 0.2, 0.018);- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Kilometre marker- const x = 1.25 - mod(u, 4) * 0.62;- ctx.fillStyle = C.line; ctx.fillRect(x - 0.008, -0.2, 0.016, 0.66);- G.disc(ctx, x, -0.26, 0.09, C.acc);- G.disc(ctx, x, -0.26, 0.05, C.bg);- },- };-- // ───────── Race walk: front leg straight, bent arms swinging, one step per beat ─────────- POSES.walk = {- iconU: 0.5,- pose: (u) => {- const ph = u / 2, s = Math.sin(ph * Math.PI * 2), c = Math.cos(ph * Math.PI * 2);- const lR1 = 30 * s, lL1 = -30 * s;- return {- torso: 3, head: -2, y: 0.028 * s * s - 0.012,- lR1, lR2: lR1 - 50 * Math.pow(Math.max(0, c), 2),- lL1, lL2: lL1 - 50 * Math.pow(Math.max(0, -c), 2),- aR1: -42 * s, aR2: -42 * s + 96, aL1: 42 * s, aL2: 42 * s + 96,- };- },- back: (ctx, J, u, C) => { dashes(ctx, 0.46, u, 0.45, C, 0.5); P.ground(ctx, 0.46, C, -1.6, 1.6); },- };-- // ───────── High jump: Fosbury flop. Takeoff on beat 1, over the bar on beat 2, onto the mat on beat 3 ─────────- // At takeoff the jumper turns 180° (in 2D that is a mirror), so the airborne stretch draws a mirrored figure in front() and moves the main figure out of frame.- const HJ_SWITCH = 1.1;- const hjTake = { b: 1.0, x: -0.28, y: -0.08, torso: -8, head: -6, lR1: 82, lR2: 2, lL1: -8, lL2: -14, aR1: 150, aR2: 168, aL1: 138, aL2: 158 };- // Pose of the mirrored figure (unmirrored values; x is in world coordinates and negated when drawn)- const hjAir = [- { b: HJ_SWITCH, X: -0.22, y: -0.16, rot: -18, torso: -6, head: -8, lR1: 60, lR2: 0, lL1: -6, lL2: -12, aR1: 150, aR2: 165, aL1: 140, aL2: 155 },- { b: 1.55, X: -0.04, y: -0.5, rot: -62, torso: -18, head: -14, lR1: 20, lR2: -30, lL1: 10, lL2: -40, aR1: 40, aR2: 50, aL1: 30, aL2: 40, e: 'o2' },- { b: 2.0, X: 0.12, y: -0.64, rot: -90, torso: -28, head: -22, lR1: -30, lR2: -112, lL1: -24, lL2: -104, aR1: 12, aR2: 22, aL1: 4, aL2: 14 },- { b: 2.55, X: 0.3, y: -0.34, rot: -122, torso: -8, head: -6, lR1: 30, lR2: 20, lL1: 22, lL2: 12, aR1: 60, aR2: 70, aL1: 50, aL2: 60, e: 'i3' },- { b: 3.0, X: 0.42, y: 0.07, rot: -96, torso: 0, head: 8, lR1: 72, lR2: 30, lL1: 62, lL2: 18, aR1: 70, aR2: 80, aL1: 60, aL2: 70, e: 'o3' },- { b: 4.0, X: 0.44, y: 0.08, rot: -92, torso: 4, head: 10, lR1: 40, lR2: -10, lL1: 30, lL2: -20, aR1: 30, aR2: 40, aL1: 20, aL2: 30 },- ];- const HJ_BAR = [0.12, -0.52];- POSES.highjump = {- iconU: 2.0,- pose: (u) => {- u = mod(u, 4);- if (u >= HJ_SWITCH) return { x: 100 };- if (u < 1) {- const x = G.lerp(-0.78, -0.28, u);- return { ...runInto(u, u * 1.4, 1, 10, hjTake, 0.62, 1.0), x };- }- return hjTake;- },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Foam mat- ctx.fillStyle = C.line; ctx.fillRect(0.06, 0.22, 0.8, 0.24);- ctx.fillStyle = C.acc; ctx.fillRect(0.06, 0.22, 0.8, 0.03);- // Uprights + bar ends- ctx.fillStyle = C.line; ctx.fillRect(HJ_BAR[0] - 0.008, HJ_BAR[1] - 0.06, 0.016, 0.46 - HJ_BAR[1] + 0.06);- G.seg(ctx, [HJ_BAR[0] - 0.16, HJ_BAR[1] + 0.02], [HJ_BAR[0] + 0.16, HJ_BAR[1] - 0.02], 0.022, C.acc);- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- if (u < HJ_SWITCH) return;- const k = G.keyPose(hjAir, u);- const p = { ...k, x: -k.X };- ctx.save(); ctx.scale(-1, 1);- G.drawFigure(ctx, G.joints(p), C.fg, C.far);- ctx.restore();- },- };-- // ───────── Pole vault: plant in the box on beat 1, inverted on beat 2, over the bar on beat 3 ─────────- const PV_BOX = [0.02, 0.46];- const pvKeys = [- { b: 1.0, x: -0.5, y: -0.06, torso: 4, head: -4, lR1: 82, lR2: -6, lL1: -22, lL2: -30, aR1: 168, aR2: 172, aL1: 132, aL2: 146 },- { b: 1.45, x: -0.42, y: -0.3, rot: -30, torso: 0, head: -6, lR1: 70, lR2: 20, lL1: -10, lL2: -40, aR1: 172, aR2: 176, aL1: 160, aL2: 170, e: 'o2' },- { b: 1.9, x: -0.28, y: -0.62, rot: -95, torso: 0, head: -4, lR1: 110, lR2: 100, lL1: 104, lL2: 94, aR1: 176, aR2: 178, aL1: 168, aL2: 174 },- { b: 2.5, x: -0.1, y: -1.02, rot: -176, torso: 0, head: 0, lR1: 4, lR2: 2, lL1: 0, lL2: -2, aR1: 178, aR2: 180, aL1: 172, aL2: 176, e: 'io' },- { b: 3.0, x: 0.06, y: -1.18, rot: -112, torso: -18, head: -18, lR1: -30, lR2: -40, lL1: -24, lL2: -34, aR1: 120, aR2: 130, aL1: 110, aL2: 120, e: 'o2' },- { b: 3.55, x: 0.32, y: -0.45, rot: -100, torso: -6, head: 0, lR1: 40, lR2: 30, lL1: 30, lL2: 20, aR1: 150, aR2: 160, aL1: 140, aL2: 150, e: 'i3' },- { b: 4.0, x: 0.42, y: 0.12, rot: -92, torso: 0, head: 8, lR1: 70, lR2: 30, lL1: 60, lL2: 20, aR1: 80, aR2: 90, aL1: 70, aL2: 80, e: 'o3' },- ];- const pvRun = (u) => {- const p = { ...G.runCycle(u * 1.3, 0.95, { lean: 8 }), x: G.lerp(-1.0, -0.5, u) };- p.aR1 = 38; p.aR2 = 92; p.aL1 = -20; p.aL2 = 62;- return p;- };- const pvPose = (u) => {- u = mod(u, 4);- if (u < 1) return mixP(pvRun(u), pvKeys[0], G.E.io(G.inv(0.7, 1.0, u)));- return G.keyPose(pvKeys, u);- };- const PV_LEN = 1.28;- POSES.polevault = {- iconU: 2.5,- fig: { s: 0.58, y: 0.17, x: 0.08 },- pose: pvPose,- back: (ctx, J, u, C) => {- u = mod(u, 4);- P.ground(ctx, 0.46, C, -2.0, 2.0);- // Plant box- G.poly(ctx, [[PV_BOX[0] - 0.12, 0.46], [PV_BOX[0], 0.52], [PV_BOX[0] + 0.02, 0.46]], C.line);- // Mat- ctx.fillStyle = C.line; ctx.fillRect(0.14, 0.18, 0.9, 0.28);- ctx.fillStyle = C.acc; ctx.fillRect(0.14, 0.18, 0.9, 0.035);- // Uprights + bar- const bx = 0.12, by = -0.95;- ctx.fillStyle = C.line; ctx.fillRect(bx - 0.01, by - 0.05, 0.02, 0.46 - by + 0.05);- G.seg(ctx, [bx - 0.2, by + 0.025], [bx + 0.2, by - 0.025], 0.028, C.acc);- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- const hand = J.aR[2];- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.032; ctx.lineCap = 'round';- if (u < 1) {- // Run-up carrying the pole: pole passes through both hands, the tip drops from raised to the plant box- const a = G.lerp(-16, 20, G.E.io(u)) * G.D2R; // angle to horizontal, positive = downward- const d = [Math.cos(a), Math.sin(a)];- ctx.beginPath(); ctx.moveTo(hand[0] - d[0] * 0.35, hand[1] - d[1] * 0.35); ctx.lineTo(hand[0] + d[0] * (PV_LEN - 0.35), hand[1] + d[1] * (PV_LEN - 0.35)); ctx.stroke();- return;- }- let top = hand;- if (u > 2.85) {- // Release the pole: it falls back, pivoting on the plant box- const t = G.E.io(G.inv(2.85, 4, u));- const a = G.lerp(-78, -140, t) * G.D2R;- top = [PV_BOX[0] + Math.cos(a) * PV_LEN, PV_BOX[1] + Math.sin(a) * PV_LEN];- }- const dx = top[0] - PV_BOX[0], dy = top[1] - PV_BOX[1], L = Math.hypot(dx, dy);- const bend = Math.max(0, PV_LEN - L) * 0.9 + 0.22 * Math.sin(Math.PI * G.clamp((u - 1) / 1.5)) ;- const mx = (PV_BOX[0] + top[0]) / 2 - (dy / L) * bend, my = (PV_BOX[1] + top[1]) / 2 + (dx / L) * bend;- ctx.beginPath(); ctx.moveTo(PV_BOX[0], PV_BOX[1]); ctx.quadraticCurveTo(mx, my, top[0], top[1]); ctx.stroke();- },- };-- // ───────── Long jump · triple jump: take-off board on beat 1, into the sand pit on beat 3 ─────────- const ljKeys = [- { b: 1.0, x: -0.4, y: -0.06, torso: 6, head: -4, lL1: -28, lL2: -34, lR1: 86, lR2: 2, aR1: -52, aR2: -20, aL1: 125, aL2: 145 },- { b: 1.55, x: -0.18, y: -0.34, torso: -8, head: -6, lR1: -8, lR2: -64, lL1: -22, lL2: -86, aR1: 168, aR2: 176, aL1: 158, aL2: 170, e: 'o2' },- { b: 2.2, x: 0.08, y: -0.26, torso: 40, head: 6, lR1: 98, lR2: 92, lL1: 92, lL2: 86, aR1: 90, aR2: 96, aL1: 84, aL2: 90 },- { b: 2.8, x: 0.3, y: 0.2, torso: 34, head: 8, lR1: 82, lR2: 66, lL1: 76, lL2: 60, aR1: -60, aR2: -40, aL1: -66, aL2: -48, e: 'i3' },- { b: 4.0, x: 0.34, y: 0.22, torso: 40, head: 10, lR1: 78, lR2: 50, lL1: 72, lL2: 44, aR1: 10, aR2: 40, aL1: 4, aL2: 34 },- ];- POSES.longjump = {- iconU: 2.2,- fig: { s: 0.8, y: 0.08, x: -0.02 },- pose: (u) => {- u = mod(u, 4);- if (u < 1) return { ...runInto(u, u * 1.4, 1, 12, ljKeys[0], 0.6, 1.0), x: G.lerp(-0.85, -0.4, u) };- return G.keyPose(ljKeys, u);- },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, -0.02);- // Take-off board + the three footprints of the triple jump- ctx.fillStyle = C.fg; ctx.fillRect(-0.47, 0.455, 0.1, 0.02);- for (let i = 0; i < 3; i++) G.disc(ctx, -1.35 + i * 0.28, 0.5, 0.018, C.line);- // Sand pit- ctx.fillStyle = C.line; ctx.fillRect(-0.02, 0.46, 0.95, 0.07);- ctx.fillStyle = C.acc;- for (let i = 0; i < 9; i++) G.disc(ctx, 0.04 + i * 0.105, 0.47, 0.03, C.acc);- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- const t = u - 2.8;- if (t < 0 || t > 1) return;- ctx.save(); ctx.globalAlpha = 1 - t;- for (let i = 0; i < 8; i++) {- const a = (-160 + i * 18) * G.D2R;- const p = fly([0.52, 0.45], [Math.cos(a) * 0.7, -0.5 - (i % 3) * 0.2], 2.4, t);- G.disc(ctx, p[0], Math.min(p[1], 0.46), 0.02, C.acc);- }- ctx.restore();- },- };-- // ───────── Shot put: glide → put on beat 3 ─────────- const shotKeys = [- { b: 0, x: -0.3, y: 0.1, torso: 55, head: 10, lR1: 62, lR2: -34, lL1: -34, lL2: -46, aR1: -100, aR2: 52, aL1: 70, aL2: 92 },- { b: 1.0, x: -0.3, y: 0.14, torso: 62, head: 14, lR1: 74, lR2: -50, lL1: 20, lL2: -10, aR1: -100, aR2: 52, aL1: 40, aL2: 70 },- { b: 1.7, x: -0.1, y: 0.06, torso: 36, head: 6, lR1: -30, lR2: -62, lL1: 50, lL2: 18, aR1: -96, aR2: 54, aL1: 80, aL2: 100, e: 'o3' },- { b: 2.5, x: -0.04, y: 0.0, torso: 10, head: -4, lR1: -18, lR2: -40, lL1: 36, lL2: 18, aR1: -80, aR2: 70, aL1: 10, aL2: 40 },- { b: 3.0, x: 0.04, y: -0.12, torso: -14, head: -16, lR1: -14, lR2: -18, lL1: 16, lL2: 10, aR1: 138, aR2: 140, aL1: -70, aL2: -44, e: 'o3' },- { b: 3.6, x: 0.1, y: -0.02, torso: 30, head: 4, lR1: 30, lR2: -20, lL1: -50, lL2: -80, aR1: 96, aR2: 100, aL1: -40, aL2: -20 },- { b: 4.0, x: 0.1, y: 0.0, torso: 28, head: 4, lR1: 26, lR2: -16, lL1: -44, lL2: -70, aR1: 70, aR2: 80, aL1: -30, aL2: -10 },- ];- const shotPose = (u) => G.keyPose(shotKeys, mod(u, 4));- const SHOT_REL = G.joints(shotPose(3)).aR[2];- POSES.shot = {- iconU: 3.0,- pose: shotPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Stop board of the throwing circle (half circle)- ctx.fillStyle = C.line; ctx.beginPath(); ctx.arc(0.4, 0.46, 0.08, Math.PI, 0); ctx.fill();- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- const t = u - 3;- const p = t < 0 ? J.aR[2] : fly(SHOT_REL, [0.95, -0.9], 1.6, t);- G.disc(ctx, p[0], p[1], 0.062, C.acc);- if (t > 0 && t < 0.5) P.speed(ctx, p[0] - 0.08, p[1], 0.3 * (1 - t * 2), 3, C, 0.7);- },- };-- // ───────── Discus: wind-up → sling on beat 3 ─────────- // Note: arm angles are in the torso frame; world angle = local angle − torso lean- const discKeys = [- { b: 0, x: -0.12, y: 0.04, torso: 22, head: 4, lR1: 26, lR2: -14, lL1: -22, lL2: -34, aR1: -46, aR2: -44, aL1: 96, aL2: 110 },- { b: 1.2, x: -0.16, y: 0.09, torso: 30, head: 6, lR1: 32, lR2: -24, lL1: -28, lL2: -46, aR1: -52, aR2: -50, aL1: 120, aL2: 130 },- { b: 2.0, x: -0.1, y: 0.07, torso: 26, head: 2, lR1: -24, lR2: -50, lL1: 38, lL2: 12, aR1: -66, aR2: -64, aL1: 90, aL2: 104, e: 'io' },- { b: 3.0, x: 0.02, y: -0.06, torso: -8, head: -10, lR1: -8, lR2: -12, lL1: 18, lL2: 12, aR1: 84, aR2: 86, aL1: -86, aL2: -70, e: 'iExp' },- { b: 3.6, x: 0.08, y: 0.0, torso: 24, head: 4, lR1: 20, lR2: -30, lL1: -40, lL2: -70, aR1: 146, aR2: 150, aL1: -40, aL2: -20, e: 'o3' },- { b: 4.0, x: 0.08, y: 0.02, torso: 22, head: 4, lR1: 18, lR2: -26, lL1: -36, lL2: -64, aR1: 128, aR2: 136, aL1: -30, aL2: -10 },- ];- const discPose = (u) => G.keyPose(discKeys, mod(u, 4));- const DISC_REL = G.joints(discPose(3)).aR[2];- const discus = (ctx, p, spin, C) => {- ctx.save(); ctx.translate(p[0], p[1]); ctx.rotate(-0.25);- ctx.fillStyle = C.acc; ctx.beginPath(); ctx.ellipse(0, 0, 0.075, 0.022 + 0.008 * Math.sin(spin), 0, 0, Math.PI * 2); ctx.fill();- ctx.restore();- };- POSES.discus = {- iconU: 3.0,- pose: discPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Arc of the arm swing- u = mod(u, 4);- if (u > 2.2 && u < 3.3) {- const s = J.sho, a = G.clamp((u - 2.2) / 0.8);- ctx.save(); ctx.globalAlpha = Math.min(1, (3.3 - u) * 3) * 0.8;- ctx.strokeStyle = C.line; ctx.lineWidth = 0.05; ctx.lineCap = 'round';- ctx.beginPath(); ctx.arc(s[0], s[1], 0.31, Math.PI * 0.95, Math.PI * (0.95 + 1.05 * a)); ctx.stroke();- ctx.restore();- }- },- front: (ctx, J, u, C) => {- u = mod(u, 4);- const t = u - 3;- const p = t < 0 ? J.aR[2] : fly(DISC_REL, [1.25, -0.75], 0.9, t);- discus(ctx, p, u * 20, C);- },- };-- // ───────── Hammer: three accelerating turns, release on beat 3 ─────────- const HAM_C = [0, -0.12], HAM_RX = 0.78, HAM_RY = 0.32;- const HAM_REL = 1.75 * Math.PI; // release phase: in front of the body, moving up and to the right- const hamPhi = (u) => {- // 3 turns in 3 beats, getting faster- const t = G.clamp(u / 3);- return HAM_REL - 2 * Math.PI * 3 * (1 - t) * (0.6 + 0.4 * (1 - t));- };- const hamHead = (u) => {- if (u <= 3) { const f = hamPhi(u); return [HAM_C[0] + HAM_RX * Math.cos(f), HAM_C[1] + HAM_RY * Math.sin(f), Math.sin(f)]; }- const f = HAM_REL, p0 = [HAM_C[0] + HAM_RX * Math.cos(f), HAM_C[1] + HAM_RY * Math.sin(f)];- return [...fly(p0, [2.4, -1.4], 2.0, u - 3), 1];- };- const hamPose = (u) => {- u = mod(u, 4);- const f = u <= 3 ? hamPhi(u) : HAM_REL;- const lean = -14 - 8 * Math.cos(f);- const base = { x: -0.02, y: 0.05 + 0.02 * Math.sin(f * 2), torso: lean, head: -8, lR1: 18, lR2: -16, lL1: -16, lL2: -34 };- let aR, aL;- if (u <= 3) {- const J0 = G.joints({ ...base });- const h = hamHead(u);- const d = [(h[0] - J0.sho[0]) * 0.45 + 0.12, h[1] - J0.sho[1] + 0.25], L = Math.hypot(d[0], d[1]);- const a = angTo([d[0] / L, d[1] / L], lean);- aR = [a, a]; aL = [a - 6, a - 6];- } else {- const t = G.E.o3((u - 3) / 0.6);- aR = [G.lerp(angTo([0.95, -0.3], lean), 160, t), G.lerp(angTo([0.95, -0.3], lean), 165, t)];- aL = [aR[0] - 10, aR[1] - 10];- base.torso = G.lerp(lean, 6, t); base.lR1 = G.lerp(18, -10, t); base.lL1 = G.lerp(-16, 20, t);- }- return { ...base, aR1: aR[0], aR2: aR[1], aL1: aL[0], aL2: aL[1] };- };- const drawHammer = (ctx, J, u, C, front) => {- u = mod(u, 4);- const h = hamHead(u);- if ((h[2] > 0) !== front) return;- let grip = J.aR[2];- if (u > 3) { const f = HAM_REL, p0 = [HAM_C[0] + HAM_RX * Math.cos(f), HAM_C[1] + HAM_RY * Math.sin(f)]; const d = [h[0] - p0[0], h[1] - p0[1]]; grip = [J.aR[2][0] + d[0], J.aR[2][1] + d[1]]; }- G.seg(ctx, grip, h, 0.012, C.line);- G.disc(ctx, h[0], h[1], 0.062, C.acc);- };- POSES.hammer = {- iconU: 2.2,- pose: hamPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Rotation path- if (mod(u, 4) < 3) {- ctx.save(); ctx.globalAlpha = 0.5; ctx.strokeStyle = C.line; ctx.lineWidth = 0.012;- ctx.beginPath(); ctx.ellipse(HAM_C[0], HAM_C[1], HAM_RX, HAM_RY, 0, 0, Math.PI * 2); ctx.stroke(); ctx.restore();- }- drawHammer(ctx, J, u, C, false);- },- front: (ctx, J, u, C) => drawHammer(ctx, J, u, C, true),- };-- // ───────── Javelin: carry and run up → withdraw → whip release on beat 3 ─────────- const javCarry = { aR1: -168, aR2: -110 }; // javelin held above the shoulder- const javKeys = [- { b: 1.3, x: -0.3, y: 0.0, torso: -6, head: -4, lR1: 30, lR2: 10, lL1: -30, lL2: -70, aR1: -120, aR2: -108, aL1: 100, aL2: 120 },- { b: 2.2, x: -0.2, y: 0.02, torso: -22, head: -8, lR1: 40, lR2: 22, lL1: -32, lL2: -56, aR1: -100, aR2: -96, aL1: 110, aL2: 130 },- { b: 2.7, x: -0.12, y: 0.0, torso: -18, head: -8, lR1: 36, lR2: 30, lL1: -40, lL2: -70, aR1: -108, aR2: -100, aL1: 70, aL2: 90 },- { b: 3.0, x: -0.04, y: -0.02, torso: 28, head: 4, lR1: 34, lR2: 30, lL1: -40, lL2: -86, aR1: 158, aR2: 146, aL1: -40, aL2: -20, e: 'iExp' },- { b: 3.5, x: 0.02, y: 0.02, torso: 46, head: 10, lR1: 30, lR2: 10, lL1: -30, lL2: -90, aR1: 60, aR2: 50, aL1: -60, aL2: -40, e: 'o3' },- { b: 4.0, x: 0.04, y: 0.02, torso: 40, head: 8, lR1: 24, lR2: 6, lL1: -24, lL2: -80, aR1: 40, aR2: 40, aL1: -40, aL2: -20 },- ];- const javPose = (u) => {- u = mod(u, 4);- if (u < 1.3) {- const p = { ...G.runCycle(u * 1.3, 0.9, { lean: 6 }), x: G.lerp(-0.55, -0.3, u / 1.3), ...javCarry };- return mixP(p, javKeys[0], G.E.io(G.inv(0.9, 1.3, u)));- }- return G.keyPose(javKeys, u);- };- const JAV_REL = G.joints(javPose(3)).aR[2];- const javelin = (ctx, grip, ang, C) => {- const d = [Math.cos(ang), Math.sin(ang)];- G.seg(ctx, [grip[0] - d[0] * 0.36, grip[1] - d[1] * 0.36], [grip[0] + d[0] * 0.56, grip[1] + d[1] * 0.56], 0.02, C.acc);- G.seg(ctx, [grip[0] - d[0] * 0.04, grip[1] - d[1] * 0.04], [grip[0] + d[0] * 0.05, grip[1] + d[1] * 0.05], 0.034, C.acc);- };- POSES.javelin = {- iconU: 2.5,- pose: javPose,- back: (ctx, J, u, C) => { P.ground(ctx, 0.46, C, -1.6, 1.6); if (mod(u, 4) < 1.3) dashes(ctx, 0.46, u, 0.8, C, 0.4); },- front: (ctx, J, u, C) => {- u = mod(u, 4);- if (u < 3) { javelin(ctx, J.aR[2], G.lerp(-10, -28, G.E.io(G.inv(1.0, 2.2, u))) * G.D2R, C); return; }- const t = u - 3, v = [1.7, -1.05 + 1.0 * t];- const p = fly(JAV_REL, [1.7, -1.05], 1.0, t);- javelin(ctx, p, Math.atan2(v[1], v[0]), C);- },- };-})();diff --git a/styles/pictogram-motion/demo/poses/ball.js b/styles/pictogram-motion/demo/poses/ball.jsdeleted file mode 100644index f6d368d..0000000--- a/styles/pictogram-motion/demo/poses/ball.js+++ /dev/null@@ -1,521 +0,0 @@-// Ball games, 16 events (football, basketball, volleyball, handball, hockey, rugby, baseball, cricket, golf + 6 racket sports + teqball)-(function () {- const G = window.G, P = G.P, POSES = window.POSES, D2R = G.D2R;-- // ── Helpers ──- const ang = (a, b) => Math.atan2(b[0] - a[0], b[1] - a[1]) / D2R; // world angle: 0 down, 90 forward- const along = (p, deg, d) => [p[0] + Math.sin(deg * D2R) * d, p[1] + Math.cos(deg * D2R) * d];- const off = (p, dx, dy) => [p[0] + dx, p[1] + dy];- const poseAt = (def, u) => (def.pose ? def.pose(u) : G.keyPose(def.keys, u, def.loop));- const jAt = (def, u) => G.joints(poseAt(def, u));- const memo = (f) => { let v; return () => (v === undefined ? (v = f()) : v); };- const ph = (u, L) => ((u % L) + L) % L;- // Segmented flight: segs = [[u0, u1, from, to, arc height, easing?]], returns a position or null- const fly = (u, segs) => {- for (const s of segs) {- if (u >= s[0] && u < s[1]) {- const a = typeof s[2] === 'function' ? s[2]() : s[2], b = typeof s[3] === 'function' ? s[3]() : s[3];- const t = (s[5] || G.E.lin)((u - s[0]) / (s[1] - s[0]));- return P.arc(a, b, s[4] || 0, t);- }- }- return null;- };- // Trail: a few fading short lines along the flight direction- const trail = (ctx, u, segs, C, n = 5, du = 0.035, r = 0.03) => {- for (let i = n; i >= 1; i--) {- const p = fly(u - i * du, segs);- if (!p) continue;- ctx.save(); ctx.globalAlpha *= 0.28 * (1 - i / (n + 1));- G.disc(ctx, p[0], p[1], r * (1 - i / (n + 2) * 0.5), C.acc);- ctx.restore();- }- };- const hand = (J) => J.aR[2];- const farHand = (J) => J.aL[2];- const foreAng = (J) => ang(J.aR[1], J.aR[2]);-- // Shuttlecock: base + conical feathers, dir = flight direction (world angle)- const shuttle = (ctx, p, dir, C) => {- const d = [Math.sin(dir * D2R), Math.cos(dir * D2R)], n = [-d[1], d[0]];- const b0 = [p[0] - d[0] * 0.012, p[1] - d[1] * 0.012];- const b1 = [p[0] - d[0] * 0.085, p[1] - d[1] * 0.085];- G.poly(ctx, [[b0[0] + n[0] * 0.012, b0[1] + n[1] * 0.012], [b1[0] + n[0] * 0.04, b1[1] + n[1] * 0.04], [b1[0] - n[0] * 0.04, b1[1] - n[1] * 0.04], [b0[0] - n[0] * 0.012, b0[1] - n[1] * 0.012]], C.acc);- G.disc(ctx, p[0], p[1], 0.02, C.fg);- };- const dirOf = (u, segs) => { const a = fly(u - 0.02, segs), b = fly(u + 0.02, segs); return a && b ? ang(a, b) : 90; };-- // Goal (football: plain lines + net grid)- const goal = (ctx, x, top, C, net = true) => {- ctx.fillStyle = C.line;- ctx.fillRect(x, top, 0.022, 0.46 - top);- ctx.fillRect(x, top, 1.2, 0.022);- if (net) {- ctx.save(); ctx.globalAlpha *= 0.45;- for (let i = 1; i < 9; i++) ctx.fillRect(x + i * 0.09, top, 0.008, 0.46 - top);- for (let j = 1; j < 7; j++) ctx.fillRect(x, top + j * (0.46 - top) / 7, 1.2, 0.008);- ctx.restore();- }- };-- // ───────── Football: shot ─────────- const FB = POSES.football = {- loop: 2, iconU: 1.05,- keys: [- { b: 0, torso: 6, lR1: -20, lR2: -45, lL1: 15, lL2: 5, aR1: -30, aR2: 10, aL1: 30, aL2: 60 },- { b: 0.6, torso: -4, y: -0.01, lR1: -50, lR2: -120, lL1: 10, lL2: 0, aR1: -25, aR2: 0, aL1: 75, aL2: 80 },- { b: 1, torso: -12, lR1: 35, lR2: 30, lL1: -4, lL2: -6, aR1: -50, aR2: -25, aL1: 100, aL2: 100, e: 'i3' },- { b: 1.4, torso: -20, y: -0.02, lR1: 100, lR2: 105, lL1: -8, lL2: -12, aR1: -65, aR2: -45, aL1: 115, aL2: 125, e: 'o3' },- ],- };- const fbSegs = [- [0, 0.95, [-1.3, 0.4], [0.31, 0.4], 0, G.E.o2],- [0.95, 1.0, [0.31, 0.4], [0.31, 0.4], 0],- [1.0, 1.55, [0.31, 0.4], [1.55, -0.2], 0.12, G.E.o2],- ];- FB.back = (ctx, J, u, C) => { P.ground(ctx, 0.46, C, -1.6, 1.6); goal(ctx, 0.95, -0.28, C); };- FB.front = (ctx, J, u, C) => {- const q = ph(u, 2);- trail(ctx, q, fbSegs, C, 5, 0.03, 0.06);- const p = fly(q, fbSegs);- if (p) P.ball(ctx, p[0], p[1], 0.06, C);- };-- // ───────── Basketball: jump shot ─────────- const BK = POSES.basketball = {- iconU: 2.05, fig: { x: -0.28 },- keys: [- { b: 0, torso: 18, y: 0.03, lR1: 25, lR2: -5, lL1: -15, lL2: -35, aR1: 40, aR2: 20, aL1: -10, aL2: 40 },- { b: 0.5, torso: 20, y: 0.04, lR1: 22, lR2: -8, lL1: -12, lL2: -32, aR1: 35, aR2: 10, aL1: -5, aL2: 45 },- { b: 1, torso: 8, y: 0.07, lR1: 35, lR2: -12, lL1: 22, lL2: -25, aR1: 75, aR2: 140, aL1: 62, aL2: 130 },- { b: 1.6, torso: -2, y: -0.15, lR1: 10, lR2: -10, lL1: -5, lL2: -25, aR1: 160, aR2: 170, aL1: 150, aL2: 172, e: 'o3' },- { b: 2, torso: -4, y: -0.19, lR1: 8, lR2: -14, lL1: -6, lL2: -28, aR1: 165, aR2: 150, aL1: 150, aL2: 175 },- { b: 2.6, torso: -2, y: -0.13, lR1: 10, lR2: -12, lL1: -5, lL2: -26, aR1: 155, aR2: 110, aL1: 140, aL2: 165 },- { b: 3.2, torso: 6, y: 0.03, lR1: 20, lR2: -10, lL1: 0, lL2: -22, aR1: 70, aR2: 60, aL1: 40, aL2: 55, e: 'io' },- { b: 4, torso: 8, y: 0.02, lR1: 18, lR2: -8, lL1: -4, lL2: -20, aR1: 25, aR2: 35, aL1: 10, aL2: 30 },- ],- };- const RIM = [1.02, -0.62];- const bkRel = memo(() => off(hand(jAt(BK, 2)), 0.02, -0.07));- const bkSegs = [- [2, 3.05, bkRel, [RIM[0], RIM[1] - 0.04], 0.5],- [3.05, 3.5, [RIM[0], RIM[1] - 0.04], [RIM[0] - 0.01, RIM[1] + 0.3], 0, G.E.i3],- ];- BK.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- // Backboard + rim + net- ctx.fillStyle = C.line; ctx.fillRect(1.2, -0.92, 0.03, 0.42);- G.seg(ctx, [1.2, -0.62], [1.1, -0.62], 0.02, C.line);- ctx.save(); ctx.globalAlpha *= 0.6;- for (let i = 0; i < 4; i++) { const x = RIM[0] - 0.085 + i * 0.056; G.seg(ctx, [x, RIM[1]], [RIM[0] - 0.05 + i * 0.033, RIM[1] + 0.13], 0.01, C.line); }- ctx.restore();- };- BK.front = (ctx, J, u, C) => {- const r = 0.058;- let p = null;- if (u < 1) { // dribble- const h = hand(J); const k = Math.abs(Math.sin(Math.PI * u * 2));- p = [h[0] + 0.02, G.lerp(0.46 - r, h[1] + r * 0.6, k)];- } else if (u < 2) p = off(hand(J), 0.02, -0.07);- else { trail(ctx, u, bkSegs, C, 5, 0.04, r); p = fly(u, bkSegs); }- if (p) P.ball(ctx, p[0], p[1], r, C);- // Rim drawn in front of the ball- G.seg(ctx, [RIM[0] - 0.09, RIM[1]], [RIM[0] + 0.09, RIM[1]], 0.024, C.fg);- };-- // ───────── Volleyball: spike ─────────- const VB = POSES.volleyball = {- loop: 4, iconU: 2, fig: { s: 0.92, x: -0.2, y: 0.08 },- keys: [- { b: 0, torso: 15, lR1: -30, lR2: -60, lL1: 30, lL2: 10, aR1: -60, aR2: -40, aL1: -50, aL2: -30 },- { b: 1, torso: 25, y: 0.08, lR1: 40, lR2: -20, lL1: 30, lL2: -30, aR1: -85, aR2: -75, aL1: -75, aL2: -65 },- { b: 1.6, torso: -15, y: -0.28, lR1: -10, lR2: -70, lL1: 10, lL2: -50, aR1: 175, aR2: 250, aL1: 150, aL2: 150, e: 'o3' },- { b: 2, torso: 10, y: -0.3, lR1: 10, lR2: -40, lL1: 20, lL2: -30, aR1: 160, aR2: 150, aL1: 60, aL2: 40, e: 'iExp' },- { b: 2.5, torso: 30, y: -0.2, lR1: 30, lR2: -10, lL1: 20, lL2: -20, aR1: 60, aR2: 40, aL1: 20, aL2: 40, e: 'o3' },- { b: 3.2, torso: 15, y: 0.06, lR1: 35, lR2: -15, lL1: 25, lL2: -25, aR1: 30, aR2: 50, aL1: -10, aL2: 20 },- ],- };- const vbHit = memo(() => off(hand(jAt(VB, 2)), 0.05, -0.05));- const vbSegs = [- [0.4, 2, [-1.1, 0.25], vbHit, 0.75],- [2, 2.35, vbHit, [1.35, 0.52], 0],- ];- VB.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- const x = 0.44;- ctx.fillStyle = C.line; ctx.fillRect(x, -0.62, 0.02, 1.08); // net post- // Net: one vertical net band (side view) + grid- ctx.save(); ctx.globalAlpha *= 0.35; ctx.fillStyle = C.fg; ctx.fillRect(x - 0.03, -0.62, 0.08, 0.36); ctx.restore();- ctx.save(); ctx.globalAlpha *= 0.6; ctx.fillStyle = C.line;- for (let j = 0; j < 8; j++) ctx.fillRect(x - 0.03, -0.6 + j * 0.045, 0.08, 0.007);- ctx.restore();- ctx.fillStyle = C.fg; ctx.fillRect(x - 0.04, -0.63, 0.1, 0.025); ctx.fillRect(x - 0.04, -0.27, 0.1, 0.015);- };- VB.front = (ctx, J, u, C) => {- const q = ph(u, 4);- trail(ctx, q, vbSegs, C, 6, 0.025, 0.062);- const p = fly(q, vbSegs);- if (p) P.ball(ctx, p[0], p[1], 0.062, C);- };-- // ───────── Handball: jump shot (knee raised) ─────────- const HB = POSES.handball = {- iconU: 1.7, fig: { x: -0.25 },- keys: [- { b: 0, ...G.runCycle(0.25, 0.8, { lean: 10 }), aR1: 60, aR2: 120 },- { b: 1, torso: 5, y: -0.06, lL1: 0, lL2: -10, lR1: 80, lR2: 0, aR1: 190, aR2: 230, aL1: 70, aL2: 90 },- { b: 1.6, torso: -10, y: -0.24, lR1: 92, lR2: 12, lL1: -10, lL2: -45, aR1: 205, aR2: 245, aL1: 95, aL2: 100, e: 'o3' },- { b: 2, torso: 22, y: -0.25, lR1: 95, lR2: 20, lL1: -10, lL2: -50, aR1: 118, aR2: 112, aL1: 40, aL2: 60, e: 'iExp' },- { b: 2.5, torso: 30, y: -0.15, lR1: 60, lR2: 0, lL1: -5, lL2: -30, aR1: 40, aR2: 30, aL1: -10, aL2: 20, e: 'o3' },- { b: 3.2, torso: 15, y: 0.04, lR1: 30, lR2: -10, lL1: -10, lL2: -30, aR1: 20, aR2: 40, aL1: -10, aL2: 10 },- ],- };- const hbRel = memo(() => off(hand(jAt(HB, 2)), 0.03, -0.03));- const hbSegs = [[2, 2.35, hbRel, [1.5, 0.25], 0]];- HB.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- // Red-and-white striped goalposts- const x = 1.05, top = -0.2;- for (let i = 0; i < 6; i++) { ctx.fillStyle = i % 2 ? C.fg : C.acc; ctx.fillRect(x, top + i * (0.66 / 6), 0.035, 0.66 / 6 + 0.001); }- for (let i = 0; i < 6; i++) { ctx.fillStyle = i % 2 ? C.fg : C.acc; ctx.fillRect(x + i * 0.12, top, 0.12, 0.035); }- };- HB.front = (ctx, J, u, C) => {- let p;- if (u < 2) p = off(hand(J), 0.03, -0.03);- else { trail(ctx, u, hbSegs, C, 5, 0.03, 0.045); p = fly(u, hbSegs); }- if (p) P.ball(ctx, p[0], p[1], 0.045, C);- };-- // ───────── Hockey: push pass ─────────- const HK = POSES.hockey = {- loop: 2, iconU: 0.6,- keys: [- { b: 0, torso: 45, y: 0.08, head: -25, lR1: 40, lR2: -10, lL1: -20, lL2: -50, aR1: 40, aR2: 30, aL1: 50, aL2: 40 },- { b: 0.6, torso: 40, y: 0.08, head: -25, lR1: 40, lR2: -10, lL1: -20, lL2: -50, aR1: -25, aR2: -50, aL1: -15, aL2: -35 },- { b: 1, torso: 50, y: 0.08, head: -25, lR1: 42, lR2: -8, lL1: -22, lL2: -52, aR1: 48, aR2: 38, aL1: 55, aL2: 45, e: 'iExp' },- { b: 1.35, torso: 42, y: 0.07, head: -20, lR1: 40, lR2: -10, lL1: -20, lL2: -50, aR1: 105, aR2: 115, aL1: 95, aL2: 105, e: 'o3' },- ],- };- const stick = (J) => {- const a = foreAng(J), h = hand(J);- const top = along(h, a, -0.12), tip = along(h, a, 0.36);- return { top, tip, a };- };- const hkTip = memo(() => { const s = stick(jAt(HK, 1)); return [s.tip[0] + 0.07, 0.425]; });- HK.back = (ctx, J, u, C) => { P.ground(ctx, 0.46, C, -1.6, 1.6); };- HK.front = (ctx, J, u, C) => {- const s = stick(J);- G.seg(ctx, s.top, s.tip, 0.026, C.fg);- // J-shaped hook- const n = along(s.tip, s.a + 90, 0.07);- G.seg(ctx, s.tip, n, 0.03, C.fg);- const q = ph(u, 2), b = hkTip();- let p = q < 1 ? b : [b[0] + (q - 1) * 3.2, b[1]];- if (q >= 1) { for (let i = 1; i <= 5; i++) { ctx.save(); ctx.globalAlpha *= 0.25 * (1 - i / 6); G.disc(ctx, p[0] - i * 0.06, p[1], 0.035, C.acc); ctx.restore(); } }- G.disc(ctx, p[0], p[1], 0.035, C.acc);- };-- // ───────── Rugby sevens: sprint with the ball → diving try ─────────- const RG = POSES.rugby = {- iconU: 2.6, fig: { x: -0.3 },- pose: (u) => {- const run = (v) => ({ ...G.runCycle(v, 0.95, { lean: 16 }), aR1: 30, aR2: 125, aL1: 95, aL2: 100, head: -6 });- const dive = { x: 0.35, rot: 72, torso: 8, y: 0.17, lR1: -20, lR2: -45, lL1: -30, lL2: -60, aR1: 168, aR2: 175, aL1: 160, aL2: 170, head: 10 };- const down = { x: 0.5, rot: 84, torso: 6, y: 0.335, lR1: -12, lR2: -30, lL1: -20, lL2: -40, aR1: 172, aR2: 178, aL1: 165, aL2: 175, head: 15 };- if (u < 1.7) return run(u);- if (u < 2.5) return G.lerpPose(run(u), dive, G.E.io((u - 1.7) / 0.8));- if (u < 3.1) return G.lerpPose(dive, down, G.E.i3((u - 2.5) / 0.6));- return down;- },- };- RG.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- ctx.fillStyle = C.fg; ctx.fillRect(0.95, 0.4, 0.035, 0.07); // try line- // H-shaped posts- ctx.fillStyle = C.line;- ctx.fillRect(1.25, -0.95, 0.022, 1.41); ctx.fillRect(1.55, -0.95, 0.022, 1.41); ctx.fillRect(1.25, -0.2, 0.32, 0.022);- if (u < 1.8) P.speed(ctx, -0.35, -0.05, 0.8, 5, C, 0.8);- };- RG.front = (ctx, J, u, C) => {- const h = u < 2.2 ? off(J.aR[1], 0.06, 0.02) : J.aR[2];- const a = u < 2.2 ? 70 : 100;- ctx.save(); ctx.translate(h[0], h[1]); ctx.rotate(-a * D2R + Math.PI / 2);- ctx.fillStyle = C.acc; ctx.beginPath(); ctx.ellipse(0, 0, 0.075, 0.045, 0, 0, Math.PI * 2); ctx.fill();- ctx.fillStyle = C.bg; ctx.fillRect(-0.03, -0.004, 0.06, 0.008);- ctx.restore();- };-- // ───────── Baseball / softball: swing and hit ─────────- const BB = POSES.baseball = {- iconU: 2.05,- keys: [- { b: 0, torso: 8, lR1: 22, lR2: 12, lL1: -20, lL2: -15, aR1: -70, aR2: 165, aL1: -55, aL2: 160, bat: 205 },- { b: 1, torso: 4, lR1: 45, lR2: 0, lL1: -22, lL2: -25, aR1: -95, aR2: 175, aL1: -80, aL2: 170, bat: 232 },- { b: 1.75, torso: 6, lR1: 28, lR2: 18, lL1: -25, lL2: -35, aR1: -80, aR2: 170, aL1: -70, aL2: 165, bat: 238 },- { b: 2, torso: 0, lR1: 25, lR2: 20, lL1: -25, lL2: -45, aR1: 88, aR2: 90, aL1: 84, aL2: 86, bat: 90, e: 'iExp' },- { b: 2.6, torso: -10, lR1: 22, lR2: 20, lL1: -20, lL2: -65, aR1: 150, aR2: 205, aL1: 140, aL2: 195, bat: 248, e: 'o3' },- ],- };- const batPt = (J, u, d) => along(hand(J), G.keyPose(BB.keys, u).bat, d);- const bbHit = memo(() => batPt(jAt(BB, 2), 2, 0.3));- const bbSegs = [- [1.35, 2, [1.5, -0.1], bbHit, 0.04],- [2, 2.45, bbHit, [1.4, -1.1], 0.1, G.E.o2],- ];- BB.back = (ctx, J, u, C) => { P.ground(ctx, 0.46, C, -1.6, 1.6); G.poly(ctx, [[-0.02, 0.46], [0.16, 0.46], [0.16, 0.48], [0.07, 0.5], [-0.02, 0.48]], C.line); };- BB.front = (ctx, J, u, C) => {- const a = G.keyPose(BB.keys, u).bat, h = hand(J);- G.seg(ctx, along(h, a, -0.04), along(h, a, 0.2), 0.022, C.fg);- G.seg(ctx, along(h, a, 0.18), along(h, a, 0.42), 0.042, C.fg);- trail(ctx, u, bbSegs, C, 5, 0.035, 0.033);- const p = fly(u, bbSegs);- if (p) P.ball(ctx, p[0], p[1], 0.033, C);- };-- // ───────── Cricket: straight drive + wicket ─────────- const CK = POSES.cricket = {- iconU: 2.1, fig: { x: 0.1 },- keys: [- { b: 0, torso: 25, y: 0.03, lR1: 15, lR2: 0, lL1: -12, lL2: -18, aR1: 30, aR2: 18, aL1: 36, aL2: 24, bat: 350 },- { b: 1, torso: 18, y: 0.02, lR1: 20, lR2: 5, lL1: -15, lL2: -20, aR1: -20, aR2: 5, aL1: -10, aL2: 15, bat: 200 },- { b: 1.6, torso: 22, y: 0.05, lR1: 45, lR2: 0, lL1: -25, lL2: -35, aR1: -35, aR2: -5, aL1: -25, aL2: 5, bat: 205 },- { b: 2, torso: 30, y: 0.07, lR1: 52, lR2: -2, lL1: -35, lL2: -45, aR1: 42, aR2: 50, aL1: 47, aL2: 56, bat: 15, e: 'iExp' },- { b: 2.6, torso: 15, y: 0.05, lR1: 50, lR2: -2, lL1: -35, lL2: -48, aR1: 135, aR2: 155, aL1: 128, aL2: 150, bat: 150, e: 'o3' },- ],- };- const ckBat = (J, u) => G.keyPose(CK.keys, u).bat;- const ckHit = memo(() => along(hand(jAt(CK, 2)), 15, 0.3));- const ckSegs = [- [1.1, 1.65, [1.5, -0.25], [0.75, 0.44], 0],- [1.65, 2, [0.75, 0.44], ckHit, 0.02],- [2, 2.4, ckHit, [1.6, 0.42], 0.02],- ];- CK.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.6);- // Stumps + bails- for (let i = 0; i < 3; i++) G.seg(ctx, [-0.52 + i * 0.05, 0.46], [-0.52 + i * 0.05, 0.14], 0.018, C.line);- G.seg(ctx, [-0.535, 0.13], [-0.415, 0.13], 0.016, C.line);- };- CK.front = (ctx, J, u, C) => {- const a = ckBat(J, u), h = hand(J);- G.seg(ctx, along(h, a, -0.05), along(h, a, 0.1), 0.02, C.fg);- G.seg(ctx, along(h, a, 0.13), along(h, a, 0.4), 0.058, C.fg);- trail(ctx, u, ckSegs, C, 5, 0.035, 0.033);- const p = fly(u, ckSegs);- if (p) P.ball(ctx, p[0], p[1], 0.033, C, { seam: false });- };-- // ───────── Golf: tee shot ─────────- const GF = POSES.golf = {- iconU: 2.9, fig: { x: -0.15 },- keys: [- { b: 0, torso: 40, y: 0.02, lR1: 12, lR2: 2, lL1: -8, lL2: -12, aR1: 50, aR2: 50, aL1: 47, aL2: 47, club: 35 },- { b: 1, torso: 38, y: 0.02, lR1: 12, lR2: 2, lL1: -8, lL2: -12, aR1: 10, aR2: -30, aL1: 20, aL2: -10, club: -80 },- { b: 1.8, torso: 30, y: 0.02, lR1: 14, lR2: 0, lL1: -6, lL2: -12, aR1: -125, aR2: -160, aL1: -115, aL2: -150, club: -175 },- { b: 2, torso: 38, y: 0.02, lR1: 10, lR2: 2, lL1: -10, lL2: -14, aR1: 52, aR2: 52, aL1: 49, aL2: 49, club: 35, e: 'iExp' },- { b: 2.8, torso: -12, y: 0, lR1: 5, lR2: 0, lL1: -12, lL2: -55, aR1: 150, aR2: 205, aL1: 140, aL2: 200, club: 235, e: 'o3' },- ],- };- const gfBall = [0.55, 0.425];- const gfSegs = [[2, 2.6, gfBall, [1.7, -0.8], 0.15, G.E.o2]];- GF.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- // Distant flagstick- G.seg(ctx, [1.35, 0.46], [1.35, 0.05], 0.012, C.line);- G.poly(ctx, [[1.35, 0.05], [1.48, 0.1], [1.35, 0.15]], C.acc);- ctx.fillStyle = C.line; ctx.fillRect(gfBall[0] - 0.005, 0.44, 0.01, 0.02); // tee- };- GF.front = (ctx, J, u, C) => {- const a = G.keyPose(GF.keys, u).club, h = hand(J);- const head = along(h, a, 0.46);- G.seg(ctx, h, head, 0.018, C.fg);- G.seg(ctx, head, along(head, a + 90, 0.06), 0.04, C.fg);- if (u < 2) G.disc(ctx, gfBall[0], gfBall[1], 0.024, C.acc);- else { trail(ctx, u, gfSegs, C, 5, 0.03, 0.024); const p = fly(u, gfSegs); if (p) G.disc(ctx, p[0], p[1], 0.024, C.acc); }- };-- // ═══════ Racket sports (2 beats per cell, the hit falls on beat 1) ═══════-- // ───────── Badminton: jump smash ─────────- const BM = POSES.badminton = {- loop: 2, iconU: 0.95, fig: { s: 0.94, y: 0.1 },- keys: [- { b: 0, torso: 10, y: 0.04, lR1: 35, lR2: -10, lL1: -20, lL2: -40, aR1: -60, aR2: -100, aL1: 100, aL2: 130 },- { b: 0.6, torso: -20, y: -0.15, lR1: 30, lR2: -60, lL1: -30, lL2: -80, aR1: 190, aR2: 262, aL1: 140, aL2: 150, e: 'o3' },- { b: 1, torso: 5, y: -0.17, lR1: 20, lR2: -40, lL1: -20, lL2: -60, aR1: 170, aR2: 162, aL1: 40, aL2: 60, e: 'iExp' },- { b: 1.4, torso: 25, y: -0.08, lR1: 40, lR2: -10, lL1: -10, lL2: -50, aR1: 40, aR2: 30, aL1: -20, aL2: 0, e: 'o3' },- ],- };- const bmHit = memo(() => { const J = jAt(BM, 1); return along(hand(J), foreAng(J), 0.22); });- const bmSegs = [[0, 1, [1.4, -0.6], bmHit, 0.45], [1, 1.35, bmHit, [1.4, 0.55], 0]];- BM.front = (ctx, J, u, C) => {- P.racket(ctx, hand(J), foreAng(J) + 8, 0.14, 0.07, C);- const q = ph(u, 2), p = fly(q, bmSegs);- if (p) shuttle(ctx, p, dirOf(q, bmSegs), C);- };- BM.back = (ctx, J, u, C) => P.ground(ctx, 0.46, C, -1.6, 1.6);-- // ───────── Table tennis: forehand loop ─────────- const TT = POSES.tabletennis = {- loop: 2, iconU: 1.05, fig: { x: -0.3 },- keys: [- { b: 0, torso: 25, y: 0.05, lR1: 30, lR2: -5, lL1: -15, lL2: -35, aR1: -35, aR2: 25, aL1: 60, aL2: 100 },- { b: 0.65, torso: 28, y: 0.06, lR1: 32, lR2: -5, lL1: -15, lL2: -35, aR1: -50, aR2: 10, aL1: 55, aL2: 95 },- { b: 1, torso: 20, y: 0.05, lR1: 30, lR2: -5, lL1: -15, lL2: -35, aR1: 60, aR2: 120, aL1: 50, aL2: 90, e: 'iExp' },- { b: 1.4, torso: 12, y: 0.03, lR1: 28, lR2: -6, lL1: -14, lL2: -34, aR1: 120, aR2: 175, aL1: 40, aL2: 80, e: 'o3' },- ],- };- const TABLE_Y = 0.05;- const ttHit = memo(() => { const J = jAt(TT, 1); return along(hand(J), foreAng(J), 0.1); });- const ttSegs = [[0, 0.6, [1.6, -0.2], [0.9, TABLE_Y - 0.02], 0.1], [0.6, 1, [0.9, TABLE_Y - 0.02], ttHit, 0.18], [1, 1.6, ttHit, [1.8, -0.15], 0.3]];- TT.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- ctx.fillStyle = C.line; ctx.fillRect(0.42, TABLE_Y, 1.4, 0.035); ctx.fillRect(0.55, TABLE_Y, 0.03, 0.41);- ctx.fillStyle = C.fg; ctx.fillRect(1.25, TABLE_Y - 0.08, 0.015, 0.08); // net- };- TT.front = (ctx, J, u, C) => {- P.racket(ctx, hand(J), foreAng(J), 0.05, 0.06, C, { solid: true });- const q = ph(u, 2); trail(ctx, q, ttSegs, C, 4, 0.03, 0.022);- const p = fly(q, ttSegs); if (p) G.disc(ctx, p[0], p[1], 0.022, C.acc);- };-- // ───────── Tennis: serve ─────────- // The serve is a full-circle arm swing: keyframes are written as continuous angles (-50 → -410), not interpolated with loop, taken modulo 2 beats- const tnKeys = [- { b: 0, torso: -5, lR1: 15, lR2: 0, lL1: -15, lL2: -20, aR1: -50, aR2: -80, aL1: 165, aL2: 175 },- { b: 0.6, torso: -22, y: 0.03, lR1: 28, lR2: -18, lL1: -8, lL2: -32, aR1: -160, aR2: -25, aL1: 170, aL2: 175 },- { b: 1, torso: 15, y: -0.08, lR1: 5, lR2: -30, lL1: -20, lL2: -60, aR1: -185, aR2: -182, aL1: 60, aL2: 30, e: 'iExp' },- { b: 1.5, torso: 35, y: 0, lR1: 40, lR2: 10, lL1: -30, lL2: -60, aR1: -340, aR2: -345, aL1: 30, aL2: 60, e: 'o3' },- { b: 2, torso: -5, lR1: 15, lR2: 0, lL1: -15, lL2: -20, aR1: -410, aR2: -440, aL1: 165, aL2: 175 },- ];- const TN = POSES.tennis = {- iconU: 0.98, fig: { y: 0.05 },- pose: (u) => G.keyPose(tnKeys, ph(u, 2)),- };- const tnHit = memo(() => { const J = jAt(TN, 1); return along(hand(J), foreAng(J), 0.22); });- const tnToss = memo(() => off(farHand(jAt(TN, 0)), 0, -0.04));- const tnSegs = [- [0, 0.8, tnToss, () => off(tnHit(), -0.02, -0.12), 0, G.E.o2],- [0.8, 1, () => off(tnHit(), -0.02, -0.12), tnHit, 0, G.E.i3],- [1, 1.3, tnHit, [1.6, 0.3], 0],- ];- TN.back = (ctx, J, u, C) => P.ground(ctx, 0.46, C, -1.6, 1.6);- TN.front = (ctx, J, u, C) => {- P.racket(ctx, hand(J), foreAng(J), 0.14, 0.085, C);- const q = ph(u, 2); if (q >= 1) trail(ctx, q, tnSegs, C, 5, 0.025, 0.032);- const p = fly(q, tnSegs); if (p) P.ball(ctx, p[0], p[1], 0.032, C);- };-- // ───────── Soft tennis: forehand topspin lob (soft ball = hollow, light colour) ─────────- const ST = POSES.softtennis = {- loop: 2, iconU: 1.4, fig: { x: -0.2 },- keys: [- { b: 0, torso: 10, y: 0.04, lR1: 30, lR2: -10, lL1: -25, lL2: -40, aR1: -70, aR2: -40, aL1: 80, aL2: 90 },- { b: 0.6, torso: 14, y: 0.06, lR1: 34, lR2: -12, lL1: -28, lL2: -45, aR1: -80, aR2: -75, aL1: 85, aL2: 95 },- { b: 1, torso: 5, y: 0.03, lR1: 30, lR2: -8, lL1: -22, lL2: -38, aR1: 55, aR2: 75, aL1: 20, aL2: 40, e: 'iExp' },- { b: 1.5, torso: -6, y: 0, lR1: 20, lR2: -10, lL1: -20, lL2: -50, aR1: 150, aR2: 215, aL1: 0, aL2: 20, e: 'o3' },- ],- };- const stHit = memo(() => { const J = jAt(ST, 1); return along(hand(J), foreAng(J), 0.2); });- const stSegs = [[0, 0.55, [1.6, -0.1], [0.75, 0.43], 0.1], [0.55, 1, [0.75, 0.43], stHit, 0.12], [1, 1.8, stHit, [1.8, -0.55], 0.55]];- const softBall = (ctx, p, C) => { G.disc(ctx, p[0], p[1], 0.036, C.fg); G.disc(ctx, p[0], p[1], 0.02, C.bg); };- ST.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- ctx.fillStyle = C.line; ctx.fillRect(1.25, 0.12, 0.018, 0.34); ctx.fillStyle = C.fg; ctx.fillRect(1.25, 0.1, 0.35, 0.02);- };- ST.front = (ctx, J, u, C) => {- P.racket(ctx, hand(J), foreAng(J), 0.13, 0.078, C);- const q = ph(u, 2), p = fly(q, stSegs);- if (p) softBall(ctx, p, C);- };-- // ───────── Squash: low lunging volley + front wall ─────────- const SQ = POSES.squash = {- loop: 2, iconU: 1.05, fig: { x: -0.25 },- keys: [- { b: 0, torso: 15, y: 0.02, lR1: 30, lR2: -10, lL1: -30, lL2: -40, aR1: -100, aR2: -170, aL1: 60, aL2: 70 },- { b: 0.7, torso: 30, y: 0.1, lR1: 75, lR2: 0, lL1: -50, lL2: -60, aR1: -110, aR2: -190, aL1: -20, aL2: -10 },- { b: 1, torso: 35, y: 0.12, lR1: 80, lR2: 5, lL1: -55, lL2: -65, aR1: 60, aR2: 80, aL1: -40, aL2: -30, e: 'iExp' },- { b: 1.4, torso: 30, y: 0.1, lR1: 78, lR2: 3, lL1: -52, lL2: -62, aR1: 110, aR2: 130, aL1: -35, aL2: -25, e: 'o3' },- ],- };- const WALL = 1.05;- const sqHit = memo(() => { const J = jAt(SQ, 1); return along(hand(J), foreAng(J), 0.2); });- const sqSegs = [[0, 1, [WALL, -0.15], sqHit, 0.08], [1, 1.3, sqHit, [WALL, 0.05], 0], [1.3, 2, [WALL, 0.05], [-1.5, 0.2], 0.25]];- SQ.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, WALL);- ctx.fillStyle = C.line; ctx.fillRect(WALL, -1.0, 0.03, 1.47);- ctx.fillStyle = C.fg; ctx.fillRect(WALL - 0.02, 0.33, 0.05, 0.03); ctx.fillRect(WALL - 0.02, -0.45, 0.05, 0.02); // tin line / service line- };- SQ.front = (ctx, J, u, C) => {- P.racket(ctx, hand(J), foreAng(J), 0.16, 0.07, C);- const q = ph(u, 2); trail(ctx, q, sqSegs, C, 4, 0.03, 0.025);- const p = fly(q, sqSegs); if (p) G.disc(ctx, p[0], p[1], 0.025, C.fg);- };-- // ───────── Padel: return after the ball bounces off the back glass (solid perforated paddle) ─────────- const PD = POSES.padel = {- loop: 2, iconU: 1.05, fig: { x: 0.1 },- keys: [- { b: 0, torso: 20, y: 0.06, lR1: 40, lR2: -5, lL1: -20, lL2: -45, aR1: -60, aR2: -20, aL1: 70, aL2: 100 },- { b: 0.6, torso: 24, y: 0.08, lR1: 42, lR2: -6, lL1: -22, lL2: -48, aR1: -75, aR2: -45, aL1: 72, aL2: 102 },- { b: 1, torso: 15, y: 0.07, lR1: 40, lR2: -5, lL1: -20, lL2: -45, aR1: 55, aR2: 90, aL1: 30, aL2: 60, e: 'iExp' },- { b: 1.4, torso: 5, y: 0.04, lR1: 38, lR2: -6, lL1: -20, lL2: -44, aR1: 120, aR2: 160, aL1: 20, aL2: 50, e: 'o3' },- ],- };- const GLASS = -0.62;- const pdHit = memo(() => { const J = jAt(PD, 1); return along(hand(J), foreAng(J), 0.1); });- const pdSegs = [[0, 0.25, [1.5, -0.3], [0.15, 0.43], 0], [0.25, 0.55, [0.15, 0.43], [GLASS + 0.03, -0.05], 0.1], [0.55, 1, [GLASS + 0.03, -0.05], pdHit, 0.05], [1, 1.4, pdHit, [1.6, -0.05], 0.1]];- PD.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, GLASS, 1.6);- // Back glass: semi-transparent panel + frame- ctx.save(); ctx.globalAlpha *= 0.18; ctx.fillStyle = C.fg; ctx.fillRect(GLASS - 0.25, -0.75, 0.25, 1.21); ctx.restore();- ctx.fillStyle = C.line; ctx.fillRect(GLASS - 0.012, -0.75, 0.024, 1.21); ctx.fillRect(GLASS - 0.25, -0.75, 0.25, 0.018);- // Diagonal glass reflection lines- ctx.save(); ctx.globalAlpha *= 0.35; G.seg(ctx, [GLASS - 0.2, -0.3], [GLASS - 0.06, -0.55], 0.012, C.fg); G.seg(ctx, [GLASS - 0.2, -0.15], [GLASS - 0.1, -0.3], 0.012, C.fg); ctx.restore();- };- PD.front = (ctx, J, u, C) => {- const hc = P.racket(ctx, hand(J), foreAng(J), 0.06, 0.075, C, { solid: true });- // Perforations- ctx.save(); ctx.translate(hc[0], hc[1]); ctx.rotate(-foreAng(J) * D2R);- for (let j = -2; j <= 2; j++) for (let i = -1; i <= 1; i++) G.disc(ctx, i * 0.022 + (j % 2 ? 0.011 : 0), j * 0.022, 0.006, C.bg);- ctx.restore();- const q = ph(u, 2); trail(ctx, q, pdSegs, C, 4, 0.03, 0.03);- const p = fly(q, pdSegs); if (p) P.ball(ctx, p[0], p[1], 0.03, C);- };-- // ───────── Teqball: knee juggle → header over the net onto the curved table ─────────- const TQ = POSES.teqball = {- iconU: 2, fig: { x: -0.4 },- keys: [- { b: 0, torso: 0, lR1: 4, lR2: 2, lL1: -4, lL2: -4, aR1: -30, aR2: -10, aL1: 30, aL2: 50 },- { b: 1, torso: -3, lR1: 85, lR2: 0, lL1: -5, lL2: -5, aR1: -40, aR2: -20, aL1: 40, aL2: 60, e: 'o3' },- { b: 1.6, torso: -15, head: -15, y: 0.02, lR1: 12, lR2: 0, lL1: -6, lL2: -10, aR1: -50, aR2: -30, aL1: -45, aL2: -25 },- { b: 2, torso: 18, head: 20, y: -0.05, lR1: 10, lR2: -20, lL1: -10, lL2: -30, aR1: -45, aR2: -20, aL1: -40, aL2: -20, e: 'iExp' },- { b: 2.6, torso: 6, head: 0, lR1: 6, lR2: -4, lL1: -6, lL2: -8, aR1: -30, aR2: -10, aL1: 20, aL2: 40, e: 'o3' },- { b: 4, torso: 0, lR1: 4, lR2: 2, lL1: -4, lL2: -4, aR1: -30, aR2: -10, aL1: 30, aL2: 50 },- ],- };- const tabY = (x) => 0.02 + 0.3 * (x - 1.0) * (x - 1.0);- const tqKnee = memo(() => { const J = jAt(TQ, 1); return off(J.lR[1], 0.02, -0.08); });- const tqHead = memo(() => { const J = jAt(TQ, 2); return off(J.head, 0.07, -0.07); });- const tqSegs = [- [0, 1, [0.3, -0.95], tqKnee, 0, G.E.i3],- [1, 2, tqKnee, tqHead, 0.35],- [2, 2.8, tqHead, [1.3, tabY(1.3) - 0.055], 0.35],- [2.8, 3.6, [1.3, tabY(1.3) - 0.055], [2.0, -0.35], 0.25],- ];- TQ.back = (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.6, 1.8);- // Curved tabletop + centre net + supports- ctx.strokeStyle = C.line; ctx.lineWidth = 0.04; ctx.lineCap = 'round'; ctx.beginPath();- for (let i = 0; i <= 30; i++) { const x = 0.42 + (1.16 * i) / 30; i ? ctx.lineTo(x, tabY(x)) : ctx.moveTo(x, tabY(x)); }- ctx.stroke();- ctx.fillStyle = C.line; ctx.fillRect(0.98, tabY(1), 0.04, 0.46 - tabY(1)); ctx.fillRect(0.82, 0.44, 0.36, 0.02);- ctx.fillStyle = C.fg; ctx.fillRect(0.99, -0.1, 0.02, 0.12);- };- TQ.front = (ctx, J, u, C) => {- trail(ctx, u, tqSegs, C, 4, 0.03, 0.055);- const p = fly(u, tqSegs); if (p) P.ball(ctx, p[0], p[1], 0.055, C);- };-})();diff --git a/styles/pictogram-motion/demo/poses/base.js b/styles/pictogram-motion/demo/poses/base.jsdeleted file mode 100644index 1c8ae70..0000000--- a/styles/pictogram-motion/demo/poses/base.js+++ /dev/null@@ -1,49 +0,0 @@-// Pose library conventions (shared by all poses/*.js)-//-// POSES[name] = {-// pose(u) → pose object u = beats since this card started (150 BPM, 1 beat 0.4s; cards are 4 beats, fast-cut cards 2 beats)-// or keys: [...] + loop: beats (see G.keyPose)-// back(ctx, J, u, C) optional, props/environment drawn behind the figure (unit = body height, origin = hips)-// front(ctx, J, u, C) optional, props drawn in front of the figure-// fig: optional { s: scale, x, y } offset of the figure on the stage (in body heights)-// second: optional (u) → pose a second person (opponent / teammate), drawn behind the main figure in colour C.far2-// secondX: second person's offset [x, y], secondFace: -1 means facing left-// }-// C = { fg near-side colour, far far-side colour, far2 second-person colour, acc accent colour, bg background colour, line thin-line colour }-// Design language: the geometry of the official core graphic — props are circles, half circles, capsule segments and straight lines; no realistic detail.-// Movement must lock to the beat: u = 0,1,2,3 are the strong beats; key actions (release, hit, landing) fall on whole beats.-window.POSES = window.POSES || {};--(function () {- const G = window.G;- // Common props- G.P = {- ball: (ctx, x, y, r, C, o = {}) => {- G.disc(ctx, x, y, r, o.col || C.acc);- if (o.seam !== false) { ctx.save(); ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.clip(); G.disc(ctx, x + r * 0.9, y - r * 0.9, r * 0.95, o.col2 || C.bg); ctx.restore(); }- },- racket: (ctx, hand, ang, len, headR, C, o = {}) => {- // ang: degrees, 0 = down, 90 = forward- const d = [Math.sin(ang * G.D2R), Math.cos(ang * G.D2R)];- const tip = [hand[0] + d[0] * len, hand[1] + d[1] * len];- G.seg(ctx, hand, tip, 0.022, o.col || C.fg);- const hc = [tip[0] + d[0] * headR, tip[1] + d[1] * headR];- ctx.save(); ctx.translate(hc[0], hc[1]); ctx.rotate(-ang * G.D2R);- ctx.strokeStyle = o.col || C.fg; ctx.lineWidth = 0.02;- ctx.beginPath(); ctx.ellipse(0, 0, headR * 0.78, headR, 0, 0, Math.PI * 2); ctx.stroke();- if (o.solid) { ctx.fillStyle = o.col || C.fg; ctx.fill(); }- ctx.restore();- return hc;- },- stick: (ctx, a, b, w, C, col) => G.seg(ctx, a, b, w, col || C.fg),- ground: (ctx, y, C, x0 = -1.2, x1 = 1.2) => { ctx.fillStyle = C.line; ctx.fillRect(x0, y, x1 - x0, 0.012); },- // Speed lines: n lines trailing back from (x,y)- speed: (ctx, x, y, len, n, C, a = 1) => {- ctx.save(); ctx.globalAlpha *= a;- for (let i = 0; i < n; i++) { ctx.fillStyle = C.line; ctx.fillRect(x - len * (0.6 + 0.4 * ((i * 37) % 10) / 10), y + (i - (n - 1) / 2) * 0.07, len * (0.5 + 0.5 * ((i * 53) % 10) / 10), 0.012); }- ctx.restore();- },- // Flight arc of an object (0→1)- arc: (a, b, h, t) => [G.lerp(a[0], b[0], t), G.lerp(a[1], b[1], t) - h * 4 * t * (1 - t)],- };-})();diff --git a/styles/pictogram-motion/demo/poses/combat.js b/styles/pictogram-motion/demo/poses/combat.jsdeleted file mode 100644index a1a8748..0000000--- a/styles/pictogram-motion/demo/poses/combat.js+++ /dev/null@@ -1,330 +0,0 @@-// Combat, 9 events: judo karate taekwondo boxing wrestling fencing jujitsu kurash mma-(function () {- const G = window.G, P = G.P, POSES = window.POSES;- // Arms/legs are written as "world angles" (0 = straight down, 90 = horizontal forward, 180 = straight up) and converted here to the skeleton convention- // Keyframes with body: true are written directly in the skeleton convention (relative to the body); suits rolls / lying on the ground- const WA = (p) => {- if (p.body) return { ...p };- const o = { ...p }, f = (p.rot || 0) + (p.torso || 0), r = p.rot || 0;- for (const k of ['aR1', 'aR2', 'aL1', 'aL2']) if (k in o) o[k] += f;- for (const k of ['lR1', 'lR2', 'lL1', 'lL2']) if (k in o) o[k] += r;- return o;- };- const K = (arr) => arr.map(WA);- const kp = (keys) => { const k = K(keys); return (u) => G.keyPose(k, u); };- // Impact: short lines radiating from point p, t 0→1- const burst = (ctx, p, t, C, r0 = 0.05, n = 7, col) => {- if (t <= 0 || t >= 1) return;- const e = G.E.o3(t);- ctx.save(); ctx.globalAlpha *= 1 - t;- for (let i = 0; i < n; i++) {- const a = (i / n) * Math.PI * 2 + 0.3;- const r1 = r0 + e * 0.1, r2 = r0 + e * 0.2;- G.seg(ctx, [p[0] + Math.cos(a) * r1, p[1] + Math.sin(a) * r1], [p[0] + Math.cos(a) * r2, p[1] + Math.sin(a) * r2], 0.014, col || C.acc);- }- ctx.restore();- };- // Belt: across the top of the hips, perpendicular to the torso- const belt = (ctx, J, col, tails) => {- const up = J.up, pr = [-up[1], up[0]];- const c = [J.hip[0] + up[0] * 0.035, J.hip[1] + up[1] * 0.035];- G.seg(ctx, [c[0] - pr[0] * 0.07, c[1] - pr[1] * 0.07], [c[0] + pr[0] * 0.07, c[1] + pr[1] * 0.07], 0.034, col);- if (tails) {- const k = [c[0] + pr[0] * 0.05, c[1] + pr[1] * 0.05];- G.seg(ctx, k, [k[0] + 0.035, k[1] + 0.1], 0.02, col);- G.seg(ctx, k, [k[0] + 0.065, k[1] + 0.085], 0.02, col);- }- };- // Second person's (mirrored) joints → main canvas coordinates- const J2 = (def, u) => {- const J = G.joints(def.second(u)), o = def.secondX || [0, 0], f = def.secondFace === -1 ? -1 : 1;- const m = (p) => [o[0] + f * p[0], o[1] + p[1]];- return { J, m, up: [f * J.up[0], J.up[1]], hip: m(J.hip), hR: m(J.aR[2]), hL: m(J.aL[2]), head: m(J.head) };- };-- // ── Judo: ippon seoi-nage. Beat 2 the opponent goes over the shoulder and back, beat 3 lands on their back ──- const judo = {- pose: kp([- { b: 0, torso: 8, aR1: 60, aR2: 85, aL1: 50, aL2: 95, lR1: 12, lR2: 4, lL1: -14, lL2: -14 },- { b: 0.9, y: 0.08, torso: 32, aR1: 55, aR2: 120, aL1: 40, aL2: 110, lR1: 35, lR2: -22, lL1: 20, lL2: -30 },- { b: 2, y: 0.11, torso: 78, aR1: 35, aR2: 10, aL1: 20, aL2: -5, lR1: 32, lR2: -18, lL1: -8, lL2: -25, e: 'io3' },- { b: 3, y: 0.06, torso: 58, aR1: 20, aR2: 5, aL1: 10, aL2: -10, lR1: 28, lR2: -12, lL1: -12, lL2: -22, e: 'o3' },- ]),- second: kp([- { b: 0, torso: 8, aR1: 60, aR2: 85, aL1: 50, aL2: 95, lR1: 12, lR2: 4, lL1: -14, lL2: -14 },- { b: 0.9, x: 0.12, y: -0.02, rot: 12, torso: 28, aR1: 70, aR2: 90, aL1: 60, aL2: 80, lR1: -10, lR2: -18, lL1: -25, lL2: -30 },- { b: 1.6, body: true, x: 0.3, y: -0.46, rot: 120, torso: 10, aR1: 30, aR2: 30, aL1: 10, aL2: 10, lR1: -10, lR2: -10, lL1: -20, lL2: -20 },- { b: 2.2, body: true, x: 0.58, y: -0.3, rot: 215, torso: 0, aR1: 60, aR2: 60, aL1: 40, aL2: 40, lR1: -5, lR2: -5, lL1: -15, lL2: -15, e: 'lin' },- { b: 2.8, body: true, x: 0.82, y: 0.37, rot: 270, torso: 0, aR1: 140, aR2: 160, aL1: 110, aL2: 130, lR1: 30, lR2: 10, lL1: 12, lL2: 2, e: 'o3' },- { b: 3.3, body: true, x: 0.84, y: 0.37, rot: 270, torso: 0, aR1: 150, aR2: 170, aL1: 115, aL2: 135, lR1: 45, lR2: 8, lL1: 20, lL2: 0, e: 'o3' },- ]),- secondX: [0.36, 0], secondFace: -1,- fig: { s: 0.82, x: 0.26 },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1.1, 0.8);- // Landing shockwave- const t = (u - 2.8) / 0.8;- if (t > 0 && t < 1) { ctx.save(); ctx.globalAlpha *= 1 - t; ctx.fillStyle = C.acc; const w = 0.2 + G.E.o3(t) * 0.6; ctx.fillRect(-0.48 - w / 2, 0.475, w, 0.018); ctx.restore(); }- },- iconU: 1.9,- };- POSES.judo = judo;-- // ── Karate: kata. Reverse punch → front kick → switch-hand punch, crisp and held ──- const kA = { torso: 4, aR1: 90, aR2: 90, aL1: -40, aL2: 80, lR1: 42, lR2: 0, lL1: -32, lL2: -30, y: 0.06 };- const kB = { torso: -6, aR1: 20, aR2: 150, aL1: 40, aL2: 140, lR1: 100, lR2: 96, lL1: -6, lL2: -6, y: -0.02 };- const kC = { torso: 4, aR1: -40, aR2: 80, aL1: 90, aL2: 90, lR1: 42, lR2: 0, lL1: -32, lL2: -30, y: 0.06 };- POSES.karate = {- pose: kp([- { b: 0, ...kA, aR1: 30, aR2: 60 },- { b: 0.22, ...kA, e: 'oExp' },- { b: 1.7, ...kA },- { b: 1.82, torso: 0, aR1: 25, aR2: 150, aL1: 35, aL2: 140, lR1: 60, lR2: -30, lL1: -8, lL2: -8, y: 0 },- { b: 2, ...kB, e: 'oExp' },- { b: 2.5, ...kB },- { b: 2.75, ...kC, aL1: 30, aL2: 60, e: 'o3' },- { b: 3, ...kC, e: 'oExp' },- ]),- back: (ctx, J, u, C) => P.ground(ctx, 0.46, C, -0.9, 0.9),- front: (ctx, J, u, C) => {- belt(ctx, J, C.acc, true);- burst(ctx, J.aR[2], (u - 0.22) / 0.5, C, 0.05, 6);- burst(ctx, J.lR[2], (u - 2) / 0.5, C, 0.05, 6);- burst(ctx, J.aL[2], (u - 3) / 0.5, C, 0.05, 6);- },- iconU: 2.2,- };-- // ── Taekwondo: high roundhouse kick (headgear + body protector) ──- const tStance = { y: 0.03, torso: 6, aR1: 20, aR2: 110, aL1: 35, aL2: 120, lR1: 26, lR2: 8, lL1: -24, lL2: -28 };- POSES.taekwondo = {- pose: kp([- { b: 0, ...tStance },- { b: 0.5, ...tStance, y: 0.0 },- { b: 1, ...tStance, y: 0.05 },- { b: 1.5, y: 0, torso: -8, aR1: 10, aR2: 100, aL1: 40, aL2: 120, lR1: 115, lR2: 0, lL1: -4, lL2: -8, e: 'o3' },- { b: 2, y: -0.03, torso: -42, aR1: -40, aR2: -20, aL1: 60, aL2: 120, lR1: 150, lR2: 152, lL1: -10, lL2: -12, e: 'oExp' },- { b: 2.6, y: -0.02, torso: -38, aR1: -35, aR2: -15, aL1: 60, aL2: 120, lR1: 146, lR2: 148, lL1: -10, lL2: -12 },- { b: 3.1, y: 0.02, torso: -5, aR1: 10, aR2: 100, aL1: 40, aL2: 120, lR1: 100, lR2: 0, lL1: -6, lL2: -10, e: 'io' },- { b: 3.6, ...tStance, e: 'o3' },- ]),- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -0.9, 0.9);- // Arc of the foot's path- const t = G.clamp((u - 1.5) / 0.5), fade = 1 - G.clamp((u - 2.1) / 0.8);- if (t > 0 && fade > 0) {- ctx.save(); ctx.globalAlpha *= fade * 0.9;- ctx.strokeStyle = C.line; ctx.lineWidth = 0.02; ctx.lineCap = 'round';- ctx.beginPath(); ctx.arc(J.hip[0], J.hip[1], 0.47, 1.1, -0.95, true); ctx.stroke();- ctx.beginPath(); ctx.arc(J.hip[0], J.hip[1], 0.39, 1.0, -0.8, true); ctx.stroke();- ctx.restore();- }- },- front: (ctx, J, u, C) => {- // Body protector: rounded block on the torso- const c = [J.hip[0] + J.up[0] * 0.17, J.hip[1] + J.up[1] * 0.17];- G.seg(ctx, [c[0] - J.up[0] * 0.07, c[1] - J.up[1] * 0.07], [c[0] + J.up[0] * 0.07, c[1] + J.up[1] * 0.07], 0.165, C.acc);- burst(ctx, J.lR[2], (u - 2) / 0.55, C, 0.06, 7);- },- iconU: 2.2,- };-- // ── Boxing: jab, jab, rear straight ──- const bG = { y: 0.04, torso: 12, aR1: 25, aR2: 160, aL1: 45, aL2: 150, lR1: 16, lR2: 2, lL1: -20, lL2: -26 };- const jab = { ...bG, torso: 18, aL1: 90, aL2: 90 };- const cross = { ...bG, torso: 26, x: 0.04, aR1: 92, aR2: 92, aL1: 30, aL2: 160, lR1: 20, lR2: 2, lL1: -32, lL2: -34 };- POSES.boxing = {- pose: kp([- { b: 0, ...bG },- { b: 0.3, ...jab, e: 'oExp' },- { b: 0.6, ...bG },- { b: 1, ...jab, e: 'oExp' },- { b: 1.3, ...bG },- { b: 1.7, ...bG, y: 0.07, torso: 8, x: -0.02 },- { b: 2, ...cross, e: 'oExp' },- { b: 2.5, ...cross },- { b: 3.1, ...bG, e: 'io' },- { b: 3.6, ...bG, y: 0.02 },- ]),- back: (ctx, J, u, C) => P.ground(ctx, 0.46, C, -0.9, 0.9),- front: (ctx, J, u, C) => {- G.disc(ctx, J.aL[2][0], J.aL[2][1], 0.066, C.acc);- G.disc(ctx, J.aR[2][0], J.aR[2][1], 0.07, C.acc);- burst(ctx, [J.aL[2][0] + 0.06, J.aL[2][1]], (u - 0.3) / 0.4, C, 0.07, 5);- burst(ctx, [J.aL[2][0] + 0.06, J.aL[2][1]], (u - 1) / 0.4, C, 0.07, 5);- burst(ctx, [J.aR[2][0] + 0.07, J.aR[2][1]], (u - 2) / 0.6, C, 0.08, 8);- },- iconU: 2.1,- };-- // ── Wrestling: double-leg takedown ──- POSES.wrestling = {- pose: kp([- { b: 0, x: -0.05, y: 0.1, torso: 38, aR1: 55, aR2: 95, aL1: 45, aL2: 100, lR1: 32, lR2: -22, lL1: -18, lL2: -38 },- { b: 0.8, x: -0.02, y: 0.13, torso: 45, aR1: 60, aR2: 90, aL1: 50, aL2: 95, lR1: 38, lR2: -25, lL1: -20, lL2: -40 },- { b: 1.2, x: 0.14, y: 0.22, torso: 62, aR1: 88, aR2: 100, aL1: 80, aL2: 100, lR1: 78, lR2: -8, lL1: 8, lL2: -92, e: 'oExp' },- { b: 2, x: 0.3, y: 0.1, torso: 42, aR1: 100, aR2: 150, aL1: 95, aL2: 145, lR1: 30, lR2: -15, lL1: -35, lL2: -48, e: 'io3' },- { b: 2.9, x: 0.4, y: 0.2, torso: 68, aR1: 95, aR2: 100, aL1: 85, aL2: 95, lR1: 60, lR2: -30, lL1: 5, lL2: -90, e: 'o3' },- ]),- second: kp([- { b: 0, y: 0.1, torso: 36, aR1: 55, aR2: 95, aL1: 45, aL2: 100, lR1: 30, lR2: -22, lL1: -18, lL2: -38 },- { b: 0.8, y: 0.1, torso: 36, aR1: 55, aR2: 95, aL1: 45, aL2: 100, lR1: 30, lR2: -22, lL1: -18, lL2: -38 },- { b: 1.2, y: 0.04, torso: 30, aR1: 75, aR2: 110, aL1: 70, aL2: 120, lR1: 18, lR2: 10, lL1: -10, lL2: -10 },- { b: 2, body: true, x: -0.18, y: -0.1, rot: -48, torso: 10, aR1: 150, aR2: 170, aL1: 130, aL2: 160, lR1: 40, lR2: 30, lL1: 20, lL2: 10, e: 'io3' },- { b: 2.9, body: true, x: -0.42, y: 0.37, rot: -90, torso: 0, aR1: 160, aR2: 175, aL1: 140, aL2: 170, lR1: 50, lR2: 8, lL1: 28, lL2: 0, e: 'o3' },- ]),- secondX: [0.36, 0], secondFace: -1,- fig: { s: 0.82, x: -0.36 },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -0.7, 1.3);- const t = (u - 2.9) / 0.8;- if (t > 0 && t < 1) { ctx.save(); ctx.globalAlpha *= 1 - t; ctx.fillStyle = C.acc; const w = 0.3 + G.E.o3(t) * 0.7; ctx.fillRect(0.86 - w / 2, 0.475, w, 0.018); ctx.restore(); }- },- iconU: 2,- };-- // ── Fencing: advance → lunge and hit, light comes on ──- const fG = { y: 0.07, torso: 0, aR1: 38, aR2: 78, aL1: -115, aL2: 165, lR1: 36, lR2: -4, lL1: -34, lL2: -12 };- POSES.fencing = {- pose: kp([- { b: 0, ...fG },- { b: 0.45, ...fG, x: 0.06, y: 0.05, lR1: 45, lR2: 5, e: 'o3' },- { b: 0.9, ...fG, x: 0.1 },- { b: 1.5, ...fG, x: 0.1, y: 0.08, aR1: 60, aR2: 85 },- { b: 2, x: 0.3, y: 0.15, torso: 10, aR1: 92, aR2: 92, aL1: -70, aL2: -75, lR1: 82, lR2: -2, lL1: -62, lL2: -62, e: 'oExp' },- { b: 2.8, x: 0.3, y: 0.15, torso: 10, aR1: 92, aR2: 92, aL1: -70, aL2: -75, lR1: 82, lR2: -2, lL1: -62, lL2: -62 },- { b: 3.6, ...fG, x: 0.16, e: 'io3' },- ]),- second: kp([- { b: 0, ...fG },- { b: 0.9, ...fG, x: -0.06 },- { b: 1.7, ...fG, x: -0.04, aR1: 55, aR2: 110 },- { b: 2, ...fG, x: -0.1, torso: -14, aR1: 70, aR2: 150, lR1: 30, lR2: -5, e: 'o3' },- { b: 3, ...fG, x: -0.12, torso: -8, aR1: 20, aR2: 40, e: 'io' },- ]),- secondX: [1.22, 0], secondFace: -1,- fig: { s: 0.72, x: -0.44 },- back: (ctx, J, u, C) => {- // Piste- ctx.fillStyle = C.line; ctx.fillRect(-0.8, 0.46, 2.85, 0.012);- ctx.fillRect(-0.8, 0.44, 0.012, 0.05); ctx.fillRect(2.04, 0.44, 0.012, 0.05); ctx.fillRect(0.61, 0.44, 0.012, 0.05);- // Opponent's blade- const S = J2(POSES.fencing, u), el = S.m(S.J.aR[1]), h = S.hR;- const d = [h[0] - el[0], h[1] - el[1]], L = Math.hypot(d[0], d[1]);- G.seg(ctx, h, [h[0] + d[0] / L * 0.5, h[1] + d[1] / L * 0.5], 0.012, C.far2);- G.disc(ctx, h[0], h[1], 0.032, C.far2);- },- front: (ctx, J, u, C) => {- const el = J.aR[1], h = J.aR[2];- const d = [h[0] - el[0], h[1] - el[1]], L = Math.hypot(d[0], d[1]);- // Blade bends slightly on the hit- const bend = G.clamp(1 - Math.abs(u - 2.1) / 0.5) * 0.05;- const tip = [h[0] + d[0] / L * 0.52, h[1] + d[1] / L * 0.52 - bend];- ctx.strokeStyle = C.fg; ctx.lineWidth = 0.012; ctx.lineCap = 'round';- ctx.beginPath(); ctx.moveTo(h[0], h[1]); ctx.quadraticCurveTo(h[0] + d[0] / L * 0.3, h[1] + d[1] / L * 0.3 - bend * 1.6, tip[0], tip[1]); ctx.stroke();- G.disc(ctx, h[0], h[1], 0.034, C.acc);- // Light: halo after the hit- const t = (u - 2) / 0.9;- if (t > 0 && t < 1) { ctx.save(); ctx.globalAlpha *= 1 - t; G.ring(ctx, tip[0], tip[1], 0.03 + G.E.o3(t) * 0.16, 0.016, C.acc); ctx.restore(); }- if (u > 2 && u < 3.2) G.disc(ctx, tip[0], tip[1], 0.025, C.acc);- },- iconU: 2.2,- };-- // ── Ju-jitsu: kneeling grip → sweep → mount with arm control ──- POSES.jujitsu = {- pose: kp([- { b: 0, x: -0.02, y: 0.225, torso: 18, aR1: 70, aR2: 85, aL1: 60, aL2: 95, lR1: 0, lR2: -90, lL1: -4, lL2: -92 },- { b: 1, x: 0.04, y: 0.2, torso: 30, aR1: 80, aR2: 60, aL1: 70, aL2: 60, lR1: 30, lR2: -60, lL1: -4, lL2: -92 },- { b: 1.9, x: 0.52, y: 0.22, torso: 38, aR1: 95, aR2: 40, aL1: 85, aL2: 30, lR1: 40, lR2: -80, lL1: 20, lL2: -95, e: 'io3' },- { b: 2.6, x: 0.62, y: 0.25, torso: -5, aR1: 110, aR2: 16, aL1: 116, aL2: 22, lR1: 30, lR2: -95, lL1: 22, lL2: -96, e: 'o3' },- { b: 3.2, x: 0.6, y: 0.25, torso: -12, aR1: 106, aR2: 12, aL1: 112, aL2: 18, lR1: 30, lR2: -95, lL1: 22, lL2: -96 },- ]),- second: kp([- { b: 0, y: 0.225, torso: 18, aR1: 70, aR2: 85, aL1: 60, aL2: 95, lR1: 0, lR2: -90, lL1: -4, lL2: -92 },- { b: 1, body: true, x: -0.04, y: 0.2, rot: -25, torso: 10, aR1: 90, aR2: 110, aL1: 80, aL2: 120, lR1: 20, lR2: -60, lL1: 0, lL2: -80 },- { b: 1.9, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 70, aR2: 80, aL1: 140, aL2: 160, lR1: 55, lR2: 8, lL1: 35, lL2: 0, e: 'io3' },- { b: 2.6, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 92, aR2: 92, aL1: 150, aL2: 170, lR1: 60, lR2: 10, lL1: 38, lL2: 2, e: 'o3' },- // Tap-out on the mat- { b: 3.0, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 92, aR2: 92, aL1: 130, aL2: 150, lR1: 60, lR2: 10, lL1: 38, lL2: 2 },- { b: 3.2, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 92, aR2: 92, aL1: 165, aL2: 180, lR1: 60, lR2: 10, lL1: 38, lL2: 2, e: 'oExp' },- { b: 3.4, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 92, aR2: 92, aL1: 130, aL2: 150, lR1: 60, lR2: 10, lL1: 38, lL2: 2 },- { b: 3.6, body: true, x: -0.2, y: 0.37, rot: -90, torso: 0, aR1: 92, aR2: 92, aL1: 165, aL2: 180, lR1: 60, lR2: 10, lL1: 38, lL2: 2, e: 'oExp' },- ]),- secondX: [0.3, 0], secondFace: -1,- fig: { s: 0.86, x: -0.3, y: -0.04 },- back: (ctx, J, u, C) => P.ground(ctx, 0.46, C, -0.6, 1.4),- front: (ctx, J, u, C) => {- const S = J2(POSES.jujitsu, u);- if (u > 2.4) G.disc(ctx, S.hR[0], S.hR[1], 0.03, C.acc);- // Tap on the mat- for (const tb of [3.2, 3.6]) burst(ctx, S.hL, (u - tb) / 0.35, C, 0.04, 5);- },- iconU: 2.8,- };-- // ── Kurash: grab the belt → lift → throw ──- POSES.kurash = {- pose: kp([- { b: 0, x: 0, y: 0.03, torso: 16, aR1: 45, aR2: 62, aL1: 40, aL2: 70, lR1: 14, lR2: 2, lL1: -16, lL2: -20 },- { b: 1, x: 0.04, y: 0.1, torso: 8, aR1: 40, aR2: 70, aL1: 35, aL2: 78, lR1: 34, lR2: -18, lL1: -8, lL2: -30 },- { b: 1.9, x: 0.06, y: 0.0, torso: -24, aR1: 70, aR2: 100, aL1: 65, aL2: 110, lR1: 18, lR2: 0, lL1: -18, lL2: -18, e: 'io3' },- { b: 2.9, x: 0.2, y: 0.12, torso: 50, aR1: 60, aR2: 40, aL1: 50, aL2: 30, lR1: 40, lR2: -10, lL1: -30, lL2: -40, e: 'o3' },- ]),- second: kp([- { b: 0, x: 0, y: 0.03, torso: 16, aR1: 45, aR2: 62, aL1: 40, aL2: 70, lR1: 14, lR2: 2, lL1: -16, lL2: -20 },- { b: 1, x: 0.03, y: 0.02, torso: 20, aR1: 45, aR2: 62, aL1: 40, aL2: 70, lR1: 10, lR2: 4, lL1: -18, lL2: -18 },- { b: 1.9, x: 0.06, y: -0.22, rot: -12, torso: 18, aR1: 50, aR2: 60, aL1: 40, aL2: 55, lR1: 20, lR2: -10, lL1: -10, lL2: -30, e: 'io3' },- { b: 2.4, body: true, x: -0.2, y: -0.12, rot: -70, torso: 5, aR1: 120, aR2: 140, aL1: 100, aL2: 130, lR1: 40, lR2: 30, lL1: 20, lL2: 10, e: 'lin' },- { b: 2.9, body: true, x: -0.46, y: 0.37, rot: -90, torso: 0, aR1: 160, aR2: 175, aL1: 140, aL2: 170, lR1: 50, lR2: 8, lL1: 28, lL2: 0, e: 'o3' },- ]),- secondX: [0.34, 0], secondFace: -1,- fig: { s: 0.84, x: -0.3 },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -0.7, 1.3);- const t = (u - 2.9) / 0.8;- if (t > 0 && t < 1) { ctx.save(); ctx.globalAlpha *= 1 - t; ctx.fillStyle = C.acc; const w = 0.3 + G.E.o3(t) * 0.7; ctx.fillRect(0.84 - w / 2, 0.475, w, 0.018); ctx.restore(); }- },- front: (ctx, J, u, C) => {- belt(ctx, J, C.acc, false);- const S = J2(POSES.kurash, u);- belt(ctx, { hip: S.hip, up: S.up }, C.acc, false);- },- iconU: 1.9,- };-- // ── MMA: octagon + small gloves, jab → body kick ──- const mG = { y: 0.06, torso: 10, aR1: 22, aR2: 158, aL1: 42, aL2: 150, lR1: 18, lR2: 2, lL1: -22, lL2: -28 };- POSES.mma = {- pose: kp([- { b: 0, ...mG },- { b: 0.3, ...mG, y: 0.03 },- { b: 0.6, ...mG, torso: 16, aL1: 90, aL2: 90, e: 'oExp' },- { b: 0.95, ...mG },- { b: 1.5, ...mG, y: 0.08, torso: 4 },- { b: 1.75, y: 0.02, torso: -12, aR1: 0, aR2: 60, aL1: 45, aL2: 150, lR1: 70, lR2: -30, lL1: -10, lL2: -12 },- { b: 2, y: 0, torso: -28, aR1: -45, aR2: -25, aL1: 50, aL2: 150, lR1: 102, lR2: 98, lL1: -12, lL2: -14, e: 'oExp' },- { b: 2.45, y: 0, torso: -24, aR1: -40, aR2: -20, aL1: 50, aL2: 150, lR1: 98, lR2: 94, lL1: -12, lL2: -14 },- { b: 3, ...mG, e: 'io3' },- { b: 3.5, ...mG, y: 0.03 },- ]),- back: (ctx, J, u, C) => {- // Wire mesh (diamond grid) + top rail- ctx.save(); ctx.beginPath(); ctx.rect(-0.95, -0.72, 1.9, 1.18); ctx.clip();- ctx.globalAlpha *= 0.32; ctx.strokeStyle = C.line; ctx.lineWidth = 0.008;- for (let i = -12; i < 14; i++) {- ctx.beginPath(); ctx.moveTo(-1.2 + i * 0.12, -0.8); ctx.lineTo(-1.2 + i * 0.12 + 1.3, 0.5); ctx.stroke();- ctx.beginPath(); ctx.moveTo(-1.2 + i * 0.12, 0.5); ctx.lineTo(-1.2 + i * 0.12 + 1.3, -0.8); ctx.stroke();- }- ctx.restore();- ctx.fillStyle = C.line; ctx.fillRect(-0.95, -0.72, 1.9, 0.02); ctx.fillRect(-0.95, 0.46, 1.9, 0.012);- },- front: (ctx, J, u, C) => {- G.disc(ctx, J.aL[2][0], J.aL[2][1], 0.046, C.acc);- G.disc(ctx, J.aR[2][0], J.aR[2][1], 0.048, C.acc);- burst(ctx, [J.aL[2][0] + 0.05, J.aL[2][1]], (u - 0.6) / 0.4, C, 0.06, 5);- burst(ctx, J.lR[2], (u - 2) / 0.55, C, 0.06, 7);- },- iconU: 2.1,- };-})();diff --git a/styles/pictogram-motion/demo/poses/nature.js b/styles/pictogram-motion/demo/poses/nature.jsdeleted file mode 100644index 9f5c6f7..0000000--- a/styles/pictogram-motion/demo/poses/nature.js+++ /dev/null@@ -1,594 +0,0 @@-// Chapter 6 Land & sea: rowing, canoe, sailing, surfing, triathlon, road/track/BMX/mountain-bike cycling, equestrian-(function () {- const G = window.G, P = G.P, POSES = window.POSES, L = G.LEN, D2R = G.D2R;- const R2D = 180 / Math.PI;- const { lerp, clamp, E } = G;-- // ── Inverse kinematics: given world-coordinate target points, solve the limb angles (solved per frame; angle jumps don't matter because rendering only uses sin/cos) ──- function ik(A, T, L1, L2, bend) {- const dx = T[0] - A[0], dy = T[1] - A[1];- let d = Math.hypot(dx, dy);- d = clamp(d, Math.abs(L1 - L2) + 1e-4, L1 + L2 - 1e-4);- const base = Math.atan2(dx, dy);- const b = Math.acos(clamp((L1 * L1 + d * d - L2 * L2) / (2 * L1 * d), -1, 1));- const a1 = base + bend * b;- const K = [A[0] + Math.sin(a1) * L1, A[1] + Math.cos(a1) * L1];- return [a1 * R2D, Math.atan2(T[0] - K[0], T[1] - K[1]) * R2D];- }- // base: {x,y,rot,torso,head}; T: fR/fL feet, hR/hL hands (world coordinates), kR/kL/eR/eL bend direction (+1 / -1)- function solve(base, T) {- const p = Object.assign({ x: 0, y: 0, rot: 0, torso: 0, head: 0 }, base);- const hip = [p.x, p.y], tf = p.rot + p.torso, sl = L.torso - 0.025;- const sho = [hip[0] + Math.sin(tf * D2R) * sl, hip[1] - Math.cos(tf * D2R) * sl];- const leg = (t, k) => { const [a, b] = ik(hip, t, L.th, L.sh, k); return [a + p.rot, b + p.rot]; };- const arm = (t, k) => { const [a, b] = ik(sho, t, L.ua, L.fa, k); return [a + tf, b + tf]; };- if (T.fR) [p.lR1, p.lR2] = leg(T.fR, T.kR ?? 1);- if (T.fL) [p.lL1, p.lL2] = leg(T.fL, T.kL ?? 1);- if (T.hR) [p.aR1, p.aR2] = arm(T.hR, T.eR ?? -1);- if (T.hL) [p.aL1, p.aL2] = arm(T.hL, T.eL ?? -1);- return p;- }- // Local (rider coordinates, unrotated, origin = hips) → world- const W = (p, loc) => { const v = G.rot2(loc, p.rot || 0); return [(p.x || 0) + v[0], (p.y || 0) + v[1]]; };- const inFrame = (ctx, J, fn) => { ctx.save(); ctx.translate(J.hip[0], J.hip[1]); ctx.rotate((J.p.rot || 0) * D2R); fn(); ctx.restore(); };- const fract = (x) => x - Math.floor(x);- // Water: one shade darker in the same palette + a row of seigaiha (青海波, overlapping wave scales) along the top (the scale pattern of the official core graphic)- const waterCol = (C) => G.mix(C.bg, '#000000', 0.16);- function waterBand(ctx, y, u, C, per = 0.3, loop = 1, dir = 1) {- const wc = waterCol(C), off = fract(u / loop) * per * dir;- const cy = y + per * 0.5;- ctx.fillStyle = wc; ctx.fillRect(-2.4, cy, 4.8, 1.4);- for (let i = -10; i < 11; i++) {- const x = i * per + off;- G.disc(ctx, x, cy, per * 0.5, wc);- ctx.strokeStyle = C.line; ctx.lineWidth = 0.01;- for (const r of [0.36, 0.22]) { ctx.beginPath(); ctx.arc(x, cy, per * r, Math.PI, 0); ctx.stroke(); }- }- }- const capsule = (ctx, a, b, w, col) => G.seg(ctx, a, b, w, col);-- // ── Bicycles ──- // g: local geometry { ra, fa, r, bb, sc, ht, hb, bar, crank, kind }- function drawBike(ctx, g, u, C, spin, o = {}) {- const lw = 0.024;- const wheel = (c, disc) => {- if (disc) { G.disc(ctx, c[0], c[1], g.r, C.far2); G.disc(ctx, c[0], c[1], g.r * 0.18, C.acc); }- G.ring(ctx, c[0], c[1], g.r - lw * 0.5, g.knobby ? 0.04 : lw, C.fg);- if (g.knobby) { ctx.save(); ctx.translate(c[0], c[1]); ctx.rotate(spin); for (let i = 0; i < 18; i++) { ctx.rotate(Math.PI * 2 / 18); ctx.fillStyle = C.fg; ctx.fillRect(-0.012, g.r - 0.005, 0.024, 0.022); } ctx.restore(); }- if (!disc) {- ctx.save(); ctx.translate(c[0], c[1]); ctx.rotate(spin);- for (let i = 0; i < 3; i++) { ctx.rotate(Math.PI / 3); G.seg(ctx, [-g.r * 0.9, 0], [g.r * 0.9, 0], 0.008, C.line); }- ctx.restore(); G.disc(ctx, c[0], c[1], 0.018, C.fg);- }- };- wheel(g.ra, g.discRear); wheel(g.fa, g.discFront);- const fc = C.acc, fw = 0.026;- capsule(ctx, g.bb, g.ra, fw * 0.8, fc); capsule(ctx, g.sc, g.ra, fw * 0.8, fc);- capsule(ctx, g.bb, g.sc, fw, fc); capsule(ctx, g.sc, g.ht, fw, fc);- capsule(ctx, g.bb, g.hb, fw * 1.15, fc); capsule(ctx, g.ht, g.hb, fw * 1.2, fc);- if (g.susp) { G.seg(ctx, g.hb, g.fa, 0.03, fc); G.seg(ctx, g.hb, G.lerp(g.hb[0], g.fa[0], 0.5) === 0 ? g.fa : [lerp(g.hb[0], g.fa[0], 0.55), lerp(g.hb[1], g.fa[1], 0.55)], 0.05, fc); }- else capsule(ctx, g.hb, g.fa, fw * 0.8, fc);- // Saddle- capsule(ctx, [g.sc[0] - 0.08, g.sc[1] - 0.02], [g.sc[0] + 0.05, g.sc[1] - 0.025], 0.03, C.fg);- // Handlebar- capsule(ctx, g.ht, g.bar, 0.022, C.fg);- if (g.drops) { ctx.strokeStyle = C.fg; ctx.lineWidth = 0.02; ctx.lineCap = 'round'; ctx.beginPath(); ctx.moveTo(g.bar[0], g.bar[1]); ctx.arc(g.bar[0], g.bar[1] + 0.045, 0.045, -Math.PI / 2, Math.PI / 2); ctx.lineTo(g.bar[0] - 0.03, g.bar[1] + 0.09); ctx.stroke(); }- if (g.aero) capsule(ctx, g.bar, [g.bar[0] + 0.12, g.bar[1] - 0.01], 0.018, C.fg);- if (g.riser) capsule(ctx, [g.bar[0] - 0.02, g.bar[1] + 0.02], [g.bar[0] + 0.02, g.bar[1] - 0.04], 0.022, C.fg);- // Chainring + far-side crank- G.ring(ctx, g.bb[0], g.bb[1], 0.05, 0.014, C.fg);- const th = o.crank ?? u * Math.PI * 2;- const pL = [g.bb[0] + Math.cos(th + Math.PI) * g.crank, g.bb[1] + Math.sin(th + Math.PI) * g.crank];- G.seg(ctx, g.bb, pL, 0.018, C.far);- }- function drawNearCrank(ctx, g, u, C, o = {}) {- const th = o.crank ?? u * Math.PI * 2;- const pR = [g.bb[0] + Math.cos(th) * g.crank, g.bb[1] + Math.sin(th) * g.crank];- G.seg(ctx, g.bb, pR, 0.02, C.fg);- G.seg(ctx, [pR[0] - 0.025, pR[1]], [pR[0] + 0.025, pR[1]], 0.016, C.acc);- G.disc(ctx, g.bb[0], g.bb[1], 0.016, C.acc);- }- const pedals = (g, th) => [- [g.bb[0] + Math.cos(th) * g.crank, g.bb[1] + Math.sin(th) * g.crank],- [g.bb[0] + Math.cos(th + Math.PI) * g.crank, g.bb[1] + Math.sin(th + Math.PI) * g.crank],- ];- // Rider: base pose + geometry + crank angle → pose- function rider(base, g, th, hands) {- const [pR, pL] = pedals(g, th);- const hb = hands || g.hand || g.bar;- return solve(base, { fR: W(base, pR), fL: W(base, pL), hR: W(base, hb), hL: W(base, [hb[0] - 0.015, hb[1] + 0.005]), kR: 1, kL: 1, eR: -1, eL: -1 });- }- // Road: scrolling dashed line (2-beat loop)- function road(ctx, y, u, C, loop = 2, x0 = -1.4, x1 = 1.4) {- P.ground(ctx, y, C, x0, x1);- const per = 0.5, off = fract(u / loop) * per * 4;- ctx.fillStyle = C.line;- for (let x = x0 - per * 4; x < x1; x += per) { const xx = x - off + per * 4; if (xx > x0 && xx < x1) ctx.fillRect(xx, y + 0.05, per * 0.45, 0.012); }- }-- const GROAD = { ra: [-0.22, 0.36], fa: [0.5, 0.36], r: 0.19, bb: [0.13, 0.34], sc: [-0.02, 0.07], ht: [0.4, 0.08], hb: [0.43, 0.17], bar: [0.47, 0.07], hand: [0.45, 0.14], crank: 0.08, drops: true };- POSES.cyc_road = {- fig: { s: 0.92, x: -0.12, y: -0.02 },- iconU: 0.25,- pose: (u) => rider({ torso: 70, head: -32, y: Math.sin(u * Math.PI * 2) * 0.004 }, GROAD, u * Math.PI * 2),- back: (ctx, J, u, C) => {- P.speed(ctx, -0.4, -0.05, 0.9, 6, C, 0.7);- road(ctx, 0.55, u, C);- inFrame(ctx, J, () => drawBike(ctx, GROAD, u, C, u * 5));- },- front: (ctx, J, u, C) => inFrame(ctx, J, () => drawNearCrank(ctx, GROAD, u, C)),- };-- const GTRACK = { ra: [-0.22, 0.36], fa: [0.5, 0.36], r: 0.19, bb: [0.13, 0.34], sc: [-0.02, 0.07], ht: [0.41, 0.1], hb: [0.44, 0.17], bar: [0.44, 0.06], hand: [0.56, 0.03], crank: 0.08, aero: true, discRear: true };- POSES.cyc_track = {- fig: { s: 0.92, x: -0.12, y: -0.02 },- iconU: 0.25,- pose: (u) => rider({ torso: 78, head: -40 }, GTRACK, u * Math.PI * 2 * 1.25),- back: (ctx, J, u, C) => {- // Tilted colour bands of the banked track (the blue and red lines of a velodrome)- ctx.save();- ctx.beginPath(); ctx.rect(-1.6, -1, 3.2, 1.55); ctx.clip();- const off = fract(u / 2) * 0.6;- for (let i = -6; i < 8; i++) {- const x = i * 0.3 - off * 2;- ctx.fillStyle = G.rgba(i % 2 ? C.fg : C.acc, i % 2 ? 0.1 : 0.16);- ctx.beginPath(); ctx.moveTo(x, 0.55); ctx.lineTo(x + 0.08, 0.55); ctx.lineTo(x + 0.58, -1); ctx.lineTo(x + 0.5, -1); ctx.fill();- }- ctx.restore();- ctx.fillStyle = C.fg; ctx.fillRect(-1.6, 0.55, 3.2, 0.018);- ctx.fillStyle = C.acc; ctx.fillRect(-1.6, 0.6, 3.2, 0.03);- P.speed(ctx, -0.35, -0.08, 1.1, 7, C, 0.9);- inFrame(ctx, J, () => drawBike(ctx, GTRACK, u, C, u * 6.25, { crank: u * Math.PI * 2 * 1.25 }));- },- front: (ctx, J, u, C) => inFrame(ctx, J, () => drawNearCrank(ctx, GTRACK, u, C, { crank: u * Math.PI * 2 * 1.25 })),- };-- // BMX: jump over a dirt mound (2 beats: takeoff at 0, peak at ~0.8, landing at 1.6)- const GBMX = { ra: [-0.2, 0.38], fa: [0.3, 0.38], r: 0.14, bb: [0.06, 0.37], sc: [-0.08, 0.2], ht: [0.26, 0.14], hb: [0.27, 0.22], bar: [0.3, 0.02], hand: [0.3, 0.03], crank: 0.075, riser: true };- function bmxState(u) {- u = ((u % 2) + 2) % 2;- if (u < 1.6) {- const t = u / 1.6;- return { y: -0.4 * Math.sin(Math.PI * t), rot: lerp(-24, 20, E.io(t)), tuck: Math.sin(Math.PI * t) };- }- const t = (u - 1.6) / 0.4;- return { y: 0.03 * Math.sin(Math.PI * t), rot: lerp(20, -24, E.io(t)), tuck: 0 };- }- POSES.cyc_bmx = {- fig: { s: 0.95, x: 0, y: 0.02 },- iconU: 0.75,- pose: (u) => {- const s = bmxState(u);- const hipLoc = [0, -0.02 + s.tuck * 0.08];- const base = { x: 0, y: s.y, rot: s.rot, torso: 30 + s.tuck * 12, head: -10 };- // After takeoff the legs tuck: feet stay on the pedals, hips press down (knees bend)- const p = rider(base, GBMX, 0.15, null);- return p;- },- back: (ctx, J, u, C) => {- // Dirt mound: exactly under the bike at beat 0.8- const ph = ((u % 2) + 2) % 2;- const cx = (0.8 - ph) * 1.1;- ctx.fillStyle = C.far2;- for (const ox of [cx - 2.2, cx, cx + 2.2]) {- ctx.beginPath(); ctx.moveTo(ox - 0.75, 0.52); ctx.quadraticCurveTo(ox - 0.35, 0.18, ox, 0.2); ctx.quadraticCurveTo(ox + 0.35, 0.18, ox + 0.75, 0.52); ctx.fill();- }- P.ground(ctx, 0.52, C, -1.6, 1.6);- const s = bmxState(u);- if (s.tuck > 0.2) P.speed(ctx, -0.3, 0.05, 0.6, 4, C, s.tuck);- inFrame(ctx, J, () => drawBike(ctx, GBMX, u, C, u * 7, { crank: 0.15 }));- },- front: (ctx, J, u, C) => inFrame(ctx, J, () => drawNearCrank(ctx, GBMX, u, C, { crank: 0.15 })),- };-- // Mountain bike: downhill, bike tilted forward, rolls over one rock per beat- const GMTB = { ra: [-0.3, 0.38], fa: [0.5, 0.38], r: 0.21, bb: [0.1, 0.36], sc: [-0.1, 0.12], ht: [0.36, 0.1], hb: [0.39, 0.19], bar: [0.38, 0.0], hand: [0.37, 0.01], crank: 0.08, knobby: true, susp: true, riser: true };- POSES.cyc_mtb = {- fig: { s: 0.9, x: -0.05, y: -0.04 },- iconU: 0.1,- pose: (u) => {- const f = fract(u);- const bump = Math.exp(-f * 6) * Math.sin(f * 18) * 0.035;- return rider({ rot: 17 + bump * 40, y: -bump, torso: 34, head: -28 }, GMTB, 0);- },- back: (ctx, J, u, C) => {- inFrame(ctx, J, () => {- // Slope (same angle as the bike), a rock passes the front wheel every beat- ctx.fillStyle = C.far2;- ctx.beginPath(); ctx.moveTo(-2, 0.59); ctx.lineTo(2, 0.59); ctx.lineTo(2, 1.4); ctx.lineTo(-2, 1.4); ctx.fill();- const off = fract(u) * 0.8;- for (let i = -3; i < 4; i++) {- const x = 0.5 + i * 0.8 - off;- G.disc(ctx, x, 0.6, 0.05 + ((i + 5) % 3) * 0.018, C.acc);- }- drawBike(ctx, GMTB, u, C, u * 5, { crank: 0 });- });- P.speed(ctx, -0.45, -0.25, 0.7, 5, C, 0.6);- },- front: (ctx, J, u, C) => inFrame(ctx, J, () => drawNearCrank(ctx, GMTB, u, C, { crank: 0 })),- };-- // ── Rowing: one catch per beat (the catch lands on the whole beat) ──- const OAR_PIVOT = [0.17, 0.03];- function rowState(u) {- const f = fract(u);- // s: 0 = catch, 1 = finish- const s = f < 0.42 ? E.o2(f / 0.42) : 1 - E.io((f - 0.42) / 0.58);- const legs = clamp(s / 0.6), body = clamp((s - 0.25) / 0.5), arms = clamp((s - 0.55) / 0.45);- const hipX = lerp(0.03, -0.13, E.io(legs));- const torso = lerp(26, -24, E.io(body));- const tf = torso * D2R, sl = L.torso - 0.025;- const sho = [hipX + Math.sin(tf) * sl, -Math.cos(tf) * sl];- const recov = f >= 0.42;- const hand = [lerp(sho[0] + 0.29, sho[0] + 0.1, E.io(arms)), lerp(sho[1] + 0.07, sho[1] + 0.15, E.io(arms)) + (recov ? 0.035 : 0)];- return { s, hipX, torso, hand, recov, f };- }- POSES.rowing = {- fig: { s: 0.82, x: -0.05, y: -0.02 },- iconU: 0.0,- pose: (u) => {- const r = rowState(u);- return solve({ x: r.hipX, y: 0, torso: r.torso, head: -r.torso * 0.5 }, { fR: [0.36, 0.08], fL: [0.35, 0.085], hR: r.hand, hL: [r.hand[0] - 0.01, r.hand[1] + 0.005], kR: 1, kL: 1 });- },- back: (ctx, J, u, C) => {- // Water + seigaiha (flowing right: the boat moves left)- waterBand(ctx, 0.17, u, C, 0.3, 1);- // Far-side oar- const r = rowState(u);- const hand = J.aL[2];- const d = [OAR_PIVOT[0] - hand[0], OAR_PIVOT[1] - hand[1]], n = Math.hypot(d[0], d[1]);- const bl = [OAR_PIVOT[0] + d[0] / n * 0.5, OAR_PIVOT[1] + d[1] / n * 0.5 - 0.02];- G.seg(ctx, hand, bl, 0.016, C.far);- // Hull- ctx.fillStyle = C.acc;- ctx.beginPath(); ctx.moveTo(-1.1, 0.075); ctx.quadraticCurveTo(0, 0.28, 1.1, 0.075); ctx.closePath(); ctx.fill();- ctx.fillStyle = C.fg; ctx.fillRect(-1.05, 0.07, 2.1, 0.014);- // Sliding-seat track + foot stretcher- ctx.fillStyle = C.fg; ctx.fillRect(-0.2, 0.06, 0.34, 0.02);- G.seg(ctx, [0.38, 0.12], [0.41, -0.0], 0.02, C.fg);- // Seat- G.seg(ctx, [J.hip[0] - 0.07, 0.05], [J.hip[0] + 0.06, 0.05], 0.03, C.fg);- // Rigger- G.seg(ctx, [0.02, 0.09], OAR_PIVOT, 0.014, C.fg);- P.speed(ctx, 0.9, -0.1, 0.5, 3, C, 0.0);- },- front: (ctx, J, u, C) => {- const r = rowState(u);- const hand = J.aR[2];- const d = [OAR_PIVOT[0] - hand[0], OAR_PIVOT[1] - hand[1]], n = Math.hypot(d[0], d[1]);- const bl = [OAR_PIVOT[0] + d[0] / n * 0.55, OAR_PIVOT[1] + d[1] / n * 0.55];- G.seg(ctx, hand, bl, 0.02, C.fg);- // Blade- ctx.save(); ctx.translate(bl[0], bl[1]); ctx.rotate(Math.atan2(d[1], d[0]));- ctx.fillStyle = C.fg; ctx.beginPath(); ctx.ellipse(0.02, 0, 0.09, r.recov ? 0.018 : 0.045, 0, 0, Math.PI * 2); ctx.fill();- ctx.restore();- // Splash at the catch: on whole beats- const f = r.f;- if (f < 0.3) {- const k = f / 0.3;- ctx.save(); ctx.globalAlpha = 1 - k;- for (let i = 0; i < 5; i++) { const a = (-0.9 + i * 0.45); G.disc(ctx, bl[0] + Math.sin(a) * 0.12 * (0.4 + k), 0.24 - Math.cos(a) * 0.1 * (0.3 + k) - k * 0.05, 0.018 * (1 - k * 0.5), C.fg); }- ctx.restore();- }- },- };-- // ── Canoe: double-bladed paddle, one side enters the water per beat ──- function paddle(u) {- const beat = Math.floor(u), f = u - beat, side = beat % 2; // 0 = near side in the water, 1 = far side- const catchB = [0.56, 0.15], exitB = [0.1, 0.14];- const catchD = [-0.5, -0.87], exitD = [-0.16, -0.99];- let B, D;- if (f < 0.5) { const t = E.o2(f / 0.5); B = [lerp(catchB[0], exitB[0], t), lerp(catchB[1], exitB[1], t)]; D = [lerp(catchD[0], exitD[0], t), lerp(catchD[1], exitD[1], t)]; }- else {- // Recovery: the shaft turns half a revolution, bringing the other end forward- const t = E.io((f - 0.5) / 0.5);- const a0 = Math.atan2(exitD[1], exitD[0]), a1 = Math.atan2(-catchD[1], -catchD[0]);- let da = a1 - a0; while (da > Math.PI) da -= Math.PI * 2; while (da < -Math.PI) da += Math.PI * 2;- const M0 = [exitB[0] + exitD[0] * 0.425, exitB[1] + exitD[1] * 0.425];- const M1 = [catchB[0] + catchD[0] * 0.425, catchB[1] + catchD[1] * 0.425];- const M = [lerp(M0[0], M1[0], t), lerp(M0[1], M1[1], t) - Math.sin(Math.PI * t) * 0.08];- const a = a0 + da * t; const dd = [Math.cos(a), Math.sin(a)];- B = [M[0] - dd[0] * 0.425, M[1] - dd[1] * 0.425]; D = dd;- }- const n = Math.hypot(D[0], D[1]); D = [D[0] / n, D[1] / n];- const e1 = B, e2 = [B[0] + D[0] * 0.85, B[1] + D[1] * 0.85];- // On side 1 the two ends swap (the same paddle turned half a revolution)- return side === 0 ? { a: e1, b: e2, dip: f < 0.5 ? 'a' : null } : { a: e2, b: e1, dip: f < 0.5 ? 'b' : null };- }- POSES.canoe = {- fig: { s: 0.9, x: -0.05, y: 0.02 },- iconU: 0.1,- pose: (u) => {- const pd = paddle(u);- const at = (k) => [lerp(pd.a[0], pd.b[0], k), lerp(pd.a[1], pd.b[1], k)];- const f = fract(u);- const torso = 8 + (f < 0.5 ? lerp(20, -6, E.o2(f / 0.5)) : lerp(-6, 20, E.io((f - 0.5) / 0.5)));- return solve({ torso, head: -torso * 0.4 }, { fR: [0.44, 0.04], fL: [0.43, 0.045], kR: -1, kL: -1, hR: at(0.36), hL: at(0.64), eR: -1, eL: -1 });- },- back: (ctx, J, u, C) => {- // Slalom gate: striped poles pass from right to left- const gx = 1.3 - fract(u / 4) * 2.8;- G.seg(ctx, [gx - 0.8, -0.9], [gx + 0.8, -0.9], 0.008, C.line);- for (let i = 0; i < 6; i++) { ctx.fillStyle = i % 2 ? C.fg : C.acc; ctx.fillRect(gx - 0.012, -0.9 + i * 0.13, 0.024, 0.13); }- const pd = paddle(u);- G.seg(ctx, pd.a, pd.b, 0.022, C.far);- // Far blade (drawn dark if this beat's stroke is on the far side)- const blade = (p, q, col) => { ctx.save(); ctx.translate(p[0], p[1]); ctx.rotate(Math.atan2(p[1] - q[1], p[0] - q[0])); ctx.fillStyle = col; ctx.beginPath(); ctx.ellipse(0, 0, 0.085, 0.04, 0, 0, Math.PI * 2); ctx.fill(); ctx.restore(); };- blade(pd.b, pd.a, C.far);- },- front: (ctx, J, u, C) => {- const pd = paddle(u);- G.seg(ctx, pd.a, pd.b, 0.022, C.fg);- const blade = (p, q, col) => { ctx.save(); ctx.translate(p[0], p[1]); ctx.rotate(Math.atan2(p[1] - q[1], p[0] - q[0])); ctx.fillStyle = col; ctx.beginPath(); ctx.ellipse(0, 0, 0.085, 0.04, 0, 0, Math.PI * 2); ctx.fill(); ctx.restore(); };- blade(pd.a, pd.b, C.fg);- // Hull covers the legs- ctx.fillStyle = C.acc;- ctx.beginPath(); ctx.moveTo(-0.9, 0.06); ctx.quadraticCurveTo(0.0, -0.06, 0.98, 0.08); ctx.quadraticCurveTo(0.0, 0.24, -0.9, 0.06); ctx.fill();- G.seg(ctx, [-0.13, 0.0], [0.15, 0.0], 0.032, C.fg); // cockpit- // Water surface- waterBand(ctx, 0.1, u, C, 0.24, 1);- // Splash at the catch- const f = fract(u);- if (f < 0.35 && pd.dip) {- const p = pd.dip === 'a' ? pd.a : pd.b, k = f / 0.35;- ctx.save(); ctx.globalAlpha = 1 - k;- for (let i = 0; i < 5; i++) G.disc(ctx, p[0] + (i - 2) * 0.05 * (1 + k), 0.12 - Math.sin((i / 4) * Math.PI) * 0.12 * (0.4 + k), 0.017, C.fg);- ctx.restore();- }- },- };-- // ── Sailing: hiking out, rising and falling with the waves; a gust on each beat pushes the sailor further out ──- function sailState(u) {- const heel = Math.sin(u * Math.PI / 2) * 5, pitch = Math.sin(u * Math.PI / 2 + 1) * 0.03;- const f = fract(u), gust = Math.exp(-f * 4) * (1 - Math.exp(-f * 30));- return { heel, pitch, gust };- }- POSES.sailing = {- fig: { s: 0.72, x: 0.05, y: 0.12 },- iconU: 0.3,- pose: (u) => {- const s = sailState(u);- const base = { x: -0.12, y: 0.0 + s.pitch, rot: s.heel, torso: -52 - s.gust * 14, head: 30 };- return solve(base, { fR: W(base, [0.36, 0.07]), fL: W(base, [0.35, 0.075]), hR: W(base, [0.02, 0.0]), hL: W(base, [-0.1, -0.28 + s.gust * 0.03]), kR: 1, kL: 1, eR: -1, eL: 1 });- },- back: (ctx, J, u, C) => {- const s = sailState(u);- // Waves- const off = fract(u / 4) * 0.5;- ctx.fillStyle = waterCol(C);- for (let i = -9; i < 10; i++) { const x = i * 0.5 + off; ctx.beginPath(); ctx.arc(x, 0.3, 0.25, Math.PI, 0); ctx.fill(); ctx.fillStyle = C.bg; ctx.beginPath(); ctx.arc(x, 0.3, 0.15, Math.PI, 0); ctx.fill(); ctx.fillStyle = waterCol(C); }- ctx.fillRect(-4, 0.3, 8, 0.7);- ctx.save(); ctx.translate(0, s.pitch); ctx.rotate(s.heel * D2R);- // Sail (triangle + battens), mast, boom- const mast = [0.3, 0.06], top = [0.3, -1.15], boom = [-0.55, -0.34];- ctx.fillStyle = C.acc;- ctx.beginPath(); ctx.moveTo(top[0] - 0.02, top[1] + 0.02); ctx.quadraticCurveTo(-0.3 - s.gust * 0.05, -0.75, boom[0], boom[1]); ctx.lineTo(0.3, -0.34); ctx.fill();- for (let i = 1; i < 4; i++) { const y = -0.34 - i * 0.2; G.seg(ctx, [0.28, y], [lerp(boom[0], 0.3, i * 0.24) + 0.02, y + 0.02], 0.008, C.bg); }- G.seg(ctx, mast, top, 0.022, C.fg);- G.seg(ctx, [0.3, -0.34], boom, 0.02, C.fg);- // Mainsheet- G.seg(ctx, [-0.35, -0.34], [-0.2, 0.04], 0.006, C.line);- // Hull- ctx.fillStyle = C.fg;- ctx.beginPath(); ctx.moveTo(-0.62, 0.06); ctx.lineTo(0.95, 0.06); ctx.quadraticCurveTo(0.7, 0.26, 0.3, 0.26); ctx.lineTo(-0.58, 0.24); ctx.closePath(); ctx.fill();- // Tiller extension- G.seg(ctx, [-0.6, 0.04], [-0.3, 0.0], 0.014, C.fg);- ctx.restore();- },- front: (ctx, J, u, C) => {- // A row of wave crests in the foreground- const off = fract(u / 4) * 0.5;- ctx.fillStyle = C.bg;- for (let i = -6; i < 7; i++) { const x = i * 0.5 - off * 0.6; ctx.beginPath(); ctx.arc(x + 0.25, 0.42, 0.12, Math.PI, 0); ctx.fill(); }- },- };-- // ── Surfing: barrel = off-centre concentric circles (the tube) + one quadratic-curve wave face; bottom turn at beat 0, top turn with spray at beat 2 ──- const SQ = [[-0.45, -0.52], [0.12, -0.2], [1.3, 0.42]];- const qpt = (t) => [0, 1].map((i) => (1 - t) * (1 - t) * SQ[0][i] + 2 * t * (1 - t) * SQ[1][i] + t * t * SQ[2][i]);- const qtan = (t) => [0, 1].map((i) => 2 * (1 - t) * (SQ[1][i] - SQ[0][i]) + 2 * t * (SQ[2][i] - SQ[1][i]));- function surfState(u) {- const up = u < 2 ? E.io(u / 2) : 1 - E.io((u - 2) / 2); // 0 bottom → 1 top- const t = lerp(0.5, 0.28, up);- const p = qpt(t), tg = qtan(t);- const a = Math.atan2(tg[1], tg[0]) * R2D;- const board = a - up * 22; // nose lifts during the top turn- const n = G.rot2([0, -1], board);- return { up, board, bp: p, hip: [p[0] + n[0] * 0.35, p[1] + n[1] * 0.35] };- }- POSES.surfing = {- fig: { s: 0.74, x: 0.16, y: 0.3 },- iconU: 2,- pose: (u) => {- const s = surfState(u);- const base = { x: s.hip[0], y: s.hip[1], rot: s.board, torso: 40 - s.board * 0.5, head: -18 + s.board * 0.3 };- return solve(base, { fR: W(base, [0.22, 0.32]), fL: W(base, [-0.2, 0.33]), kR: 1, kL: 1, hR: W(base, [0.5, 0.02 + s.up * 0.06]), hL: W(base, [-0.42, -0.22 - s.up * 0.12]), eR: -1, eL: 1 });- },- back: (ctx, J, u, C) => {- const wc = waterCol(C), lite = G.mix(C.bg, C.fg, 0.12);- // Distant sea- ctx.fillStyle = wc; ctx.fillRect(-2.4, SQ[2][1], 4.8, 1.2);- // Wave face (below the curve)- ctx.fillStyle = wc;- ctx.beginPath(); ctx.moveTo(SQ[0][0], SQ[0][1]); ctx.quadraticCurveTo(SQ[1][0], SQ[1][1], SQ[2][0], SQ[2][1]);- ctx.lineTo(SQ[2][0], 1.4); ctx.lineTo(-2.4, 1.4); ctx.lineTo(-2.4, SQ[0][1]); ctx.fill();- // Tube: off-centre concentric circles, shifting further down-left towards the inside, as if curling in- const spin = u * 0.12;- const rings = 7;- for (let i = 0; i < rings; i++) {- const k = i / (rings - 1);- const r = lerp(0.62, 0.1, k);- const cx = lerp(-0.92, -1.08 + Math.sin(spin + k) * 0.02, k), cy = lerp(-0.04, 0.16, k);- G.disc(ctx, cx, cy, r, i % 2 ? wc : (i % 4 === 0 ? C.acc : lite));- }- // Lip: a thick arc curling from the top of the wave face over the tube- ctx.strokeStyle = wc; ctx.lineWidth = 0.16; ctx.lineCap = 'round';- ctx.beginPath(); ctx.arc(-0.92, -0.04, 0.6, Math.PI * 1.25, Math.PI * 1.92); ctx.stroke();- G.disc(ctx, -1.3, -0.4, 0.09, wc);- for (let i = 0; i < 9; i++) {- const t = i / 8, a = Math.PI * (1.05 + t * 0.9);- G.disc(ctx, -0.92 + Math.cos(a) * 0.66, -0.04 + Math.sin(a) * 0.66, 0.035 - t * 0.012 + Math.sin(u * 3 + i) * 0.004, C.fg);- }- // Stripes on the wave face (sense of speed)- ctx.save();- ctx.beginPath(); ctx.moveTo(SQ[0][0], SQ[0][1]); ctx.quadraticCurveTo(SQ[1][0], SQ[1][1], SQ[2][0], SQ[2][1]); ctx.lineTo(SQ[2][0], 1.4); ctx.lineTo(-0.3, 1.4); ctx.closePath(); ctx.clip();- ctx.strokeStyle = C.line; ctx.lineWidth = 0.01;- for (let i = 1; i < 5; i++) {- const o = i * 0.11 + fract(u / 4) * 0.11;- ctx.beginPath(); ctx.moveTo(SQ[0][0] + 0.2, SQ[0][1] + o); ctx.quadraticCurveTo(SQ[1][0], SQ[1][1] + o, SQ[2][0], SQ[2][1] + o); ctx.stroke();- }- ctx.restore();- // Board- const s = surfState(u);- inFrame(ctx, J, () => {- ctx.fillStyle = C.acc;- ctx.beginPath(); ctx.ellipse(0.0, 0.365, 0.5, 0.038, 0, 0, Math.PI * 2); ctx.fill();- G.seg(ctx, [-0.42, 0.365], [0.42, 0.365], 0.008, C.fg);- // Wake behind the tail- ctx.fillStyle = G.rgba(C.fg, 0.5); ctx.fillRect(-1.0, 0.39, 0.48, 0.012); ctx.fillRect(-0.85, 0.415, 0.32, 0.01);- });- // Spray thrown off the top: beat 2- const d = u - 1.85;- if (d > 0 && d < 1.3) {- const k = d / 1.3;- ctx.save(); ctx.globalAlpha = 1 - k * k;- const tail = G.rot2([-0.45, 0.36], s.board);- const b0 = [J.hip[0] + tail[0], J.hip[1] + tail[1]];- for (let i = 0; i < 14; i++) {- const a = (-150 + i * 9) * D2R, sp = 0.5 + (i % 4) * 0.18;- G.disc(ctx, b0[0] + Math.cos(a) * sp * k, b0[1] + Math.sin(a) * sp * k + k * k * 0.35, 0.03 * (1 - k * 0.5) * (0.7 + (i % 3) * 0.3), C.fg);- }- ctx.restore();- }- },- };-- // ── Triathlon: swim → bike → run, three small figures appear in turn on the beats, strung together by one course line ──- const GTRI = { ra: [-0.22, 0.36], fa: [0.48, 0.36], r: 0.19, bb: [0.13, 0.34], sc: [-0.02, 0.07], ht: [0.4, 0.09], hb: [0.43, 0.17], bar: [0.44, 0.07], hand: [0.55, 0.04], crank: 0.08, aero: true };- const TRI_S = 0.4, TRI_DX = 0.6 / 0.4;- const pop = (u, t0) => E.oBack(clamp((u - t0) / 0.35), 2.2);- function swimPose(u) {- const a = u * 360;- return { rot: 90, torso: 0, head: -70, aR1: 180 - a, aR2: 180 - a + 20, aL1: -a, aL2: -a + 20, lR1: Math.sin(u * 12) * 12, lR2: Math.sin(u * 12 - 1) * 16, lL1: -Math.sin(u * 12) * 12, lL2: -Math.sin(u * 12 - 1) * 16 };- }- POSES.triathlon = {- fig: { s: TRI_S, x: -0.6, y: 0.02 },- iconU: 2.5,- pose: (u) => swimPose(u * 0.75),- back: (ctx, J, u, C) => {- // Course line (three segments in different colours, growing segment by segment)- const y = 0.55;- const segs = [[-0.6, TRI_DX * 0.5], [TRI_DX * 0.5, TRI_DX * 1.5], [TRI_DX * 1.5, TRI_DX * 2 + 0.6]];- segs.forEach((s, i) => {- const p = clamp((u - i * 0.9) / 0.6);- if (p <= 0) return;- ctx.fillStyle = i === 1 ? C.acc : C.line;- ctx.fillRect(s[0], y + 0.12, (s[1] - s[0]) * E.o3(p), 0.035);- G.disc(ctx, i * TRI_DX, y + 0.1375, 0.055 * E.oBack(p), C.fg);- });- // Labels- ctx.save(); ctx.fillStyle = C.fg; ctx.font = '500 0.15px "DM Mono"'; ctx.textAlign = 'center'; ctx.letterSpacing = '0.02px';- ['SWIM', 'BIKE', 'RUN'].forEach((t, i) => { const p = clamp((u - i * 0.9) / 0.4); if (p > 0) { ctx.globalAlpha = p; ctx.fillText(t, i * TRI_DX, 1.0); } });- ctx.restore();- },- front: (ctx, J, u, C) => {- // Water: a few ripples cover the swimmer's lower body- ctx.strokeStyle = C.fg; ctx.lineWidth = 0.022; ctx.lineCap = 'round';- for (let i = 0; i < 5; i++) { const x = -0.64 + i * 0.26 + fract(u) * 0.26 * -1 + 0.26; ctx.beginPath(); ctx.arc(x, 0.2, 0.13, Math.PI * 1.1, Math.PI * 1.9); ctx.stroke(); }- ctx.fillStyle = C.bg; ctx.fillRect(-0.9, 0.2, 1.7, 0.2);- // Bike- const pb = pop(u, 0.9);- if (pb > 0) {- ctx.save(); ctx.translate(TRI_DX, -0.08); ctx.scale(pb, pb);- const th = u * Math.PI * 2;- const p = rider({ torso: 74, head: -36 }, GTRI, th);- const Jb = G.joints(p);- drawBike(ctx, GTRI, u, C, u * 5, { crank: th });- G.drawFigure(ctx, Jb, C.fg, C.far);- drawNearCrank(ctx, GTRI, u, C, { crank: th });- ctx.restore();- }- // Run- const pr = pop(u, 1.8);- if (pr > 0) {- ctx.save(); ctx.translate(TRI_DX * 2, 0); ctx.scale(pr, pr);- const Jr = G.joints({ ...G.runCycle(u / 1.2, 0.9, { lean: 12 }), head: -6 });- G.drawFigure(ctx, Jr, C.fg, C.far);- ctx.restore();- }- },- };-- // ── Equestrian: show jumping, above the fence on beat 2 ──- function horseState(u) {- // 0–1.2 canter in, 1.2 takeoff, 2 peak, 2.8 landing, canter afterwards- const jt = clamp((u - 1.2) / 1.6);- const air = u > 1.2 && u < 2.8;- const y = air ? -0.45 * Math.sin(Math.PI * jt) : 0;- const pitch = air ? lerp(-20, 20, E.io(jt)) : 0;- const canter = Math.sin(u * Math.PI * 2) * (air ? 0 : 1);- return { jt, air, y: y + canter * 0.02, pitch: pitch + canter * 2.5, ph: u };- }- function drawHorse(ctx, s, C) {- const col = C.acc, far = G.mix(C.acc, C.bg, 0.35);- const leg = (hip, a1, a2, len, c, w) => { const k = [hip[0] + Math.sin(a1 * D2R) * len, hip[1] + Math.cos(a1 * D2R) * len]; const f = [k[0] + Math.sin(a2 * D2R) * len, k[1] + Math.cos(a2 * D2R) * len]; G.seg(ctx, hip, k, w, c); G.seg(ctx, k, f, w * 0.8, c); G.disc(ctx, f[0], f[1], w * 0.55, c); };- const fr = [0.34, 0.26], hd = [-0.42, 0.24];- let fA, fB, hA, hB;- if (s.air) {- // Front legs tucked, hind legs pushing back- const t = s.jt;- fA = [lerp(40, 70, t), lerp(-60, -30, t)]; fB = [lerp(30, 60, t), lerp(-70, -40, t)];- hA = [lerp(-50, 10, t), lerp(-40, 30, t)]; hB = [lerp(-40, 20, t), lerp(-30, 40, t)];- } else {- const p = s.ph * Math.PI * 2;- fA = [Math.sin(p) * 30, Math.sin(p) * 30 - Math.max(0, Math.cos(p)) * 60]; fB = [Math.sin(p - 0.8) * 30, Math.sin(p - 0.8) * 30 - Math.max(0, Math.cos(p - 0.8)) * 60];- hA = [Math.sin(p + 2.4) * 28, Math.sin(p + 2.4) * 28 + Math.max(0, -Math.cos(p + 2.4)) * 35]; hB = [Math.sin(p + 1.6) * 28, Math.sin(p + 1.6) * 28 + Math.max(0, -Math.cos(p + 1.6)) * 35];- }- const LL = 0.27;- leg(fr, fB[0], fB[1], LL, far, 0.07); leg(hd, hB[0], hB[1], LL, far, 0.08);- // Tail- ctx.strokeStyle = far; ctx.lineWidth = 0.06; ctx.lineCap = 'round';- ctx.beginPath(); ctx.moveTo(-0.58, 0.12); ctx.quadraticCurveTo(-0.78, 0.15 + (s.air ? -0.1 : 0), -0.74, 0.42); ctx.stroke();- // Body- G.seg(ctx, [-0.44, 0.19], [0.36, 0.19], 0.3, col);- // Neck + head- G.seg(ctx, [0.32, 0.14], [0.56, -0.2], 0.17, col);- G.seg(ctx, [0.56, -0.22], [0.76, -0.06], 0.11, col);- G.poly(ctx, [[0.52, -0.3], [0.55, -0.4], [0.59, -0.29]], col); // ear- // Mane- ctx.strokeStyle = far; ctx.lineWidth = 0.035; ctx.beginPath(); ctx.moveTo(0.34, 0.04); ctx.lineTo(0.52, -0.26); ctx.stroke();- leg(fr, fA[0], fA[1], LL, col, 0.075); leg(hd, hA[0], hA[1], LL, col, 0.085);- // Saddle- G.seg(ctx, [-0.12, 0.05], [0.12, 0.05], 0.04, C.fg);- }- POSES.equestrian = {- fig: { s: 0.62, x: 0.0, y: -0.12 },- iconU: 2,- pose: (u) => {- const s = horseState(u);- const jump = s.air ? Math.sin(Math.PI * s.jt) : 0;- const base = { x: 0, y: s.y - 0.02 - jump * 0.05, rot: s.pitch, torso: 22 + jump * 26, head: -18 - jump * 10 };- return solve(base, { fR: W(base, [0.08 + jump * 0.04, 0.36]), fL: W(base, [0.07 + jump * 0.04, 0.365]), kR: 1, kL: 1, hR: W(base, [0.4 + jump * 0.08, 0.0 - jump * 0.04]), hL: W(base, [0.39 + jump * 0.08, 0.01 - jump * 0.04]) });- },- back: (ctx, J, u, C) => {- // Fence: under the horse at u = 2- const x = (2 - u) * 0.9;- const gy = 0.83;- ctx.fillStyle = C.line; ctx.fillRect(-2.2, gy, 4.4, 0.016);- for (const ox of [x, x + 3.6, x - 3.6]) {- G.seg(ctx, [ox - 0.26, gy], [ox - 0.26, gy - 0.62], 0.035, C.fg);- G.seg(ctx, [ox + 0.26, gy], [ox + 0.26, gy - 0.62], 0.035, C.fg);- for (let i = 0; i < 3; i++) {- const yy = gy - 0.2 - i * 0.17;- for (let k = 0; k < 4; k++) { ctx.fillStyle = k % 2 ? C.fg : C.far2; ctx.fillRect(ox - 0.26 + k * 0.13, yy, 0.13, 0.045); }- }- }- const s = horseState(u);- ctx.save(); ctx.translate(J.hip[0], J.hip[1] + 0.02); ctx.rotate(s.pitch * D2R);- drawHorse(ctx, s, C);- ctx.restore();- },- };-})();diff --git a/styles/pictogram-motion/demo/poses/power.js b/styles/pictogram-motion/demo/poses/power.jsdeleted file mode 100644index 297c3e9..0000000--- a/styles/pictogram-motion/demo/poses/power.js+++ /dev/null@@ -1,292 +0,0 @@-// Power & precision, 7 events: weightlifting shooting archery gym_art gym_rhythm gym_tramp pentathlon-(function () {- const G = window.G, P = G.P, POSES = window.POSES;- // World-angle notation (0 down / 90 forward / 180 up); frames with body: true use the skeleton convention as is- const WA = (p) => {- if (p.body) return { ...p };- const o = { ...p }, f = (p.rot || 0) + (p.torso || 0), r = p.rot || 0;- for (const k of ['aR1', 'aR2', 'aL1', 'aL2']) if (k in o) o[k] += f;- for (const k of ['lR1', 'lR2', 'lL1', 'lL2']) if (k in o) o[k] += r;- return o;- };- const kp = (keys) => { const k = keys.map(WA); return (u) => G.keyPose(k, u); };- const mid = (a, b) => [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];- const target = (ctx, x, y, r, C, hit) => {- const cols = [C.fg, C.bg, C.fg, C.bg, C.acc];- for (let i = 0; i < 5; i++) G.disc(ctx, x, y, r * (1 - i * 0.19), cols[i]);- if (hit > 0 && hit < 1) { ctx.save(); ctx.globalAlpha *= 1 - hit; G.ring(ctx, x, y, r * (0.3 + G.E.o3(hit) * 1.4), 0.014, C.acc); ctx.restore(); }- };-- // ── Weightlifting: snatch. Locked out overhead on beat 2 and held ──- POSES.weightlifting = {- pose: kp([- { b: 0, y: 0.18, torso: 50, aR1: 0, aR2: 0, aL1: 0, aL2: 0, lR1: 75, lR2: -15, lL1: 71, lL2: -19 },- { b: 0.6, y: 0.12, torso: 38, aR1: 0, aR2: 0, aL1: 0, aL2: 0, lR1: 45, lR2: -5, lL1: 41, lL2: -9, e: 'io' },- { b: 1.05, y: -0.03, torso: -8, aR1: 2, aR2: 2, aL1: 2, aL2: 2, lR1: 4, lR2: -6, lL1: 0, lL2: -10, e: 'io3' },- { b: 1.5, y: 0.29, torso: 22, aR1: 192, aR2: 192, aL1: 190, aL2: 190, lR1: 104, lR2: -26, lL1: 100, lL2: -30, e: 'oExp' },- { b: 2, y: 0.0, torso: 0, aR1: 198, aR2: 198, aL1: 196, aL2: 196, lR1: 3, lR2: -2, lL1: -3, lL2: -6, e: 'o3' },- { b: 2.4, y: 0.005, torso: 0, aR1: 197, aR2: 199, aL1: 195, aL2: 197, lR1: 3, lR2: -2, lL1: -3, lL2: -6 },- { b: 4, y: 0.0, torso: 0, aR1: 198, aR2: 198, aL1: 196, aL2: 196, lR1: 3, lR2: -2, lL1: -3, lL2: -6 },- ]),- fig: { x: -0.06, y: 0.04 },- back: (ctx, J, u, C) => P.ground(ctx, 0.46, C, -0.8, 0.8),- // At lockout the bar is behind and above the head; the plate overlaps only one corner of the head- front: (ctx, J, u, C) => {- const h = mid(J.aR[2], J.aL[2]);- const shake = u > 2 && u < 2.8 ? Math.sin(u * 60) * 0.004 * (2.8 - u) : 0;- // Side view: plates are circles- const hy = h[1] - 0.02;- G.disc(ctx, h[0] + shake, hy, 0.125, C.acc);- G.ring(ctx, h[0] + shake, hy, 0.088, 0.011, C.bg);- G.disc(ctx, h[0] + shake, hy, 0.03, C.bg);- // Halo at the moment of lockout- const t = (u - 2) / 0.7;- if (t > 0 && t < 1) { ctx.save(); ctx.globalAlpha *= 1 - t; G.ring(ctx, h[0], h[1] - 0.02, 0.15 + G.E.o3(t) * 0.18, 0.012, C.line); ctx.restore(); }- },- iconU: 2.4,- };-- // ── Shooting: standing rifle, hold breath → fire on beat 2, hit the target ──- const aim = { torso: -8, head: 14, aR1: 30, aR2: 150, aL1: 10, aL2: 160, lR1: 8, lR2: 8, lL1: -10, lL2: -10 };- POSES.shooting = {- pose: (u) => {- const k = G.keyPose([- { b: 0, ...WA({ ...aim, torso: -2, head: 4, aR1: 20, aR2: 120 }) },- { b: 0.8, ...WA(aim), e: 'io3' },- { b: 2, ...WA(aim) },- { b: 2.08, ...WA({ ...aim, torso: -11, head: 11 }), e: 'oExp' },- { b: 2.6, ...WA(aim), e: 'io' },- ], u);- const br = u < 2 ? Math.sin(u * Math.PI) * 0.004 : 0; // breathing- return { ...k, y: br };- },- fig: { x: -0.5 },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -0.4, 1.35);- target(ctx, 1.12, J.sho[1] - 0.03, 0.11, C, (u - 2.15) / 0.8);- ctx.fillStyle = C.line; ctx.fillRect(1.114, J.sho[1] + 0.08, 0.012, 0.38);- },- front: (ctx, J, u, C) => {- // Rifle: stock against the shoulder, barrel forward along the line of sight- const s = J.sho, lift = G.clamp(1 - Math.abs(u - 2.08) / 0.4) * 0.02;- const a = [s[0] - 0.06, s[1] + 0.01], b = [s[0] + 0.54, s[1] - 0.035 - lift];- G.seg(ctx, a, [s[0] + 0.28, s[1] - 0.015 - lift / 2], 0.05, C.fg);- G.seg(ctx, a, b, 0.022, C.fg);- G.seg(ctx, [s[0] + 0.14, s[1] - 0.04], [s[0] + 0.2, s[1] - 0.05], 0.018, C.fg);- // Bullet path- const t = (u - 2) / 0.2;- if (t > 0 && t < 1.6) {- ctx.save(); ctx.globalAlpha *= G.clamp(1.6 - t);- const x0 = b[0] + 0.02, x1 = G.lerp(x0, 1.12, G.clamp(t));- ctx.fillStyle = C.acc; ctx.fillRect(Math.max(x0, x1 - 0.35), b[1] - 0.006, x1 - Math.max(x0, x1 - 0.35), 0.012);- ctx.restore();- }- if (u > 2.15) G.disc(ctx, 1.12, J.sho[1] - 0.03, 0.018, C.bg);- },- iconU: 1.6,- };-- // ── Archery: raise the bow → draw to anchor → release on beat 2 ──- POSES.archery = {- pose: kp([- { b: 0, torso: -2, head: 0, aR1: 60, aR2: 70, aL1: 40, aL2: 80, lR1: 8, lR2: 8, lL1: -10, lL2: -10 },- { b: 0.7, torso: -3, head: 4, aR1: 90, aR2: 90, aL1: 50, aL2: 95, lR1: 8, lR2: 8, lL1: -10, lL2: -10, e: 'io3' },- { b: 1.4, torso: -4, head: 6, aR1: 90, aR2: 90, aL1: -80, aL2: 96, lR1: 8, lR2: 8, lL1: -10, lL2: -10, e: 'io3' },- { b: 2, torso: -4, head: 6, aR1: 90, aR2: 90, aL1: -82, aL2: 95, lR1: 8, lR2: 8, lL1: -10, lL2: -10 },- { b: 2.2, torso: -5, head: 6, aR1: 91, aR2: 91, aL1: -100, aL2: -50, lR1: 8, lR2: 8, lL1: -10, lL2: -10, e: 'oExp' },- { b: 3.2, torso: -4, head: 6, aR1: 88, aR2: 88, aL1: -96, aL2: -45, lR1: 8, lR2: 8, lL1: -10, lL2: -10 },- ]),- fig: { x: -0.2 },- back: (ctx, J, u, C) => P.ground(ctx, 0.46, C, -0.6, 1.2),- front: (ctx, J, u, C) => {- const bh = J.aR[2]; // bow hand- const H = 0.34;- const top = [bh[0] - 0.06, bh[1] - H], bot = [bh[0] - 0.06, bh[1] + H];- const drawn = u > 1.0 && u < 2.05;- const release = G.clamp((u - 2) / 0.12);- const pull = drawn ? G.E.io3((u - 0.7) / 0.7) : 0;- // Bow limbs: more curved at full draw- const bend = 0.1 + 0.05 * pull;- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.026; ctx.lineCap = 'round';- ctx.beginPath(); ctx.moveTo(top[0], top[1]); ctx.quadraticCurveTo(bh[0] + bend * 1.8, bh[1], bot[0], bot[1]); ctx.stroke();- // String- const sh = J.aL[2];- const nock = u < 0.7 ? [bh[0] - 0.06, bh[1]] : drawn || u < 2 ? [G.lerp(bh[0] - 0.06, sh[0], G.clamp((u - 0.7) / 0.7)), G.lerp(bh[1], sh[1], G.clamp((u - 0.7) / 0.7))] : [bh[0] - 0.06 - Math.sin((u - 2) * 30) * 0.02 * (1 - G.clamp((u - 2) / 0.8)), bh[1]];- ctx.strokeStyle = C.line; ctx.lineWidth = 0.007;- ctx.beginPath(); ctx.moveTo(top[0], top[1]); ctx.lineTo(nock[0], nock[1]); ctx.lineTo(bot[0], bot[1]); ctx.stroke();- // Arrow- let ax0, ax1;- if (u < 2) { ax0 = nock[0]; ax1 = Math.max(bh[0] + 0.12, nock[0] + 0.6); }- else { const fx = G.E.i3(G.clamp((u - 2) / 0.35)) * 3; ax0 = nock[0] + 0.02 + fx + release * 0.1; ax1 = ax0 + 0.6; }- const ay = u < 2 ? nock[1] : bh[1];- if (ax0 < 2.2) {- G.seg(ctx, [ax0, ay], [ax1, ay], 0.014, C.fg);- G.poly(ctx, [[ax1 + 0.05, ay], [ax1 - 0.01, ay - 0.025], [ax1 - 0.01, ay + 0.025]], C.fg);- G.poly(ctx, [[ax0, ay], [ax0 + 0.07, ay], [ax0 + 0.03, ay - 0.03]], C.acc);- }- if (u > 2 && u < 2.7) P.speed(ctx, Math.min(ax0 + 0.1, 1.4), ay, 0.6, 3, C, 1 - (u - 2) / 0.7);- },- iconU: 1.8,- };-- // ── Artistic gymnastics: giant swing on the high bar ──- // Hands fixed on the bar, body rotates around it; slow at the top, fast at the bottom- const hang = (rot, arch) => ({ body: true, rot, torso: 0, head: -4, aR1: 180, aR2: 180, aL1: 178, aL2: 178, lR1: arch, lR2: arch, lL1: arch - 3, lL2: arch - 3 });- POSES.gym_art = {- pose: (u) => {- const ph = u / 2; // one revolution per 2 beats- const th = 180 + 360 * ph - 38 * Math.sin(2 * Math.PI * ph);- const arch = -14 * Math.max(0, Math.cos((th - 360) * G.D2R)) + 10 * Math.max(0, -Math.cos((th - 360) * G.D2R)) * 0;- const p = hang(th, arch);- const J = G.joints(p);- const h = mid(J.aR[2], J.aL[2]);- return { ...p, x: -h[0], y: -h[1] };- },- fig: { s: 0.6, y: -0.16 },- back: (ctx, J, u, C) => {- // High bar: bar = dot, two uprights + guy wires (side view)- G.seg(ctx, [0, 0], [0, 1.4], 0.03, C.line);- G.seg(ctx, [0, -0.02], [-0.75, 1.4], 0.012, C.line);- G.seg(ctx, [0, -0.02], [0.75, 1.4], 0.012, C.line);- ctx.fillStyle = C.line; ctx.fillRect(-1.3, 1.4, 2.6, 0.02);- // Swing path- ctx.save(); ctx.globalAlpha *= 0.55; ctx.strokeStyle = C.line; ctx.lineWidth = 0.016;- const th = 180 + 360 * (u / 2) - 38 * Math.sin(2 * Math.PI * u / 2);- const a1 = (th + 90) * G.D2R;- ctx.beginPath(); ctx.arc(0, 0, 1.02, a1 - 1.6, a1 - 0.15); ctx.stroke();- ctx.beginPath(); ctx.arc(0, 0, 0.88, a1 - 1.2, a1 - 0.2); ctx.stroke();- ctx.restore();- },- front: (ctx, J, u, C) => G.disc(ctx, 0, 0, 0.035, C.acc),- iconU: 0,- };-- // ── Rhythmic gymnastics: ribbon, split leap ──- const rgPose = kp([- { b: 0, x: -0.25, y: 0.02, torso: 6, head: -6, aR1: -40, aR2: -30, aL1: 40, aL2: 50, lR1: 25, lR2: 20, lL1: -25, lL2: -40 },- { b: 0.6, x: -0.12, y: 0.07, torso: 10, head: -4, aR1: 60, aR2: 70, aL1: -30, aL2: -20, lR1: 30, lR2: -20, lL1: -20, lL2: -30 },- { b: 1, x: 0.0, y: -0.2, torso: 2, head: -12, aR1: 150, aR2: 165, aL1: -120, aL2: -135, lR1: 92, lR2: 94, lL1: -92, lL2: -94, e: 'o3' },- { b: 1.5, x: 0.14, y: 0.05, torso: 4, head: -6, aR1: 120, aR2: 135, aL1: -80, aL2: -90, lR1: 12, lR2: 6, lL1: -30, lL2: -34, e: 'i3' },- { b: 2.2, x: 0.18, y: 0.0, torso: 30, head: -18, aR1: 100, aR2: 110, aL1: -100, aL2: -110, lR1: 2, lR2: 2, lL1: -80, lL2: -84, e: 'io' },- { b: 3, x: 0.12, y: -0.03, torso: -8, head: -20, aR1: 175, aR2: 185, aL1: 120, aL2: 150, lR1: 4, lR2: 4, lL1: -10, lL2: 60, e: 'io' },- { b: 4, x: 0.08, y: -0.03, torso: -10, head: -22, aR1: 180, aR2: 190, aL1: 115, aL2: 150, lR1: 4, lR2: 4, lL1: -10, lL2: 60 },- ]);- POSES.gym_rhythm = {- pose: rgPose,- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -1, 1);- // Ribbon: hand → stick → a ribbon trailing along the hand's past path, with ripples- const pts = [];- const N = 36;- for (let i = 0; i < N; i++) {- const uu = u - i * 0.035;- const Jp = G.joints(rgPose(uu));- const h = Jp.aR[2], e = Jp.aR[1];- const d = [h[0] - e[0], h[1] - e[1]], L = Math.hypot(d[0], d[1]) || 1;- const tip = [h[0] + d[0] / L * 0.2, h[1] + d[1] / L * 0.2];- const w = Math.sin(i * 0.45 - u * 9) * 0.05 * (i / N);- pts.push([tip[0] - (d[1] / L) * w, tip[1] + (d[0] / L) * w + i * 0.004]);- }- ctx.save(); ctx.lineCap = 'round'; ctx.lineJoin = 'round';- for (let i = 1; i < N; i++) {- ctx.strokeStyle = C.acc; ctx.lineWidth = 0.046 * (1 - i / N * 0.6); ctx.globalAlpha = 1 - (i / N) * 0.6;- ctx.beginPath(); ctx.moveTo(pts[i - 1][0], pts[i - 1][1]); ctx.lineTo(pts[i][0], pts[i][1]); ctx.stroke();- }- ctx.restore();- },- front: (ctx, J, u, C) => {- const h = J.aR[2], e = J.aR[1];- const d = [h[0] - e[0], h[1] - e[1]], L = Math.hypot(d[0], d[1]) || 1;- G.seg(ctx, h, [h[0] + d[0] / L * 0.2, h[1] + d[1] / L * 0.2], 0.012, C.fg);- },- iconU: 1,- };-- // ── Trampoline: press the bed → high tucked somersault → land on the bed, then again in a straight position ──- const tuck = (rot, y) => ({ body: true, rot, y, torso: 20, head: 10, aR1: 70, aR2: 20, aL1: 65, aL2: 15, lR1: 125, lR2: -10, lL1: 120, lL2: -15 });- const straight = (rot, y) => ({ body: true, rot, y, torso: 0, head: 0, aR1: 20, aR2: 18, aL1: 16, aL2: 14, lR1: 2, lR2: 2, lL1: -2, lL2: -2 });- const land = (y) => ({ body: true, rot: 0, y, torso: 14, head: 0, aR1: 40, aR2: 60, aL1: 35, aL2: 55, lR1: 40, lR2: -18, lL1: 36, lL2: -22 });- const up = (y) => ({ body: true, rot: 0, y, torso: 0, head: -6, aR1: 175, aR2: 178, aL1: 170, aL2: 174, lR1: 2, lR2: 2, lL1: -2, lL2: -2 });- POSES.gym_tramp = {- pose: (u) => {- const ph = ((u % 2) + 2) % 2, second = u >= 2;- const H = 0.62;- const y = ph < 0.1 ? 0.12 : 0.12 - (H + 0.12) * 4 * ((ph - 0.1) / 1.8) * (1 - (ph - 0.1) / 1.8);- const yy = ph >= 1.9 ? 0.12 : y;- let p;- if (ph < 0.1) p = land(0.12);- else if (ph < 0.4) p = G.lerpPose(land(yy), up(yy), G.E.o3((ph - 0.1) / 0.3));- else if (ph < 1.5) {- const k = G.E.io((ph - 0.4) / 1.1);- p = second ? straight(360 * k, yy) : G.lerpPose(tuck(360 * k, yy), tuck(360 * k, yy), 0);- if (!second) { const a = G.clamp((ph - 0.4) / 0.15), b = G.clamp((1.5 - ph) / 0.15); p = G.lerpPose(up(yy), p, Math.min(a, b)); p.rot = 360 * k; }- } else if (ph < 1.9) p = G.lerpPose(up(yy), land(yy), G.E.io((ph - 1.5) / 0.4));- else p = land(0.12);- return p;- },- fig: { s: 0.78, y: 0.14 },- back: (ctx, J, u, C) => {- const ph = ((u % 2) + 2) % 2;- const dip = ph < 0.1 || ph > 1.9 ? 0.09 : ph < 0.25 ? 0.09 * (1 - (ph - 0.1) / 0.15) : 0;- const yb = 0.58;- // Bed (V-shaped when pressed down)- ctx.strokeStyle = C.fg; ctx.lineWidth = 0.022; ctx.lineCap = 'round';- ctx.beginPath(); ctx.moveTo(-0.55, yb); ctx.quadraticCurveTo(0, yb + dip * 2, 0.55, yb); ctx.stroke();- ctx.fillStyle = C.line;- ctx.fillRect(-0.6, yb - 0.01, 1.2, 0.022);- G.seg(ctx, [-0.56, yb], [-0.66, yb + 0.26], 0.02, C.line);- G.seg(ctx, [0.56, yb], [0.66, yb + 0.26], 0.02, C.line);- // Dots marking the path in the air- if (ph > 0.4 && ph < 1.5) {- ctx.save(); ctx.globalAlpha *= 0.5;- for (let i = 1; i < 6; i++) G.disc(ctx, 0, J.hip[1] + i * 0.09, 0.012, C.line);- ctx.restore();- }- },- iconU: 0.95,- };-- // ── Modern pentathlon: laser run. Run → stop and raise the pistol → fire on beat 3 → run again. Five dots light up one by one ──- const aimP = { torso: -2, head: 4, aR1: 90, aR2: 90, aL1: 10, aL2: 40, lR1: 16, lR2: 8, lL1: -14, lL2: -14 };- POSES.pentathlon = {- pose: (u) => {- const run = (uu) => ({ ...G.runCycle(uu / 1.0, 0.85, { lean: 10 }), head: -4 });- const aim = WA(aimP);- if (u < 1.3) return run(u);- if (u < 1.8) return G.lerpPose(run(u), aim, G.E.o3((u - 1.3) / 0.5));- if (u < 3.25) return u > 3 && u < 3.1 ? { ...aim, torso: -4, aR1: 95, aR2: 97 } : aim;- return G.lerpPose(aim, run(u), G.E.io((u - 3.25) / 0.6));- },- fig: { x: -0.3 },- back: (ctx, J, u, C) => {- P.ground(ctx, 0.46, C, -0.6, 1.2);- if (u < 1.6) P.speed(ctx, -0.35, -0.05, 0.7, 4, C, 1 - u / 1.6);- if (u > 3.3) P.speed(ctx, -0.35, -0.05, 0.7, 4, C, G.clamp((u - 3.3) / 0.4));- target(ctx, 0.96, -0.2, 0.085, C, (u - 3.05) / 0.8);- // Five dots for the five events- for (let i = 0; i < 5; i++) {- const on = u >= i * 0.8 - 0.001;- const cx = 0.0 + i * 0.15;- if (on) G.disc(ctx, cx, -0.7, 0.038, i === Math.min(4, Math.floor(u / 0.8)) ? C.acc : C.fg);- else G.ring(ctx, cx, -0.7, 0.032, 0.012, C.line);- }- },- front: (ctx, J, u, C) => {- if (u > 1.5 && u < 3.4) {- const h = J.aR[2], e = J.aR[1];- const d = [h[0] - e[0], h[1] - e[1]], L = Math.hypot(d[0], d[1]) || 1;- G.seg(ctx, h, [h[0] + d[0] / L * 0.1, h[1] + d[1] / L * 0.1], 0.04, C.fg);- G.seg(ctx, h, [h[0] - 0.005, h[1] + 0.06], 0.03, C.fg);- // Laser- const t = (u - 3) / 0.35;- if (t > 0 && t < 1) {- ctx.save(); ctx.globalAlpha *= 1 - t;- const a = [h[0] + d[0] / L * 0.12, h[1] + d[1] / L * 0.12];- G.seg(ctx, a, [0.96, -0.2], 0.01, C.acc);- ctx.restore();- }- }- },- iconU: 2.4,- };-})();diff --git a/styles/pictogram-motion/demo/render.mjs b/styles/pictogram-motion/demo/render.mjsdeleted file mode 100644index 2e163f3..0000000--- a/styles/pictogram-motion/demo/render.mjs+++ /dev/null@@ -1,67 +0,0 @@-// Usage (run from the demo/ folder):-// node render.mjs stills 1.9 3.1 ... → stills/t_*.png-// node render.mjs video [workers] → $OUTDIR/seg_*.mp4 + list.txt (silent segments, handed to mux.sh)-// Language: LANGQ=ej (default, English/Japanese version) → output to out_ej/; LANGQ=zh (Chinese version) → output to out/-// Optional: START / END (seconds) to render only one stretch; FPS (default 60)-import { chromium } from 'playwright-core';-import { EXE as CORE_EXE } from '../../../core/render/browser.mjs';-import { spawn } from 'child_process';-import fs from 'fs';-import path from 'path';-const EXE = CORE_EXE; // headless shell from this machine's playwright cache (or PLAYWRIGHT_CHROME)-const LANGQ = process.env.LANGQ || 'ej';-const URL = 'file://' + path.resolve('index.html') + '?lang=' + LANGQ;-const OUT = process.env.OUTDIR || (LANGQ === 'ej' ? 'out_ej' : 'out');-const FPS = parseInt(process.env.FPS || "60");-const mode = process.argv[2];--async function openPage(browser) {- const page = await browser.newPage({ viewport: { width: 1920, height: 1080 }, deviceScaleFactor: 1 });- page.on('console', m => { if (m.type() === 'error') console.error('[page]', m.text()); });- page.on('pageerror', e => console.error('[pageerror]', e.message));- await page.goto(URL);- await page.waitForFunction(() => window.READY === true, null, { timeout: 60000 });- return page;-}--const browser = await chromium.launch({ executablePath: EXE, args: ['--font-render-hinting=none', '--force-color-profile=srgb', '--allow-file-access-from-files'] });-if (mode === 'stills') {- fs.mkdirSync('stills', { recursive: true });- const page = await openPage(browser);- for (const ts of process.argv.slice(3)) {- await page.evaluate(t => window.render(t), parseFloat(ts));- await page.screenshot({ path: `stills/t_${ts}.png` });- }-} else if (mode === 'events') {- const page = await openPage(browser);- const ev = await page.evaluate(() => ({ dur: window.DUR, ev: window.EV }));- fs.writeFileSync('events.json', JSON.stringify(ev, null, 0));- console.log('events', ev.ev.length, 'dur', ev.dur.toFixed(2));-} else if (mode === 'video') {- const W = parseInt(process.argv[3] || '6');- fs.mkdirSync(OUT, { recursive: true });- const probe = await openPage(browser); const DURV = await probe.evaluate(() => window.DUR); await probe.close();- const F0 = Math.round(FPS * parseFloat(process.env.START || '0')), F1 = Math.round(FPS * parseFloat(process.env.END || String(DURV)));- const TOTAL = F1 - F0;- const per = Math.ceil(TOTAL / W);- const t0 = Date.now();- await Promise.all([...Array(W)].map(async (_, w) => {- const a = F0 + w * per, b = Math.min(F1, a + per);- const br = await chromium.launch({ executablePath: EXE, args: ['--font-render-hinting=none', '--force-color-profile=srgb', '--allow-file-access-from-files'] });- const page = await openPage(br);- const ff = spawn('ffmpeg', ['-y', '-loglevel', 'error', '-f', 'image2pipe', '-framerate', String(FPS), '-c:v', 'mjpeg', '-i', '-',- '-c:v', 'libx264', '-preset', 'medium', '-crf', '12', '-pix_fmt', 'yuv420p', `${OUT}/seg_${w}.mp4`]);- for (let f = a; f < b; f++) {- await page.evaluate(t => window.render(t), f / FPS);- const buf = await page.screenshot({ type: 'jpeg', quality: 100 });- if (!ff.stdin.write(buf)) await new Promise(r => ff.stdin.once('drain', r));- if (w === 0 && (f - a) % 30 === 0) console.log(`w0 ${f - a}/${b - a} ${((Date.now() - t0) / 1000).toFixed(0)}s`);- }- ff.stdin.end();- await new Promise(r => ff.on('close', r));- await br.close();- }));- fs.writeFileSync(OUT + '/list.txt', [...Array(W)].map((_, w) => `file 'seg_${w}.mp4'`).join('\n'));- console.log('done', ((Date.now() - t0) / 1000).toFixed(0) + 's');-}-await browser.close();diff --git a/styles/pictogram-motion/demo/scenes.js b/styles/pictogram-motion/demo/scenes.jsdeleted file mode 100644index ec58fc6..0000000--- a/styles/pictogram-motion/demo/scenes.js+++ /dev/null@@ -1,719 +0,0 @@-// Scenes: opening / chapter cards / event cards (three layouts) / athletics long take / ending / transitions / HUD-(function () {- const G = window.G, E = G.E, EDL = window.EDL, POSES = window.POSES;- const { W, H, clamp, lerp, inv, PAL, mix, rgba, F, CELL } = G;- const BEAT = EDL.BEAT;- const EJ = new URLSearchParams(location.search).get('lang') === 'ej';- G.EJ = EJ;- // Large second language: Chinese version = Chinese; English/Japanese version = Japanese- const big2 = (s) => (EJ ? s.jpBig || s.jp : s.zh);- const F2 = (w, px) => (EJ ? F.jp(w, px) : F.zh(w, px));- const SH = EDL.shots;- const CARDS = SH.filter((s) => s.kind === 'card');- const TRACK = SH.filter((s) => s.track);- SH.forEach((s, i) => (s.i = i));-- // Palette for each card- for (const s of SH) {- if (s.kind === 'card') s.pk = s.pal === 'multi' ? G.CYCLE[s.ci % 5] : s.pal;- else if (s.kind === 'chapter') s.pk = s.pal === 'multi' ? 'purple' : s.pal;- }-- const lightFg = (pk) => PAL[pk].fg === G.CREAM;- const colorsFor = (pk, bg) => {- const P = PAL[pk]; bg = bg || P.t[2];- return {- fg: P.fg, bg,- far: mix(P.fg, bg, 0.42), far2: mix(P.fg, bg, 0.6),- acc: pk === 'ink' ? PAL.gold.t[2] : lightFg(pk) ? P.t[4] : P.deep,- line: mix(P.fg, bg, 0.55),- };- };- G.colorsFor = colorsFor;-- // ───────── Figures ─────────- const bufFig = G.canvas();- function poseOf(def, u) { return def.pose ? def.pose(u) : G.keyPose(def.keys, u, def.loop); }- function drawFigUnits(ctx, def, u, C) {- const J = G.joints(poseOf(def, u));- ctx.save();- if (def.fig) { ctx.translate(def.fig.x || 0, def.fig.y || 0); if (def.fig.s) ctx.scale(def.fig.s, def.fig.s); }- if (def.back) def.back(ctx, J, u, C);- if (def.second) {- const J2 = G.joints(def.second(u));- ctx.save(); const o = def.secondX || [0, 0]; ctx.translate(o[0], o[1]); if (def.secondFace === -1) ctx.scale(-1, 1);- G.drawFigure(ctx, J2, C.far2, mix(C.far2, C.bg, 0.35)); ctx.restore();- }- G.drawFigure(ctx, J, C.fg, C.far);- if (def.front) def.front(ctx, J, u, C);- ctx.restore();- }- G.drawFigUnits = drawFigUnits;- // Draw the figure on the stage; asm = assembly progress (0 = cut into horizontal strips and offset, 1 = whole)- // mask = { x0, x1, y1, f }: keeps the figure layer (including environment such as water surface and ramps) out of the text area, with an f-pixel soft edge- function stageFigure(ctx, name, u, C, x, y, U, asm = 1, mask) {- const def = POSES[name];- const f = bufFig.getContext('2d');- f.setTransform(1, 0, 0, 1, 0, 0); f.globalCompositeOperation = 'source-over'; f.clearRect(0, 0, W, H);- f.save(); f.translate(x, y); f.scale(U, U);- if (def) drawFigUnits(f, def, u, C); else G.drawFigure(f, G.joints({}), C.fg, C.far);- f.restore();- if (mask) {- const fd = mask.f || 90;- f.globalCompositeOperation = 'destination-in';- if (mask.x0 != null || mask.x1 != null) {- const g = f.createLinearGradient(0, 0, W, 0);- const a0 = mask.x0 != null ? mask.x0 : -1e3, a1 = mask.x1 != null ? mask.x1 : W + 1e3;- const st = (v) => clamp(v / W, 0, 1);- g.addColorStop(0, 'rgba(0,0,0,0)');- if (mask.x0 != null) { g.addColorStop(st(a0 - fd), 'rgba(0,0,0,0)'); g.addColorStop(st(a0), 'rgba(0,0,0,1)'); }- else g.addColorStop(0, 'rgba(0,0,0,1)');- if (mask.x1 != null) { g.addColorStop(st(a1), 'rgba(0,0,0,1)'); g.addColorStop(st(a1 + fd), 'rgba(0,0,0,0)'); g.addColorStop(1, 'rgba(0,0,0,0)'); }- else g.addColorStop(1, 'rgba(0,0,0,1)');- f.fillStyle = g; f.fillRect(0, 0, W, H);- }- if (mask.y1 != null) {- const g = f.createLinearGradient(0, 0, 0, H);- g.addColorStop(0, 'rgba(0,0,0,1)'); g.addColorStop(clamp((mask.y1 - fd) / H), 'rgba(0,0,0,1)'); g.addColorStop(clamp(mask.y1 / H), 'rgba(0,0,0,0)'); g.addColorStop(1, 'rgba(0,0,0,0)');- f.fillStyle = g; f.fillRect(0, 0, W, H);- }- f.globalCompositeOperation = 'source-over';- }- if (asm >= 0.999) { ctx.drawImage(bufFig, 0, 0); return; }- const band = 54, k = 1 - asm;- ctx.save();- for (let yy = 0, j = 0; yy < H; yy += band, j++) {- const dx = k * (j % 2 ? 1 : -1) * (90 + ((j * 37) % 5) * 40);- ctx.globalAlpha = clamp(asm * 3);- ctx.drawImage(bufFig, 0, yy, W, band, dx, yy, W, band);- }- ctx.restore();- }-- // ───────── Background: pattern with whole-row offsets ─────────- function patBg(ctx, pk, seed, lt, o = {}) {- const pat = G.pattern(pk, seed, { spread: o.spread ?? 0.5, density: o.density ?? 0.42 });- const amp = o.amp ?? 22, sp = o.sp ?? 26;- G.drawPattern(ctx, pat, (j) => (j % 2 ? 1 : -1) * (lt * sp) + Math.sin(j * 1.7 + seed) * amp + (o.step ? o.step(j) : 0));- }- function multiBg(ctx, seed, offs, spread = 0.9) {- const rows = Math.ceil(H / CELL);- for (let j = 0; j < rows; j++) {- const pk = G.CYCLE[(j + seed) % 5];- const pat = G.pattern(pk, seed + j, { spread, density: 0.5 });- ctx.save(); ctx.beginPath(); ctx.rect(0, j * CELL, W, CELL); ctx.clip();- G.drawPattern(ctx, pat, (jj) => (jj === j ? offs(j) : 0));- ctx.restore();- }- }-- // ───────── Text block ─────────- function textBlock(ctx, s, lt, x, y, o = {}) {- const P = PAL[s.pk], fg = o.fg || P.fg, dim = o.dim || rgba(fg, 0.72);- const k = s.beats <= 2 ? 0.7 : 1;- const maxW = o.maxW || 860;- const al = o.align || 'left';- // family / number- const no = String(s.n).padStart(2, '0');- const meta = (s.family ? s.family + ' ' : '') + no + ' / 43';- G.typeText(ctx, meta, x, y - (o.titlePx || 170) - 40, F.mono(22), dim, inv(0.02, 0.3 * k, lt), { ls: '3px', align: al, caret: false });- // big title- const px = G.fitFont(ctx, s.title, 'en', 900, o.titlePx || 170, maxW, -0.02);- G.maskText(ctx, s.title, x, y, F.en(900, px), fg, inv(0.0, 0.5 * k, lt), { ls: -0.02 * px + 'px', align: al });- // Chinese- const zpx = EJ ? G.fitFont(ctx, big2(s), 'jp', 900, o.zhPx || 92, maxW, 0.02) : (o.zhPx || 92);- G.maskText(ctx, big2(s), x, y + zpx + 34, F2(900, zpx), fg, inv(0.08 * k, 0.55 * k, lt), { ls: '2px', align: al });- // small Japanese line (in the English/Japanese version Japanese is already the big text, so skip this line)- if (!EJ) G.maskText(ctx, s.jp, x, y + zpx + 96, F.jp(500, 28), dim, inv(0.16 * k, 0.6 * k, lt), { ls: '5px', align: al });- // corner tag- if (s.tag) {- ctx.save(); ctx.font = F.mono(20); ctx.letterSpacing = '3px';- const tw = ctx.measureText(s.tag).width + 28;- const p = E.oExp(inv(0.2 * k, 0.5 * k, lt));- const tx = al === 'right' ? x - tw : al === 'center' ? x - tw / 2 : x;- const ty = y + zpx + 130;- ctx.fillStyle = s.tag === 'NEW' ? PAL.red.t[2] : fg; ctx.globalAlpha = p;- if (s.tag === 'NEW' && s.pk === 'red') ctx.fillStyle = G.CREAM;- ctx.fillRect(tx, ty, tw * p, 38);- ctx.fillStyle = s.tag === 'NEW' ? (s.pk === 'red' ? PAL.red.t[2] : G.CREAM) : PAL[s.pk].t[2];- ctx.fillText(s.tag, tx + 14, ty + 27);- ctx.restore();- }- }-- // ───────── Event card ─────────- function layoutOf(s) {- // A run of 2-beat fast cuts uses the same layout; otherwise layouts rotate by order within the chapter- if (s.beats <= 2) return s.racket ? 'B' : 'A';- const order = { ball: 'ACBAB', combat: 'CAMBC', power: 'BCA', nature: 'CABAC', asia: 'ABCM', aqua: 'CAB' }[s.chap] || 'ACB';- return order[s.ci % order.length];- }- function cardScene(ctx, s, lt) {- const P = PAL[s.pk], u = lt / BEAT;- const L = layoutOf(s);- const asm = E.o3(inv(0, s.beats <= 2 ? 0.28 : 0.42, lt));- ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);- patBg(ctx, s.pk, s.i, lt, { spread: 0.42 });- const discCol = s.pk === 'ink' ? P.t[3] : lightFg(s.pk) ? P.t[1] : P.t[4];- const C = colorsFor(s.pk, discCol);- const no = String(s.n).padStart(2, '0');- const dp = E.o5(inv(0, 0.5, lt));- if (L === 'A' || L === 'M') {- const mir = L === 'M';- const wide = s.water && !mir; // swimming lies horizontal, so move the stage further right- const cx = mir ? 640 : wide ? 1370 : 1290, cy = 540;- bigNumber(ctx, no, mir ? 80 : 1850, 1000, P, lt, mir ? 'left' : 'right');- sun(ctx, cx, cy, 380 * lerp(0.82, 1, dp), discCol, P, lt);- stageFigure(ctx, s.pose, u, C, cx, cy + 20, 560, asm, mir ? { x1: 1060, f: 110 } : { x0: wide ? 960 : 880, f: 110 });- textBlock(ctx, s, lt, mir ? 1800 : 130, 610, { align: mir ? 'right' : 'left', maxW: wide ? 700 : 820 });- } else if (L === 'B') {- // Title fills the frame, figure sits on top of the text- const px = G.fitFont(ctx, s.title, 'en', 900, 330, 1760, -0.03);- const ghost = lightFg(s.pk) ? P.t[1] : P.t[4];- G.maskText(ctx, s.title, W / 2, 700, F.en(900, px), ghost, inv(0, 0.5, lt), { ls: -0.03 * px + 'px', align: 'center' });- sun(ctx, W / 2, 470, 250 * lerp(0.8, 1, dp), discCol, P, lt);- stageFigure(ctx, s.pose, u, C, W / 2, 470, 520, asm, { y1: 850, f: 70 });- // Bottom info bar- const k = s.beats <= 2 ? 0.7 : 1;- const zpx = 80;- G.maskText(ctx, big2(s), 130, 930, F2(900, zpx), P.fg, inv(0.06 * k, 0.5 * k, lt), { ls: '2px' });- ctx.font = F2(900, zpx); ctx.letterSpacing = '2px';- const zw = ctx.measureText(big2(s)).width;- G.maskText(ctx, s.title, 130 + zw + 40, 930, F.en(800, 44), P.fg, inv(0.1 * k, 0.55 * k, lt), { ls: '0px' });- if (!EJ) G.maskText(ctx, s.jp, 130 + zw + 42, 876, F.jp(500, 24), rgba(P.fg, 0.7), inv(0.14 * k, 0.6 * k, lt), { ls: '4px' });- G.typeText(ctx, (s.family ? s.family + ' ' : '') + no + ' / 43' + (s.tag ? ' · ' + s.tag : ''), 1790, 930, F.mono(22), rgba(P.fg, 0.75), inv(0.05, 0.3 * k, lt), { ls: '3px', align: 'right', caret: false });- } else if (L === 'C') {- // Solid panel on the left + pattern and figure on the right- const pw = 820 * E.o5(inv(0, 0.4, lt));- const panel = lightFg(s.pk) ? P.t[0] : P.t[4];- ctx.fillStyle = panel; ctx.fillRect(0, 0, pw, H);- // Thin line grid on the panel (a small detail that reads as premium)- ctx.save(); ctx.beginPath(); ctx.rect(0, 0, pw, H); ctx.clip();- ctx.strokeStyle = rgba(P.fg, 0.1); ctx.lineWidth = 1;- for (let x = 90; x < 820; x += 90) { ctx.beginPath(); ctx.moveTo(x + 0.5, 0); ctx.lineTo(x + 0.5, H); ctx.stroke(); }- bigNumber(ctx, no, 110, 1000, P, lt, 'left', panel);- textBlock(ctx, s, lt, 110, 560, { maxW: 640, titlePx: 150, zhPx: 84 });- ctx.restore();- const cx = 1370, cy = 530;- sun(ctx, cx, cy, 360 * lerp(0.82, 1, dp), discCol, P, lt);- stageFigure(ctx, s.pose, u, C, cx, cy + 20, 540, asm, { x0: 820 + 110, f: 110 });- }- }- // Sun disc: solid circle + a slowly sweeping highlight- function sun(ctx, x, y, r, col, P, lt) {- G.disc(ctx, x, y, r, col);- ctx.save(); ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.clip();- const sx = x - r * 1.6 + (lt * 0.5 % 1) * 0 + E.o3(inv(0.05, 1.1, lt)) * r * 3.2;- const g = ctx.createLinearGradient(sx - r * 0.5, y - r, sx + r * 0.5, y + r);- g.addColorStop(0, rgba('#ffffff', 0)); g.addColorStop(0.5, rgba('#ffffff', 0.09)); g.addColorStop(1, rgba('#ffffff', 0));- ctx.fillStyle = g; ctx.fillRect(x - r, y - r, r * 2, r * 2);- ctx.restore();- }- // Big outlined number- function bigNumber(ctx, no, x, y, P, lt, align = 'left') {- ctx.save();- ctx.font = F.en(800, 300); ctx.letterSpacing = '-10px'; ctx.textAlign = align;- ctx.strokeStyle = rgba(P.fg, 0.2 * E.o3(inv(0.05, 0.5, lt))); ctx.lineWidth = 2;- ctx.strokeText(no, x, y + (1 - E.oExp(inv(0, 0.6, lt))) * 60);- ctx.restore();- }-- // ───────── Chapter card ─────────- function chapterScene(ctx, s, lt) {- const P = PAL[s.pk], u = lt / BEAT;- ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);- // In the second bar, whole rows jump one cell every beat (on the drum hits)- const step = (j) => {- let v = 0;- for (let b = 4; b <= 7; b++) v += E.oExp(inv(b, b + 0.35, u)) * (j % 2 ? 1 : -1) * CELL * 0.25;- return v;- };- if (s.pal === 'multi') multiBg(ctx, 3, (j) => (j % 2 ? 1 : -1) * lt * 30 + step(j), 0.95);- else patBg(ctx, s.pk, 100 + s.i, lt, { spread: s.pk === 'ink' ? 1 : 0.95, density: 0.55, step, sp: 30 });- // Solid band in the middle (two rows tall)- const bp = E.o5(inv(0.05, 0.5, lt));- const band = s.pal === 'multi' ? G.INK : lightFg(s.pk) ? P.t[0] : P.t[4];- const fg = s.pal === 'multi' ? G.CREAM : P.fg;- const by = 2 * CELL - 90, bh = 2 * CELL;- ctx.fillStyle = band; ctx.fillRect(W / 2 - (W / 2) * bp, by, W * bp, bh);- ctx.save(); ctx.beginPath(); ctx.rect(0, by, W, bh); ctx.clip();- // Outlined chapter number- ctx.font = F.en(800, 330); ctx.letterSpacing = '-14px';- ctx.strokeStyle = rgba(fg, 0.85); ctx.lineWidth = 2.5;- const ny = by + bh - 34 + (1 - E.oExp(inv(0.1, 0.7, lt))) * 300;- ctx.strokeText(s.no, 110, ny);- const tx = 560;- G.typeText(ctx, 'CHAPTER ' + s.no + ' · ' + PAL[s.pk].name.toUpperCase(), tx + 4, by + 70, F.mono(22), rgba(fg, 0.7), inv(0.15, 0.6, lt), { ls: '4px', caret: false });- const px = G.fitFont(ctx, s.en, 'en', 900, 170, 1250, -0.02);- G.maskText(ctx, s.en, tx, by + 222, F.en(900, px), fg, inv(0.12, 0.7, lt), { ls: -0.02 * px + 'px' });- G.maskText(ctx, big2(s), tx + 4, by + 312, F2(900, 66), fg, inv(0.25, 0.8, lt), { ls: '6px' });- if (!EJ) {- ctx.font = F.zh(900, 66); ctx.letterSpacing = '6px';- const zw = ctx.measureText(s.zh).width;- G.maskText(ctx, s.jp, tx + zw + 40, by + 310, F.jp(500, 28), rgba(fg, 0.7), inv(0.35, 0.9, lt), { ls: '6px' });- }- ctx.restore();- // Thin lines above and below the band- G.hair(ctx, W / 2 - (W / 2) * bp, by - 10, W * bp, rgba(fg, 0.5), 1, 2);- G.hair(ctx, W / 2 - (W / 2) * bp, by + bh + 8, W * bp, rgba(fg, 0.5), 1, 2);- }-- // ───────── Athletics long take ─────────- const T_OUT = 0.14, T_IN = 0.24; // whip-pan window: before / after the beat- const TV = 42; // constant drift, px/s- const SPEC = { sprint: '100M', hurdles: '110M H', relay: '4×100M', distance: '1500M', steeple: '3000M SC', marathon: '42.195 KM', walk: '20 KM', highjump: 'HJ', polevault: 'PV', longjump: 'LJ · TJ', shot: '7.26 KG', discus: '2 KG', hammer: '7.26 KG', javelin: '800 G' };- const RUNNING = { sprint: 1, hurdles: 1, relay: 1, distance: 0.7, steeple: 0.7, marathon: 0.5, walk: 0.35 };- function trackCam(t) {- const T0 = TRACK[0].t0;- let c = TV * (t - T0);- for (let k = 1; k < TRACK.length; k++) c += W * E.ioExp(inv(TRACK[k].t0 - T_OUT, TRACK[k].t0 + T_IN, t));- return c;- }- function stationX(k) { // the moment the camera faces the middle of this station- const s = TRACK[k]; const T0 = TRACK[0].t0;- return TV * (s.t0 + s.dur / 2 - T0) + k * W;- }- function trackScene(ctx, s, lt) {- const t = s.t0 + lt;- const P = PAL.red;- const cam = trackCam(t);- const ci = TRACK.indexOf(s);- ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);- // Two rows of large cells in the distance, parallax at different speeds = the whole-row offset of the official graphic- const rows = [{ y: -80, S: 360, par: 0.28 }, { y: 280, S: 360, par: 0.42 }];- const T = P.t.map((c) => mix(P.t[2], c, 0.5));- rows.forEach((R, ri) => {- const off = cam * R.par;- const i0 = Math.floor(off / R.S) - 1;- for (let i = i0; i < i0 + Math.ceil(W / R.S) + 3; i++) {- const r = G.rng(i * 131 + ri * 7 + 5);- const pick = () => T[Math.floor(r() * 5)];- let a = pick(), b = pick(); while (b === a) b = pick();- G.motif(ctx, Math.floor(r() * 14), Math.round(i * R.S - off), R.y, R.S, [a, b, pick(), T[4]], r);- }- });- // Track- const ty = 780;- // Each station's sun (rises behind the track)- for (let k = Math.max(0, ci - 1); k <= Math.min(TRACK.length - 1, ci + 1); k++) {- const x = stationX(k) - cam + 1250;- if (x < -600 || x > W + 600) continue;- const lk = t - TRACK[k].t0;- G.disc(ctx, x, ty - 60, 330 * lerp(0.9, 1, E.o5(inv(-0.1, 0.6, lk))), P.t[0]);- }- ctx.fillStyle = P.deep; ctx.fillRect(0, ty, W, H - ty);- const lanes = [0, 44, 98, 162, 236, 320];- ctx.fillStyle = rgba(G.CREAM, 0.5);- lanes.forEach((y) => ctx.fillRect(0, ty + y, W, 3));- // Ticks / start lines on the track, moving with the world; extra scrolling for a sense of speed- const run = s.pose in RUNNING ? RUNNING[s.pose] : 0.15;- const roll = cam + t * 900 * run;- ctx.fillStyle = rgba(G.CREAM, 0.28);- for (let li = 0; li < lanes.length - 1; li++) {- const y = ty + lanes[li] + 3, h = lanes[li + 1] - lanes[li] - 3;- const sp = 260 + li * 70;- for (let x = -((roll * (1 + li * 0.18)) % sp); x < W; x += sp) ctx.fillRect(x, y + h * 0.42, 56 + li * 10, Math.max(3, h * 0.12));- }- // Each station: spec text painted on the track, figure, text- for (let k = Math.max(0, ci - 1); k <= Math.min(TRACK.length - 1, ci + 1); k++) {- const st = TRACK[k];- const ox = stationX(k) - cam;- if (ox < -W * 1.2 || ox > W * 1.2) continue;- const lk = t - st.t0;- ctx.save(); ctx.translate(ox, 0);- // Track text- ctx.font = F.en(900, 150); ctx.letterSpacing = '-4px'; ctx.textAlign = 'left';- ctx.fillStyle = rgba(G.CREAM, 0.12);- ctx.save(); ctx.translate(820, 1060); ctx.transform(1, 0, -0.35, 1, 0, 0); ctx.fillText(SPEC[st.pose] || '', 0, 0); ctx.restore();- // Figure- const C = colorsFor('red', P.t[0]);- stageFigure(ctx, st.pose, Math.max(0, lk) / BEAT, C, 1250, ty + 10 - 0.46 * 480, 480, E.o3(inv(0, 0.45, lk)), { x0: 900, f: 120 });- // Text- if (lk > -0.3) {- const ss = Object.assign({}, st, { pk: 'red' });- textBlock(ctx, ss, Math.max(0, lk), 130, 420, { maxW: 820, titlePx: 160, zhPx: 88 });- }- ctx.restore();- }- }-- // ───────── Opening ─────────- const RINGS = ['red', 'purple', 'gold', 'green', 'ochre'];- function rings(ctx, x, y, r0, gap, w, prog, rot, alpha = 1, cols) {- for (let i = 0; i < 5; i++) {- const p = clamp(prog(i));- if (p <= 0) continue;- const r = r0 + i * gap;- const a0 = rot * (i % 2 ? -1 : 1) + i * 1.3 - Math.PI / 2;- ctx.strokeStyle = cols ? cols[i] : PAL[RINGS[i]].t[2]; ctx.globalAlpha = alpha; ctx.lineWidth = w; ctx.lineCap = 'butt';- ctx.beginPath(); ctx.arc(x, y, r, a0, a0 + Math.PI * 2 * p); ctx.stroke();- }- ctx.globalAlpha = 1;- }- function introScene(ctx, s, lt) {- const u = lt / BEAT;- const INK = PAL.ink.t[0];- if (u < 16) {- ctx.fillStyle = INK; ctx.fillRect(0, 0, W, H);- // Heartbeat pulse- let pulse = 0;- for (const b of [0, 2, 4, 6, 8, 10, 12, 14]) pulse += Math.exp(-Math.max(0, u - b) * 5) * (u >= b ? 1 : 0);- for (const b of [0, 4, 8, 12]) {- const q = u - b; if (q < 0 || q > 4) continue;- G.ring(ctx, W / 2, H / 2, 90 + q * 260, 1.5, rgba(PAL.red.t[2], 0.5 * (1 - q / 4)));- }- const r = 78 * E.oBack(inv(0, 1.2, u), 2.2) * (1 + 0.08 * pulse) * (1 - 0.25 * E.i3(inv(14.5, 16, u)));- G.disc(ctx, W / 2, H / 2, r, PAL.red.t[2]);- // Five-colour rings- const rp = (i) => E.io3(inv(8 + i * 0.5, 13 + i * 0.3, u));- const squeeze = 1 - 0.18 * E.i3(inv(14.8, 16, u));- rings(ctx, W / 2, H / 2, 150 * squeeze, 58 * squeeze, 30, rp, u * 0.35);- // Text- G.typeText(ctx, '2026 · AICHI – NAGOYA · JAPAN', W / 2, H - 120, F.mono(22), rgba(G.CREAM, 0.7), inv(2.5, 6, u), { ls: '6px', align: 'center', caret: false });- G.typeText(ctx, 'THE 20TH ASIAN GAMES', W / 2, 140, F.mono(22), rgba(G.CREAM, 0.7), inv(8, 10, u), { ls: '8px', align: 'center', caret: false });- if (u > 15.6) { ctx.fillStyle = rgba(G.CREAM, E.i3(inv(15.6, 16, u)) * 0.9); ctx.fillRect(0, 0, W, H); }- return;- }- if (u < 32) {- // Title: five-colour grid fills the frame + ink band in the middle- const q = u - 16;- multiBg(ctx, 11, (j) => {- const dir = j % 2 ? 1 : -1;- const inn = (1 - E.oExp(inv(j * 0.12, 1.2 + j * 0.12, q))) * W * 0.9 * dir;- const hit = [20, 24, 28].reduce((v, b) => v + E.oExp(inv(b - 16, b - 15.6, q)) * CELL * 0.25 * dir, 0);- return clamp(inn, -CELL, CELL) + q * 6 * dir + hit;- });- // On entry whole rows slide in from off-screen: a mask covers the parts not yet in- for (let j = 0; j < 6; j++) {- const k = 1 - E.oExp(inv(j * 0.12, 1.4 + j * 0.12, q));- if (k <= 0.001) continue;- const dir = j % 2 ? 1 : -1;- ctx.fillStyle = G.CREAM;- if (dir > 0) ctx.fillRect(0, j * CELL, W * k, CELL); else ctx.fillRect(W * (1 - k), j * CELL, W * k, CELL);- }- const bp = E.o5(inv(0.6, 2.0, q));- const by = 2 * CELL - 60, bh = 2 * CELL + 120;- ctx.fillStyle = INK; ctx.fillRect(W / 2 - (W / 2) * bp, by, W * bp, bh);- ctx.save(); ctx.beginPath(); ctx.rect(0, by, W, bh); ctx.clip();- G.typeText(ctx, 'THE 20TH ASIAN GAMES', W / 2, by + 78, F.mono(24), rgba(G.CREAM, 0.72), inv(1.2, 3, q), { ls: '10px', align: 'center', caret: false });- const px = 168;- G.maskText(ctx, 'AICHI-NAGOYA 2026', W / 2, by + 280, F.en(900, px), G.CREAM, inv(1.0, 2.6, q), { ls: '-4px', align: 'center' });- if (EJ) {- G.maskText(ctx, '第20回アジア競技大会 · 愛知・名古屋', W / 2, by + 380, F.jp(800, 50), G.CREAM, inv(1.6, 3.2, q), { ls: '8px', align: 'center' });- G.maskText(ctx, 'SEPTEMBER 19 — OCTOBER 4, 2026', W / 2, by + 440, F.mono(24), rgba(G.CREAM, 0.65), inv(2.0, 3.6, q), { ls: '6px', align: 'center' });- } else {- G.maskText(ctx, '第20届亚洲运动会 · 爱知 · 名古屋', W / 2, by + 380, F.zh(800, 50), G.CREAM, inv(1.6, 3.2, q), { ls: '8px', align: 'center' });- G.maskText(ctx, '第20回アジア競技大会(2026 / 愛知・名古屋)', W / 2, by + 440, F.jp(500, 26), rgba(G.CREAM, 0.65), inv(2.0, 3.6, q), { ls: '6px', align: 'center' });- }- ctx.restore();- return;- }- if (u < 44) {- // Three numbers, one per bar- const k = Math.floor((u - 32) / 4), q = (u - 32) - k * 4, ql = q * BEAT;- const D = [- { n: 43, pk: 'red', en: 'SPORTS', zh: EJ ? '競技' : '个大项', jp: EJ ? '' : '競技' },- { n: 469, pk: 'purple', en: 'EVENTS', zh: EJ ? '種目' : '个小项', jp: EJ ? '' : '種目' },- { n: 16, pk: 'green', en: 'DAYS', zh: EJ ? '日間 · 9.19 — 10.4' : '天 · 9.19 — 10.4', jp: EJ ? '' : '日間' },- ][k];- const P = PAL[D.pk];- ctx.fillStyle = P.t[2]; ctx.fillRect(0, 0, W, H);- patBg(ctx, D.pk, 40 + k, ql, { spread: 0.9, density: 0.5, amp: 0 });- // Solid block covers the middle 4 rows, leaving only one row of pattern above and below- const bp = E.o5(inv(0, 0.35, ql));- ctx.fillStyle = P.t[2]; ctx.fillRect(0, CELL * 0.5 + (1 - bp) * CELL * 2, W, (H - CELL) * bp);- ctx.fillStyle = P.t[1]; ctx.fillRect(0, CELL * 0.5 + (1 - bp) * CELL * 2, W, 3);- const cnt = Math.round(D.n * E.o3(inv(0, 0.5, ql)));- ctx.save();- ctx.font = F.en(900, 520); ctx.letterSpacing = '-24px'; ctx.textAlign = 'right'; ctx.fillStyle = P.fg;- const nx = 1060;- ctx.beginPath(); ctx.rect(0, 180, W, 720); ctx.clip();- ctx.fillText(String(cnt), nx, 740 + (1 - E.oExp(inv(0, 0.35, ql))) * 500);- ctx.restore();- G.maskText(ctx, D.en, 1130, 560, F.en(900, 150), P.fg, inv(0.05, 0.45, ql), { ls: '-3px' });- G.maskText(ctx, D.zh, 1136, 660, F2(900, 64), P.fg, inv(0.1, 0.5, ql), { ls: '4px' });- G.maskText(ctx, D.jp, 1138, 722, F.jp(500, 28), rgba(P.fg, 0.7), inv(0.15, 0.55, ql), { ls: '6px' });- return;- }- // On your marks — set — (silence) — bang- const q = u - 44;- ctx.fillStyle = INK; ctx.fillRect(0, 0, W, H);- const lines = EJ ? [[0, 'ON YOUR MARKS', '位置について'], [2, 'SET', 'よーい']] : [[0, 'ON YOUR MARKS', '各就各位'], [2, 'SET', '预备']];- for (const [b, en, zh] of lines) {- if (q < b || q >= b + 2) continue;- const l = (q - b) * BEAT;- const a = q > 3.5 ? 0 : 1;- ctx.globalAlpha = a;- G.maskText(ctx, en, W / 2, 560, F.en(900, b ? 260 : 170), G.CREAM, inv(0, 0.3, l), { ls: '-4px', align: 'center' });- G.maskText(ctx, zh, W / 2, 680, F2(800, 54), rgba(G.CREAM, 0.8), inv(0.05, 0.35, l), { ls: '20px', align: 'center' });- ctx.globalAlpha = 1;- }- // Five-colour squares on the start line, lighting up on the beats- for (let i = 0; i < 5; i++) {- const on = q >= i * 0.7;- ctx.fillStyle = on && q < 3.5 ? PAL[RINGS[i]].t[2] : rgba(G.CREAM, 0.08);- ctx.fillRect(W / 2 - 170 + i * 70, 800, 50, 12);- }- }-- // ───────── Ending ─────────- const GRID = { cols: 9, rows: 5 };- function finaleScene(ctx, s, lt) {- const u = lt / BEAT;- const cw = W / GRID.cols, ch = H / GRID.rows;- // The first card of each of the 43 sports- const firsts = [];- for (const c of CARDS) if (!firsts.find((f) => f.n === c.n)) firsts.push(c);- if (u < 20) {- ctx.fillStyle = PAL.ink.t[0]; ctx.fillRect(0, 0, W, H);- const zoom = lerp(1, 0.9, E.io3(inv(12, 16, u)));- const gap = 10 * E.io3(inv(12, 16, u));- const collapse = E.i3(inv(16.2, 19.6, u));- ctx.save(); ctx.translate(W / 2, H / 2); ctx.scale(zoom, zoom); ctx.translate(-W / 2, -H / 2);- // Cell order: top-left to bottom-right; the two middle cells are kept for the red sun and the year- let idx = 0;- for (let r = 0; r < GRID.rows; r++) for (let c = 0; c < GRID.cols; c++) {- const special = r === 2 && (c === 4 || c === 3) ? (c === 4 ? 'sun' : 'yr') : null;- const card = special ? null : firsts[idx++];- const order = special ? -1.5 : idx - 1;- const t0 = (order + 1.5) * (12 / 45); // light the red sun and year in the middle first, then flip the cells open one by one over 12 beats- const fp = E.o3(inv(t0, t0 + 0.8, u));- const allRed = E.io3(inv(16 + (Math.abs(c - 4) + Math.abs(r - 2)) * 0.15, 16.6 + (Math.abs(c - 4) + Math.abs(r - 2)) * 0.15, u));- let x = c * cw + gap / 2, y = r * ch + gap / 2, w = cw - gap, h = ch - gap;- // Gather: shrink towards the centre- if (collapse > 0) {- const cx = x + w / 2, cy = y + h / 2;- const k = 1 - collapse;- x = lerp(W / 2, cx, k) - (w * k) / 2; y = lerp(H / 2, cy, k) - (h * k) / 2; w *= k; h *= k;- }- if (fp <= 0) continue;- const sy = Math.abs(Math.cos(Math.PI * (1 - fp) / 2)); // flip open- const pk = card ? card.pk : 'red';- const P = PAL[pk];- ctx.save();- ctx.translate(x + w / 2, y + h / 2); ctx.scale(1, fp < 1 ? Math.max(0.02, fp) : 1); ctx.translate(-(x + w / 2), -(y + h / 2));- const bg = mix(P.t[(c + r) % 2 ? 2 : 1], PAL.red.t[2], allRed);- ctx.fillStyle = bg; ctx.fillRect(x, y, w, h);- ctx.beginPath(); ctx.rect(x, y, w, h); ctx.clip();- const fg = allRed > 0.5 ? G.CREAM : P.fg;- if (card) {- const def = POSES[card.pose];- const C = colorsFor(pk, bg); C.fg = fg; C.far = mix(fg, bg, 0.42); C.far2 = mix(fg, bg, 0.6); C.line = mix(fg, bg, 0.55);- if (allRed > 0.5) C.acc = PAL.red.t[4];- ctx.save(); ctx.translate(x + w / 2, y + h * 0.5); const U = h * 0.66 * (w / (cw - gap || cw)); ctx.scale(U, U);- if (def) drawFigUnits(ctx, def, def.iconU ?? 1, C); else G.drawFigure(ctx, G.joints({}), C.fg, C.far);- ctx.restore();- ctx.font = F.mono(Math.max(1, 13 * w / cw)); ctx.letterSpacing = '1px'; ctx.fillStyle = rgba(fg, 0.75);- if (collapse < 0.3) ctx.fillText(String(card.n).padStart(2, '0') + ' ' + card.en.split(' · ')[0], x + 12, y + h - 14);- } else if (special === 'sun') {- G.disc(ctx, x + w / 2, y + h / 2, h * 0.28, allRed > 0.5 ? G.CREAM : PAL.red.t[2]);- } else {- ctx.font = F.en(900, 64 * w / cw); ctx.letterSpacing = '-2px'; ctx.textAlign = 'center'; ctx.fillStyle = G.CREAM;- ctx.fillText('2026', x + w / 2, y + h / 2 + 22 * w / cw);- }- ctx.restore();- }- ctx.restore();- // While gathering, the red sun grows out of the centre- if (u > 17) {- const rr = 150 * E.oExp(inv(18.4, 20, u));- G.disc(ctx, W / 2, H / 2, rr, PAL.red.t[2]);- }- return;- }- // Slogan + end card: off-white ground, red sun + five-colour rings- const q = u - 20;- ctx.fillStyle = G.CREAM; ctx.fillRect(0, 0, W, H);- const up = E.io3(inv(1.5, 4, q));- const sx = W / 2, sy = lerp(H / 2, 330, up);- const sc = lerp(1, 0.62, up);- G.disc(ctx, sx, sy, 150 * sc, PAL.red.t[2]);- rings(ctx, sx, sy, 210 * sc, 48 * sc, 24 * sc, (i) => E.io3(inv(i * 0.35, 2.2 + i * 0.35, q)), q * 0.18 + 0.5);- if (q < 16) {- const l = (q - 3) * BEAT;- G.maskText(ctx, 'IMAGINE ONE ASIA', W / 2, 720, F.en(900, 150), G.INK, inv(0, 0.8, l), { ls: '-3px', align: 'center' });- G.maskText(ctx, 'ここで、ひとつに。', W / 2, 815, F.jp(700, 48), G.INK, inv(0.5, 1.4, l), { ls: '14px', align: 'center' });- if (!EJ) G.maskText(ctx, '在这里,合而为一', W / 2, 885, F.zh(500, 34), rgba(G.INK, 0.7), inv(0.9, 1.8, l), { ls: '18px', align: 'center' });- } else {- const l = (q - 16) * BEAT;- G.maskText(ctx, 'AICHI-NAGOYA 2026', W / 2, 700, F.en(900, 120), G.INK, inv(0, 0.5, l), { ls: '-3px', align: 'center' });- G.maskText(ctx, 'THE 20TH ASIAN GAMES · 2026.9.19 — 10.4', W / 2, 780, F.mono(26), rgba(G.INK, 0.7), inv(0.2, 0.8, l), { ls: '6px', align: 'center' });- G.maskText(ctx, EJ ? '第20回アジア競技大会 · 愛知・名古屋' : '第20届亚洲运动会 · 爱知 · 名古屋', W / 2, 850, F2(700, 36), G.INK, inv(0.35, 1, l), { ls: '8px', align: 'center' });- // Five-colour bar- for (let i = 0; i < 5; i++) {- const p = E.o5(inv(0.3 + i * 0.06, 1.1 + i * 0.06, l));- ctx.fillStyle = PAL[RINGS[i]].t[2]; ctx.fillRect(W / 2 - 300 + i * 120, 920, 110 * p, 10);- }- // End credit (the uniform Lemo-Opuscar credit): below the five-colour bar, DM Mono, fades out with the end card- G.maskText(ctx, 'LemoLab × Claude Opus 5.5', W / 2, 1000, F.mono(24), rgba(G.INK, 0.6), inv(0.6, 1.2, l), { ls: '4px', align: 'center' });- // Final fade-out- const fo = E.io(inv(EDL.shots[EDL.shots.length - 1].dur - 1.3, EDL.shots[EDL.shots.length - 1].dur - 0.1, lt));- if (fo > 0) { ctx.fillStyle = rgba('#000000', fo); ctx.fillRect(0, 0, W, H); }- }- }-- // ───────── HUD (persistent overlay) ─────────- function hud(ctx, s, lt) {- if (s.kind !== 'card' && s.kind !== 'chapter') return;- const pk = s.pk;- const fg = s.kind === 'chapter' && s.pal === 'multi' ? G.CREAM : PAL[pk].fg;- const a = 0.8;- ctx.save();- ctx.font = F.mono(17); ctx.letterSpacing = '3px'; ctx.fillStyle = rgba(fg, a);- ctx.textAlign = 'left';- ctx.fillText('THE 20TH ASIAN GAMES', 64, 70); ctx.fillText('AICHI-NAGOYA 2026', 64, 96);- ctx.textAlign = 'right';- const ch = SH.filter((x) => x.kind === 'chapter' && x.t0 <= s.t0).pop();- ctx.fillText('CH.' + ch.no + ' ' + ch.en, W - 64, 70);- ctx.fillText('9.19 — 10.4', W - 64, 96);- // Progress: 43 ticks- const x0 = 64, x1 = W - 64, y = H - 58;- const cur = s.kind === 'card' ? s.n : 0;- for (let i = 1; i <= 43; i++) {- const x = lerp(x0, x1, (i - 1) / 42);- const done = i < cur, now = i === cur;- ctx.fillStyle = rgba(fg, now ? 1 : done ? 0.75 : 0.28);- ctx.fillRect(Math.round(x) - (now ? 2 : 1), y - (now ? 14 : 6), now ? 4 : 2, now ? 20 : 12);- }- ctx.restore();- }-- // ───────── Scene dispatch ─────────- function drawShot(ctx, s, lt) {- ctx.save();- if (s.kind === 'intro') introScene(ctx, s, lt);- else if (s.kind === 'chapter') chapterScene(ctx, s, lt);- else if (s.kind === 'finale') finaleScene(ctx, s, lt);- else if (s.track) trackScene(ctx, s, lt);- else cardScene(ctx, s, lt);- ctx.restore();- }-- // ───────── Transitions ─────────- const TA = 0.12, TB = 0.26;- function transType(a, b) {- if (a.track && b.track) return 'none';- if (a.kind === 'intro') return 'rows';- if (b.kind === 'chapter') return 'rows';- if (b.kind === 'finale') return 'quarter';- if (a.kind === 'chapter') return 'cols';- if (b.beats <= 2 || a.beats <= 2) return b.racket ? 'slide' : 'cols';- return ['quarter', 'rows', 'iris', 'flip', 'cols'][b.ci % 5];- }- const bufA = G.canvas(), bufB = G.canvas();- function composite(ctx, type, p, A, B, b) {- const S = CELL;- if (type === 'rows') {- ctx.drawImage(A, 0, 0);- for (let j = 0; j < 6; j++) {- const pj = E.ioExp(clamp(p * 1.5 - j * 0.1));- const dir = j % 2 ? 1 : -1;- ctx.drawImage(A, 0, j * S, W, S, dir * W * 0.25 * pj, j * S, W, S);- ctx.drawImage(B, 0, j * S, W, S, -dir * W * (1 - pj), j * S, W, S);- }- } else if (type === 'cols') {- const cw = 240;- ctx.drawImage(A, 0, 0);- for (let i = 0; i < 8; i++) {- const pj = E.ioExp(clamp(p * 1.5 - i * 0.07));- const dir = i % 2 ? 1 : -1;- ctx.drawImage(B, i * cw, 0, cw, H, i * cw, -dir * H * (1 - pj), cw, H);- }- } else if (type === 'slide') {- const pj = E.ioExp(p);- ctx.drawImage(A, -W * 0.3 * pj, 0);- ctx.drawImage(B, W * (1 - pj), 0);- ctx.fillStyle = rgba('#000', 0.15 * (1 - Math.abs(pj - 0.5) * 2)); ctx.fillRect(W * (1 - pj) - 8, 0, 8, H);- } else if (type === 'quarter') {- ctx.drawImage(A, 0, 0);- ctx.save(); ctx.beginPath();- for (let j = 0; j < 6; j++) for (let i = 0; i < 11; i++) {- const d = (i + j) * 0.035;- const r = S * 1.42 * E.o3(clamp((p - d) / 0.55));- if (r <= 0) continue;- const corner = (i + j) % 4;- const cx = i * S + (corner === 1 || corner === 2 ? S : 0), cy = j * S + (corner >= 2 ? S : 0);- ctx.save(); ctx.rect(i * S, j * S, S, S); ctx.restore();- ctx.moveTo(cx, cy); ctx.arc(cx, cy, r, 0, Math.PI * 2);- }- ctx.clip();- // Should take effect only inside each cell: clipping again with the cell rectangle is awkward, so a size limit approximates it (r ≤ 1.42S covers this cell and spills slightly into neighbours, which looks more organic)- ctx.drawImage(B, 0, 0);- ctx.restore();- } else if (type === 'iris') {- ctx.drawImage(A, 0, 0);- const cx = b.x || W / 2, cy = b.y || H / 2;- const r = 1300 * E.ioExp(p);- ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, Math.PI * 2); ctx.clip(); ctx.drawImage(B, 0, 0); ctx.restore();- G.ring(ctx, cx, cy, r, 22 * (1 - p), b.ring || G.CREAM);- } else if (type === 'flip') {- const cols = 11, rows = 6;- // Behind the flipping card, first lay a darkened B so no black shows when the card is edge-on- ctx.drawImage(B, 0, 0); ctx.fillStyle = rgba('#000', 0.45); ctx.fillRect(0, 0, W, H);- for (let j = 0; j < rows; j++) for (let i = 0; i < cols; i++) {- const d = ((i * 0.6 + j) / (cols * 0.6 + rows)) * 0.5;- const pc = clamp((p - d) / 0.5);- const src = pc < 0.5 ? A : B;- const sx = Math.abs(Math.cos(pc * Math.PI));- const x = i * S, y = j * S;- const w = S * sx;- ctx.drawImage(src, x, y, S, S, x + (S - w) / 2, y, Math.max(1, w), S);- if (pc > 0 && pc < 1) { ctx.fillStyle = rgba('#000', 0.35 * (1 - sx)); ctx.fillRect(x + (S - w) / 2, y, w, S); }- }- }- }-- // ───────── Frame ─────────- function shotAt(t) {- let lo = 0, hi = SH.length - 1;- while (lo < hi) { const m = (lo + hi + 1) >> 1; if (SH[m].t0 <= t) lo = m; else hi = m - 1; }- return lo;- }- function frame(ctx, t) {- t = clamp(t, 0, EDL.DUR - 1e-6);- let i = shotAt(t);- let s = SH[i];- // Which transition window does this fall in?- let tr = null;- const nx = SH[i + 1];- if (nx && t >= nx.t0 - TA) tr = [s, nx];- else if (i > 0 && t < s.t0 + TB) tr = [SH[i - 1], s];- if (tr) {- const [a, b] = tr, type = transType(a, b);- if (type !== 'none') {- const p = clamp((t - (b.t0 - TA)) / (TA + TB));- const ca = bufA.getContext('2d'), cb = bufB.getContext('2d');- ca.setTransform(1, 0, 0, 1, 0, 0); cb.setTransform(1, 0, 0, 1, 0, 0);- drawShot(ca, a, t - a.t0); drawShot(cb, b, Math.max(0, t - b.t0));- const info = { x: a.kind === 'card' && !a.track ? (layoutOf(a) === 'B' ? W / 2 : layoutOf(a) === 'M' ? 640 : layoutOf(a) === 'C' ? 1370 : 1290) : W / 2, y: 540, ring: PAL[b.pk || 'red'] ? PAL[b.pk || 'red'].t[4] : G.CREAM };- composite(ctx, type, p, bufA, bufB, info);- hud(ctx, p < 0.5 ? a : b, t - (p < 0.5 ? a : b).t0);- return;- }- s = t < b.t0 ? a : b;- }- drawShot(ctx, s, t - s.t0);- hud(ctx, s, t - s.t0);- }- // Moments that need motion blur: transition windows, athletics whip pans, opening impacts- function isFast(t) {- const i = shotAt(t), s = SH[i], nx = SH[i + 1];- if (nx && t >= nx.t0 - TA - 0.02) return true;- if (i > 0 && t < s.t0 + TB + 0.02) return true;- return false;- }- const bufSub = G.canvas();- G.renderFrame = function (ctx, t) {- if (!isFast(t)) { ctx.setTransform(1, 0, 0, 1, 0, 0); frame(ctx, t); return; }- const N = 5, shutter = 0.5 / 60;- const sc = bufSub.getContext('2d');- for (let k = 0; k < N; k++) {- sc.setTransform(1, 0, 0, 1, 0, 0);- frame(sc, t - shutter / 2 + (shutter * k) / (N - 1));- ctx.globalAlpha = 1 / (k + 1);- ctx.drawImage(bufSub, 0, 0);- }- ctx.globalAlpha = 1;- };- G.layoutOf = layoutOf;-})();diff --git a/styles/pictogram-motion/demo/sheet.py b/styles/pictogram-motion/demo/sheet.pydeleted file mode 100644index b76ab4c..0000000--- a/styles/pictogram-motion/demo/sheet.py+++ /dev/null@@ -1,13 +0,0 @@-import sys-from PIL import Image, ImageDraw-files = sys.argv[2:]; out = sys.argv[1]-cols = 3 if len(files) > 4 else 2-w, h = 640, 360-rows = (len(files) + cols - 1) // cols-S = Image.new('RGB', (cols * w, rows * h), 'black')-for i, f in enumerate(files):- im = Image.open(f).resize((w, h), Image.LANCZOS)- d = ImageDraw.Draw(im); lab = f.split('t_')[-1].rsplit('.', 1)[0]- d.rectangle([0, 0, 8 * len(lab) + 12, 20], fill='black'); d.text((6, 4), lab, fill='white')- S.paste(im, ((i % cols) * w, (i // cols) * h))-S.save(out, quality=88)diff --git a/styles/pictogram-motion/demo/shot.mjs b/styles/pictogram-motion/demo/shot.mjsdeleted file mode 100644index 55a5373..0000000--- a/styles/pictogram-motion/demo/shot.mjs+++ /dev/null@@ -1,28 +0,0 @@-// Usage: node shot.mjs 1.0 6.8 20.1 ... → stills/t_*.jpg ; add --sheet to tile them into one image-import { chromium } from 'playwright-core';-import path from 'path';-import { execSync } from 'child_process';-import fs from 'fs';-import { EXE } from '../../../core/render/browser.mjs';-// Language: LANGQ=ej (default, English/Japanese version) / LANGQ=zh (Chinese version). Run from the demo/ folder.-const LANGQ = process.env.LANGQ || 'ej';-const PY = fs.existsSync('../../../.venv/bin/python') ? '../../../.venv/bin/python' : '/usr/bin/python3';-const args = process.argv.slice(2).filter((a) => !a.startsWith('--'));-const sheet = process.argv.includes('--sheet');-const b = await chromium.launch({ executablePath: EXE, args: ['--allow-file-access-from-files'] });-const p = await b.newPage({ viewport: { width: 1920, height: 1080 } });-p.on('pageerror', (e) => console.error('[pageerror]', e.message));-p.on('console', (m) => { if (m.type() === 'error' && !/ERR_FILE_NOT_FOUND/.test(m.text())) console.error('[page]', m.text()); });-await p.goto('file://' + path.resolve('index.html') + '?lang=' + LANGQ);-await p.waitForFunction(() => window.READY === true, null, { timeout: 60000 });-const files = [];-for (const ts of args) {- await p.evaluate((t) => window.render(t), parseFloat(ts));- const f = `stills/t_${ts}.jpg`; files.push(f);- await p.screenshot({ path: f, type: 'jpeg', quality: 85 });-}-await b.close();-if (sheet && files.length) {- execSync(`${PY} sheet.py stills/sheet.jpg ${files.join(' ')}`);- console.log('stills/sheet.jpg');-}diff --git a/styles/pictogram-motion/demo/srt.cjs b/styles/pictogram-motion/demo/srt.cjsdeleted file mode 100644index 5529514..0000000--- a/styles/pictogram-motion/demo/srt.cjs+++ /dev/null@@ -1,37 +0,0 @@-// Title-card subtitles: the film has no narration, so this exports the on-screen title cards, following the edit list, as an .srt (English/Japanese version text)-// Usage (from the demo/ folder): node srt.cjs [../pictogram-motion.srt]-const fs = require('fs'), path = require('path'), vm = require('vm');-const sb = {};-vm.runInNewContext(fs.readFileSync(path.join(__dirname, 'edl.js'), 'utf8'), sb);-const E = sb.EDL, B = E.BEAT;-const cues = [];-const cue = (t0, t1, text) => cues.push({ t0, t1, text });--// Opening (intro, 48 beats, see introScene in scenes.js)-cue(1.0, 6.4, '2026 · AICHI – NAGOYA · JAPAN');-cue(6.4 + 1.0 * B, 12.8, 'THE 20TH ASIAN GAMES\nAICHI-NAGOYA 2026 · 第20回アジア競技大会');-cue(12.8, 14.4, '43 SPORTS · 競技');-cue(14.4, 16.0, '469 EVENTS · 種目');-cue(16.0, 17.6, '16 DAYS · 9.19 — 10.4');-cue(17.6, 18.4, 'ON YOUR MARKS · 位置について');-cue(18.4, 19.2, 'SET · よーい');--for (const s of E.shots) {- const t0 = s.t0, t1 = s.t0 + s.dur;- if (s.kind === 'chapter') cue(t0, t1, `CHAPTER ${s.no} · ${s.en}\n${s.jp}`);- else if (s.kind === 'card') {- const fam = s.fam ? `${s.en} — ${s.sub}` : s.en + (s.sub ? ` (${s.sub})` : '');- cue(t0, t1, `${String(s.n).padStart(2, '0')}/43 ${fam}\n${s.jpBig || s.jp}`);- } else if (s.kind === 'finale') {- cue(t0, t0 + 20 * B, 'ALL 43 SPORTS');- cue(t0 + 23 * B, t0 + 36 * B, 'IMAGINE ONE ASIA\nここで、ひとつに。');- cue(t0 + 36 * B, t1 - 0.2, 'AICHI-NAGOYA 2026\nTHE 20TH ASIAN GAMES · 2026.9.19 — 10.4\nLemoLab × Claude Opus 5.5');- }-}-const ts = (t) => {- const ms = Math.round(t * 1000), h = Math.floor(ms / 3600000), m = Math.floor(ms / 60000) % 60, s = Math.floor(ms / 1000) % 60;- return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')},${String(ms % 1000).padStart(3, '0')}`;-};-const out = process.argv[2] || path.join(__dirname, '..', 'pictogram-motion.srt');-fs.writeFileSync(out, cues.map((c, i) => `${i + 1}\n${ts(c.t0)} --> ${ts(c.t1)}\n${c.text}\n`).join('\n'));-console.log(cues.length, 'cues →', out);diff --git a/styles/pictogram-motion/demo/stills/styleframe.jpg b/styles/pictogram-motion/demo/stills/styleframe.jpgindex 125877c..a034aa2 100644Binary files a/styles/pictogram-motion/demo/stills/styleframe.jpg and b/styles/pictogram-motion/demo/stills/styleframe.jpg differdiff --git a/styles/pictogram-motion/demo/tools/cues.py b/styles/pictogram-motion/demo/tools/cues.pynew file mode 100644index 0000000..83af939--- /dev/null+++ b/styles/pictogram-motion/demo/tools/cues.py@@ -0,0 +1,28 @@+"""Subtitle cues from voice/vo.json (start times) + out/voice/dur.json (TTS lengths).+Writes voice/cues.js (for the page) and an .srt for the span [a, b] (film seconds); default ../pictogram-motion.srt.+usage: cues.py [a b out.srt]"""+import json, sys, os+HERE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+vo = json.load(open(f'{HERE}/voice/vo.json'))+dur = json.load(open(f'{HERE}/out/voice/dur.json'))+cues = []+for i, v in enumerate(vo):+ d = dur[v['id']]+ t1 = max(v['t'] + 1.8, v['t'] + d + 0.6)+ if i + 1 < len(vo): t1 = min(t1, vo[i + 1]['t'] - 0.15)+ assert t1 - v['t'] >= max(1.8, d + 0.6) - 1e-6, (v['id'], 'subtitle too short')+ cues.append(dict(id=v['id'], t0=v['t'], t1=round(t1, 3), vo_end=round(v['t'] + d, 3), en=v['en'], zh=v['zh']))+open(f'{HERE}/voice/cues.js', 'w').write('window.CUES = ' + json.dumps(cues, ensure_ascii=False, indent=1) + ';\n')+a = float(sys.argv[1]) if len(sys.argv) > 1 else 0.0+b = float(sys.argv[2]) if len(sys.argv) > 2 else 1e9+out = sys.argv[3] if len(sys.argv) > 3 else os.path.join(os.path.dirname(HERE), 'pictogram-motion.srt')+def ts(x):+ ms = int(round(x * 1000)); h, ms = divmod(ms, 3600000); m, ms = divmod(ms, 60000); s, ms = divmod(ms, 1000)+ return f'{h:02}:{m:02}:{s:02},{ms:03}'+n, lines = 0, []+for c in cues:+ if c['t1'] <= a or c['t0'] >= b: continue+ n += 1+ lines += [str(n), f"{ts(max(c['t0'], a) - a)} --> {ts(min(c['t1'], b) - a)}", c['zh'], c['en'], '']+open(out, 'w').write('\n'.join(lines))+print('cues', len(cues), '→', out, n, 'in span')diff --git a/styles/pictogram-motion/demo/tools/fetch_fonts.sh b/styles/pictogram-motion/demo/tools/fetch_fonts.shnew file mode 100755index 0000000..fc5cf71--- /dev/null+++ b/styles/pictogram-motion/demo/tools/fetch_fonts.sh@@ -0,0 +1,8 @@+#!/bin/sh+# Downloads the three OFL fonts the film uses into demo/fonts/ when they are missing (Google Fonts repository).+set -e+F=$(cd "$(dirname "$0")/.." && pwd)/fonts+get() { [ -s "$F/$1" ] || { echo "fetching $1"; curl -fsSL --retry 3 -o "$F/$1" "https://github.com/google/fonts/raw/main/ofl/$2"; }; }+get InterTightwght.ttf 'intertight/InterTight%5Bwght%5D.ttf'+get DMMono-Medium.ttf 'dmmono/DMMono-Medium.ttf'+get NotoSansSCwght.ttf 'notosanssc/NotoSansSC%5Bwght%5D.ttf'diff --git a/styles/pictogram-motion/demo/voice/cues.js b/styles/pictogram-motion/demo/voice/cues.jsnew file mode 100644index 0000000..1ae58e3--- /dev/null+++ b/styles/pictogram-motion/demo/voice/cues.js@@ -0,0 +1,66 @@+window.CUES = [+ {+ "id": "L1",+ "t0": 0.4,+ "t1": 3.636,+ "vo_end": 3.036,+ "en": "7:42. Rain on Line 4.",+ "zh": "7:42,4 路车上在下雨。"+ },+ {+ "id": "L2",+ "t0": 3.9,+ "t1": 8.648,+ "vo_end": 8.048,+ "en": "Then the sun came out, and someone forgot their umbrella.",+ "zh": "后来太阳出来了,有人把伞忘在了车上。"+ },+ {+ "id": "L3",+ "t0": 11.0,+ "t1": 16.67,+ "vo_end": 16.07,+ "en": "It rode the line all day. Nobody needs an umbrella in the sun.",+ "zh": "它坐着车跑了一整天。晴天里,谁也不需要伞。"+ },+ {+ "id": "L4",+ "t0": 19.6,+ "t1": 25.225,+ "vo_end": 24.625,+ "en": "At the end of the line, it joined 312 others.",+ "zh": "到了终点站,它和另外 312 把伞待在了一起。"+ },+ {+ "id": "L5",+ "t0": 28.4,+ "t1": 32.093,+ "vo_end": 31.493,+ "en": "Then, at rush hour, the storm came back.",+ "zh": "后来,晚高峰,暴雨又来了。"+ },+ {+ "id": "L6",+ "t0": 33.9,+ "t1": 37.202,+ "vo_end": 36.602,+ "en": "The depot opened every shelf.",+ "zh": "车场打开了所有的货架。"+ },+ {+ "id": "L7",+ "t0": 37.4,+ "t1": 42.715,+ "vo_end": 42.115,+ "en": "313 umbrellas went back out into the rain.",+ "zh": "313 把伞,回到了雨里。"+ },+ {+ "id": "L8",+ "t0": 44.3,+ "t1": 49.052,+ "vo_end": 48.452,+ "en": "Lost on a sunny day. Found on a rainy one.",+ "zh": "晴天里丢的,雨天里找到了用处。"+ }+];diff --git a/styles/pictogram-motion/demo/voice/lines.json b/styles/pictogram-motion/demo/voice/lines.jsonnew file mode 100644index 0000000..89ccd41--- /dev/null+++ b/styles/pictogram-motion/demo/voice/lines.json@@ -0,0 +1,59 @@+[+ {+ "id": "L1",+ "text": "Seven forty-two. Rain on Line Four.",+ "voice": "bf_emma",+ "speed": 0.84,+ "lang": "en-gb",+ "asr": "742, rain on line 4."+ },+ {+ "id": "L2",+ "text": "Then the sun came out, and someone forgot their umbrella.",+ "voice": "bf_emma",+ "speed": 0.74,+ "lang": "en-gb"+ },+ {+ "id": "L3",+ "text": "It rode the line all day. Nobody needs an umbrella in the sun.",+ "voice": "bf_emma",+ "speed": 0.74,+ "lang": "en-gb"+ },+ {+ "id": "L4",+ "text": "At the end of the line, it joined three hundred and twelve others.",+ "voice": "bf_emma",+ "speed": 0.66,+ "lang": "en-gb"+ },+ {+ "id": "L5",+ "text": "Then, at rush hour, the storm came back.",+ "voice": "bf_emma",+ "speed": 0.74,+ "lang": "en-gb"+ },+ {+ "id": "L6",+ "text": "The depot opened every shelf.",+ "voice": "bf_emma",+ "speed": 0.72,+ "lang": "en-gb"+ },+ {+ "id": "L7",+ "text": "Three hundred and thirteen umbrellas went back out into the rain.",+ "voice": "bf_emma",+ "speed": 0.74,+ "lang": "en-gb"+ },+ {+ "id": "L8",+ "text": "Lost on a sunny day. Found on a rainy one.",+ "voice": "bf_emma",+ "speed": 0.66,+ "lang": "en-gb"+ }+]\ No newline at end of filediff --git a/styles/pictogram-motion/demo/voice/vo.json b/styles/pictogram-motion/demo/voice/vo.jsonnew file mode 100644index 0000000..4ecbe21--- /dev/null+++ b/styles/pictogram-motion/demo/voice/vo.json@@ -0,0 +1,50 @@+[+ {+ "id": "L1",+ "t": 0.4,+ "en": "7:42. Rain on Line 4.",+ "zh": "7:42,4 路车上在下雨。"+ },+ {+ "id": "L2",+ "t": 3.9,+ "en": "Then the sun came out, and someone forgot their umbrella.",+ "zh": "后来太阳出来了,有人把伞忘在了车上。"+ },+ {+ "id": "L3",+ "t": 11.0,+ "en": "It rode the line all day. Nobody needs an umbrella in the sun.",+ "zh": "它坐着车跑了一整天。晴天里,谁也不需要伞。"+ },+ {+ "id": "L4",+ "t": 19.6,+ "en": "At the end of the line, it joined 312 others.",+ "zh": "到了终点站,它和另外 312 把伞待在了一起。"+ },+ {+ "id": "L5",+ "t": 28.4,+ "en": "Then, at rush hour, the storm came back.",+ "zh": "后来,晚高峰,暴雨又来了。"+ },+ {+ "id": "L6",+ "t": 33.9,+ "en": "The depot opened every shelf.",+ "zh": "车场打开了所有的货架。"+ },+ {+ "id": "L7",+ "t": 37.4,+ "en": "313 umbrellas went back out into the rain.",+ "zh": "313 把伞,回到了雨里。"+ },+ {+ "id": "L8",+ "t": 44.3,+ "en": "Lost on a sunny day. Found on a rainy one.",+ "zh": "晴天里丢的,雨天里找到了用处。"+ }+]\ No newline at end of filediff --git a/styles/pictogram-motion/pictogram-motion.srt b/styles/pictogram-motion/pictogram-motion.srtindex 17b34cb..5882078 100644--- a/styles/pictogram-motion/pictogram-motion.srt+++ b/styles/pictogram-motion/pictogram-motion.srt@@ -1,428 +1,39 @@1-00:00:01,000 --> 00:00:06,400-2026 · AICHI – NAGOYA · JAPAN+00:00:00,400 --> 00:00:03,636+7:42,4 路车上在下雨。+7:42. Rain on Line 4.2-00:00:06,800 --> 00:00:12,800-THE 20TH ASIAN GAMES-AICHI-NAGOYA 2026 · 第20回アジア競技大会+00:00:03,900 --> 00:00:08,648+后来太阳出来了,有人把伞忘在了车上。+Then the sun came out, and someone forgot their umbrella.3-00:00:12,800 --> 00:00:14,400-43 SPORTS · 競技+00:00:11,000 --> 00:00:16,670+它坐着车跑了一整天。晴天里,谁也不需要伞。+It rode the line all day. Nobody needs an umbrella in the sun.4-00:00:14,400 --> 00:00:16,000-469 EVENTS · 種目+00:00:19,600 --> 00:00:25,225+到了终点站,它和另外 312 把伞待在了一起。+At the end of the line, it joined 312 others.5-00:00:16,000 --> 00:00:17,600-16 DAYS · 9.19 — 10.4+00:00:28,400 --> 00:00:32,093+后来,晚高峰,暴雨又来了。+Then, at rush hour, the storm came back.6-00:00:17,600 --> 00:00:18,400-ON YOUR MARKS · 位置について+00:00:33,900 --> 00:00:37,202+车场打开了所有的货架。+The depot opened every shelf.7-00:00:18,400 --> 00:00:19,200-SET · よーい+00:00:37,400 --> 00:00:42,715+313 把伞,回到了雨里。+313 umbrellas went back out into the rain.8-00:00:19,200 --> 00:00:22,400-CHAPTER 01 · ATHLETICS-陸上競技--9-00:00:22,400 --> 00:00:24,000-01/43 ATHLETICS — SPRINT-短距離--10-00:00:24,000 --> 00:00:25,600-01/43 ATHLETICS — HURDLES-ハードル--11-00:00:25,600 --> 00:00:27,200-01/43 ATHLETICS — RELAY-リレー--12-00:00:27,200 --> 00:00:28,800-01/43 ATHLETICS — MIDDLE & LONG-中長距離--13-00:00:28,800 --> 00:00:30,400-01/43 ATHLETICS — STEEPLECHASE-障害--14-00:00:30,400 --> 00:00:32,000-01/43 ATHLETICS — MARATHON-マラソン--15-00:00:32,000 --> 00:00:33,600-01/43 ATHLETICS — RACE WALK-競歩--16-00:00:33,600 --> 00:00:35,200-01/43 ATHLETICS — HIGH JUMP-走高跳--17-00:00:35,200 --> 00:00:36,800-01/43 ATHLETICS — POLE VAULT-棒高跳--18-00:00:36,800 --> 00:00:38,400-01/43 ATHLETICS — LONG & TRIPLE JUMP-走幅跳・三段跳--19-00:00:38,400 --> 00:00:40,000-01/43 ATHLETICS — SHOT PUT-砲丸投--20-00:00:40,000 --> 00:00:41,600-01/43 ATHLETICS — DISCUS-円盤投--21-00:00:41,600 --> 00:00:43,200-01/43 ATHLETICS — HAMMER-ハンマー投--22-00:00:43,200 --> 00:00:44,800-01/43 ATHLETICS — JAVELIN-やり投--23-00:00:44,800 --> 00:00:48,000-CHAPTER 02 · AQUATICS-水泳--24-00:00:48,000 --> 00:00:48,800-02/43 SWIMMING — FREESTYLE-自由形--25-00:00:48,800 --> 00:00:49,600-02/43 SWIMMING — BREASTSTROKE-平泳ぎ--26-00:00:49,600 --> 00:00:50,400-02/43 SWIMMING — BACKSTROKE-背泳ぎ--27-00:00:50,400 --> 00:00:51,200-02/43 SWIMMING — BUTTERFLY-バタフライ--28-00:00:51,200 --> 00:00:52,800-02/43 DIVING-飛込--29-00:00:52,800 --> 00:00:54,400-02/43 ARTISTIC SWIMMING-アーティスティックスイミング--30-00:00:54,400 --> 00:00:56,000-02/43 WATER POLO-水球--31-00:00:56,000 --> 00:00:59,200-CHAPTER 03 · BALL GAMES-球技--32-00:00:59,200 --> 00:01:00,800-03/43 FOOTBALL-サッカー--33-00:01:00,800 --> 00:01:02,400-04/43 BASKETBALL (5×5 · 3×3)-バスケットボール--34-00:01:02,400 --> 00:01:04,000-05/43 VOLLEYBALL (INDOOR · BEACH)-バレーボール--35-00:01:04,000 --> 00:01:05,600-06/43 HANDBALL-ハンドボール--36-00:01:05,600 --> 00:01:07,200-07/43 HOCKEY-ホッケー--37-00:01:07,200 --> 00:01:08,800-08/43 RUGBY SEVENS-7人制ラグビー--38-00:01:08,800 --> 00:01:10,400-09/43 BASEBALL · SOFTBALL-野球・ソフトボール--39-00:01:10,400 --> 00:01:12,000-10/43 CRICKET (T20)-クリケット--40-00:01:12,000 --> 00:01:13,600-11/43 GOLF-ゴルフ--41-00:01:13,600 --> 00:01:14,400-12/43 BADMINTON-バドミントン--42-00:01:14,400 --> 00:01:15,200-13/43 TABLE TENNIS-卓球--43-00:01:15,200 --> 00:01:16,000-14/43 TENNIS-テニス--44-00:01:16,000 --> 00:01:16,800-14/43 SOFT TENNIS (TENNIS)-ソフトテニス--45-00:01:16,800 --> 00:01:17,600-15/43 SQUASH-スカッシュ--46-00:01:17,600 --> 00:01:18,400-16/43 PADEL (NEW)-パデル--47-00:01:18,400 --> 00:01:20,000-17/43 TEQBALL (NEW)-テックボール--48-00:01:20,000 --> 00:01:23,200-CHAPTER 04 · COMBAT-格闘技--49-00:01:23,200 --> 00:01:24,800-18/43 JUDO-柔道--50-00:01:24,800 --> 00:01:26,400-19/43 KARATE-空手--51-00:01:26,400 --> 00:01:28,000-20/43 TAEKWONDO-テコンドー--52-00:01:28,000 --> 00:01:29,600-21/43 BOXING-ボクシング--53-00:01:29,600 --> 00:01:31,200-22/43 WRESTLING-レスリング--54-00:01:31,200 --> 00:01:32,800-23/43 FENCING-フェンシング--55-00:01:32,800 --> 00:01:34,400-24/43 JU-JITSU-柔術--56-00:01:34,400 --> 00:01:36,000-24/43 KURASH-クラッシュ--57-00:01:36,000 --> 00:01:37,600-24/43 MMA-総合格闘技--58-00:01:37,600 --> 00:01:40,800-CHAPTER 05 · POWER & PRECISION-力と精度--59-00:01:40,800 --> 00:01:42,400-25/43 WEIGHTLIFTING-ウエイトリフティング--60-00:01:42,400 --> 00:01:44,000-26/43 SHOOTING-射撃--61-00:01:44,000 --> 00:01:45,600-27/43 ARCHERY-アーチェリー--62-00:01:45,600 --> 00:01:47,200-28/43 GYMNASTICS — ARTISTIC-体操競技--63-00:01:47,200 --> 00:01:48,800-28/43 GYMNASTICS — RHYTHMIC-新体操--64-00:01:48,800 --> 00:01:50,400-28/43 GYMNASTICS — TRAMPOLINE-トランポリン--65-00:01:50,400 --> 00:01:52,000-29/43 MODERN PENTATHLON-近代五種--66-00:01:52,000 --> 00:01:55,200-CHAPTER 06 · LAND & SEA-山と海--67-00:01:55,200 --> 00:01:56,800-30/43 ROWING-ボート--68-00:01:56,800 --> 00:01:58,400-31/43 CANOE (SPRINT · SLALOM)-カヌー--69-00:01:58,400 --> 00:02:00,000-32/43 SAILING-セーリング--70-00:02:00,000 --> 00:02:01,600-33/43 SURFING (NEW)-サーフィン--71-00:02:01,600 --> 00:02:03,200-34/43 TRIATHLON-トライアスロン--72-00:02:03,200 --> 00:02:04,000-35/43 CYCLING — ROAD-ロード--73-00:02:04,000 --> 00:02:04,800-35/43 CYCLING — TRACK-トラック--74-00:02:04,800 --> 00:02:05,600-35/43 CYCLING — BMX-BMX--75-00:02:05,600 --> 00:02:06,400-35/43 CYCLING — MOUNTAIN BIKE-マウンテンバイク--76-00:02:06,400 --> 00:02:08,000-36/43 EQUESTRIAN-馬術--77-00:02:08,000 --> 00:02:11,200-CHAPTER 07 · ASIA & NEW WAVE-アジアと新時代--78-00:02:11,200 --> 00:02:12,800-37/43 KABADDI-カバディ--79-00:02:12,800 --> 00:02:14,400-38/43 SEPAK TAKRAW-セパタクロー--80-00:02:14,400 --> 00:02:16,000-39/43 WUSHU-武術--81-00:02:16,000 --> 00:02:17,600-40/43 SKATEBOARDING-スケートボード--82-00:02:17,600 --> 00:02:19,200-41/43 SPORT CLIMBING-スポーツクライミング--83-00:02:19,200 --> 00:02:20,800-42/43 BREAKING-ブレイキン--84-00:02:20,800 --> 00:02:22,400-43/43 ESPORTS-eスポーツ--85-00:02:22,400 --> 00:02:30,400-ALL 43 SPORTS--86-00:02:31,600 --> 00:02:36,800-IMAGINE ONE ASIA-ここで、ひとつに。--87-00:02:36,800 --> 00:02:41,400-AICHI-NAGOYA 2026-THE 20TH ASIAN GAMES · 2026.9.19 — 10.4-LemoLab × Claude Opus 5.5+00:00:44,300 --> 00:00:49,052+晴天里丢的,雨天里找到了用处。+Lost on a sunny day. Found on a rainy one.diff --git a/styles/pictogram-motion/poster.jpg b/styles/pictogram-motion/poster.jpgindex 125877c..a034aa2 100644Binary files a/styles/pictogram-motion/poster.jpg and b/styles/pictogram-motion/poster.jpg differdiff --git a/styles/pictogram-motion/style.json b/styles/pictogram-motion/style.jsonindex d53eea6..f964c69 100644--- a/styles/pictogram-motion/style.json+++ b/styles/pictogram-motion/style.json@@ -5,14 +5,14 @@"cn": "象形运动图形","category_en": "Graphic & Type","category_cn": "图形与排版",- "film": "Aichi-Nagoya 2026 — All 43 Sports",- "line": "All 43 sports of the 2026 Asian Games as beat-locked geometric pictograms.",- "line_cn": "2026 亚运会 43 个大项,几何象形人卡着节拍快闪。",+ "film": "Left Behind",+ "line": "A yellow umbrella left on a bus waits out a sunny day on the lost-property shelf, then opens with 312 others when the storm comes back: objects, vehicles, weather and signs as beat-locked geometric pictograms.",+ "line_cn": "一把被落在公交车上的黄伞,晴天里在失物招领的货架上等了一整天,暴雨回来时和另外 312 把一起撑开:物件、交通、天气和标识,都是卡着节拍的几何象形符号。","uses": [- "Sports events",- "Visual identity",- "Event openers"+ "Public services and city stories",+ "Brand and event identity films",+ "Explainers told through signs and objects"],- "frame_sec": 65.44,- "dur": 163.6+ "frame_sec": 9.2,+ "dur": 50.0}