Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion main.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
}

.clock {
background: url(https://media.geeksforgeeks.org/wp-content/uploads/20210302161254/imgonlinecomuaCompressToSizeOmNATjUMFKw-300x300.jpg);
background-size: 100%;

width: 30rem;
height: 30rem;
border:20px solid white;
Expand Down Expand Up @@ -47,4 +50,4 @@
transform: rotate(90deg);
transition: all 0.05s;
transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
}
}
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const secondHand = document.querySelector('.second-hand');

const seconds = now.getSeconds();
const secondsDegrees = ((seconds / 60) * 360) + 90;
secondHand.style.transform = `rotate(${secondsDegrees}deg)`;
secondHand.style.transform = "rotate(" + secondsDegrees "deg)";

const mins = now.getMinutes();
const minsDegrees = ((mins / 60) * 360) + ((seconds/60)*6) + 90;
minsHand.style.transform = `rotate(${minsDegrees}deg)`;
minsHand.style.transform = "rotate(" + minsDegrees + "deg)";

const hour = now.getHours();
const hourDegrees = ((hour / 12) * 360) + ((mins/60)*30) + 90;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
hourHand.style.transform = "rotate(" + hourDegrees + "deg)";
}

setInterval(setDate, 1000);
Expand Down