Skip to content
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

Convert es/web/api/animation to Markdown (es) #8910

Merged
merged 3 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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