plus de mots autorisés, favicon

This commit is contained in:
Adrien MALINGREY 2024-04-25 01:26:15 +02:00
parent c889fbcb01
commit 479b632989
12 changed files with 237227 additions and 33 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
favicons/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

BIN
favicons/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
favicons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1 @@
{"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

@ -8,6 +8,10 @@
<title>LOTUS</title> <title>LOTUS</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"/>
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
<link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicons/favicon-16x16.png">
<link rel="manifest" href="favicons/site.webmanifest">
</head> </head>
<body> <body>
@ -22,7 +26,8 @@
<audio preload src="sons/lettre-bien-place.wav" id="sonLettreBienPlacee"></audio> <audio preload src="sons/lettre-bien-place.wav" id="sonLettreBienPlacee"></audio>
</div> </div>
<script src="mots.js" charset="UTF-8"></script> <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 src="script.js" charset="UTF-8"></script>
</body> </body>
</html> </html>

View File

@ -1,4 +1,4 @@
const mots = [ const motsATrouver = [
"abattu", "abbaye", "abetir", "abimee", "abimer", "abimes", "abject", "abolie", "abolir", "abolis", "abattu", "abbaye", "abetir", "abimee", "abimer", "abimes", "abject", "abolie", "abolir", "abolis",
"abonne", "abords", "aboyer", "abrupt", "abruti", "absent", "absolu", "abusee", "abuser", "abuses", "abonne", "abords", "aboyer", "abrupt", "abruti", "absent", "absolu", "abusee", "abuser", "abuses",
"abusif", "abysse", "acabit", "acacia", "acajou", "accent", "accord", "accroc", "acerbe", "achats", "acteur", "abusif", "abysse", "acabit", "acacia", "acajou", "accent", "accord", "accroc", "acerbe", "achats", "acteur",
@ -2670,5 +2670,6 @@ const mots = [
"visualisee", "visualiser", "visualises", "vitaminees", "vitrifiees", "vivifiante", "vivifiants", "viviparite", "vocalement", "vocalisees", "visualisee", "visualiser", "visualises", "vitaminees", "vitrifiees", "vivifiante", "vivifiants", "viviparite", "vocalement", "vocalisees",
"vociferees", "voilements", "voisinages", "voituriere", "voituriers", "volatilise", "volatilite", "volcanique", "volcanisee", "volcaniser", "vociferees", "voilements", "voisinages", "voituriere", "voituriers", "volatilise", "volatilite", "volcanique", "volcanisee", "volcaniser",
"volcanises", "volubilite", "volumineux", "voluptueux", "voyageuses", "voyeurisme", "voyeuriste", "vulcanisee", "vulcaniser", "volcanises", "volubilite", "volumineux", "voluptueux", "voyageuses", "voyeurisme", "voyeuriste", "vulcanisee", "vulcaniser",
"vulcanises", "vulgarisee", "vulgariser", "vulgarises", "vulgarites", "vulnerable" "vulcanises", "vulgarisee", "vulgariser", "vulgarises", "vulgarites", "vulnerable",
"toutes", "triees", "truand", "truque"
] ]

237205
motsAutorises.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,11 @@
const periode = 500 //ms const periode = 500 //ms
var substition = {
"é": "e",
"è": "e",
"ê": "e",
"ë": "e",
"â": "a",
"à": "a",
"î": "i",
"ô": "o",
"œ": "oe",
"û": "u",
"ù": "u",
"ü": "u",
"ç": "c"
}
var motATrouver var motATrouver
var lettresTrouvees var lettresTrouvees
var nbLettres var nbLettres
function nouvellePartie() { function nouvellePartie() {
motATrouver = mots[Math.floor(mots.length * Math.random())] motATrouver = motsATrouver[Math.floor(motsATrouver.length * Math.random())].normalize("NFD").replace(/\p{Diacritic}/gu, "")
motATrouver = Array.from(motATrouver).map((lettre) => substition[lettre] || lettre) motATrouver = Array.from(motATrouver)
nbLettres = motATrouver.length nbLettres = motATrouver.length
lettresTrouvees = [motATrouver[0]] lettresTrouvees = [motATrouver[0]]
@ -69,9 +53,7 @@ function onfocus() {
} }
function oninput() { function oninput() {
var lettre = this.value.toLowerCase() this.value = this.value.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase()
if (substition[lettre]) lettre = substition[lettre]
this.value = lettre
if (this.checkValidity()) { if (this.checkValidity()) {
this.nextSibling?.focus() this.nextSibling?.focus()
} else { } else {
@ -95,7 +77,7 @@ function onkeyup(event) {
function onsubmit(event) { function onsubmit(event) {
if (this.checkValidity()) { if (this.checkValidity()) {
if (mots.includes(Array.from(form.children).map((input) => input.value).join(""))) { if (motsAutorises.includes(Array.from(form.children).map((input) => input.value).join(""))) {
var inputsNonValides = Array.from(form.children) var inputsNonValides = Array.from(form.children)
motATrouver.forEach((lettre, indice) => { motATrouver.forEach((lettre, indice) => {
var input = this.children[indice] var input = this.children[indice]
@ -127,8 +109,7 @@ function onsubmit(event) {
setTimeout(() => { setTimeout(() => {
if (nbLettresBienPlacees == nbLettres) { if (nbLettresBienPlacees == nbLettres) {
alert("Bien joué gros !\nUne nouvelle partie ?") if (confirm("Bien joué gros !\nUne nouvelle partie ?")) nouvellePartie()
nouvellePartie()
} else nouvelEssai() } else nouvelEssai()
}, motATrouver.length * periode) }, motATrouver.length * periode)

View File

@ -10,16 +10,17 @@ h1 {
#grille input[type=text] { #grille input[type=text] {
font-size: 2em; font-size: 2em;
text-transform: capitalize; text-transform: capitalize;
width: 1.2em; width: 1.3em;
height: 1.2em; height: 1.3em;
padding: 0.2rem; padding: 0.15em;
text-align: center; text-align: center;
border-radius: 0.3rem; border-radius: 0.3rem;
vertical-align: center;
} }
.lettre-bien-placee { .lettre-bien-placee {
background-image: linear-gradient(#D93526A0, #D93526A0); background-image: linear-gradient(#D93526D0, #D93526D0);
background-clip: content-box; background-origin: content-box;
} }
.lettre-mal-placee { .lettre-mal-placee {