From 75a79fb7009b381f2726632cb9df3784d7b21d55 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Sun, 5 May 2024 18:56:02 +0200 Subject: [PATCH] formatting, update text, ux --- index.html | 6 +++--- script.js | 10 ++++++++-- style.css | 3 ++- sw.js | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 8312178..e10b173 100755 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Role Playing Game Dices - + @@ -80,7 +80,7 @@
- +
@@ -104,7 +104,7 @@
- +
diff --git a/script.js b/script.js index 6d66459..ea03eef 100755 --- a/script.js +++ b/script.js @@ -97,7 +97,10 @@ function renderDice(dice, index) { if (dices.filter((dice) => dice.selected).length) { document.getElementById('roll-button').classList.remove("disabled"); - document.getElementById('roll-add-button').classList.remove("disabled"); + document.getElementById('roll-add-button').classList.add("disabled"); + if (dices.filter((dice) => dice.selected).length > 1) { + document.getElementById('roll-add-button').classList.remove("disabled"); + } } else { document.getElementById('roll-button').classList.add("disabled"); document.getElementById('roll-add-button').classList.add("disabled"); @@ -143,7 +146,10 @@ function renderDices() { if (dices.filter((dice) => dice.selected).length) { document.getElementById('roll-button').classList.remove("disabled"); - document.getElementById('roll-add-button').classList.remove("disabled"); + document.getElementById('roll-add-button').classList.add("disabled"); + if (dices.filter((dice) => dice.selected).length > 1) { + document.getElementById('roll-add-button').classList.remove("disabled"); + } } else { document.getElementById('roll-button').classList.add("disabled"); document.getElementById('roll-add-button').classList.add("disabled"); diff --git a/style.css b/style.css index aa9c3b1..60f56bd 100755 --- a/style.css +++ b/style.css @@ -264,7 +264,8 @@ body { display: grid; grid-template-columns: repeat(4, auto); width: 100%; - margin-top: 2em; + margin-top: 1.5em; + margin-bottom: 0.5em; row-gap: 0.3em; column-gap: 0.3em; } diff --git a/sw.js b/sw.js index 61b5a1b..6eadc8f 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const rpgDicesVersion = "rpg-dices-v0.2.0" +const rpgDicesVersion = "rpg-dices-v0.2.1" const assets = [ "/", "/index.html",