diff --git a/src/index.html b/src/index.html index 0cbe57c..7fce25e 100644 --- a/src/index.html +++ b/src/index.html @@ -50,7 +50,7 @@ + +
Settings
+
+

+ Change unit between meters and feet. + +

+

+ Reset app to it's original state. + +

+
+
+

+ If you like this little app, consider supporting it on + patreon or + buy me a coffee. +

+ +

MyThrow.xyz

@@ -101,10 +124,9 @@

MyThrow.xyz

@@ -143,29 +165,34 @@

MyThrow.xyz

text-align: center; } - #about-dialog { + dialog { margin-left: 0.8rem; margin-right: 0.8rem; padding: 10px 10px; text-wrap: pretty; } - #about-dialog > header:first-child { - margin: -10px -10px 10px; /* Must change together with #about-dialog padding */ + dialog > header:first-child { + margin: -10px -10px 10px; /* Must change together with dialog padding */ } - #about-dialog > article { + dialog > article { padding: 0 10px; max-height: 55dvh; overflow: auto; } - #about-dialog > button { + dialog article p > button { + margin-top: 6px; + display: block; + } + + dialog > button { margin: auto 6px 6px auto; display: block; } - #about-dialog > p:has(~button) { + dialog > p:has(~ button) { margin-bottom: 0; } @@ -208,13 +235,6 @@

MyThrow.xyz

padding-right: 0.1rem; padding-left: 0.1rem; } - - #unit-btn { - all: unset; - position: absolute; - bottom: 7.3rem; - right: 0.8rem; - } @@ -586,10 +606,10 @@

MyThrow.xyz

if (state.get().unit === "feet") { state.update({ unit: "meter" }); - btn.textContent = "use feet"; + btn.textContent = "meter"; } else { state.update({ unit: "feet" }); - btn.textContent = "use meters"; + btn.textContent = "feet"; } } @@ -614,7 +634,7 @@

MyThrow.xyz

.addEventListener("click", setStartPosition); document.querySelector("#unit-btn").textContent = - state.get().unit === "feet" ? "use meters" : "use feet"; + state.get().unit === "feet" ? "feet" : "meter"; document.querySelector("#unit-btn").addEventListener("click", toggleUnit); document @@ -630,7 +650,7 @@

MyThrow.xyz

const aboutDialog = document.querySelector("#about-dialog"); document - .querySelector("#about-dialog-trigger") + .querySelector("#open-about-dialog-btn") .addEventListener("click", () => { aboutDialog.showModal(); }); @@ -640,6 +660,20 @@

MyThrow.xyz

.addEventListener("click", () => { aboutDialog.close(); }); + + const settingsDialog = document.querySelector("#settings-dialog"); + + document + .querySelector("#open-settings-dialog-btn") + .addEventListener("click", () => { + settingsDialog.showModal(); + }); + + document + .querySelector("#close-settings-dialog-btn") + .addEventListener("click", () => { + settingsDialog.close(); + });