diff --git a/westreiche_website/app/util.php b/westreiche_website/app/util.php index 45a376c..1187f95 100644 --- a/westreiche_website/app/util.php +++ b/westreiche_website/app/util.php @@ -88,12 +88,19 @@ function url(string $path = '/'): string return $base . $path; } -/** Cache-Buster: bei Änderungen an app.css/app.js erhöhen. */ +/** Notnagel-Cache-Buster, falls eine Datei fehlt (normal: Änderungszeit). */ const WS_ASSET_VERSION = '5'; +/** + * Asset-URL mit Cache-Buster. Die Version ist die Änderungszeit der Datei – + * dadurch kommen neue app.css/app.js ohne manuelles Hochzählen an. + */ function asset(string $path): string { - return url('/assets/' . ltrim($path, '/')) . '?v=' . WS_ASSET_VERSION; + $relative = ltrim($path, '/'); + $file = WS_ROOT . '/assets/' . $relative; + $version = is_file($file) ? (string) filemtime($file) : WS_ASSET_VERSION; + return url('/assets/' . $relative) . '?v=' . $version; } function redirect(string $path, int $status = 303): never diff --git a/westreiche_website/assets/app.css b/westreiche_website/assets/app.css index 6d6f24b..af085ef 100644 --- a/westreiche_website/assets/app.css +++ b/westreiche_website/assets/app.css @@ -821,30 +821,14 @@ input[type="file"] { .stat .b.bonus-zero { color: var(--parchment-dim); } .stat .b.bonus-neg { color: #e0756a; } -/* --- Trefferwürfe: Rechenkette als Feld, Overlay zum Bearbeiten --------- */ +/* --- Trefferwürfe: Rechenkette als Knopf, Overlay zum Bearbeiten --------- */ .hp-sum { - display: flex; - align-items: baseline; - justify-content: space-between; - gap: 0.6rem; - width: 100%; - padding: 0.55rem 0.7rem; - border: 1px solid rgba(201, 162, 39, 0.35); - border-radius: var(--radius); - background: rgba(6, 9, 16, 0.55); - color: var(--parchment); - font: inherit; + justify-content: flex-start; + letter-spacing: 0.06em; font-variant-numeric: tabular-nums; - letter-spacing: 0.02em; - text-align: left; - cursor: pointer; } -.hp-sum:hover, -.hp-sum:focus-visible { - border-color: var(--gold); - background: rgba(201, 162, 39, 0.12); -} -.hp-sum small { color: var(--parchment-dim); font-size: 0.72rem; white-space: nowrap; } +.hp-sum span { text-transform: none; } +.hp-sum small { color: var(--parchment-dim); font-size: 0.68rem; letter-spacing: 0.1em; } .hp-roll-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); diff --git a/westreiche_website/views/_fields.php b/westreiche_website/views/_fields.php index 1ff341d..ad09526 100644 --- a/westreiche_website/views/_fields.php +++ b/westreiche_website/views/_fields.php @@ -76,13 +76,14 @@ $hpSlotValue = static fn (int $slot): string => ((int) ($hpRolls[$slot] ?? 0)) >