Compare commits
9 Commits
86461c1a87
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a4fbc0c5e | |||
| 4f2ea7d607 | |||
| 905f6de44b | |||
| 11d7a857cd | |||
| 1b07e6ae58 | |||
| a2e08dad4d | |||
| 5c3957c516 | |||
| a03e5b567a | |||
| e9d74efed9 |
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# L🪷TUS
|
||||||
|
|
||||||
|
Clone of TV game show Lingo / Motus / Sutom
|
||||||
|
|
||||||
|

|
||||||
@ -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"}
|
|
||||||
15
index.html
15
index.html
@ -11,7 +11,17 @@
|
|||||||
<link rel="apple-touch-icon" sizes="180x180" href="icones/apple-touch-icon.png">
|
<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="32x32" href="icones/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="icones/favicon-16x16.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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -24,7 +34,7 @@
|
|||||||
<form id="optionsForm" action="#" method="dialog">
|
<form id="optionsForm" action="#" method="dialog">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label class="option">
|
<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/>
|
<input type="number" id="nbLettresInput" min="6" max="10" value="8" size="2" step="1" required/>
|
||||||
lettres.
|
lettres.
|
||||||
</label>
|
</label>
|
||||||
@ -85,6 +95,5 @@
|
|||||||
<script src="motsATrouver.js" charset="UTF-8"></script>
|
<script src="motsATrouver.js" charset="UTF-8"></script>
|
||||||
<script src="motsAutorises.js" charset="UTF-8"></script>
|
<script src="motsAutorises.js" charset="UTF-8"></script>
|
||||||
<script src="script.js" charset="UTF-8"></script>
|
<script src="script.js" charset="UTF-8"></script>
|
||||||
<script>navigator?.serviceWorker.register('service-worker.js')</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
27
script.js
27
script.js
@ -40,6 +40,13 @@ function nouvellePartie() {
|
|||||||
nouvelEssai()
|
nouvelEssai()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function perdu() {
|
||||||
|
if (confirm(`Perdu ! Le mot à trouver était : ${motATrouver.toUpperCase()}.\nRéessayer ?`)) nouvellePartie()
|
||||||
|
else nbEssais = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
sonPerdu.onended = perdu
|
||||||
|
|
||||||
var form
|
var form
|
||||||
var lettresATrouver
|
var lettresATrouver
|
||||||
var nbLettresBienPlacees
|
var nbLettresBienPlacees
|
||||||
@ -83,9 +90,8 @@ function nouvelEssai() {
|
|||||||
input.disabled = true
|
input.disabled = true
|
||||||
input.value = lettre
|
input.value = lettre
|
||||||
})
|
})
|
||||||
play(sonPerdu)
|
if (volumeOn) play(sonPerdu)
|
||||||
if (confirm(`Perdu ! Le mot à trouver était : ${motATrouver.toUpperCase()}.\nRéessayer ?`)) nouvellePartie()
|
else perdu()
|
||||||
else nbEssais = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,6 +129,12 @@ function play(son) {
|
|||||||
son.play()
|
son.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gagne() {
|
||||||
|
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
|
||||||
|
}
|
||||||
|
|
||||||
|
sonMotTrouve.onended = gagne
|
||||||
|
|
||||||
function onsubmit(event) {
|
function onsubmit(event) {
|
||||||
if (this.checkValidity()) {
|
if (this.checkValidity()) {
|
||||||
if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) {
|
if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) {
|
||||||
@ -150,15 +162,15 @@ function onsubmit(event) {
|
|||||||
input.classList.add("mal-placee")
|
input.classList.add("mal-placee")
|
||||||
if (volumeOn) play(sonLettreMalPlacee)
|
if (volumeOn) play(sonLettreMalPlacee)
|
||||||
}, periode * indice)
|
}, periode * indice)
|
||||||
} else {
|
} else if (volumeOn) {
|
||||||
setTimeout(() => {if (volumeOn) play(sonLettreNonTrouvee)}, periode * indice)
|
setTimeout(() => play(sonLettreNonTrouvee), periode * indice)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (nbLettresBienPlacees == nbLettres) {
|
if (nbLettresBienPlacees == nbLettres) {
|
||||||
play(sonMotTrouve)
|
if (volumeOn) play(sonMotTrouve)
|
||||||
if (confirm("Bien joué !\nUne nouvelle partie ?")) nouvellePartie()
|
else gagne()
|
||||||
} else nouvelEssai()
|
} else nouvelEssai()
|
||||||
}, listeATrouver.length * periode)
|
}, listeATrouver.length * periode)
|
||||||
|
|
||||||
@ -172,3 +184,4 @@ function onsubmit(event) {
|
|||||||
this.reportValidity()
|
this.reportValidity()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
site.webmanifest
Normal file
12
site.webmanifest
Normal 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"
|
||||||
|
}
|
||||||
BIN
thumbnail.png
BIN
thumbnail.png
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user