Compare commits

...

2 Commits

Author SHA1 Message Date
a03e5b567a wait for sound end before confirm 2024-07-23 01:58:13 +02:00
e9d74efed9 emoji in name in webmanifest 2024-06-12 16:09:42 +02:00
4 changed files with 26 additions and 7 deletions

View File

@ -1 +0,0 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

View File

@ -11,7 +11,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="icones/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="icones/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icones/favicon-16x16.png">
<link rel="manifest" href="icones/site.webmanifest">
<link rel="manifest" href="site.webmanifest">
</head>
<body>

View File

@ -83,9 +83,12 @@ function nouvelEssai() {
input.disabled = true
input.value = lettre
})
play(sonPerdu)
if (confirm(`Perdu ! Le mot à trouver était : ${motATrouver.toUpperCase()}.\nRéessayer ?`)) nouvellePartie()
else nbEssais = 0
sonPerdu.onended = function() {
if (confirm(`Perdu ! Le mot à trouver était : ${motATrouver.toUpperCase()}.\nRéessayer ?`)) nouvellePartie()
else nbEssais = 0
}
if (volumeOn) play(sonPerdu)
else sonPerdu.onended()
}
}
@ -123,6 +126,10 @@ function play(son) {
son.play()
}
sonMotTrouve.onended = function(event) {
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
}
function onsubmit(event) {
if (this.checkValidity()) {
if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) {
@ -157,8 +164,8 @@ function onsubmit(event) {
setTimeout(() => {
if (nbLettresBienPlacees == nbLettres) {
play(sonMotTrouve)
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
if (volumeOn) play(sonMotTrouve)
else sonMotTrouve.onended()
} else nouvelEssai()
}, listeATrouver.length * periode)
@ -172,3 +179,4 @@ function onsubmit(event) {
this.reportValidity()
}
}

12
site.webmanifest Normal file
View File

@ -0,0 +1,12 @@
{
"name": "L🪷TUS",
"short_name": "L🪷TUS",
"description": "Devinez le mot",
"icons": [
{ "src": "icones/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "icones/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
],
"theme_color": "#f26c9a",
"background_color": "#ffffff",
"display": "standalone"
}