diff --git a/src/pages/utilities/animations.md b/src/pages/utilities/animations.md index 43752359e4e..b390926682e 100755 --- a/src/pages/utilities/animations.md +++ b/src/pages/utilities/animations.md @@ -162,9 +162,9 @@ createAnimation() .duration(3000) .iterations(Infinity) .keyframes([ - { offset: 0, background: 'red' }, - { offset: 0.72, background: 'var(--background)' }, - { offset: 1, background: 'green' } + { offset: 0, transform: "rotate(0deg) scale(1)" }, + { offset: 0.72, transform: "rotate(180deg) scale(2)" }, + { offset: 1, transform: "rotate(360deg) scale(1)" } ]); ``` @@ -176,9 +176,9 @@ this.animationCtrl.create() .duration(3000) .iterations(Infinity) .keyframes([ - { offset: 0, background: 'red' }, - { offset: 0.72, background: 'var(--background)' }, - { offset: 1, background: 'green' } + { offset: 0, transform: "rotate(0deg) scale(1)" }, + { offset: 0.72, transform: "rotate(180deg) scale(2)" }, + { offset: 1, transform: "rotate(360deg) scale(1)" } ]); ``` @@ -189,9 +189,9 @@ this.animationCtrl.create() duration={3000} iterations={Infinity} keyframes={[ - { offset: 0, background: 'red' }, - { offset: 0.72, background: 'var(--background)' }, - { offset: 1, background: 'green' } + { offset: 0, transform: "rotate(0deg) scale(1)" }, + { offset: 0.72, transform: "rotate(180deg) scale(2)" }, + { offset: 1, transform: "rotate(360deg) scale(1)" } ]} > ... @@ -200,6 +200,8 @@ this.animationCtrl.create() +You can view a live example of this in Angular [here](https://stackblitz.com/edit/ionic-angular-animation-keyframes) and in React [here](https://stackblitz.com/edit/ionic-react-animation-keyframes). + In the example above, the `.square` element will transition from a red background color, to a background color defined by the `--background` variable, and then transition on to a green background color. Each keyframe object contains an `offset` property. `offset` is a value between 0 and 1 that defines the keyframe step. Offset values must go in ascending order and cannot repeat.