Add files via upload
This commit is contained in:
parent
49f3bf0b8b
commit
81300f8539
|
@ -64,7 +64,6 @@
|
|||
#second {
|
||||
transform-origin: 300px 300px;
|
||||
transition: transform .5s ease-in-out;
|
||||
animation: infinite linear;
|
||||
}
|
||||
|
||||
|
||||
|
|
15
js/script.js
15
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);
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue