mode sombre + horloge

This commit is contained in:
2026-06-23 09:59:20 +02:00
parent c3ab560c47
commit 126d5adea2
3 changed files with 17 additions and 1 deletions
+9 -1
View File
@@ -11,7 +11,6 @@ const txt_restant = document.getElementById("txt_restant");
const MAX = 500;
const formulaire = document.querySelector("form");
console.log("dans le local : ", localStorage.getItem("nbVehicules"));
const services = [
{
nom: "Géolocalisation",
@@ -31,6 +30,7 @@ const services = [
},
];
const corps = document.getElementById("services");
const horloge = document.getElementById("horloge");
let lignes = "";
let nbVehicules;
if (localStorage.getItem("nbVehicules") !== null) {
@@ -86,3 +86,11 @@ for (const service of services) {
</tr>`;
}
corps.innerHTML = lignes;
document.getElementById("color").addEventListener("click", function () {
document.body.classList.toggle("sombre");
});
function heure() {
horloge.textContent = new Date().toLocaleTimeString();
}
heure();
setInterval(heure, 1000);
+6
View File
@@ -42,6 +42,8 @@ h1 {
position: fixed;
bottom: 0;
width: 100%;
display: flex;
justify-content: space-around;
}
#nav_barre {
display: flex;
@@ -211,3 +213,7 @@ p {
gap: 6px;
line-height: normal;
}
body.sombre {
background-color: #1d2733;
color: white;
}
+2
View File
@@ -67,7 +67,9 @@
</div>
</div>
<footer class="footer">
<button id="color">Mode sombre</button>
stagiaires rpz echoes
<span id="horloge"></span>
</footer>
<script src="css/devis.js"></script>
</body>