Trefferwurf-Knopf dezent als .btn, Cache-Buster aus Dateizeit statt fester Version
This commit is contained in:
parent
f9126675b2
commit
38ad53254c
3 changed files with 19 additions and 27 deletions
|
|
@ -88,12 +88,19 @@ function url(string $path = '/'): string
|
||||||
return $base . $path;
|
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';
|
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
|
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
|
function redirect(string $path, int $status = 303): never
|
||||||
|
|
|
||||||
|
|
@ -821,30 +821,14 @@ input[type="file"] {
|
||||||
.stat .b.bonus-zero { color: var(--parchment-dim); }
|
.stat .b.bonus-zero { color: var(--parchment-dim); }
|
||||||
.stat .b.bonus-neg { color: #e0756a; }
|
.stat .b.bonus-neg { color: #e0756a; }
|
||||||
|
|
||||||
/* --- Trefferwürfe: Rechenkette als Feld, Overlay zum Bearbeiten --------- */
|
/* --- Trefferwürfe: Rechenkette als Knopf, Overlay zum Bearbeiten --------- */
|
||||||
.hp-sum {
|
.hp-sum {
|
||||||
display: flex;
|
justify-content: flex-start;
|
||||||
align-items: baseline;
|
letter-spacing: 0.06em;
|
||||||
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;
|
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
letter-spacing: 0.02em;
|
|
||||||
text-align: left;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
.hp-sum:hover,
|
.hp-sum span { text-transform: none; }
|
||||||
.hp-sum:focus-visible {
|
.hp-sum small { color: var(--parchment-dim); font-size: 0.68rem; letter-spacing: 0.1em; }
|
||||||
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-roll-grid {
|
.hp-roll-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
|
||||||
|
|
|
||||||
|
|
@ -76,13 +76,14 @@ $hpSlotValue = static fn (int $slot): string => ((int) ($hpRolls[$slot] ?? 0)) >
|
||||||
<div class="field" style="grid-column: span 2;">
|
<div class="field" style="grid-column: span 2;">
|
||||||
<span>Trefferwürfe <small class="muted">Stufe 0 (1W<?= (int) WS_HP_LEVEL0_DIE ?>), dann Stufe 1 … <?= (int) $hp['level'] ?></small></span>
|
<span>Trefferwürfe <small class="muted">Stufe 0 (1W<?= (int) WS_HP_LEVEL0_DIE ?>), dann Stufe 1 … <?= (int) $hp['level'] ?></small></span>
|
||||||
<input type="hidden" name="hp_rolls" data-hp-input value="<?= e(hp_rolls_format($hpRolls)) ?>">
|
<input type="hidden" name="hp_rolls" data-hp-input value="<?= e(hp_rolls_format($hpRolls)) ?>">
|
||||||
<button class="hp-sum" type="button" data-dialog-open="#hp-rolls-dialog" title="Einzelne Würfe bearbeiten">
|
<button class="btn hp-sum" type="button" data-dialog-open="#hp-rolls-dialog" title="Einzelne Würfe bearbeiten">
|
||||||
<span data-hp-sum><?= e(hp_rolls_sum($values)) ?></span>
|
<span data-hp-sum><?= e(hp_rolls_sum($values)) ?></span>
|
||||||
<small>bearbeiten</small>
|
<small class="muted">bearbeiten</small>
|
||||||
</button>
|
</button>
|
||||||
<small class="muted">
|
<small class="muted">
|
||||||
<?= (int) $hp['con'] === 0 ? 'ohne Konstitutionsbonus' : 'Konstitutionsbonus ' . e(signed((int) $hp['con'])) . ' eingerechnet' ?>
|
<?= $hp['complete']
|
||||||
· fehlende Würfe zählen nicht mit
|
? ((int) $hp['con'] === 0 ? '' : 'Konstitutionsbonus ' . e(signed((int) $hp['con'])) . ' eingerechnet')
|
||||||
|
: 'fehlende Würfe zählen nicht mit' ?>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<label class="field">
|
<label class="field">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue