Compare commits

..

No commits in common. "f1c16da7e4c848eb4e8bd4015b838e1787071ee7" and "a0e81cd2770a86b056f545f6a95d8348783090e2" have entirely different histories.

5 changed files with 321 additions and 413 deletions

56
TODO.md
View File

@ -75,41 +75,33 @@
- x add modal geht bei enter key nicht zu -> liegt daran, dass ich nicht mehr .modal("hide") verwende - x add modal geht bei enter key nicht zu -> liegt daran, dass ich nicht mehr .modal("hide") verwende
- ich könnt's umstellen, aber will ich das? - ich könnt's umstellen, aber will ich das?
- nicht mehr aktuell - nicht mehr aktuell
- x dafür sorgen, dass lange Namen nicht das Design sprengen -> https://www.design-fluide.com/09-12-2018/how-to-break-long-words-in-an-html-or-css-table/
- x (Re)Design
- table anders aufteilen (cell width) (zB ist INI zu breit)
- Seite für größere Screens anpassen (Schrift, Buttons, Icons skalieren)
- Breakpoints: 600px, 1200px
- Tabellenbreite begrenzen (mit Containerbreite immer ~95%)
- viewport width <= 600px: 100%
- viewport width > 600px: (100-x/24)% mit x = vWidth-600px
- viewport widht > 1200: 75%
- nicht px benutzen, sondern vw/vh/vmin/vmax -> muss aber schauen, ob FF4And das unterstützt
- clamp(minsize, relsize, maxsize)
- auch mgl.: calc(0.75em + 1vw) (macht den Vergrößerungseffekt für große Viewports irrelevant)
- slightly restyle elements
- navbar: augmented-ui br clipping is too wide
- x table: table row clipping not working -> liegt an td { clip-path: none; }
- footer: smaller
- x use variables for repeating CSS values (box-shadow, text-shadow, button size etc.)
- augmented-ui Fallstricke:
- --aug-[b|t|][l|r|] fkt. nur sicher mit Werten in px; em, rem, % etc. fkt. idR nicht
- --aug-border-* fkt. nicht mit Wert 0, es muss 0px sein
- x Design im Chromium checken (zB damage slider #combatant-modal)
- -moz-… mit -webkit-… ergänzen
- x make color scheme friendly for people with red green bindness (Felix)
- see here: https://venngage.com/tools/accessible-color-palette-generator
- Kandidaten
- gelb: gold, yellow, orange
- grün: lawngreen, lime, greenyellow
### open ### open
- color scheme beim Favicon anpassen - dafür sorgen, dass lange Namen nicht das Design sprengen -> https://www.design-fluide.com/09-12-2018/how-to-break-long-words-in-an-html-or-css-table/
- Design
- im Chromium sind die Slider für Damage im #combatant-modal ungestylet
- augmented-ui Fallstricke:
- --aug-[b|t|][l|r|] fkt. nur sicher mit Werten in px; em, rem, % etc. fkt. idR nicht
- --aug-border-* fkt. nicht mit Wert 0, es muss 0px sein
- Seite für größere Screens anpassen (Schrift, Buttons, Icons skalieren)
- Breakpoints: 600px, 1200px
- Elementbreite begrenzen
- viewport width <= 600px: 100%
- viewport width > 600px: (100-x/24)% mit x = vWidth-600px
- viewport widht > 1200: 75%
- nicht px benutzen, sondern vw/vh/vmin/vmax -> muss aber schauen, ob FF4And das unterstützt
- clamp(minsize, relsize, maxsize)
- auch mgl.: calc(0.75em + 1vw) (macht den Vergrößerungseffekt für große Viewports irrelevant)
- make color scheme friendly for people with red green bindness (Felix)
- see here: https://venngage.com/tools/accessible-color-palette-generator
- Favicon nicht vergessen!!
- tests
- weiß: ghostwhite, white, lightgrey
- gelb: gold, yellow, orange
- grün: lawngreen, lime, greenyellow
- rot: orangered, red, darkred
- 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
@ -128,6 +120,8 @@
- Seite als Web App auf FF4And installable machen - Seite als Web App auf FF4And installable machen
- mal sehen … - mal sehen …
- Seite auch mal im Chrome checken
- -moz-… mit -webkit-… ergänzen
- Animationen? Transitions? - Animationen? Transitions?
- deployment: dist/* soll direkt auf hermes hochgeladen werden - deployment: dist/* soll direkt auf hermes hochgeladen werden
- x warum sind im dist/-Folder immer zwei Versionen der gleichen Datei? -> lag an parcel-reporter-static-file-copy - x warum sind im dist/-Folder immer zwei Versionen der gleichen Datei? -> lag an parcel-reporter-static-file-copy

View File

@ -1,7 +1,7 @@
{ {
"name": "Shadowrun 2e Ini Tracker", "name": "Shadowrun 2e Ini Tracker",
"short_name": "sr2ini", "short_name": "sr2ini",
"start_url": "/", "start_url": "https://unterdemradar.de/sr2ini",
"description": "A simple Initiative tracker for Shadowrun 2e", "description": "A simple Initiative tracker for Shadowrun 2e",
"orientation": "portrait", "orientation": "portrait",
"icons": [ "icons": [

View File

@ -1,83 +1,18 @@
/* *********************** /*$fg: deeppink; // #ff1493
* Non-bootstrap variables $fg-bright: lightpink; // #ffb6c1
************************* */ $fg-dark: #b3005f;*/
$fg: gold; $fg: gold;
$fg-bright: yellow; $fg-bright: yellow;
$fg-dark: orange; $fg-dark: orange;
// old fg-colors: deeppink, lightpink, #b3005f;
$bg: cyan; // #00ffff $bg: cyan; // #00ffff
$bg-bright: lightcyan; // #e0ffff $bg-bright: lightcyan; // #e0ffff
$bg-dark: darkcyan; // #008b8b $bg-dark: darkcyan; // #008b8b
$html-font-size: 14px;
/* ******************************
* Overriding Bootstrap variables
******************************** */
@import "../../node_modules/bootstrap/scss/functions";
// fonts
@font-face { @font-face {
font-family: "Electrolize"; font-family: "Electrolize";
src: local("Electrolize"), url("../img/Electrolize-Regular.ttf") format("truetype"), url("https://fonts.googleapis.com/css2?family=Electrolize&display=swap"); src: local("Electrolize"), url("../img/Electrolize-Regular.ttf") format("truetype"), url("https://fonts.googleapis.com/css2?family=Electrolize&display=swap");
} }
$font-family-base: "Electrolize";
// colors
$warning: $bg;
$danger: $fg;
// <input>
$input-bg: transparent;
$input-color: $fg;
$input-font-size: 1rem !important;
$input-focus-box-shadow: 0 0 .25rem $bg-bright, 0 0 .5rem $bg, 0 0 1rem $bg-dark !important;
// <input type="text/number">
$input-group-addon-color: $bg;
$input-group-addon-bg: transparent;
$input-group-addon-border-color: none;
// <input type="range">
$form-range-track-height: .2rem;
$form-range-track-bg: $bg;
$form-range-track-box-shadow: none;
$form-range-thumb-width: .25rem;
$form-range-thumb-height: 1rem;
$form-range-thumb-bg: $fg;
$form-range-thumb-border: none;
$form-range-thumb-box-shadow: none;
$form-range-thumb-focus-box-shadow: 0 0 .5rem $fg-bright, 0 0 1rem $fg, 0 0 2rem $fg-dark;
// <input> validation
$form-feedback-valid-color: $warning;
$form-feedback-icon-valid: none;
$form-feedback-icon-invalid: none;
// more bootstrap stylesheets
//@import "../../node_modules/bootstrap/scss/bootstrap";
@import "../../node_modules/bootstrap/scss/variables";
@import "../../node_modules/bootstrap/scss/variables-dark";
@import "../../node_modules/bootstrap/scss/maps";
@import "../../node_modules/bootstrap/scss/mixins";
@import "../../node_modules/bootstrap/scss/root";
@import "../../node_modules/bootstrap/scss/containers";
@import "../../node_modules/bootstrap/scss/navbar";
@import "../../node_modules/bootstrap/scss/tables";
@import "../../node_modules/bootstrap/scss/modal";
@import "../../node_modules/bootstrap/scss/forms";
@import "../../node_modules/bootstrap/scss/utilities";
@import "../../node_modules/bootstrap/scss/badge";
@import "../../node_modules/bootstrap/scss/reboot";
/* ******
* Mixins
******** */
@mixin aug() { @mixin aug() {
--aug-b: 5px; --aug-b: 5px;
@ -90,64 +25,25 @@ $form-feedback-icon-invalid: none;
} }
@mixin border() { @mixin border() {
--aug-border-all: .1rem; --aug-border-all: 2px;
--aug-border-bg: cyan; // variables don't work in this specific instance --aug-border-bg: cyan; // variables don't work in this specific instance
--aug-border-opacity: .5; --aug-border-opacity: .5;
} }
@mixin inlay() { @mixin inlay() {
--aug-inlay-bg: rgba(0, 0, 0, .5); --aug-inlay-bg: rgba(0, 0, 0, .5);
--aug-inlay-x: .12em; --aug-inlay-y: 10%;
--aug-inlay-y: .12em;
} }
@mixin button() {
/* ******************* background: transparent;
* Responsive styles border: 1px solid $bg;
********************* */ border-radius: 1px;
box-shadow: 0 0 2px $bg-bright, 0 0 4px $bg, 0 0 8px $bg-dark;
@media (width <= 500px) { color: $fg;
html { padding-inline: 0px;
font-size: $html-font-size;
} }
.container {
min-width: 100vw;
max-width: 100vw;
}
.table-responsive { max-width: calc(100% - .8rem); }
}
@media (500px < width < 1000px) {
html {
font-size: calc(100vw / (500px / $html-font-size));
}
.container {
$calc-width: calc(100vw / 2 + 250px);
min-width: $calc-width;
max-width: $calc-width;
}
}
@media (1000px <= width) {
html {
font-size: calc($html-font-size * 2);
}
.container {
min-width: 75vw;
max-width: 75vw;
}
}
/* *****************
* Basic styles
******************* */
html { html {
font-family: 'Electrolize', sans-serif; font-family: 'Electrolize', sans-serif;
height: 100%; height: 100%;
@ -162,60 +58,23 @@ body {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-size: cover; background-size: cover;
margin: .2rem;
} }
.container { .svg-icons { display: none; }
padding: .2rem;
position: relative;
}
button { font-family: Electrolize; } .icon { fill: $fg; }
button:focus { .sr2-button:focus-visible {
filter: brightness(150%) !important; border: 1px solid $bg !important;
box-shadow: 0 0 4px $bg-bright, 0 0 8px $bg, 0 0 16px $bg-dark !important;
outline: none; outline: none;
} }
.sr2-button { .container {
background: transparent; padding: 4px;
border: .07rem solid $bg; position: relative;
border-radius: .07rem;
box-shadow: 0 0 .15rem $bg-bright, 0 0 .3rem $bg, 0 0 .6rem $bg-dark;
color: $fg;
font-size: 1rem;
margin-left: .2rem;
margin-right: .2rem;
padding-inline: 0px;
svg {
fill: $fg;
height: 93%;
width: 93%;
vertical-align: unset;
} }
&:focus {
border: .1rem solid $bg !important;
box-shadow: 0 0 .3rem $bg-bright, 0 0 .6rem $bg, 0 0 1.2rem $bg-dark !important;
}
&:disabled {
box-shadow: none;
border-color: $bg-dark;
svg { fill: $fg-dark; }
}
}
.display-none { display: none; }
/* *****************
* Header styles
******************* */
header.navbar { header.navbar {
@include border; @include border;
@include inlay; @include inlay;
@ -228,35 +87,34 @@ header.navbar {
--aug-r: 7px; --aug-r: 7px;
--aug-tl: 7px; --aug-tl: 7px;
--aug-tr: 7px; --aug-tr: 7px;
padding-left: calc(15px + 1rem); padding-right: .6rem;;
padding-right: 15px;
.navbar-brand { .navbar-brand {
color: $bg; color: $bg;
font-size: 140%; text-shadow: 0 0 3px, 0 0 6px, 0 0 12px, 0 0 24px;
text-shadow: 0 0 .25rem, 0 0 .5rem, 0 0 .75rem, 0 0 1rem;
} }
nav { justify-content: flex-end !important; }
button { button {
height: 2rem; @include button;
width: 2rem;
height: 38px;
margin-left: 3px;
margin-right: 3px;
width: 38px;
svg {
width: 32px;
height: 32px;
fill: $fg;
}
} }
} }
.table-responsive { margin-bottom: 1px; }
/* *****************
* Table styles
******************* */
.table-responsive { overflow: visible !important; }
#combatants-table { #combatants-table {
border-collapse: collapse !important; margin-top: .5rem;
margin-bottom: .1rem;
margin-top: .4rem;
tr { tr {
@include aug; @include aug;
@ -267,10 +125,18 @@ header.navbar {
--aug-border-right: 0px; --aug-border-right: 0px;
} }
tr:last-of-type td, .combatant-row {
tr:last-of-type th { --aug-border-bottom: 2px; } clip-path: none;
vertical-align: middle !important;
}
.combatant-row { clip-path: none; } th:not(:first-of-type) { text-align: center; }
.th-ini { min-width: 3rem; }
.th-dice-and-rea { min-width: 3.75rem; }
.th-actions { min-width: 6.5rem; }
th, th,
td { td {
@ -281,7 +147,6 @@ header.navbar {
--aug-border-bottom: 0px; --aug-border-bottom: 0px;
--aug-border-right: 0px; --aug-border-right: 0px;
background: none !important; background: none !important;
vertical-align: middle !important;
} }
th { th {
@ -289,97 +154,116 @@ header.navbar {
text-transform: uppercase; text-transform: uppercase;
} }
.th-name {
padding-left: .75rem !important;
text-align: left;
width: 100%;
}
.th-ini {
min-width: 4rem;
}
.th-dice-and-rea { min-width: 3rem; }
.th-actions {
min-width: min-content;
--aug-border-right: 2px;
}
td { td {
clip-path: none;
color: $fg; color: $fg;
font-weight: bold; font-weight: bold;
text-align: center; }
th:first-of-type,
td:first-of-type {
padding-left: 1rem !important;
}
th:last-of-type,
td:last-of-type {
--aug-border-right: 2px;
padding-right: .75rem;
}
tr:last-of-type td,
tr:last-of-type th {
--aug-border-bottom: 2px;
}
.combatant-actions {
display: flex;
justify-content: flex-end;
}
.sr2-button { .sr2-button {
height: 1.3rem; @include button;
width: 1.3rem;
height: 24px;
margin-left: 3px;
margin-right: 3px;
width: 24px;
svg,
.icon {
bottom: 3px;
height: 16px;
position: relative;
width: 16px;
}
&:disabled {
box-shadow: none;
border-color: $bg-dark;
.icon { fill: $fg-dark; }
} }
} }
.combatant-name { .combatant-ini {
padding-left: .6rem !important; padding-right: 1rem !important;
text-align: left; text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.combatant-dice-and-rea { text-align: center; }
.combatant-dice::before { content: attr(data-combatant-dice); } .combatant-dice::before { content: attr(data-combatant-dice); }
.combatant-rea::before { content: attr(data-combatant-rea); } .combatant-rea::before { content: attr(data-combatant-rea); }
.combatant-actions {
--aug-border-right: 2px;
display: flex;
min-width: 5rem;
}
.actions-menu { .actions-menu {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
padding: .2rem; padding: 6px;
.sr2-button { button {
margin-bottom: .2rem; @include button;
margin-top: .2rem;
height: 24px;
margin: 4px;
width: 24px;
} }
} }
} }
.max-ini td { .max-ini td {
text-shadow: 0 0 .15rem $fg; text-shadow: 0 0 .15em $fg;
} }
.zero-ini td { .zero-ini td {
color: $fg-dark; color: $fg-dark !important;
svg { fill: $fg-dark; } .icon { fill: $fg-dark !important; }
} }
.ko-or-dead td { .ko-or-dead td {
background-color: rgba(0, 0, 0, .5); background-color: rgba(0, 0, 0, .5);
color: $fg-dark; color: $fg-dark !important;
text-decoration: line-through .1rem $fg; text-decoration: line-through .1em $fg;
.sr2-button svg { fill: $fg-dark; } .icon { fill: $fg-dark !important; }
} }
.badge.bg-warning { .badge.bg-warning {
background: radial-gradient(circle at center, $bg, $bg-dark); background: radial-gradient(circle at center, $bg, $bg-dark);
bottom: .2rem;
color: black; color: black;
left: .2rem; bottom: -4px;
position: absolute; left: 12px;
width: 20px;
} }
.badge.bg-danger { .badge.bg-danger {
background: radial-gradient(circle at center, $fg, $fg-dark); background: radial-gradient(circle at center, $fg, $fg-dark);
color: black; color: black;
left: .2rem; left: 12px;
position: absolute; top: 12px;
top: .3rem; width: 20px;
} }
.damage-dropdown, .damage-dropdown,
@ -395,8 +279,8 @@ header.navbar {
--aug-inlay-bg: rgba(0, 0, 0, .5); --aug-inlay-bg: rgba(0, 0, 0, .5);
--aug-border-opacity: .75; --aug-border-opacity: .75;
padding-top: .7remx; padding-top: 10px;
padding-bottom: .7rem; padding-bottom: 10px;
position: absolute; position: absolute;
z-index: 200; z-index: 200;
@ -416,21 +300,17 @@ header.navbar {
} }
.damage-monitor { .damage-monitor {
padding: .5rem;
button { button {
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: Electrolize; font-size: smaller;
font-size: .9rem; height: 24px;
font-weight: bold; margin: 0px 2px;
height: 1.5rem !important; width: 24px;
margin: 0rem .15rem;
width: 1.5rem !important;
svg { &:focus-visible {
height: 100%; filter: brightness(150%) !important;
width: 100%; outline: none;
} }
} }
@ -442,36 +322,75 @@ header.navbar {
.damage-stun.active { .damage-stun.active {
background: radial-gradient(circle at center, $bg-bright, $bg); background: radial-gradient(circle at center, $bg-bright, $bg);
box-shadow: 0 0 .25rem $bg-bright, 0 0 .5rem $bg, 0 0 1rem $bg-dark; box-shadow: 0 0 3px $bg-bright, 0 0 6px $bg, 0 0 12px $bg-dark;
} }
.damage-physical { .damage-physical {
background: radial-gradient(circle at center, $fg, $fg-dark); background: radial-gradient(circle at center, $fg, $fg-dark);
border-radius: 50%; // circle, not square border-radius: 50%;;
box-shadow: none; box-shadow: none;
transition: background .5s, box-shadow .5s; transition: background .5s, box-shadow .5s;
&:focus-visible { outline: $fg !important; }
} }
.damage-physical.active { .damage-physical.active {
background: radial-gradient(circle at center, $fg-bright, $fg); background: radial-gradient(circle at center, $fg-bright, $fg);
box-shadow: 0 0 .25rem $fg-bright, 0 0 .5rem $fg, 0 0 1rem $fg-dark; box-shadow: 0 0 3px $fg-bright, 0 0 6px $fg, 0 0 12px $fg-dark;
}
svg {
height: 16px;
width: 16px;
} }
} }
/* ***************** .footer-container {
* Modal styles bottom: 0px;
******************* */ left: 0px;
position: fixed;
right: 0px;
}
footer {
@include aug;
@include inlay;
--aug-border-all: 2px !important;
--aug-border-bg: cyan !important; // vars don't work here
--aug-border-opacity: .5 !important;
--aug-inlay-bg: rgba(0, 0, 0, .75) !important;
--aug-tl: 10px;
--aug-tr: 10px;
height: 2.5em;
p {
color: $bg;
font-size: xx-small;
margin: .25rem;
padding-top: .65em;
text-align: center;
user-select: auto;
a {
color: $fg;
text-decoration: none;
}
}
}
.sr2-modal { .sr2-modal {
@include border; @include border;
@include aug; @include aug;
color: $bg; color: $bg;
font-family: Electrolize !important;
pointer-events: auto; pointer-events: auto;
button { @include button; }
.modal-header { .modal-header {
@include inlay; @include inlay;
@include border; @include border;
@ -480,7 +399,7 @@ header.navbar {
border-bottom: none; border-bottom: none;
text-transform: uppercase; text-transform: uppercase;
button { width: 2.5rem; } button { width: 30px; }
} }
.modal-body { .modal-body {
@ -497,16 +416,10 @@ header.navbar {
--aug-inlay-top: 0; --aug-inlay-top: 0;
border-top: none; border-top: none;
button { button { width: 4rem; }
width: 5rem;
margin: .3rem;
}
} }
label { label { margin: 0; }
margin: 0;
margin-left: calc(100% / 22 + 1rem);
}
.label-swap { .label-swap {
display: flex; display: flex;
@ -518,99 +431,97 @@ header.navbar {
} }
.range-group { margin-top: 1rem; }
input { input {
margin: .3em; background-color: transparent;
color: $fg;
user-select: text; user-select: text;
width: 98%; // 100% is inexplicably too long on the right hand side
&::selection { &::selection {
background-color: $fg; background-color: $fg;
color: black; color: black;
} }
&[type="number"]::-webkit-inner-spin-button, &:focus {
&[type="number"]::-webkit-outer-spin-button { background-color: transparent;
appearance: none; color: $fg;
} }
&:focus:invalid { box-shadow: 0 0 .25rem $fg-bright, 0 0 .5rem $fg, 0 0 1rem $fg-dark !important; } &:focus-visible {
background-color: transparent;
color: $fg;
}
&[type="range"] { &:not([type=range]):valid {
box-shadow: none !important; background-image: none !important;
margin-left: calc(100% / 22 - .15rem); border: 1px solid $bg !important ;
width: calc(100% / 11 * 10 + .3rem); }
&:invalid {
background-image: none !important;
border: 1px solid $fg;
box-shadow: 0 0 3px $fg-bright, 0 0 6px $fg, 0 0 12px $fg-dark;
}
&[type=number]::-webkit-inner-spin-button,
&[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
&[type=number] {
-moz-appearance: textfield;
appearance: textfield;
margin: 0;
}
&[type=range] {
// -webkit-appearance: none;
margin-left: calc(4.5% - 2px);
width: 91%;
+ datalist { + datalist {
border-collapse: collapse; display: block;
display: table;
table-layout: fixed;
width: 100%; width: 100%;
option { option {
display: table-cell; display: inline-block;
margin: 0;
text-align: center; text-align: center;
} width: 9%;
}
} }
} }
#combatant-modal-dice { margin-right: 0; } &::-moz-range-track {
border: 1px;
border-radius: 1px;
height: 2px;
}
#combatant-modal-rea { margin-left: 0; } &::-moz-range-thumb {
height: 20px;
width: 4px;
}
}
}
.input-group-text { .input-group-text {
background-color: transparent; background-color: transparent;
border: none; border: none;
color: $fg; color: $fg;
padding: .25rem; }
hr {
border-top: 2px solid $bg;
opacity: .5;
} }
} }
#combatant-modal-stun {
/* ***************** &::-moz-range-track { background-color: $bg-dark; }
* Footer styles &::-moz-range-thumb { background-color: $bg; }
******************* */
.footer-container {
bottom: 0px;
left: 0px;
position: fixed;
right: 0px;
} }
footer { #combatant-modal-physical {
@include aug; &::-moz-range-track { background-color: $fg-dark; }
@include inlay; &::-moz-range-thumb { background-color: $fg; }
--aug-border-all: .1rem !important;
--aug-border-bg: cyan !important; // vars don't work here
--aug-border-opacity: .5 !important;
--aug-inlay-bg: rgba(0, 0, 0, .75) !important;
--aug-tl: .7rem;
--aug-tr: .7rem;
p {
color: $bg;
font-size: x-small;
margin: .15em;
padding: .25rem;
text-align: center;
user-select: text;
-webkit-user-select: text;
a {
color: $fg;
text-decoration: none;
} }
&::selection,
a::selection {
background-color: $fg;
color: black;
}
}
}

View File

@ -12,7 +12,7 @@
<link rel="manifest" href="/icons/sr2ini.webmanifest"> <link rel="manifest" href="/icons/sr2ini.webmanifest">
<!-- <link type="text/css" rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" > --> <link type="text/css" rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" >
<link type="text/css" rel="stylesheet" href="../node_modules/augmented-ui/augmented-ui.css"> <link type="text/css" rel="stylesheet" href="../node_modules/augmented-ui/augmented-ui.css">
<link type="text/css" rel="stylesheet" href="css/sr2ini.scss"> <link type="text/css" rel="stylesheet" href="css/sr2ini.scss">
@ -47,11 +47,11 @@
<main class="table-responsive overflow-visible"> <main class="table-responsive overflow-visible">
<table class="table table-sm table-borderless" id="combatants-table"> <table class="table table-sm table-borderless" id="combatants-table">
<thead> <thead>
<tr data-augmented-ui="tl-clip-y tr-clip-y"> <tr data-augmented-ui="tl-2-clip-y r-clip-y">
<th class="th-name" data-augmented-ui="tl-clip-y both" title="Name" scope="col">Name</th> <th class="col th-name" data-augmented-ui="tl-2-clip-y both" title="Name">Name</th>
<th class="th-ini" data-augmented-ui="both" title="Initiative" scope="col">Ini</th> <th class="col-2 th-ini" data-augmented-ui="both" title="Initiative">Ini</th>
<th class="th-dice-and-rea" data-augmented-ui="both" title="Initiative Dice and Reaction" scope="col">D+R</th> <th class="col-2 th-dice-and-rea" data-augmented-ui="both" title="Initiative Dice and Reaction">D+R</th>
<th class="th-actions" data-augmented-ui="tr-clip-y both" title="Actions" scope="col">Actions</th> <th class="col-3 th-actions" data-augmented-ui="r-clip-y both" title="Actions">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -62,10 +62,10 @@
<!-- confirm modal --> <!-- confirm modal -->
<div class="modal fade" id="confirm-modal" tabindex="-2" role="dialog"> <div class="modal fade" id="confirm-modal" tabindex="-2" role="dialog">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="sr2-modal" data-augmented-ui="tl-2-clip-x tr-clip-y bl-clip-y br-2-clip-x b-scoop-x border"> <div class="sr2-modal" data-augmented-ui="tl-2-clip-x tr-clip-y bl-clip-y br-2-clip-x b-scoop-x border">
<div class="modal-header" data-augmented-ui="inlay"> <div class="modal-header" data-augmented-ui="inlay">
<h2 class="modal-title">Start New Round</h2> <h5 class="modal-title">Start New Round</h5>
<button type="button" class="sr2-button" data-bs-dismiss="modal" aria-label="Close">&#10006;</button> <button type="button" class="sr2-button" data-bs-dismiss="modal" aria-label="Close">&#10006;</button>
</div> </div>
<div class="modal-body" data-augmented-ui="inlay"> <div class="modal-body" data-augmented-ui="inlay">
@ -74,7 +74,7 @@
<div class="modal-footer" data-augmented-ui="inlay"> <div class="modal-footer" data-augmented-ui="inlay">
<button type="button" class="sr2-button" data-bs-dismiss="modal">Cancel</button> <button type="button" class="sr2-button" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="sr2-button" id="confirm-modal-new-round-ok-button" data-bs-dismiss="modal">OK</button> <button type="submit" class="sr2-button" id="confirm-modal-new-round-ok-button" data-bs-dismiss="modal">OK</button>
<button type="submit" class="sr2-button display-none" id="confirm-modal-remove-combatant-ok-button" data-bs-dismiss="modal">OK</button> <button type="submit" class="sr2-button d-none" id="confirm-modal-remove-combatant-ok-button" data-bs-dismiss="modal">OK</button>
</div> </div>
</div> </div>
</div> </div>
@ -82,33 +82,34 @@
<!-- combatant modal (add & edit) --> <!-- combatant modal (add & edit) -->
<div class="modal fade" id="combatant-modal" tabindex="-1" role="dialog"> <div class="modal fade" id="combatant-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="sr2-modal" data-augmented-ui="tl-2-clip-x tr-clip-y bl-clip-y br-2-clip-x b-scoop-x border"> <div class="sr2-modal" data-augmented-ui="tl-2-clip-x tr-clip-y bl-clip-y br-2-clip-x b-scoop-x border">
<div class="modal-header" data-augmented-ui="inlay"> <div class="modal-header" data-augmented-ui="inlay">
<h2 class="modal-title">Add New Combatant</h2> <h5 class="modal-title">Add New Combatant</h5>
<button type="button" class="sr2-button" data-bs-dismiss="modal" aria-label="Close">&#10006;</button> <button type="button" class="sr2-button" data-bs-dismiss="modal" aria-label="Close">&#10006;</button>
</div> </div>
<div class="modal-body" data-augmented-ui="inlay"> <div class="modal-body" data-augmented-ui="inlay">
<form id="combatant-form" name="combatant-modal-form" class="was-validated" onsubmit="return false;"> <form id="combatant-form" name="combatant-modal-form" class="was-validated" onsubmit="return false;">
<div> <div class="my-2">
<input type="text" maxlength="40" class="form-control form-control-sm" id="combatant-modal-name" form="combatant-form" placeholder="Name" required> <input type="text" maxlength="40" class="form-control form-control-sm" id="combatant-modal-name" form="combatant-form" placeholder="Name" required>
</div> </div>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm my-2">
<input type="number" min="1" max="5" class="form-control form-control-sm" id="combatant-modal-dice" form="combatant-form" placeholder="Dice"> <input type="number" min="1" max="5" class="form-control form-control-sm" id="combatant-modal-dice" form="combatant-form" placeholder="Dice">
<span class="input-group-text">D+</span> <span class="input-group-text">D+</span>
<input type="number" min="0" max="30" class="form-control form-control-sm" id="combatant-modal-rea" form="combatant-form" placeholder="REA"> <input type="number" min="0" max="30" class="form-control form-control-sm" id="combatant-modal-rea" form="combatant-form" placeholder="REA">
<span class="input-group-text">&nbsp;&nbsp;&nbsp;</span> <span class="input-group-text">&nbsp;&nbsp;&nbsp;</span>
<input type="number" min="0" max="55" class="form-control form-control-sm" id="combatant-modal-ini" form="combatant-form" placeholder="Ini"> <input type="number" min="0" max="55" class="form-control form-control-sm" id="combatant-modal-ini" form="combatant-form" placeholder="Ini">
</div> </div>
<div class="range-group"> <div class="my-2">
<label for="combatant-modal-stun" class="form-label">Stun damage <span id="combatant-modal-penalty-stun"></span></label> <label for="combatant-modal-stun" class="form-label">Stun Damage <span id="combatant-modal-penalty-stun"></span></label>
<input type="range" class="form-range" min="0" max="10" value="0" id="combatant-modal-stun" list="damage-level"> <input type="range" class="form-range" min="0" max="10" value="0" id="combatant-modal-stun" list="damage">
<datalist id="damage-level"> <datalist id="damage">
<option>0</option><option>L</option><option>.</option><option>M</option><option>.</option><option>.</option><option>S</option><option>.</option><option>.</option><option>.</option><option>D</option> <option>-</option><option>L</option><option>.</option><option>M</option><option>.</option><option>.</option><option>S</option><option>.</option><option>.</option><option>.</option><option>D</option>
</datalist> </datalist>
<div class="label-swap"> <div class="label-swap">
<label for="combatant-modal-physical" class="form-label">Physical damage <span id="combatant-modal-penalty-physical"></span></label> <label for="combatant-modal-physical" class="form-label">Physical Damage <span id="combatant-modal-penalty-physical"></span></label>
<input type="range" class="form-range" min="0" max="10" value="0" id="combatant-modal-physical" list="damage-level"> <input type="range" class="form-range" min="0" max="10" value="0" id="combatant-modal-physical" list="damage">
</div> </div>
</div> </div>
</form> </form>
@ -117,14 +118,14 @@
<button type="button" class="sr2-button" id="combatant-modal-cancel-button" data-bs-dismiss="modal">Cancel</button> <button type="button" class="sr2-button" id="combatant-modal-cancel-button" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="sr2-button" id="combatant-modal-add-apply-button">Apply</button> <button type="submit" class="sr2-button" id="combatant-modal-add-apply-button">Apply</button>
<button type="submit" class="sr2-button" id="combatant-modal-add-ok-button" >OK</button> <button type="submit" class="sr2-button" id="combatant-modal-add-ok-button" >OK</button>
<button type="submit" class="sr2-button display-none" id="combatant-modal-edit-ok-button" >OK</button> <button type="submit" class="sr2-button d-none" id="combatant-modal-edit-ok-button" >OK</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- SVG icon <symbol> definitions (for later <use>)--> <!-- SVG icon <symbol> definitions (for later <use>)-->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" class="display-none"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" class="d-none">
<defs> <defs>
<!-- add combatant --> <!-- add combatant -->
<symbol id="add" > <symbol id="add" >
@ -191,8 +192,8 @@
</svg> </svg>
<!-- footer --> <!-- footer -->
<div class="footer-container container"> <div class="footer-container">
<footer data-augmented-ui="tl-clip br-clip both"> <footer data-augmented-ui="tl-2-clip-x tr-2-clip-x both">
<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> <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>

View File

@ -31,21 +31,21 @@ const DAMAGE_PENALTY = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4];
const DAMAGE_NIVEAU = ["", "L", "M", "S", "D"]; const DAMAGE_NIVEAU = ["", "L", "M", "S", "D"];
const COMBATANT_TABLE_ROW = [ const COMBATANT_TABLE_ROW = [
'<tr class="combatant-row" data-true-ini="">\n', '<tr class="combatant-row" data-true-ini="" data-augmented-ui="tl-scoop bl-clip-y tr-clip-y br-scoop">\n',
'<td class="combatant-name" title="Combatant\'s name" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="both"></td>\n', '<td class="combatant-name" title="Combatant\'s name" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="tl-scoop bl-clip-y both"></td>\n',
'<td class="combatant-ini" title="Effective initiative (w/ wound penalties)" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="both"></td>\n', '<td class="combatant-ini" title="Effective initiative (w/ wound penalties)" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="both"></td>\n',
'<td class="combatant-dice-and-rea" title="Iniative dice and reaction" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="both"><span class="combatant-dice"></span>D+<span class="combatant-rea"></span></td>\n', '<td class="combatant-dice-and-rea" title="Iniative dice and reaction" data-bs-toggle="modal" data-bs-target="#combatant-modal" data-augmented-ui="both"><span class="combatant-dice"></span>D+<span class="combatant-rea"></span></td>\n',
'<td class="combatant-actions" data-augmented-ui="both">\n', '<td class="combatant-actions" data-augmented-ui="tr-clip-y br-scoop both">\n',
'<button type="button" class="sr2-button act-button" title="Act and reduce ini by 10"><svg viewbox="0 0 512 512"><use href="#act" /></svg></button>\n', '<button type="button" class="sr2-button act-button" title="Act and reduce ini by 10"><svg viewbox="0 0 512 512" class="icon"><use href="#act" /></svg></button>\n',
'<div class="damage-dropdown">\n', '<div class="damage-dropdown">\n',
'<button type="button" class="sr2-button damage-button" title="Take damage"><svg viewbox="0 0 512 512"><use href="#take-damage" /></svg></button>\n', '<button type="button" class="sr2-button damage-button" title="Take damage"><svg viewbox="0 0 512 512" class="icon"><use href="#take-damage" /></svg></button>\n',
'</div>\n', '</div>\n',
'<div class="actions-dropdown">\n', '<div class="actions-dropdown">\n',
'<button type="button" class="sr2-button actions-button" title="More actions"><svg viewbox="0 0 512 512"><use href="#more-actions" /</svg></button>\n', '<button type="button" class="sr2-button actions-button" title="More actions"><svg viewbox="0 0 512 512" class="icon"><use href="#more-actions" /</svg></button>\n',
'<div class="actions-menu" data-augmented-ui="tl-scoop bl-clip-y tr-clip-y br-scoop both">\n', '<div class="actions-menu" data-augmented-ui="tl-scoop bl-clip-y tr-clip-y br-scoop both">\n',
'<button type="button" class="sr2-button edit-button" title="Edit combatant" data-bs-toggle="modal" data-bs-target="#combatant-modal" tabindex="-1"><svg viewbox="0 0 512 512"><use href="#edit" /></svg></button>\n', '<button type="button" class="sr2-button edit-button" title="Edit combatant" data-bs-toggle="modal" data-bs-target="#combatant-modal" tabindex="-1"><svg viewbox="0 0 512 512" class="icon"><use href="#edit" /></svg></button>\n',
'<button type="button" class="sr2-button clone-button" title="Clone combatant" data-bs-toggle="modal" data-bs-target="#combatant-modal" tabindex="-1"><svg viewbox="0 0 512 512"><use href="#clone" /></svg></button>\n', '<button type="button" class="sr2-button clone-button" title="Clone combatant" data-bs-toggle="modal" data-bs-target="#combatant-modal" tabindex="-1"><svg viewbox="0 0 512 512" class="icon"><use href="#clone" /></svg></button>\n',
'<button type="button" class="sr2-button remove-button" title="Remove combatant" data-bs-toggle="modal" data-bs-target="#confirm-modal" tabindex="-1"><svg viewbox="0 0 512 512"><use href="#delete" /></svg></button>\n', '<button type="button" class="sr2-button remove-button" title="Remove combatant" data-bs-toggle="modal" data-bs-target="#confirm-modal" tabindex="-1"><svg viewbox="0 0 512 512" class="icon"><use href="#delete" /></svg></button>\n',
'</div>\n', '</div>\n',
'</div>\n', '</div>\n',
'</td>\n', '</td>\n',
@ -67,8 +67,8 @@ const DAMAGE_MONITOR_HTML = [
'</table>\n', '</table>\n',
'</div>'].join(""); '</div>'].join("");
const STUN_BADGE_HTML = '<sup><span class="badge bg-warning translate-middle stun-badge" title="Stun damage niveau"></span></sup>'; const STUN_BADGE_HTML = '<sup><span class="badge bg-warning position-absolute translate-middle stun-badge" title="Stun damage niveau"></span></sup>';
const PHYSICAL_BADGE_HTML = '<sub><span class="badge bg-danger translate-middle physical-badge" title="Physical damage niveau"></span></sub>'; const PHYSICAL_BADGE_HTML = '<sub><span class="badge bg-danger position-absolute translate-middle physical-badge" title="Physical damage niveau"></span></sub>';
/* /*
@ -148,8 +148,8 @@ function handleActButtonClick(event) {
function handleAddButtonClick(event) { function handleAddButtonClick(event) {
// restyle modal // restyle modal
$("#combatant-modal .modal-title").text("Add Combatant"); $("#combatant-modal .modal-title").text("Add Combatant");
$("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").removeClass("display-none"); $("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").removeClass("d-none");
$("#combatant-modal-edit-ok-button").addClass("display-none"); $("#combatant-modal-edit-ok-button").addClass("d-none");
// set default values // set default values
$("#combatant-modal-name").val("Goon 1"); $("#combatant-modal-name").val("Goon 1");
$("#combatant-modal-dice").val("2"); $("#combatant-modal-dice").val("2");
@ -173,8 +173,8 @@ function handleCloneButtonClick(event) {
$tr.find(".actions-menu").removeClass("seen"); $tr.find(".actions-menu").removeClass("seen");
// restyle modal // restyle modal
$("#combatant-modal .modal-title").text("Clone Combatant"); $("#combatant-modal .modal-title").text("Clone Combatant");
$("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").removeClass("display-none"); $("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").removeClass("d-none");
$("#combatant-modal-edit-ok-button").addClass("display-none"); $("#combatant-modal-edit-ok-button").addClass("d-none");
// populate modal with values from row // populate modal with values from row
$("#combatant-modal-name").val($tr.find(".combatant-name").text()); $("#combatant-modal-name").val($tr.find(".combatant-name").text());
$("#combatant-modal-dice").val($tr.find(".combatant-dice").attr("data-combatant-dice")); $("#combatant-modal-dice").val($tr.find(".combatant-dice").attr("data-combatant-dice"));
@ -252,8 +252,8 @@ function handleEditButtonClick(event) {
let $tr = $(event.target).parents(".combatant-row"); let $tr = $(event.target).parents(".combatant-row");
// restyle modal // restyle modal
$("#combatant-modal .modal-title").text("Edit Combatant"); $("#combatant-modal .modal-title").text("Edit Combatant");
$("#combatant-modal-edit-ok-button").removeClass("display-none"); $("#combatant-modal-edit-ok-button").removeClass("d-none");
$("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").addClass("display-none"); $("#combatant-modal-add-ok-button, #combatant-modal-add-apply-button").addClass("d-none");
// populate modal with values from row // populate modal with values from row
$("#combatant-modal-name").val($tr.find(".combatant-name").text()); $("#combatant-modal-name").val($tr.find(".combatant-name").text());
$("#combatant-modal-dice").val($tr.find(".combatant-dice").attr("data-combatant-dice")); $("#combatant-modal-dice").val($tr.find(".combatant-dice").attr("data-combatant-dice"));
@ -291,8 +291,8 @@ function handleMoreActionsButtonClick(event) {
function handleNewRoundButtonClick(event) { function handleNewRoundButtonClick(event) {
// restyle modal // restyle modal
$("#confirm-modal .modal-title").text("Start new Round"); $("#confirm-modal .modal-title").text("Start new Round");
$("#confirm-modal-new-round-ok-button").removeClass("display-none"); $("#confirm-modal-new-round-ok-button").removeClass("d-none");
$("#confirm-modal-remove-combatant-ok-button").addClass("display-none"); $("#confirm-modal-remove-combatant-ok-button").addClass("d-none");
// add handler for enter key // add handler for enter key
$("#confirm-modal").off("keydown"); $("#confirm-modal").off("keydown");
$("#confirm-modal").on("keydown", (e) => { $("#confirm-modal").on("keydown", (e) => {
@ -307,8 +307,8 @@ function handleNewRoundButtonClick(event) {
function handleRemoveButtonClick(event) { function handleRemoveButtonClick(event) {
// restyle modal // restyle modal
$("#confirm-modal .modal-title").text("Remove Combatant"); $("#confirm-modal .modal-title").text("Remove Combatant");
$("#confirm-modal-remove-combatant-ok-button").removeClass("display-none"); $("#confirm-modal-remove-combatant-ok-button").removeClass("d-none");
$("#confirm-modal-new-round-ok-button").addClass("display-none"); $("#confirm-modal-new-round-ok-button").addClass("d-none");
// mark which row is being removed // mark which row is being removed
$("#confirm-modal").data("row", $(".combatant-row").index($(event.target).parents(".combatant-row"))); // here it's okay to use .data() b/c HTML/CSS does not care about this value $("#confirm-modal").data("row", $(".combatant-row").index($(event.target).parents(".combatant-row"))); // here it's okay to use .data() b/c HTML/CSS does not care about this value
// add handler for enter key // add handler for enter key
@ -555,3 +555,5 @@ $(document).ready(function () {
}); });
addTestCombatant(); addTestCombatant();
}); });
//module.exports = { rollForInitiative, validateCombatant, whoGoesFirst, getEffectiveIni };