mirror of
https://github.com/groupe1cir1n/groupe1CIR1Njs.git
synced 2026-03-18 21:40:30 +01:00
End of the footer js part and little cleanup from the code
This commit is contained in:
@@ -31,6 +31,7 @@ nav {
|
||||
.menu li {
|
||||
margin: 10px 0;
|
||||
list-style: none;
|
||||
background-color: #48435c;
|
||||
}
|
||||
|
||||
.menu li a {
|
||||
@@ -48,7 +49,3 @@ nav {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.menu li:hover{
|
||||
background-color: #314153;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ document.getElementById("submitBtn").addEventListener("click", function() {
|
||||
console.error("Ni pile, ni face !");
|
||||
window.location.reload();
|
||||
}
|
||||
var random = Math.floor(Math.random() * 2);
|
||||
let random = Math.floor(Math.random() * 2);
|
||||
if (random === result) {
|
||||
alert("Vous avez gagné ! Votre message a bien été envoyé !");
|
||||
}
|
||||
|
||||
@@ -47,17 +47,17 @@ document.addEventListener("click", function(event) {
|
||||
|
||||
//Récupérer les éléments du menu
|
||||
const menuItems = document.querySelectorAll('.menu li');
|
||||
|
||||
const menuItemsElements = document.querySelectorAll('.menu li a');
|
||||
menuItems.forEach((menuItem) => {
|
||||
//Récupérer la couleur de fond originale
|
||||
const originalBgColor = menuItem.style.backgroundColor;
|
||||
console.log(originalBgColor)
|
||||
menuItem.addEventListener('mouseover', () => {
|
||||
//Récupérer la nouvelle couleur de fond
|
||||
const newBgColor = menuItem.dataset.color;
|
||||
let originalBgColor = getComputedStyle(menuItem).backgroundColor;
|
||||
let newBgColor = "rgb(49, 65, 83)";
|
||||
menuItem.style.backgroundColor = newBgColor;
|
||||
console.log("L'ancienne couleur de fond était " + originalBgColor + " et la nouvelle est " + newBgColor + ".")
|
||||
});
|
||||
menuItem.addEventListener('mouseout', () => {
|
||||
menuItem.style.backgroundColor = "";
|
||||
});
|
||||
});
|
||||
|
||||
//Lance les fonctions updateTime et startTimer
|
||||
|
||||
Reference in New Issue
Block a user