Skip to content

Commit 087dd15

Browse files
authored
Merge pull request #324 from TevaHenry/master
JavaScript animations
2 parents 4478657 + 92ce2c1 commit 087dd15

File tree

5 files changed

+139
-139
lines changed

5 files changed

+139
-139
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
To bounce we can use CSS property `top` and `position:absolute` for the ball inside the field with `position:relative`.
1+
Pour rebondir, nous pouvons utiliser les propriétés CSS `top` et `position:absolute` pour la balle à l'intérieur du champ avec `position:relative`.
22

3-
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.
3+
La coordonnée du bas du champ est `field.clientHeight`. La propriété CSS `top` fait référence au bord supérieur de la balle. Elle doit donc aller de `0` à `field.clientHeight - ball.clientHeight`, c'est-à-dire la position finale la plus basse du bord supérieur de la balle.
44

5-
To get the "bouncing" effect we can use the timing function `bounce` in `easeOut` mode.
5+
Pour obtenir l'effet de "rebond", nous pouvons utiliser la fonction de timing `bounce` en mode `easeOut`.
66

7-
Here's the final code for the animation:
7+
Voici le code final de l'animation :
88

99
```js
1010
let to = field.clientHeight - ball.clientHeight;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 5
22

33
---
44

5-
# Animate the bouncing ball
5+
# Animer la balle rebondissante
66

7-
Make a bouncing ball. Click to see how it should look:
7+
Créez une balle rebondissante. Cliquez pour voir à quoi elle doit ressembler :
88

99
[iframe height=250 src="solution"]

7-animation/3-js-animation/2-animate-ball-hops/solution.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
In the task <info:task/animate-ball> we had only one property to animate. Now we need one more: `elem.style.left`.
1+
Dans la tâche <info:task/animate-ball>, nous n'avions qu'une seule propriété à animer. Maintenant, nous avons besoin d'une supplémentaire : `elem.style.left`.
22

3-
The horizontal coordinate changes by another law: it does not "bounce", but gradually increases shifting the ball to the right.
3+
La coordonnée horizontale change selon une autre loi : elle ne "rebondit" pas, mais augmente progressivement en déplaçant la balle vers la droite.
44

5-
We can write one more `animate` for it.
5+
Nous pouvons écrire un autre `animate` pour elle.
66

7-
As the time function we could use `linear`, but something like `makeEaseOut(quad)` looks much better.
7+
Comme fonction de temporisation, nous pourrions utiliser `linear`, mais quelque chose comme `makeEaseOut(quad)` semble bien mieux.
88

9-
The code:
9+
Le code :
1010

1111
```js
1212
let height = field.clientHeight - ball.clientHeight;
1313
let width = 100;
1414

15-
// animate top (bouncing)
15+
// animer top (rebondissement)
1616
animate({
1717
duration: 2000,
1818
timing: makeEaseOut(bounce),
@@ -21,7 +21,7 @@ animate({
2121
}
2222
});
2323

24-
// animate left (moving to the right)
24+
// animer left (déplacement vers la droite)
2525
animate({
2626
duration: 2000,
2727
timing: makeEaseOut(quad),

7-animation/3-js-animation/2-animate-ball-hops/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ importance: 5
22

33
---
44

5-
# Animate the ball bouncing to the right
5+
# Animer la balle pour qu'elle rebondisse vers la droite.
66

7-
Make the ball bounce to the right. Like this:
7+
Faites rebondir la balle vers la droite. Comme ceci :
88

99
[iframe height=250 src="solution"]
1010

11-
Write the animation code. The distance to the left is `100px`.
11+
Écrivez le code d'animation. La distance à gauche est de `100px`.
1212

13-
Take the solution of the previous task <info:task/animate-ball> as the source.
13+
Prenez la solution de la tâche précédente <info:task/animate-ball> comme source.

0 commit comments

Comments
 (0)