diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 25ef71d..f1d5717 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -55,11 +55,10 @@ function useActionBarAnimation(combatantCount: number) { const empty = combatantCount === 0; const risingClass = rising ? " animate-rise-to-center" : ""; const settlingClass = settling ? " animate-settle-to-bottom" : ""; - const topBarClass = settling - ? " animate-slide-down-in" - : topBarExiting - ? " absolute inset-x-0 top-0 z-10 px-4 animate-slide-up-out" - : ""; + const exitingClass = topBarExiting + ? " absolute inset-x-0 top-0 z-10 px-4 animate-slide-up-out" + : ""; + const topBarClass = settling ? " animate-slide-down-in" : exitingClass; const showTopBar = !empty || topBarExiting; return { @@ -194,7 +193,7 @@ export function App() { block: "nearest", behavior: "smooth", }); - }, [encounter.activeIndex]); + }, []); // Auto-show stat block for the active combatant when turn changes, // but only when the viewport is wide enough to show it alongside the tracker. @@ -203,7 +202,7 @@ export function App() { useEffect(() => { if (prevActiveIndexRef.current === encounter.activeIndex) return; prevActiveIndexRef.current = encounter.activeIndex; - if (!window.matchMedia("(min-width: 1024px)").matches) return; + if (!globalThis.matchMedia("(min-width: 1024px)").matches) return; const active = encounter.combatants[encounter.activeIndex]; if (!active?.creatureId || !isLoaded) return; sidePanel.showCreature(active.creatureId as CreatureId); @@ -216,8 +215,8 @@ export function App() { return (
+
Load stat block data for all {totalSources} sources at once.
{error}
Stat block data for this source needs to be loaded. Enter a URL or upload a JSON file.
No cached sources
{creature.size} {creature.type}, {creature.alignment}
{creature.sourceDisplayName}
{creature.legendaryActions.preamble}