-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
es/web/api/animation
to Markdown (es) (#8910)
* 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
Showing
36 changed files
with
1,243 additions
and
1,498 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.