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>
<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="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>
<body>
@ -22,7 +26,8 @@
<audio preload src="sons/lettre-bien-place.wav" id="sonLettreBienPlacee"></audio>
</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>
</body>
</html>

View File

@ -1,4 +1,4 @@
const mots = [
const motsATrouver = [
"abattu", "abbaye", "abetir", "abimee", "abimer", "abimes", "abject", "abolie", "abolir", "abolis",
"abonne", "abords", "aboyer", "abrupt", "abruti", "absent", "absolu", "abusee", "abuser", "abuses",
"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",
"vociferees", "voilements", "voisinages", "voituriere", "voituriers", "volatilise", "volatilite", "volcanique", "volcanisee", "volcaniser",
"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
var substition = {
"é": "e",
"è": "e",
"ê": "e",
"ë": "e",
"â": "a",
"à": "a",
"î": "i",
"ô": "o",
"œ": "oe",
"û": "u",
"ù": "u",
"ü": "u",
"ç": "c"
}
var motATrouver
var lettresTrouvees
var nbLettres
function nouvellePartie() {
motATrouver = mots[Math.floor(mots.length * Math.random())]
motATrouver = Array.from(motATrouver).map((lettre) => substition[lettre] || lettre)
motATrouver = motsATrouver[Math.floor(motsATrouver.length * Math.random())].normalize("NFD").replace(/\p{Diacritic}/gu, "")
motATrouver = Array.from(motATrouver)
nbLettres = motATrouver.length
lettresTrouvees = [motATrouver[0]]
@ -69,9 +53,7 @@ function onfocus() {
}
function oninput() {
var lettre = this.value.toLowerCase()
if (substition[lettre]) lettre = substition[lettre]
this.value = lettre
this.value = this.value.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase()
if (this.checkValidity()) {
this.nextSibling?.focus()
} else {
@ -95,7 +77,7 @@ function onkeyup(event) {
function onsubmit(event) {
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)
motATrouver.forEach((lettre, indice) => {
var input = this.children[indice]
@ -127,11 +109,10 @@ function onsubmit(event) {
setTimeout(() => {
if (nbLettresBienPlacees == nbLettres) {
alert("Bien joué gros !\nUne nouvelle partie ?")
nouvellePartie()
if (confirm("Bien joué gros !\nUne nouvelle partie ?")) nouvellePartie()
} else nouvelEssai()
}, motATrouver.length * periode)
} else {
for(input of form.children) input.readOnly = true
sonLettreMalPlacee.play()

View File

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