From 3c9d7e77f037f449a7fcf542aabc21e8e2f3c2d8 Mon Sep 17 00:00:00 2001 From: adrien Date: Thu, 25 Apr 2024 15:21:32 +0200 Subject: [PATCH] icones --- .../android-chrome-192x192.png | Bin .../android-chrome-512x512.png | Bin {favicons => icones}/apple-touch-icon.png | Bin {favicons => icones}/favicon-16x16.png | Bin {favicons => icones}/favicon-32x32.png | Bin {favicons => icones}/favicon.ico | Bin icones/lotus.svg | 26 ++++++++++++++++++ {favicons => icones}/site.webmanifest | 0 icones/volumeOff.svg | 1 + icones/volumeOn.svg | 1 + index.html | 26 ++++++++++++++---- script.js | 9 +++--- style.css | 11 ++++++-- 13 files changed, 63 insertions(+), 11 deletions(-) rename {favicons => icones}/android-chrome-192x192.png (100%) rename {favicons => icones}/android-chrome-512x512.png (100%) rename {favicons => icones}/apple-touch-icon.png (100%) rename {favicons => icones}/favicon-16x16.png (100%) rename {favicons => icones}/favicon-32x32.png (100%) rename {favicons => icones}/favicon.ico (100%) create mode 100644 icones/lotus.svg rename {favicons => icones}/site.webmanifest (100%) create mode 100644 icones/volumeOff.svg create mode 100644 icones/volumeOn.svg diff --git a/favicons/android-chrome-192x192.png b/icones/android-chrome-192x192.png similarity index 100% rename from favicons/android-chrome-192x192.png rename to icones/android-chrome-192x192.png diff --git a/favicons/android-chrome-512x512.png b/icones/android-chrome-512x512.png similarity index 100% rename from favicons/android-chrome-512x512.png rename to icones/android-chrome-512x512.png diff --git a/favicons/apple-touch-icon.png b/icones/apple-touch-icon.png similarity index 100% rename from favicons/apple-touch-icon.png rename to icones/apple-touch-icon.png diff --git a/favicons/favicon-16x16.png b/icones/favicon-16x16.png similarity index 100% rename from favicons/favicon-16x16.png rename to icones/favicon-16x16.png diff --git a/favicons/favicon-32x32.png b/icones/favicon-32x32.png similarity index 100% rename from favicons/favicon-32x32.png rename to icones/favicon-32x32.png diff --git a/favicons/favicon.ico b/icones/favicon.ico similarity index 100% rename from favicons/favicon.ico rename to icones/favicon.ico diff --git a/icones/lotus.svg b/icones/lotus.svg new file mode 100644 index 0000000..da09059 --- /dev/null +++ b/icones/lotus.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/favicons/site.webmanifest b/icones/site.webmanifest similarity index 100% rename from favicons/site.webmanifest rename to icones/site.webmanifest diff --git a/icones/volumeOff.svg b/icones/volumeOff.svg new file mode 100644 index 0000000..638ff68 --- /dev/null +++ b/icones/volumeOff.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icones/volumeOn.svg b/icones/volumeOn.svg new file mode 100644 index 0000000..00aea26 --- /dev/null +++ b/icones/volumeOn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 1f0e3a1..f886a7e 100644 --- a/index.html +++ b/index.html @@ -8,15 +8,31 @@ LOTUS - - - - + + + +
-

LOTUS

+
diff --git a/script.js b/script.js index 52c0e6d..25d1519 100644 --- a/script.js +++ b/script.js @@ -79,6 +79,7 @@ function onkeyup(event) { function onsubmit(event) { if (this.checkValidity()) { + volumeOn = volumeCheckbox.checked if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) { var inputsNonValides = Array.from(form.children) motATrouver.forEach((lettre, indice) => { @@ -90,7 +91,7 @@ function onsubmit(event) { nbLettresBienPlacees++ setTimeout(() => { input.className = "lettre-bien-placee" - sonLettreBienPlacee.play() + if (volumeOn) sonLettreBienPlacee.play() }, periode * indice) } input.readOnly = true @@ -102,10 +103,10 @@ function onsubmit(event) { delete(lettresATrouver[index]) setTimeout(() => { input.className = "lettre-mal-placee" - sonLettreMalPlacee.play() + if (volumeOn) sonLettreMalPlacee.play() }, periode * indice) } else { - setTimeout(() => sonLettreNonTrouvee.play(), periode * indice) + setTimeout(() => {if (volumeOn) sonLettreNonTrouvee.play()}, periode * indice) } }) @@ -117,7 +118,7 @@ function onsubmit(event) { } else { for(input of form.children) input.readOnly = true - sonLettreMalPlacee.play() + if (volumeOn) sonLettreMalPlacee.play() nouvelEssai() } diff --git a/style.css b/style.css index b93bb5d..07fa686 100644 --- a/style.css +++ b/style.css @@ -1,6 +1,5 @@ :root { font-size: 125%; - --pico-typography-spacing-vertical: 1.1em; } h1 { @@ -13,7 +12,7 @@ h1 img { border-radius: 100%; background-origin: content-box; padding: 0; - height: 0.7em; + height: 0.75em; vertical-align: baseline; } @@ -40,4 +39,12 @@ h1 img { .lettre-mal-placee { background-image: radial-gradient(ellipse at center, #FFBF00A0 70%, transparent 70%); background-repeat: no-repeat; +} + +#volumeCheckbox { + display: none; +} + +#volumeCheckbox:checked ~ label svg path { + d: path("M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320ZM400-606l-86 86H200v80h114l86 86v-252ZM300-480Z"); } \ No newline at end of file