Fertigkeiten: Praxispunkte (10 Kaestchen) und Wuergel je Fertigkeitsstufe in Bogen und PDF

This commit is contained in:
torsten 2026-11-22 19:31:30 +01:00
parent 3a5d366aba
commit 85fd24a0f0
10 changed files with 185 additions and 7 deletions

View file

@ -813,6 +813,24 @@ input[type="file"] {
MOD (regulär) und STUFE (fett) exakt auf gleicher Höhe stehen. */
.skill-table td.num { vertical-align: baseline; }
/* Würfelspalte und ankreuzbare Praxispunkte (PP) */
.skill-table th.die, .skill-table td.die { width: 3.4rem; white-space: nowrap; }
.skill-table td.pp-cell { white-space: nowrap; vertical-align: baseline; }
.pp-slots { display: inline-flex; gap: 0.16rem; margin: 0; padding: 0; border: 0; }
.pp-slot {
width: 0.68rem;
height: 0.68rem;
padding: 0;
border: 1px solid rgba(201, 162, 39, 0.55);
border-radius: 2px;
background: transparent;
cursor: pointer;
transition: background 0.12s ease, border-color 0.12s ease;
}
.pp-slot:hover { border-color: var(--gold); }
.pp-slot.is-filled { background: var(--gold); border-color: var(--gold); }
.pp-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* --- Boni: positiv grün, null grau, negativ rot ------------------------- */
.bonus-pos { color: #79d29a; }
.bonus-zero { color: var(--parchment-dim); }

View file

@ -201,6 +201,36 @@
});
}
// Praxispunkte im Charakterbogen: Klick setzt die Punkte ohne Reload
document.addEventListener('submit', async function (event) {
const form = event.target.closest('[data-pp-form]');
if (!form) {
return;
}
event.preventDefault();
const pressed = event.submitter;
const want = pressed ? parseInt(pressed.value, 10) || 0 : 0;
try {
const response = await fetch(form.action, {
method: 'POST',
body: new FormData(form),
headers: { 'X-Requested-With': 'fetch' }
});
const data = await response.json();
if (!data || data.ok !== true) {
return;
}
form.querySelectorAll('.pp-slot').forEach(function (slot) {
const value = parseInt(slot.value, 10) || 0;
const filled = value <= data.pp;
slot.classList.toggle('is-filled', filled);
slot.setAttribute('aria-pressed', filled ? 'true' : 'false');
});
} catch (error) {
form.submit();
}
});
// Selektor-Schirme: Fertigkeiten und Zauber aus dem Katalog wählen
// Blendet Überschriften aus, wenn keine ihrer Einträge sichtbar ist.
const hideEmptyGroups = function (dialog) {