diff --git a/7-animation/2-css-animations/1-animate-logo-css/solution.md b/7-animation/2-css-animations/1-animate-logo-css/solution.md index 7aa7ca728..4272635c4 100644 --- a/7-animation/2-css-animations/1-animate-logo-css/solution.md +++ b/7-animation/2-css-animations/1-animate-logo-css/solution.md @@ -1,17 +1,17 @@ -CSS to animate both `width` and `height`: +CSS para animar ambos `width` e `height`: ```css -/* original class */ +/* classe original */ #flyjet { transition: all 3s; } -/* JS adds .growing */ +/* JS insere .growing */ #flyjet.growing { width: 400px; height: 240px; } ``` -Please note that `transitionend` triggers two times -- once for every property. So if we don't perform an additional check then the message would show up 2 times. +Por favor, note que `transitionend` é disparado duas vezes -- uma vez para cada propriedade. Então, se não perfomarmos uma verificação adicional, a mensagem será exibida 2 vezes. diff --git a/7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html b/7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html index 4e90e2478..5c70decad 100644 --- a/7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html +++ b/7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html @@ -34,7 +34,7 @@ flyjet.addEventListener('transitionend', function() { if (!ended) { ended = true; - alert('Done!'); + alert('Feito!'); } }); diff --git a/7-animation/2-css-animations/1-animate-logo-css/task.md b/7-animation/2-css-animations/1-animate-logo-css/task.md index ed10d4ace..e43977892 100644 --- a/7-animation/2-css-animations/1-animate-logo-css/task.md +++ b/7-animation/2-css-animations/1-animate-logo-css/task.md @@ -2,13 +2,13 @@ importance: 5 --- -# Animate a plane (CSS) +# Anime um avião (CSS) -Show the animation like on the picture below (click the plane): +Mostre a animação como na imagem abaixo (clique no avião para ver): [iframe src="solution" height=300] -- The picture grows on click from `40x24px` to `400x240px` (10 times larger). -- The animation takes 3 seconds. -- At the end output: "Done!". -- During the animation process, there may be more clicks on the plane. They shouldn't "break" anything. +- A imagem cresce após o clique de `40x24px` para `400x240px` (10 vezes maior). +- A animação dura 3 segundos. +- Ao final exibimos: "Feito!". +- Durante a animação, talvez haja mais cliques no avião. Eles não devem "quebrar" nada. diff --git a/7-animation/2-css-animations/2-animate-logo-bezier-css/solution.md b/7-animation/2-css-animations/2-animate-logo-bezier-css/solution.md index 88105399c..1aa01398a 100644 --- a/7-animation/2-css-animations/2-animate-logo-bezier-css/solution.md +++ b/7-animation/2-css-animations/2-animate-logo-bezier-css/solution.md @@ -1,7 +1,7 @@ -We need to choose the right Bezier curve for that animation. It should have `y>1` somewhere for the plane to "jump out". +Precisamos escolher a curva Bezier certa para essa animação. Ela deve ter `y>1` em algum lugar para que o avião *jump out* (pule fora). -For instance, we can take both control points with `y>1`, like: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`. +Por exemplo, podemos configurar ambos os pontos de controle com `y>1`, como: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`. -The graph: +O gráfico: ![](bezier-up.svg) diff --git a/7-animation/2-css-animations/2-animate-logo-bezier-css/task.md b/7-animation/2-css-animations/2-animate-logo-bezier-css/task.md index 9e21f4101..a3db4b40b 100644 --- a/7-animation/2-css-animations/2-animate-logo-bezier-css/task.md +++ b/7-animation/2-css-animations/2-animate-logo-bezier-css/task.md @@ -2,12 +2,12 @@ importance: 5 --- -# Animate the flying plane (CSS) +# Anime o avião voador (CSS) -Modify the solution of the previous task to make the plane grow more than it's original size 400x240px (jump out), and then return to that size. +Modifique a tarefa anterior para fazer com que o avião cresça mais que seu tamanho original 400x240px (*jump out*), e depois retornar ao tamanho original. -Here's how it should look (click on the plane): +Ele deve se comportar assim (clique no avião para ver): [iframe src="solution" height=350] -Take the solution of the previous task as the source. +Use a solução da tarefa anterior como fonte. diff --git a/7-animation/2-css-animations/3-animate-circle/task.md b/7-animation/2-css-animations/3-animate-circle/task.md index 83bbb3e84..9c9ec1a8e 100644 --- a/7-animation/2-css-animations/3-animate-circle/task.md +++ b/7-animation/2-css-animations/3-animate-circle/task.md @@ -2,15 +2,15 @@ importance: 5 --- -# Animated circle +# Círculo animado -Create a function `showCircle(cx, cy, radius)` that shows an animated growing circle. +Crie uma função `showCircle(cx, cy, radius)` que mostre um círculo animado crescendo. -- `cx,cy` are window-relative coordinates of the center of the circle, -- `radius` is the radius of the circle. +- `cx,cy` são coordenadas do centro do círculo relativas à janela do navegador, +- `radius` é o raio do círculo. -Click the button below to see how it should look like: +Clique no botão abaixo para ver como a animação se comporta: [iframe src="solution" height=260] -The source document has an example of a circle with right styles, so the task is precisely to do the animation right. +A fonte do documento possui um exemplo de um círculo com os estilos certos, a tarefa é justamente fazer a animação corretamente. diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 844a27587..08767d218 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -1,16 +1,16 @@ -# CSS-animations +# Animações CSS -CSS animations allow to do simple animations without JavaScript at all. +Animações CSS nos permitem criar animações simples sem usar *Javascript*. -JavaScript can be used to control CSS animation and make it even better with a little of code. +*Javascript* pode ser usado para controlar a animação CSS e torná-la ainda melhor com pouco código. -## CSS transitions [#css-transition] +## Transições CSS [#css-transition] -The idea of CSS transitions is simple. We describe a property and how its changes should be animated. When the property changes, the browser paints the animation. +A idéia das transições CSS é simples. Descrevemos uma propriedade e como suas mudanças devem ser animadas. Quando a propriedade muda, o navegador desenha a animação. -That is: all we need is to change the property. And the fluent transition is made by the browser. +Isto é: tudo que precisamos fazer é mudar uma propriedade. E a transição é feita pelo navegador. -For instance, the CSS below animates changes of `background-color` for 3 seconds: +Por exemplo, o CSS abaixo anima as mudanças em `background-color` por 3 segundos: ```css .animated { @@ -19,12 +19,12 @@ For instance, the CSS below animates changes of `background-color` for 3 seconds } ``` -Now if an element has `.animated` class, any change of `background-color` is animated during 3 seconds. +Agora, se algum elemento possui a classe `.animated`, qualquer mudança em `background-color` é animada durante 3 segundos. -Click the button below to animate the background: +Clique no botão abaixo para animar a cor de seu fundo: ```html run autorun height=60 - + ``` -There are many articles about `@keyframes` and a [detailed specification](https://drafts.csswg.org/css-animations/). +Existem vários artigos sobre `@keyframes` e uma [especificação detalhada](https://drafts.csswg.org/css-animations/). -Probably you won't need `@keyframes` often, unless everything is in the constant move on your sites. +Provavelmente, você não precisará de `@keyframes` regularmente, a não ser que tudo estiver em movimento constante em sua página. -## Summary +## Resumo -CSS animations allow to smoothly (or not) animate changes of one or multiple CSS properties. +Animações CSS permitem animar de forma suave (ou não) mudanças em uma ou diversas propriedades CSS. -They are good for most animation tasks. We're also able to use JavaScript for animations, the next chapter is devoted to that. +Elas são úteis para a maioria das tarefas envolvendo animações. Também podemos usar *Javascript* para animações, o próximo capítulo é dedicado a isso. -Limitations of CSS animations compared to JavaScript animations: +Limitações de animações CSS comparadas a animações usando *JavaScript*: ```compare plus="CSS animations" minus="JavaScript animations" -+ Simple things done simply. -+ Fast and lightweight for CPU. -- JavaScript animations are flexible. They can implement any animation logic, like an "explosion" of an element. -- Not just property changes. We can create new elements in JavaScript for purposes of animation. ++ Animações simples de forma simples. ++ Rápidas e leves para a CPU. +- Animações *Javascript* são flexíveis. Elas podem produzir qualquer lógica de animação, como a "explosão" de um elemento. +- Não são apenas as propriedades que mudam. Podemos criar novos elementos em *JavaScript* para os propósitos da animação. ``` -The majority of animations can be implemented using CSS as described in this chapter. And `transitionend` event allows to run JavaScript after the animation, so it integrates fine with the code. +A maioria das animações pode ser implementada usando CSS como descrito nesse capítulo. E o evento `transitionend` nos permite rodar *Javascript* após a animação, integrando-se bem com o código. -But in the next chapter we'll do some JavaScript animations to cover more complex cases. +Mas, no próximo capítulo, iremos criar animações em *Javascript* para cobrir casos mais complexos. diff --git a/7-animation/2-css-animations/boat.view/index.html b/7-animation/2-css-animations/boat.view/index.html index 60b704262..eb2050fe2 100644 --- a/7-animation/2-css-animations/boat.view/index.html +++ b/7-animation/2-css-animations/boat.view/index.html @@ -13,7 +13,7 @@ diff --git a/7-animation/2-css-animations/digits.view/index.html b/7-animation/2-css-animations/digits.view/index.html index a156d8189..149bda115 100644 --- a/7-animation/2-css-animations/digits.view/index.html +++ b/7-animation/2-css-animations/digits.view/index.html @@ -8,7 +8,7 @@ - Click below to animate: + Clique abaixo para animar:
0123456789
diff --git a/7-animation/2-css-animations/step-end.view/index.html b/7-animation/2-css-animations/step-end.view/index.html index 2c8df7275..5525c545a 100644 --- a/7-animation/2-css-animations/step-end.view/index.html +++ b/7-animation/2-css-animations/step-end.view/index.html @@ -8,7 +8,7 @@ - Click below to animate: + Clique abaixo para animar:
0123456789
diff --git a/7-animation/2-css-animations/step.view/index.html b/7-animation/2-css-animations/step.view/index.html index 2c8df7275..5525c545a 100644 --- a/7-animation/2-css-animations/step.view/index.html +++ b/7-animation/2-css-animations/step.view/index.html @@ -8,7 +8,7 @@ - Click below to animate: + Clique abaixo para animar:
0123456789