From 4435d1e1302ef9eb758daf0087cef705f62c8601 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 2 Aug 2023 18:15:45 -0600 Subject: [PATCH] change label for aspect lock on token create form, adjust dice scroll logic --- static/admin.js | 4 ++-- static/index.html | 14 +++++++------- static/socket.js | 2 +- static/style.css | 4 ++++ static/util.js | 2 +- templates/error.html | 2 +- templates/register.html | 2 +- templates/registered.html | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/static/admin.js b/static/admin.js index 85a411b..ae41075 100644 --- a/static/admin.js +++ b/static/admin.js @@ -98,7 +98,7 @@ function previewSprite(source) { function toggleAspectLock() { try { const locked = $("token_aspect_lock").checked; - $("aspect_lock_label").innerHTML = locked ? "🔒" : "🔓" + $("aspect_lock_label").innerHTML = locked ? "w:h locked" : "w:h free" } catch {} } @@ -339,7 +339,7 @@ async function uploadImg(imgType) { if (res.ok) { loadAdmin(tableKey.name, tableKey.passcode); } else { - throw new Error("Something went wrong uploading the ${imgType} image..."); + throw new Error(`Something went wrong uploading the ${imgType} image...`); } } catch (err) { setErr(`${err.name}: ${err.message}`); diff --git a/static/index.html b/static/index.html index 9e02697..872cf87 100644 --- a/static/index.html +++ b/static/index.html @@ -111,7 +111,7 @@

-
+



@@ -146,14 +146,14 @@ -
felt v0.2.3 (license) | built with leaflet (license)
+
felt v0.2.5 (license) | built with leaflet (license)
- - - - - + + + + + diff --git a/static/socket.js b/static/socket.js index 8c892d5..be8bd6d 100644 --- a/static/socket.js +++ b/static/socket.js @@ -193,7 +193,7 @@ function logDice(dice) { try{ const p = formatDice(r); diceLog.append(p); - p.scrollIntoView(); + diceLog.scrollTop = diceLog.scrollHeight; } catch{} } } diff --git a/static/style.css b/static/style.css index 466ed2c..4ecafdf 100644 --- a/static/style.css +++ b/static/style.css @@ -202,6 +202,10 @@ nav { background: transparent; } +#aspect_lock_label { + color: var(--main_color); +} + #token_aspect_lock { display: none; } diff --git a/static/util.js b/static/util.js index c4bbda7..4a47aa2 100644 --- a/static/util.js +++ b/static/util.js @@ -53,7 +53,7 @@ function setupDiceAutoScroll() { if (diceWin.open) { const diceLog = $("dice_log"); if (diceLog && diceLog.children.length > 0) { - diceLog.children[diceLog.children.length - 1].scrollIntoView(); + diceLog.scrollTop = diceLog.scrollHeight; } } }); diff --git a/templates/error.html b/templates/error.html index f0124ef..7d56f51 100644 --- a/templates/error.html +++ b/templates/error.html @@ -15,6 +15,6 @@

Get back to gaming...

- + \ No newline at end of file diff --git a/templates/register.html b/templates/register.html index ff0ca56..a346f87 100644 --- a/templates/register.html +++ b/templates/register.html @@ -23,5 +23,5 @@ {{end}} - + \ No newline at end of file diff --git a/templates/registered.html b/templates/registered.html index 2ed8ef3..d15df8d 100644 --- a/templates/registered.html +++ b/templates/registered.html @@ -19,5 +19,5 @@ {{end}} - + \ No newline at end of file