Skip to content

Commit 3d4a6e9

Browse files
committed
Fix typos in 7.3 (JavaScript animations)
1 parent ff40f49 commit 3d4a6e9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

7-animation/3-js-animation/1-animate-ball/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ To bounce we can use CSS property `top` and `position:absolute` for the ball ins
22

33
The bottom coordinate of the field is `field.clientHeight`. The CSS `top` property refers to the upper edge of the ball. So it should go from `0` till `field.clientHeight - ball.clientHeight`, that's the final lowest position of the upper edge of the ball.
44

5-
To to get the "bouncing" effect we can use the timing function `bounce` in `easeOut` mode.
5+
To get the "bouncing" effect we can use the timing function `bounce` in `easeOut` mode.
66

77
Here's the final code for the animation:
88

7-animation/3-js-animation/article.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ setInterval(animate3, 20);
7777

7878
These several independent redraws should be grouped together, to make the redraw easier for the browser and hence load less CPU load and look smoother.
7979

80-
There's one more thing to keep in mind. Sometimes when CPU is overloaded, or there are other reasons to redraw less often (like when the browser tab is hidden), so we really shouldn't run it every `20ms`.
80+
There's one more thing to keep in mind. Sometimes CPU is overloaded, or there are other reasons to redraw less often (like when the browser tab is hidden), so we really shouldn't run it every `20ms`.
8181

8282
But how do we know about that in JavaScript? There's a specification [Animation timing](http://www.w3.org/TR/animation-timing/) that provides the function `requestAnimationFrame`. It addresses all these issues and even more.
8383

@@ -227,7 +227,7 @@ See in action (click to activate):
227227

228228
[iframe height=40 src="quad" link]
229229

230-
...Or the cubic curve or event greater `n`. Increasing the power makes it speed up faster.
230+
...Or the cubic curve or even greater `n`. Increasing the power makes it speed up faster.
231231

232232
Here's the graph for `progress` in the power `5`:
233233

@@ -397,15 +397,15 @@ The effect is clearly seen if we compare the graphs of `easeIn`, `easeOut` and `
397397

398398
![](circ-ease.svg)
399399

400-
- <span style="color:#EE6B47">Red</span> is the regular variantof `circ` (`easeIn`).
400+
- <span style="color:#EE6B47">Red</span> is the regular variant of `circ` (`easeIn`).
401401
- <span style="color:#8DB173">Green</span> -- `easeOut`.
402402
- <span style="color:#62C0DC">Blue</span> -- `easeInOut`.
403403

404404
As we can see, the graph of the first half of the animation is the scaled down `easeIn`, and the second half is the scaled down `easeOut`. As a result, the animation starts and finishes with the same effect.
405405

406406
## More interesting "draw"
407407

408-
Instead of moving the element we can do something else. All we need is to write the write the proper `draw`.
408+
Instead of moving the element we can do something else. All we need is to write the proper `draw`.
409409

410410
Here's the animated "bouncing" text typing:
411411

0 commit comments

Comments
 (0)