plus de mots autorisés, favicon
This commit is contained in:
parent
c889fbcb01
commit
479b632989
BIN
favicons/android-chrome-192x192.png
Normal file
BIN
favicons/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
favicons/android-chrome-512x512.png
Normal file
BIN
favicons/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
favicons/apple-touch-icon.png
Normal file
BIN
favicons/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.6 KiB |
BIN
favicons/favicon-16x16.png
Normal file
BIN
favicons/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 610 B |
BIN
favicons/favicon-32x32.png
Normal file
BIN
favicons/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
favicons/favicon.ico
Normal file
BIN
favicons/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
1
favicons/site.webmanifest
Normal file
1
favicons/site.webmanifest
Normal 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"}
|
@ -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>
|
@ -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
237205
motsAutorises.js
Normal file
File diff suppressed because it is too large
Load Diff
31
script.js
31
script.js
@ -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,11 +109,10 @@ 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)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for(input of form.children) input.readOnly = true
|
for(input of form.children) input.readOnly = true
|
||||||
sonLettreMalPlacee.play()
|
sonLettreMalPlacee.play()
|
||||||
|
11
style.css
11
style.css
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user