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

|
||||
13
index.html
13
index.html
@ -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">
|
||||
<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>
|
||||
23
script.js
23
script.js
@ -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,12 +90,8 @@ function nouvelEssai() {
|
||||
input.disabled = true
|
||||
input.value = lettre
|
||||
})
|
||||
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()
|
||||
else perdu()
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,10 +129,12 @@ function play(son) {
|
||||
son.play()
|
||||
}
|
||||
|
||||
sonMotTrouve.onended = function(event) {
|
||||
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(""))) {
|
||||
@ -157,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) {
|
||||
if (volumeOn) play(sonMotTrouve)
|
||||
else sonMotTrouve.onended()
|
||||
else gagne()
|
||||
} else nouvelEssai()
|
||||
}, listeATrouver.length * periode)
|
||||
|
||||
|
||||
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