Skip to content

Commit 003f93b

Browse files
chore: merge translations for javaScript animations article
Merge pull request #136 from karlasamantha/javascript-animations
2 parents 2a1c550 + 035218d commit 003f93b

File tree

6 files changed

+163
-168
lines changed

6 files changed

+163
-168
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+
Para quicar, podemos usar a propriedade CSS `top` e `position:absolute` para a bola dentro do campo com `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+
A coordenada inferior do campo é `field.clientHeight`. Mas a propriedade `top` fornece coordenadas para o topo da bola Então animamos a propriedade `top` a partir de `0` até `field.clientHeight - ball.clientHeight`, isto é até à posição mais baixa do topo da bola.
44

5-
To get the "bouncing" effect we can use the timing function `bounce` in `easeOut` mode.
5+
Para obter o efeito de "quique", podemos usar a função de tempo `bounce` no modo `easeOut`.
66

7-
Here's the final code for the animation:
7+
Aqui está o código final para a animação:
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+
# Animar a bola quicando
66

7-
Make a bouncing ball. Click to see how it should look:
7+
Faça uma bola quicando. Clique para ver como deve ficar:
88

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

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
In the task <info:task/animate-ball> we had only one property to animate. Now we need one more: `elem.style.left`.
1+
Na atividade <info:task/animate-ball> nós tínhamos apenas uma propriedade para animar. Agora precisamos de mais uma: `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+
A coordenada horizontal é modificada por outra regra: ela não "quica", mas gradativamente aumenta a movimentação da bola para a direita.
44

5-
We can write one more `animate` for it.
5+
Podemos escrever mais um `animate` para isso.
66

7-
As the time function we could use `linear`, but something like `makeEaseOut(quad)` looks much better.
7+
Como função de tempo podemos usar `linear`, mas algo como `makeEaseOut(quad)` parece bem melhor.
88

9-
The code:
9+
O código:
1010

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

15-
// animate top (bouncing)
15+
// anime o topo (quicando)
1616
animate({
1717
duration: 2000,
1818
timing: makeEaseOut(bounce),
19-
draw: function(progress) {
20-
ball.style.top = height * progress + 'px'
19+
draw: function (progress) {
20+
ball.style.top = height * progress + "px"
2121
}
2222
});
2323

24-
// animate left (moving to the right)
24+
// anime a esquerda (movendo para a direita)
2525
animate({
2626
duration: 2000,
2727
timing: makeEaseOut(quad),
28-
draw: function(progress) {
28+
draw: function (progress) {
2929
ball.style.left = width * progress + "px"
3030
}
3131
});

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+
# Anime a bola quicando para a direita
66

7-
Make the ball bounce to the right. Like this:
7+
Faça a bola quicar para a direita. Assim:
88

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

11-
Write the animation code. The distance to the left is `100px`.
11+
Escreva o código da animação. A distância para a esquerda é `100px`.
1212

13-
Take the solution of the previous task <info:task/animate-ball> as the source.
13+
Use a solução da atividade anterior <info:task/animate-ball> como fonte.

0 commit comments

Comments
 (0)