V1.32.0: battles that keep to the fight
- The scene description shows during a battle only between rounds (while the first in the order is on turn), and always before and after it - Combatant details start closed in a battle: the spotlight has whoever is on turn, or on a narrow screen their own card opens - While a battle is under way, Add to the scene, Experience and Rewards fold to their titles - Button labels wrap inside their buttons instead of spilling out - Sticky turn order and side column follow the measured top bar height - Phone: quick stats no longer sits on Log out, incoming rolls clear the bottom bar, the damage bar no longer scrolls on its own - Docs updated; all packages at version 1.32.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Suspense } from 'react';
|
||||
import { Suspense, useEffect, useRef } from 'react';
|
||||
import { Link, NavLink, Outlet, useMatch } from 'react-router-dom';
|
||||
import { useAuth } from '../auth/useAuth';
|
||||
import { useLastCampaignId, useRememberCampaign } from '../lib/lastCampaign';
|
||||
@@ -15,6 +15,19 @@ export function Layout() {
|
||||
useRememberCampaign(onCampaign?.params.campaignId);
|
||||
const campaignId = useLastCampaignId();
|
||||
|
||||
// How tall the top bar really is, as --topbar-h, so that what sticks under
|
||||
// it (the turn order in a battle) sits right below it on any screen.
|
||||
const topbar = useRef<HTMLElement>(null);
|
||||
useEffect(() => {
|
||||
const bar = topbar.current;
|
||||
if (!bar) return;
|
||||
const measure = () => document.documentElement.style.setProperty('--topbar-h', `${bar.offsetHeight}px`);
|
||||
measure();
|
||||
const observer = new ResizeObserver(measure);
|
||||
observer.observe(bar);
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
// The same destinations twice: along the top bar on a wide screen, and as a
|
||||
// bar along the bottom, in reach of a thumb, on a phone.
|
||||
const destinations = [
|
||||
@@ -39,7 +52,7 @@ export function Layout() {
|
||||
|
||||
return (
|
||||
<div className="app-shell">
|
||||
<header className="topbar">
|
||||
<header className="topbar" ref={topbar}>
|
||||
<Link to="/campaigns" className="topbar-brand">
|
||||
<span className="die" aria-hidden>
|
||||
⚄
|
||||
|
||||
Reference in New Issue
Block a user