MCPcopy Create free account
hub / github.com/codemistic/Web-Development / setdate

Function setdate

clockn/main.js:4–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2const minutehand=document.querySelector('.hourhand');
3const audio = document.querySelector('.audio');
4function setdate() {
5 const now = new Date();
6 const seconds = now.getSeconds();
7 const a = (seconds*6);
8 console.log(a);
9
10
11 secondhand.style.transform = `rotate(${a}deg)`;
12 audio.play();
13 audio.currentTime = 1;
14
15
16
17 //using properties that have : , :is replaced by = and than the ahead part comes in backticks
18 //whenever you are writing a varible const use ${} and whenever you use ${} you must use `` backtics (i.e esc down button) to close your brackets
19 // how to change the class of an elemt by js , make that new class in css and use elementconstname.classList.add('newstyleclassname');
20
21}
22
23function setminute() {
24 const now = new Date();

Callers

nothing calls this directly

Calls 1

logMethod · 0.45

Tested by

no test coverage detected