Skip to content

Commit 49d5cfc

Browse files
committed
hotfix: fix seconds hand glitch
1 parent 48f1d07 commit 49d5cfc

2 files changed

Lines changed: 8 additions & 77 deletions

File tree

02 - JS and CSS Clock/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
transition: all 0.05s;
6565
transition-timing-function: cubic-bezier(0.29, 1.01, 1, -0.68);
6666
}
67+
68+
.fast {
69+
transition: all 0s;
70+
}
6771
</style>
6872

6973
<script>
@@ -87,6 +91,10 @@
8791
hourHand.style.transform = `rotate(${hourHandDegrees}deg) scale(0.7)`;
8892
minHand.style.transform = `rotate(${minHandDegrees}deg)`;
8993
secondHand.style.transform = `rotate(${secondHandDegrees}deg)`;
94+
95+
//fix glich second hand
96+
if (secondHandDegrees === 0) secondHand.classList.add("fast");
97+
if (secondHandDegrees === 1) secondHand.classList.remove("fast");
9098
}, 1000);
9199
</script>
92100
</body>

03 - CSS Variables/index-FINISHED.html

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)