Files
petal/web/src/components/Companion/companions.ts
prosolis a634994d25 Companion: double the mascot size + drop the sleepy-face nap
- Mascot badge 64→128px (Lottie 56→112, emoji fallback 32→64); zzz glyph
  scaled + repositioned to match. It read too small on screen.
- Awake companions (no sleeping clip, e.g. Happy Dog) no longer show a 😴
  face or drifting "z" when the engine naps them — they hold their idle pose
  via a renderMood redirect. Only the always-asleep cat (real sleep clip)
  keeps the zzz, preserving that gag.

Claude-Session: https://claude.ai/code/session_016Yr6jELuRc7hyzYLccQKZd
2026-06-25 22:35:38 -07:00

50 lines
1.4 KiB
TypeScript

import type { Mood } from './useCompanion'
import sleepingCat from './animations/sleeping-cat.json'
import happyDog from './animations/happy-dog.json'
export interface Companion {
id: string
name: string // English label
zh: string // Chinese label (she reads Mandarin — north star Note #17)
emoji: string // shown in the picker + used as the per-mood fallback base
// mood → Lottie asset. Unmapped moods fall back to the per-mood emoji.
animations: Partial<Record<Mood, object>>
// When true the mascot keeps its calm sway + drifting zzz regardless of mood
// (e.g. a cat that's always asleep but still talks in its sleep).
alwaysAsleep?: boolean
}
// The roster. Add a companion by dropping a pure-vector Lottie JSON into
// ./animations and appending an entry here — that's the whole change.
export const COMPANIONS: Companion[] = [
{
id: 'cat',
name: 'Sleepy Cat',
zh: '瞌睡猫',
emoji: '😴',
alwaysAsleep: true,
animations: {
idle: sleepingCat,
happy: sleepingCat,
talking: sleepingCat,
celebrate: sleepingCat,
sleeping: sleepingCat,
},
},
{
id: 'dog',
name: 'Happy Dog',
zh: '开心狗',
emoji: '🐶',
animations: {
idle: happyDog,
happy: happyDog,
talking: happyDog,
celebrate: happyDog,
// no sleeping clip → stays in its idle pose instead of visibly napping
},
},
]
export const DEFAULT_COMPANION = 'cat'