Skip to content

feat(mascot): layer motion and whole outfits (3.1) - #537

Merged
lorant-one merged 4 commits into
previewfrom
feat/mascot-layer-motion
Nov 23, 2026
Merged

lorant-one merged 4 commits into
previewfrom
feat/mascot-layer-motion

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Requested by Lorant · project thread

This is step 3 of the mascot levels plan. Studio's wardrobe (on the progression switch) dresses each mascot in layers, and this PR gives core what it needs to show those outfits in every app. It's for 3.1 and listed under the 3.1.0 section of the changelog, so it should be merged into the 3.0 branch only after 3.0.0 ships.

What changes

  • motion on MascotIdentityLayer: float, bob, sway, spin, pulse or flicker. A layer can also take an origin ("x y" in the 200 × 200 box) that it turns or grows around.
    • The loop runs on a group around the path, so the layer's own transform stays in place.
    • The animation is CSS only and stops under prefers-reduced-motion.
    • parseMascotDesign keeps known motions and valid origins, and drops anything else.
  • 48 layers per design (it was 16), so one design can hold a hat, glasses, something held, a back piece and a pet.
  • Built-in accessories and layers are drawn together. Before, a built-in accessory replaced the layers; now both show, with the layers drawn over the built-ins. This is a behaviour change only for code that passes both.
  • mascotSvg takes layers and draws them as a still image. That way a saved look renders the same in an OG image, an email or the Discord /level card (step 4).
  • New exports: MASCOT_LAYER_MOTIONS and MascotLayerMotion.
  • A "Layers that move" example in the AI module docs, and a changelog entry.

Checked

  • vitest run src/__tests__/mascot*: 86 pass, including 5 new tests. They cover motion parsing, the 48-layer cap, the motion group and its origin, built-ins drawn with layers, and the still output from mascotSvg.
  • tsc has no errors, and biome is clean on the changed files.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

The visual check flagged 3 shots on /modules/ai. Each one changes size by a single pixel (636×122 → 123, 357 → 356, 411 → 410). That's the page where this PR adds the "Layers that move" example, so the new section shifts the demos below it by a sub-pixel. No other page changed. This is intended, so I added visual-change.


Generated by Claude Code

@lorant-one
lorant-one changed the base branch from feat/3-0-breaking-cleanup to preview November 23, 2026 20:50
@lorant-one
lorant-one merged commit 7154b4d into preview Nov 23, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
27 tasks done
@lorant-one lorant-one added the approved label Nov 24, 2026 — with Claude
@lorant-one
lorant-one deleted the feat/mascot-layer-motion branch November 29, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants