feat: soundboard, toast notifications, robust JSON parsing
Soundboard (Web Audio API): - 8 ambient loops: rain, wind, fire, ocean, forest, tavern, thunder, cave - 8 one-shot SFX: sword, bow, spell, door, coins, horn, dice, footsteps - Brown noise generation for ambient textures - Oscillator-based SFX with frequency sweeps - Volume slider, active state indicators with pulsing dot - Stop All button when ambients are playing - Toast notifications on SFX trigger Toast notification system: - Zustand-based store with auto-dismiss (4s) - 4 types: success, error, info, warning - Slide-in animation from top-right - Dismissible with × button - Integrated into App shell JSON parsing (all AI components): - Shared lib/llm-parse.ts with extractJson, parseLlmJson, flattenValue, ensureArray - Strips markdown code fences before parsing - Handles nested objects where strings expected - All 5 AI components use parseLlmJson instead of raw regex - All prompts explicitly request raw JSON with no fences - ItemForge shows raw response in <details> on parse failure Full production build passing
This commit is contained in:
@@ -179,4 +179,22 @@ body,
|
||||
*:focus-visible {
|
||||
outline: 2px solid var(--color-gold-bright);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ─── Animations ──────────────────────────────────────────────── */
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
Reference in New Issue
Block a user