Skip to content

Commit 03bcb06

Browse files
committed
Section 20: Smoothing the Animation
1 parent 2212e32 commit 03bcb06

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

20-Drawing-Animations/02-timer-v2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Timer</title>
88
</head>
99
<body>
10-
<svg height="400" widht="400">
10+
<svg height="400" width="400">
1111
<circle
1212
r="190"
1313
cx="200"

20-Drawing-Animations/02-timer-v2/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const timer = new Timer(durationInput, startButton, pauseButton, {
1515
},
1616
onTick() {
1717
circle.setAttribute('stroke-dashoffset', currentOffset)
18-
currentOffset = currentOffset - 50
18+
currentOffset = currentOffset - 1
1919
},
2020
onComplete() {
2121
console.log('Timer just completed')

20-Drawing-Animations/02-timer-v2/timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ class Timer {
5757
}
5858

5959
set timeRemaining(time) {
60-
this.durationInput.value = time
60+
this.durationInput.value = time.toFixed(2)
6161
}
6262
}

20-Drawing-Animations/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,4 @@ The X axis increases from left to right and the Y axis increases from top to bot
242242

243243
## 13. 22 First Pass on the Animation
244244

245+
## 14. 23 Smoothing the Animation

0 commit comments

Comments
 (0)