Skip to content

Commit 15d754c

Browse files
authored
Merge pull request #275 from odsantos/update-en-javaScript-animations
Update "JavaScript animations" English version
2 parents 3198eca + 37af3e6 commit 15d754c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ These several independent redraws should be grouped together, to make the redraw
7979

8080
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

82-
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.
82+
But how do we know about that in JavaScript? There's a specification [Animation timing](https://www.w3.org/TR/animation-timing/) that provides the function `requestAnimationFrame`. It addresses all these issues and even more.
8383

8484
The syntax:
8585
```js
@@ -96,7 +96,7 @@ The returned value `requestId` can be used to cancel the call:
9696
cancelAnimationFrame(requestId);
9797
```
9898

99-
The `callback` gets one argument -- the time passed from the beginning of the page load in microseconds. This time can also be obtained by calling [performance.now()](mdn:api/Performance/now).
99+
The `callback` gets one argument -- the time passed from the beginning of the page load in milliseconds. This time can also be obtained by calling [performance.now()](mdn:api/Performance/now).
100100

101101
Usually `callback` runs very soon, unless the CPU is overloaded or the laptop battery is almost discharged, or there's another reason.
102102

@@ -159,7 +159,7 @@ Function `animate` accepts 3 parameters that essentially describes the animation
159159
}
160160
```
161161

162-
It's graph:
162+
Its graph:
163163
![](linear.svg)
164164

165165
That's just like `transition-timing-function: linear`. There are more interesting variants shown below.

7-animation/3-js-animation/text.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
timing: bounce,
3030
draw: function(progress) {
3131
let result = (to - from) * progress + from;
32-
textArea.value = text.substr(0, Math.ceil(result))
32+
textArea.value = text.slice(0, Math.ceil(result))
3333
}
3434
});
3535
}

0 commit comments

Comments
 (0)