Blobby
- Size:
- Cozy! 100%
- Mood:
- Awake
- Pokes:
- 0
- Snacks:
- 0
Teach Blobby
Suggest a lessonTeach Blobby
Suggest a lessonMake a purple Blobby look sad after a snack!
You asked for red to mean a smile. Blobby has no red swatch, so pink stands in for red: a pink Blobby already grins after a snack. This step makes a purple Blobby look sad after a snack. As a visitor, I want Blobby's colour to show an emotion when I feed it, starting with a purple Blobby turning sad, so that picking a colour changes how Blobby feels. src/features/blob/lib/time-mood.ts: new `sad` mood with the label "Sad", plus `colorSnackMood(color)` (purple → sad, every other colour → happy). `shownMood` takes the snack mood, so a daytime snack shows sad or happy, and night still stays Sleepy. src/features/blob/components/blob-creature.tsx: passes the colour's snack mood to `shownMood`. While Blobby is Sad it draws a frown overlay (`data-testid="blob-frown"`). It fades back to Awake on the existing 4 s HAPPY_MS timer. src/features/blob/components/blob.module.css: a `.sad` class on the body hides the glyph's own calm smile and gulp mouth while the frown shows, so the two mouths don't cross into an X. src/features/blob/feature.manifest.ts: new selectors `frown` and `colorPurple`, a new flow `blob.sad` that walks through every acceptance criterion, and an updated uiLocation. FEATURE_MAP.md is regenerated with `pnpm featuremap`. src/features/blob/tests/time-mood.test.ts: unit tests for `colorSnackMood`, the Sad label, and `shownMood` with a sad snack (day, night, surprised, not fed). src/features/blob/README.md: the mood section notes that a purple Blobby is Sad after a snack.
Make Blobby look surprised when it has evolved since your last visit!
You asked for Blobby to look surprised when a new evolution is merged. Blobby can't watch merges as they happen, so instead it looks surprised the next time you visit if its Evolved count has gone up since you last saw it. As a visitor, I want Blobby to look surprised when a new change has shipped since I last saw it, so that I can tell at a glance that Blobby has evolved again. New src/features/blob/lib/surprise.ts: reads the last-seen Evolved count (`?seen=N` pin, else localStorage `petri.blob.seen.v1`), decides surprised = evolved > seen (a first visit isn't surprised), remembers the new count, and shares the result through a small external store. src/features/blob/components/blob-creature.tsx: EvolvedLink takes an optional `count` and reports it from a ref callback (no effects). BlobCreature reads the store with useSyncExternalStore and draws a `blob-surprised` overlay (raised brows, O mouth). Surprise opens Blobby's eyes at night. src/features/blob/lib/time-mood.ts: new `surprised` mood with the label 'Surprised'. A daytime snack still shows Happy, and Sleepy/Awake are otherwise unchanged. src/app/page.tsx: EvolvedCount passes `count={count}` to EvolvedLink, alongside the label it already passed. feature.manifest.ts: adds the `surprised` selector, a new `blob.surprised` flow covering all 3 acceptance criteria, and an updated uiLocation. FEATURE_MAP.md is regenerated and the README is updated. Tests: new tests/surprise.test.ts (pin parsing, comparison, remembering the count, storage failure) and extra cases in tests/time-mood.test.ts. `pnpm check` passes and all 17 `pnpm verify:all` flows pass.
Make Blobby look happy right after a snack!
You asked for Blobby to look happy when ideas get votes. Blobby can't see votes yet, so this step makes it look happy for a few seconds after you feed it instead. As a visitor, I want Blobby to show a happy mood and smile after I feed it so that it feels like it has real moods, not just sleepy or awake. src/features/blob/lib/time-mood.ts: adds a ShownMood type that includes 'happy', HAPPY_MS = 4000, and shownMood(time, justFed). It returns 'happy' only when it is daytime and Blobby was just fed. timeMoodLabel now also returns 'Happy'. src/features/blob/components/blob-creature.tsx: Feed sets a justFed flag and starts a 4 s timer, restarted on each snack, that clears it. The Mood stat shows the result of shownMood. src/features/blob/components/blob-creature.tsx: while Happy, a grin overlay (data-testid blob-smile, dark D-shaped mouth with a pink tongue) is drawn over the face. It uses the same scale and wobble/breathe classes as the body, so src/shared/ui/blob-glyph.tsx is unchanged. src/features/blob/feature.manifest.ts: adds the smile selector, notes the Happy mood in uiLocation, and adds a blob.happy flow that walks all four acceptance criteria. FEATURE_MAP.md was regenerated with pnpm featuremap. src/features/blob/tests/time-mood.test.ts: unit tests for shownMood (happy after a daytime snack, Sleepy at night even after a snack, otherwise follows the clock) and the Happy label. src/features/blob/README.md: describes the Happy mood.