Compare commits

..

9 Commits

Author SHA1 Message Date
7a4fbc0c5e Add README 2025-05-21 10:25:33 +02:00
4f2ea7d607 update thumbnail 2025-05-20 17:01:28 +02:00
905f6de44b new thumbnail 2025-05-17 14:41:05 +02:00
11d7a857cd mots 2025-05-17 14:24:02 +02:00
1b07e6ae58 description 2025-05-17 14:13:28 +02:00
a2e08dad4d meta 2025-05-16 10:17:29 +02:00
5c3957c516 perdu ! 2025-05-09 18:08:25 +02:00
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
6 changed files with 49 additions and 11 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# L🪷TUS
Clone of TV game show Lingo / Motus / Sutom
![screenshot](https://git.malingrey.fr/adrien/lotus/raw/branch/master/thumbnail.png)

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,17 @@
<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">
<meta property="og:title" content="L🪷TUS"/>
<meta property="og:type" content="game"/>
<meta property="og:url" content="https://adrien.malingrey.fr/jeux/lotus/"/>
<meta property="og:image" content="https://adrien.malingrey.fr/jeux/lotus/thumbnail.png"/>
<meta property="og:image:width" content="540"/>
<meta property="og:image:height" content="540"/>
<meta property="og:description" content="Devinez le mot dans cette adaptation d'un jeu télé"/>
<meta property="og:locale" content="fr_FR"/>
<meta property="og:site_name" content="adrien.malingrey.fr"/>
<link rel="manifest" href="site.webmanifest">
<script>navigator?.serviceWorker.register('service-worker.js')</script>
</head>
<body>
@ -24,7 +34,7 @@
<form id="optionsForm" action="#" method="dialog">
<fieldset>
<label class="option">
Trouvez des mot de
Trouvez des mots de
<input type="number" id="nbLettresInput" min="6" max="10" value="8" size="2" step="1" required/>
lettres.
</label>
@ -85,6 +95,5 @@
<script src="motsATrouver.js" charset="UTF-8"></script>
<script src="motsAutorises.js" charset="UTF-8"></script>
<script src="script.js" charset="UTF-8"></script>
<script>navigator?.serviceWorker.register('service-worker.js')</script>
</body>
</html>

View File

@ -40,6 +40,13 @@ function nouvellePartie() {
nouvelEssai()
}
function perdu() {
if (confirm(`Perdu ! Le mot à trouver était : ${motATrouver.toUpperCase()}.\nRéessayer ?`)) nouvellePartie()
else nbEssais = 0
}
sonPerdu.onended = perdu
var form
var lettresATrouver
var nbLettresBienPlacees
@ -83,9 +90,8 @@ 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
if (volumeOn) play(sonPerdu)
else perdu()
}
}
@ -123,6 +129,12 @@ function play(son) {
son.play()
}
function gagne() {
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
}
sonMotTrouve.onended = gagne
function onsubmit(event) {
if (this.checkValidity()) {
if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) {
@ -150,15 +162,15 @@ function onsubmit(event) {
input.classList.add("mal-placee")
if (volumeOn) play(sonLettreMalPlacee)
}, periode * indice)
} else {
setTimeout(() => {if (volumeOn) play(sonLettreNonTrouvee)}, periode * indice)
} else if (volumeOn) {
setTimeout(() => play(sonLettreNonTrouvee), periode * indice)
}
})
setTimeout(() => {
if (nbLettresBienPlacees == nbLettres) {
play(sonMotTrouve)
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
if (volumeOn) play(sonMotTrouve)
else gagne()
} else nouvelEssai()
}, listeATrouver.length * periode)
@ -172,3 +184,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"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 35 KiB