Compare commits

..

No commits in common. "e9c163ea2a20a0ef2ffae00f457317a396b84cec" and "48c070f024d208de5cfb5b2909427e3f73769822" have entirely different histories.

4 changed files with 33 additions and 24 deletions

19
TODO.md
View File

@ -102,31 +102,26 @@
- Kandidaten - Kandidaten
- gelb: gold, yellow, orange - gelb: gold, yellow, orange
- grün: lawngreen, lime, greenyellow - grün: lawngreen, lime, greenyellow
- x nach dem Laden passiert es manchmal, dass nach dem Einfügen von testCombatant das add Modal gleich wieder aufgeht
- schien die gleiche Sache zu sein wie mit dem hidden.bs.modal event
- jetzt kommt es aber trotzdem manchmal wieder
- vllt. ein timeout-Problem?
### open ### open
- custom validation not triggering error message nor visible styles
- color scheme beim Favicon anpassen - color scheme beim Favicon anpassen
- focus-related stuff
- after pressing damage button, focus moves to first table row act button
- it's probably b/c I resort the table
- wenn ein damage monitor offen ist und ich auf add combatant clicke, springt der Fokus nicht zuverlässig ins erste input feld
- im FP3T Tor Browser kann ich rauszoomen, bis ich die ganzen damage monitors und action menus sehe -> verhindern! - im FP3T Tor Browser kann ich rauszoomen, bis ich die ganzen damage monitors und action menus sehe -> verhindern!
- action-menu und damage-monitor sliden jetzt nicht mehr rein, sondern bleiben an Ort und Stelle - action-menu und damage-monitor sliden jetzt nicht mehr rein, sondern bleiben an Ort und Stelle
- das sollte die Sache verhindern - das sollte die Sache verhindern
- warum fkt. das Ganze nicht als Webapp? - warum fkt. das Ganze nicht als Webapp?
- Firefox (android) sieht die Seite nicht als installable an - Firefox (android) sieht die Seite nicht als installable an
- Webmanifest ist aber da und scheint auch in Ordnung zu sein (sagt Firefox on Linux) - Webmanifest ist aber da und scheint auch in Ordnung zu sein (sagt Firefox on Linux)
- comments with general info in source files? - nach dem Laden passiert es manchmal, dass nach dem Einfügen von testCombatant das add Modal gleich wieder aufgeht
- nice to have: focus trapping im modal fkt. nur rückwärts (shift-tab), aber nicht vorwärts - schien die gleiche Sache zu sein wie mit dem hidden.bs.modal event
- zumindest im Chrome; FF ungetestet - jetzt kommt es aber trotzdem manchmal wieder
- vllt. ein timeout-Problem?
- wenn ein damage monitor offen ist und ich auf add combatant clicke, springt der Fokus nicht zuverlässig ins erste input feld
## Feature Requests ## Feature Requests

View File

@ -59,7 +59,7 @@ $form-feedback-icon-valid: none;
$form-feedback-icon-invalid: none; $form-feedback-icon-invalid: none;
// more bootstrap stylesheets // more bootstrap stylesheets
//@import "../../node_modules/bootstrap/scss/bootstrap"; // everything //@import "../../node_modules/bootstrap/scss/bootstrap";
@import "../../node_modules/bootstrap/scss/variables"; @import "../../node_modules/bootstrap/scss/variables";
@import "../../node_modules/bootstrap/scss/variables-dark"; @import "../../node_modules/bootstrap/scss/variables-dark";
@import "../../node_modules/bootstrap/scss/maps"; @import "../../node_modules/bootstrap/scss/maps";
@ -107,7 +107,9 @@ $form-feedback-icon-invalid: none;
********************* */ ********************* */
@media (width <= 500px) { @media (width <= 500px) {
html { font-size: $html-font-size; } html {
font-size: $html-font-size;
}
.container { .container {
min-width: 100vw; min-width: 100vw;
@ -118,7 +120,9 @@ $form-feedback-icon-invalid: none;
} }
@media (500px < width < 1000px) { @media (500px < width < 1000px) {
html { font-size: calc(100vw / (500px / $html-font-size)); } html {
font-size: calc(100vw / (500px / $html-font-size));
}
.container { .container {
$calc-width: calc(100vw / 2 + 250px); $calc-width: calc(100vw / 2 + 250px);
@ -128,7 +132,9 @@ $form-feedback-icon-invalid: none;
} }
@media (1000px <= width) { @media (1000px <= width) {
html { font-size: calc($html-font-size * 2); } html {
font-size: calc($html-font-size * 2);
}
.container { .container {
min-width: 75vw; min-width: 75vw;
@ -137,6 +143,7 @@ $form-feedback-icon-invalid: none;
} }
/* ***************** /* *****************
* Basic styles * Basic styles
******************* */ ******************* */
@ -165,6 +172,9 @@ body {
button { font-family: Electrolize; } button { font-family: Electrolize; }
//button:focus {
//}
.sr2-button { .sr2-button {
background: transparent; background: transparent;
border: .07rem solid $bg; border: .07rem solid $bg;
@ -201,6 +211,7 @@ button { font-family: Electrolize; }
.display-none { display: none; } .display-none { display: none; }
/* ***************** /* *****************
* Header styles * Header styles
******************* */ ******************* */
@ -235,6 +246,7 @@ header.navbar {
} }
/* ***************** /* *****************
* Table styles * Table styles
******************* */ ******************* */
@ -425,7 +437,7 @@ header.navbar {
&:focus { &:focus {
outline: none; outline: none;
animation: .6s alternate infinite pulse; animation: .6s alternate ease-in-out infinite pulse;
animation-delay: -.3s; animation-delay: -.3s;
} }
@ -462,6 +474,7 @@ header.navbar {
} }
/* ***************** /* *****************
* Modal styles * Modal styles
******************* */ ******************* */
@ -615,3 +628,4 @@ footer {
} }
} }

View File

@ -193,7 +193,7 @@
<!-- footer --> <!-- footer -->
<div class="footer-container container"> <div class="footer-container container">
<footer data-augmented-ui="tl-clip br-clip both"> <footer data-augmented-ui="tl-clip br-clip both">
<p><a href="https://git.unterdemradar.de/tobias/sr2ini" tabindex="-1" title="sr2ini">sr2ini</a> | Copyright (C) 2023 by Tobias P | background by <a href="https://www.deviantart.com/xxaries1970xx" tabindex="-1" title="xxAries1970xx on DeviantArt">xxAries1970xx</a></p> <p>code & design by <a href="#" tabindex="-1" title="Eclipse">Eclipse</a> | background by <a href="https://www.deviantart.com/xxaries1970xx" tabindex="-1" title="xxAries1970xx on DeviantArt">xxAries1970xx</a></p>
</footer> </footer>
</div> </div>
</body> </body>

View File

@ -236,6 +236,7 @@ function handleDamageLevelClick(event) {
damageLevel += 1; damageLevel += 1;
} }
let damageType = $btn.attr("class").split(" ").filter(cls => cls.substr(0, 7) == "damage-" ? cls : false).toString().substr(7); let damageType = $btn.attr("class").split(" ").filter(cls => cls.substr(0, 7) == "damage-" ? cls : false).toString().substr(7);
console.log("damageType is", damageType);
// add damage level to table row as as data attribute // add damage level to table row as as data attribute
$btn.parents("tr.combatant-row").attr("data-damage-" + damageType, damageLevel); $btn.parents("tr.combatant-row").attr("data-damage-" + damageType, damageLevel);
// select/unselect damage buttons above/below // select/unselect damage buttons above/below
@ -367,7 +368,9 @@ function editCombatant() {
ini = (ini != "") ? ini : rollForInitiative(dice, rea); ini = (ini != "") ? ini : rollForInitiative(dice, rea);
// get correct row // get correct row
let index = parseInt($("#combatant-modal").data("row")); let index = parseInt($("#combatant-modal").data("row"));
console.log("row index is", index);
let $tr = $("tr.combatant-row").eq(index); let $tr = $("tr.combatant-row").eq(index);
console.log("row is", $tr);
// set new values // set new values
$tr.attr("data-true-ini", ini); $tr.attr("data-true-ini", ini);
$tr.find(".combatant-name").text(name); $tr.find(".combatant-name").text(name);
@ -522,24 +525,21 @@ $(document).ready(function () {
removeCombatant(); removeCombatant();
}); });
// add event listeners to damage sliders in combatant modal // add event listeners to damage sliders in combatant modal
$("#combatant-modal-stun").on("input change", () => { $("#combatant-modal-stun").on("change", () => {
if ($("#combatant-modal-stun").val() == "10") { if ($("#combatant-modal-stun").val() == "10") {
$("#combatant-modal-penalty-stun").text("(K.O.)"); $("#combatant-modal-penalty-stun").text("(K.O.)");
} else if ($("#combatant-modal-stun").val() == "0") {
$("#combatant-modal-penalty-stun").text("");
} else { } else {
$("#combatant-modal-penalty-stun").text("(wound penalty -" + DAMAGE_PENALTY[$("#combatant-modal-stun").val()] + ")"); $("#combatant-modal-penalty-stun").text("(wound penalty -" + DAMAGE_PENALTY[$("#combatant-modal-stun").val()] + ")");
} }
}); });
$("#combatant-modal-physical").on("input change", () => { $("#combatant-modal-physical").on("change", () => {
if ($("#combatant-modal-physical").val() == "10") { if ($("#combatant-modal-physical").val() == "10") {
$("#combatant-modal-penalty-physical").text("(dead)"); $("#combatant-modal-penalty-physical").text("(dead)");
} else if ($("#combatant-modal-physical").val() == "0") {
$("#combatant-modal-penalty-physical").text("");
} else { } else {
$("#combatant-modal-penalty-physical").text("(wound penalty -" + DAMAGE_PENALTY[$("#combatant-modal-physical").val()] + ")"); $("#combatant-modal-penalty-physical").text("(wound penalty -" + DAMAGE_PENALTY[$("#combatant-modal-physical").val()] + ")");
} }
}); });
// always focus name input field when combatant modal appears // always focus name input field when combatant modal appears
$('#combatant-modal').on('shown.bs.modal', () => $('#combatant-modal-name').focus()); $('#combatant-modal').on('shown.bs.modal', () => $('#combatant-modal-name').focus());
// always empty input fields when combatant modal disappears // always empty input fields when combatant modal disappears