From d698804c509649a2ee31ee3478dc315ee88aceae Mon Sep 17 00:00:00 2001 From: Raul FS Date: Sat, 5 Oct 2019 18:56:07 +0200 Subject: [PATCH 1/9] CSS Animations chapter translation --- .../1-animate-logo-css/solution.md | 8 +- .../1-animate-logo-css/task.md | 12 +- .../2-animate-logo-bezier-css/solution.md | 6 +- .../2-animate-logo-bezier-css/task.md | 8 +- .../2-css-animations/3-animate-circle/task.md | 12 +- 7-animation/2-css-animations/article.md | 254 +++++++++--------- .../2-css-animations/boat.view/index.html | 2 +- .../digits-negative-delay.view/index.html | 2 +- .../2-css-animations/digits.view/index.html | 2 +- .../2-css-animations/step-end.view/index.html | 2 +- .../2-css-animations/step.view/index.html | 2 +- 11 files changed, 155 insertions(+), 155 deletions(-) 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..33a341fa4 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 da la salida: "¡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..cd60c4974 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 fuera". -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..8e2ab67df 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 volador (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..681285e35 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
From a308952b958d1bd026e83881f6ebd146ea030720 Mon Sep 17 00:00:00 2001 From: Raul FS Date: Sun, 22 Dec 2019 20:09:30 +0100 Subject: [PATCH 2/9] CSS Animations chapter translation corrections --- 7-animation/2-css-animations/1-animate-logo-css/task.md | 2 +- .../2-animate-logo-bezier-css/solution.md | 2 +- 7-animation/2-css-animations/article.md | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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 33a341fa4..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 @@ -10,5 +10,5 @@ Muestra la animación como en la imagen a continuación (haz clic en el avión): - La imagen crece al hacer clic de `40x24px` a `400x240px` (10 veces más grande). - La animación dura 3 segundos. -- Al final da la salida: "¡Listo!". +- 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 cd60c4974..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,4 +1,4 @@ -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 fuera". +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". Por ejemplo, podemos tomar ambos puntos de control con `y>1`, como: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`. diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 681285e35..eea49070f 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -244,7 +244,7 @@ Pero si haces clic en el tren, verás que: [codetabs src="train-over"] -¿Por qué sucede? es bastante obvio si miramos el gráfico de la curva de Bézier dada: +¿Por qué sucede? es bastante obvio si miramos la gráfica de la curva de Bézier dada: ![](bezier-train-over.svg) @@ -295,7 +295,7 @@ El proceso está progresando así: - `1s` -- `-20%` - ... - `8s` -- `-80%` -- (el último segundo muestra el valor final) +- (el último segundo muestra el valor final). El valor alternativo 'end' significaría que el cambio debe aplicarse no al principio, sino al final de cada segundo. @@ -320,9 +320,9 @@ Estos valores rara vez se usan, porque eso no es realmente animación, sino un c ## Evento transitionend -Cuando finaliza la animación CSS, se activa el evento `transitionend`. +Cuando finaliza la animación CSS, se dispara el evento `transitionend`. -Es ampliamente utilizado para hacer una acción después de que se realiza la animación. También podemos unir animaciones. +Es ampliamente utilizado para hacer una acción después que se realiza la animación. También podemos unir animaciones. Por ejemplo, el barco en el ejemplo a continuación comienza a navegar ida y vuelta al hacer clic, cada vez más y más a la derecha: From 41b55a84b2a8951651a981e4578cafba69217aed Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:42:39 -0400 Subject: [PATCH 3/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index eea49070f..1a50e88fc 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -365,7 +365,7 @@ El objeto de evento para `transitionend` tiene pocas propiedades específicas: `event.elapsedTime` : El tiempo (en segundos) que duró la animación, sin `transition-delay`. -## Fotogramas clave +## Fotogramas clave (Keyframes) Podemos unir múltiples animaciones simples juntas usando la regla CSS `@keyframes`. From 6ab2c7b0f1ee35ad3ad143178a692e28d2c18137 Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:42:49 -0400 Subject: [PATCH 4/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 1a50e88fc..491db69b2 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -337,7 +337,7 @@ boat.onclick = function() { function go() { if (times % 2) { - // navegar al a derecha + // navegar a la derecha boat.classList.remove('back'); boat.style.marginLeft = 100 * times + 200 + 'px'; } else { From f9e152e90c9acbdb99c6d7e62312176915007c47 Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:43:10 -0400 Subject: [PATCH 5/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 491db69b2..63992ea2d 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -324,7 +324,7 @@ Cuando finaliza la animación CSS, se dispara el evento `transitionend`. Es ampliamente utilizado para hacer una acción después que se realiza la animación. También podemos unir animaciones. -Por ejemplo, el barco en el ejemplo a continuación comienza a navegar ida y vuelta al hacer clic, cada vez más y más a la derecha: +Por ejemplo, el barco a continuación comienza a navegar ida y vuelta al hacer clic, cada vez más y más a la derecha: [iframe src="boat" height=300 edit link] From 6df4b3dc468a538f7848bffe1b40c8cc6f1b55b8 Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:43:20 -0400 Subject: [PATCH 6/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 63992ea2d..aeea14225 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -145,7 +145,7 @@ La función de temporización se puede establecer como una [curva de Bézier](/b La sintaxis de una curva de Bézier en CSS: `cubic-bezier(x2, y2, x3, y3)`. Aquí necesitamos especificar solo los puntos de control segundo y tercero, porque el primero está fijado a `(0,0)` y el cuarto es `(1,1)`. -La función de temporización describe como de rápido pasa en el tiempo el proceso de animación. +La función de temporización determina qué tan rápido ocurre el proceso de animación a lo largo del tiempo. - El eje `x` es el tiempo: `0` -- el momento inicial, `1` -- el último momento de `transition-duration`. - El eje `y` especifica la finalización del proceso: `0` -- el valor inicial de la propiedad, `1` -- el valor final. From 84d231f61038782484d869f2b3af4f23c2f69449 Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:43:30 -0400 Subject: [PATCH 7/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index aeea14225..18fc6f199 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -114,7 +114,7 @@ Aquí, si haces clic en el dígito, comienza la animación desde el segundo actu [codetabs src="digits-negative-delay"] -JavaScript lo hace por una línea extra: +JavaScript lo hace con una línea extra: ```js stripe.onclick = function() { From 1e44ca7e8a0ab52048ebb9d27623ca86ee2cd91b Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:43:39 -0400 Subject: [PATCH 8/9] Update 7-animation/2-css-animations/2-animate-logo-bezier-css/task.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/2-animate-logo-bezier-css/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8e2ab67df..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,7 +2,7 @@ importance: 5 --- -# Animar el avión volador (CSS) +# Animar el avión volando (CSS) 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. From 2aedc97e935cbf4ae05131553581593d6b1988fa Mon Sep 17 00:00:00 2001 From: Valentina VP <34555644+vplentinax@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:43:48 -0400 Subject: [PATCH 9/9] Update 7-animation/2-css-animations/article.md Co-authored-by: joaquinelio --- 7-animation/2-css-animations/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7-animation/2-css-animations/article.md b/7-animation/2-css-animations/article.md index 18fc6f199..1b0c3be27 100644 --- a/7-animation/2-css-animations/article.md +++ b/7-animation/2-css-animations/article.md @@ -76,7 +76,7 @@ Ahora cubramos las propiedades de animación una por una. En `transition-property` escribimos una lista de propiedades para animar, por ejemplo: `left`, `margin-left`, `height`, `color`. -No todas las propiedades pueden ser animadas, pero [muchas de ellas](http://www.w3.org/TR/css3-transitions/#animatable-properties-). El valor `all` significa "animar todas las propiedades". +No todas las propiedades pueden ser animadas, sí [muchas de ellas](http://www.w3.org/TR/css3-transitions/#animatable-properties-). El valor `all` significa "animar todas las propiedades". ## transition-duration