Skip to content

Commit

Permalink
Convert es/web/api/animation to Markdown (es) (#8910)
Browse files Browse the repository at this point in the history
* feat: improve es docs

* replace "syntaxbox" class with "js"
* remove "brush" classes

* feat: convert web/api/animation to markdown

* Correct http links to https
* Remove "SeeCompatTable" macro

* feat: improve web/api/animation

* Simplify "Compat" macro
* Replace "None" with "Ningun"
* Correct markdown
* Minor text edits
* Use "Compatibilidad con navegadores"

Co-authored-by: Craig Blaszczyk <[email protected]>
  • Loading branch information
jakul and Craig Blaszczyk committed Sep 29, 2022
1 parent 957986b commit 04a23f8
Show file tree
Hide file tree
Showing 36 changed files with 1,243 additions and 1,498 deletions.
59 changes: 0 additions & 59 deletions files/es/web/api/animation/animation/index.html

This file was deleted.

45 changes: 45 additions & 0 deletions files/es/web/api/animation/animation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Animation()
slug: Web/API/Animation/Animation
tags:
- Animacion
translation_of: Web/API/Animation/Animation
original_slug: Web/API/Animation/Animación
---
{{ APIRef("Web Animations API") }}

El constructor `Animation()` de [Web Animations API](/es/docs/Web/API/Web_Animations_API) devuelve una instancia del objeto `Animation`.

## Sintaxis

```js
var animation = new Animation([effect][, timeline]);
```

### Parámetros

- `effect` {{optional_inline}}
- : El efecto objetivo, es un objeto de la interfaz {{domxref("AnimationEffectReadOnly")}}, para asignarlo a la animación. Aunque en el futuro podrían ser asignados otros efectos como `SequenceEffect` o `GroupEffect`, el único efecto disponible actualmente es {{domxref("KeyframeEffect")}}. Este puede ser `null` (valor por defecto) para indicar que no debe aplicarse ningún efecto.
- `timeline` {{optional_inline}}
- : Especifica el `timeline` con el que asociar la animación, como un objeto de tipo basado en la interfaz {{domxref("AnimationTimeline")}} . Actualmente el único tipo de línea de tiempo disponible es {{domxref("DocumentTimeline")}}, pero en el futuro habrá lineas de tiempo asociadas , por ejemplo, con gestos o desplazamiento. El valor por defecto es {{domxref("Document.timeline")}}, pero puede ser establecido en `null`.

## Ejemplos

En el ejemplo [Follow the White Rabbit ](https://codepen.io/rachelnabors/pen/eJyWzm/?editors=0010), el constructor `Animation()` es usado para crear una `Animation` para el `rabbitDownKeyframes` utilizando el `timeline` del documento:

```js
var rabbitDownAnimation = new Animation(rabbitDownKeyframes, document.timeline);
```

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Ver también

- [Web Animations API](/es/docs/Web/API/Web_Animations_API)
- {{domxref("Animation")}}
71 changes: 0 additions & 71 deletions files/es/web/api/animation/cancel/index.html

This file was deleted.

53 changes: 53 additions & 0 deletions files/es/web/api/animation/cancel/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Animation.cancel()
slug: Web/API/Animation/cancel
tags:
- API
- Animacion
- Animaciones Web
- Experimental
- Reference
- cancel
- metodo
- waapi
translation_of: Web/API/Animation/cancel
---
{{ APIRef("Web Animations") }}

El método `cancel()` de la Web Animations API de la interfaz {{domxref("Animation")}} borra todos los {{domxref("KeyframeEffect")}} causados por esta animación y aborta su reproducción.

> **Nota:** Cuando se cancela una animación, su {{domxref("Animation.startTime", "startTime")}} y su {{domxref("Animation.currentTime", "currentTime")}} se establecen en `null`.
## Sintaxis

```js
Animation.cancel();
```

### Parámetros

Ningun.

### Valor devuelto

Ningun.

### Excepciones

Este método no arroja excepciones directamente; sin embargo, si la animación {{domxref ("Animation.playState", "playState")}} no está `"idle"`"inactiva" cuando se cancela, el {{domxref ("Animation.finished", "current finished promise", "", 1)}} se rechaza con un {{domxref ("DOMException")}} llamado `AbortError`.

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Ver también

- [Web Animations API](/es/docs/Web/API/Web_Animations_API)
- {{domxref("KeyframeEffect")}}
- {{domxref("Animation")}}
- {{domxref("Animation.playState")}}
- {{domxref("Animation.finished")}} devuelve la promesa que esta acción rechazará si la animación de `playState` no está `"idle"` ("inactiva") .
68 changes: 0 additions & 68 deletions files/es/web/api/animation/cancel_event/index.html

This file was deleted.

54 changes: 54 additions & 0 deletions files/es/web/api/animation/cancel_event/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Animation.oncancel
slug: Web/API/Animation/cancel_event
tags:
- API
- Animacion
- Animaciones Web
- Experimental
- Reference
- oncancel
translation_of: Web/API/Animation/oncancel
original_slug: Web/API/Animation/oncancel
---
{{ APIRef("Web Animations") }}

La propiedad `oncancel` de la interfaz {{domxref("Animation")}} de la [Web Animations API](/es/docs/Web/API/Web_Animations_API) es el manejador de eventos para el evento {{event("cancel")}} .

El evento `cancel` puede ser activado manualmente con {{domxref("Animation.cancel()")}} cuando la animación entra en estado de reproducción `"idle"(inactivo)` desde otro estado, como cuando una animación se elimina de un elemento antes de que termine de reproducirse.

> **Nota:** La creación de una nueva animación, inicialmente inactiva, no activa el evento {{event("cancel")}} en la nueva animación.
## Sintaxis

```js
var cancelHandler = Animation.oncancel;

Animation.oncancel = cancelHandler;
```

### Valor

Una función que será ejecutada cuando la animación sea cancelada, o `null` si no hay un manejador de eventos {{event("cancel")}}.

## Ejemplos

Si esta animación es cancelada, elimina su elemento.

```js
animation.oncancel = animation.effect.target.remove();
```

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Ver también

- [Web Animations API](/es/docs/Web/API/Web_Animations_API)
- {{domxref("Animation")}}
- The {{event("cancel")}} event
Loading

0 comments on commit 04a23f8

Please sign in to comment.