From 81300f8539dbc24901c0286c97bf2477a06cca31 Mon Sep 17 00:00:00 2001 From: HarmandI <90188561+HarmandI@users.noreply.github.com> Date: Mon, 20 Sep 2021 16:28:57 +0200 Subject: [PATCH] Add files via upload --- css/style.css | 1 - js/script.js | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index fd0e899..d819216 100644 --- a/css/style.css +++ b/css/style.css @@ -64,7 +64,6 @@ #second { transform-origin: 300px 300px; transition: transform .5s ease-in-out; - animation: infinite linear; } diff --git a/js/script.js b/js/script.js index b7eb833..7ac64a8 100644 --- a/js/script.js +++ b/js/script.js @@ -13,12 +13,19 @@ let dAujourdhui=new Date(); let heures = dAujourdhui.getHours(); let minutes= dAujourdhui.getMinutes(); let secondes = dAujourdhui.getSeconds(); +console.log(heures); // Calculer de degré de mouvement de l'aiguille heure, de l'aiguille minute, de l'aiguille seconde // Hint : Tous les aiguilles doivent se déplacer chaque second selon un degré -let secondeDegre=secondes*360/60; -let minuteDegre=minutes*(360/60)+secondeDegre/60; -let heureDegre = heures*(360/12)+minuteDegre/60+secondeDegre/3600; + +let timSec=heures*3600+minutes*60+secondes + + +let secondeDegre=(timSec*(360/60)); +let minuteDegre= (timSec*(360/3600)); +let heureDegre = (timSec*(360/43200)); + + // Déplacer les aiguilles AIGUILLEHR.style.transform=`rotate(${heureDegre}deg)`; @@ -30,3 +37,5 @@ AIGUILLESEC.style.transform=`rotate(${secondeDegre}deg)`; var interval = setInterval(demarrerLaMontre, 1000); + +