Skip to content
Closed
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
98 changes: 0 additions & 98 deletions 02 - JS + CSS Clock/index-FINISHED.html

This file was deleted.

73 changes: 0 additions & 73 deletions 02 - JS + CSS Clock/index-START.html

This file was deleted.

26 changes: 15 additions & 11 deletions 02 - JS + CSS Clock/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<style>
html {
background:#018DED url(http://unsplash.it/1500/1000?image=881&blur=50);
background:#333 url(https://i.ytimg.com/vi/pX4qZcjiv5U/maxresdefault.jpg?&blur=50);
background-size:cover;
font-family:'helvetica neue';
text-align: center;
Expand Down Expand Up @@ -58,21 +58,26 @@
.hand {
width:50%;
height:6px;
background:black;
background:white;
position: absolute;
top:50%;
box-shadow:
0 0 0 4px rgba(0,0,0,0.1),
inset 0 0 0 3px #EFEFEF,
inset 0 0 10px black,
0 0 10px rgba(0,0,0,0.2);
transform-origin: 100%;
transform: rotate(90deg);
transition: all 0.05s;
transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
}
</style>

<script>
const secondHand = document.querySelector('.second-hand');
const minsHand = document.querySelector('.min-hand');
const hourHand = document.querySelector('.hour-hand');
</style>

<script>
const secondHand = document.querySelector('.second-hand')
const minuteHand = document.querySelector('.min-hand')
const hourHand = document.querySelector('.hour-hand')
function setDate() {
const now = new Date();

Expand All @@ -82,15 +87,14 @@

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

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

setInterval(setDate, 1000);

</script>
</script>
</body>
</html>