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..04991519a 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 tanto `width` como `height`: ```css -/* original class */ +/* clase original */ #flyjet { transition: all 3s; } -/* JS adds .growing */ +/* JS añade .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. +Ten en cuenta que `transitionend` se dispara dos veces, una para cada propiedad. Entonces, si no realizamos una verificación adicional, el mensaje aparecería 2 veces. 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..8fbb6c0e0 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) +# Animar un avión (CSS) -Show the animation like on the picture below (click the plane): +Muestra la animación como en la imagen a continuación (haz clic en el avión): [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. +- La imagen crece al hacer clic de `40x24px` a `400x240px` (10 veces más grande). +- La animación dura 3 segundos. +- Al final muestra: "¡Listo!". +- Durante el proceso de animación, puede haber más clics en el avión. No deberían "romper" nada. \ No newline at end of file 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..6a15092ae 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". +Necesitamos elegir la curva de Bézier correcta para esa animación. Debe tener `y>1` en algún punto para que el avión "salte". -For instance, we can take both control points with `y>1`, like: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`. +Por ejemplo, podemos tomar ambos puntos de control con `y>1`, como: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`. -The graph: +La gráfica: ![](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..c713b202d 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) +# Animar el avión volando (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. +Modifica la solución de la tarea anterior para hacer que el avión crezca más que su tamaño original 400x240px (saltar fuera), y luego vuelva a ese tamaño. -Here's how it should look (click on the plane): +Así es como debería verse (haz clic en el avión): [iframe src="solution" height=350] -Take the solution of the previous task as the source. +Toma la solución de la tarea anterior como punto de partida. 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..0856bc50a 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. +Crea una función `showCircle(cx, cy, radius)` que muestre un círculo animado creciendo. -- `cx,cy` are window-relative coordinates of the center of the circle, -- `radius` is the radius of the circle. +- `cx,cy` son coordenadas relativas a la ventana del centro del círculo, +- `radius` es el radio del círculo. -Click the button below to see how it should look like: +Haz clic en el botón de abajo para ver cómo debería verse: [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. +El documento fuente tiene un ejemplo de un círculo con estilos correctos, por lo que la tarea es precisamente hacer la animación correctamente. diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 844a27587..1b0c3be27 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -1,16 +1,16 @@ -# CSS-animations +# Animaciones CSS -CSS animations allow to do simple animations without JavaScript at all. +Las animaciones CSS permiten hacer animaciones simples sin JavaScript en absoluto. -JavaScript can be used to control CSS animation and make it even better with a little of code. +Se puede utilizar JavaScript para controlar la animación CSS y mejorarla con un poco de código. -## CSS transitions [#css-transition] +## Transiciones 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. +La idea de las transiciones CSS es simple. Describimos una propiedad y cómo se deberían animar sus cambios. Cuando la propiedad cambia, el navegador pinta la animación. -That is: all we need is to change the property. And the fluent transition is made by the browser. +Es decir: todo lo que necesitamos es cambiar la propiedad. Y la transición fluida es realizada por el navegador. -For instance, the CSS below animates changes of `background-color` for 3 seconds: +Por ejemplo, el CSS a continuación anima los cambios de `background-color` durante 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. +Ahora, si un elemento tiene la clase `.animated`, cualquier cambio de `background-color` es animado durante 3 segundos. -Click the button below to animate the background: +Haz clic en el botón de abajo para animar el fondo: ```html run autorun height=60 - + ``` -There are many articles about `@keyframes` and a [detailed specification](https://drafts.csswg.org/css-animations/). +Hay muchos artículos sobre `@keyframes` y una [especificación detallada](https://drafts.csswg.org/css-animations/). -Probably you won't need `@keyframes` often, unless everything is in the constant move on your sites. +Probablemente no necesitarás `@keyframes` a menudo, a menos que todo esté en constante movimiento en tus sitios. -## Summary +## Resumen -CSS animations allow to smoothly (or not) animate changes of one or multiple CSS properties. +Las animaciones CSS permiten animar suavemente (o no) los cambios de una o varias propiedades CSS. -They are good for most animation tasks. We're also able to use JavaScript for animations, the next chapter is devoted to that. +Son buenas para la mayoría de las tareas de animación. También podemos usar JavaScript para animaciones, el siguiente capítulo está dedicado a eso. -Limitations of CSS animations compared to JavaScript animations: +Limitaciones de las animaciones CSS en comparación con las animaciones 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. +```comparar más="Animaciones CSS" menos="Animaciones JavaScript" ++ Cosas simples hechas simplemente. ++ Rápido y ligero para la CPU. +- Las animaciones de JavaScript son flexibles. Pueden implementar cualquier lógica de animación, como una "explosión" de un elemento. +- No solo cambios de propiedad. Podemos crear nuevos elementos en JavaScript para fines de animación. ``` -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. +La mayoría de las animaciones se pueden implementar usando CSS como se describe en este capítulo. Y el evento `transitionend` permite ejecutar JavaScript después de la animación, por lo que se integra bien con el código. -But in the next chapter we'll do some JavaScript animations to cover more complex cases. +Pero en el próximo capítulo haremos algunas animaciones en JavaScript para cubrir casos más complejos. diff --git a/7-animation/2-css-animations/boat.view/index.html b/7-animation/2-css-animations/boat.view/index.html index 60b704262..4bfcfc7eb 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..a459f0f4c 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: + Haz clic a continuación 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..0f4f85e03 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: + Haz clic a continuación 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..0f4f85e03 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: + Haz clic a continuación para animar:
0123456789