Skip to content

CSS Animations #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
8 changes: 4 additions & 4 deletions 7-animation/2-css-animations/1-animate-logo-css/solution.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 6 additions & 6 deletions 7-animation/2-css-animations/1-animate-logo-css/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ importance: 5

---

# Animate the flying plane (CSS)
# Animar el avión volador (CSS)

Modify the solution of the previous task <info:task/animate-logo-css> 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 <info:task/animate-logo-css> 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.
12 changes: 6 additions & 6 deletions 7-animation/2-css-animations/3-animate-circle/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading