Skip to content

Commit 7bc5a88

Browse files
Lexpearthadanielroe
authored andcommitted
docs: update IonAnimation code example to code group
1 parent 52a4b42 commit 7bc5a88

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

docs/content/3.features.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,28 @@ Module also offers few components made for easier and more seamless way to integ
3636

3737
Component made specifically to make usage of Ionic's `createAnimation` easier. It has almost 1 to 1 props matching as your usual animation object. For more see [official Ionic docs](https://ionicframework.com/docs/utilities/animations) or check out [playground examples](https://github.com/danielroe/nuxt-ionic/blob/main/playground/pages/tabs/tab4.vue)
3838

39-
Instead of using the function manually:
39+
You can see how it replaces usage of regular `createAnimation` function in the code example below:
4040

41-
```vue
41+
::code-group
42+
43+
```vue [IonAnimation]
44+
<template>
45+
<IonAnimation
46+
:duration="3000"
47+
:iterations="Infinity"
48+
:keyframes="[
49+
{ offset: 0, background: 'red' },
50+
{ offset: 0.72, background: 'var(--background)' },
51+
{ offset: 1, background: 'green' },
52+
]"
53+
playOnMount
54+
>
55+
<!-- Content to animate -->
56+
</IonAnimation>
57+
</template>
58+
```
59+
60+
```vue [Manual usage]
4261
<script setup lang="ts">
4362
// Template ref of your element
4463
const squareRef = ref()
@@ -60,24 +79,7 @@ onMounted(() => {
6079
</script>
6180
```
6281

63-
You can delegate all that logic to the component:
64-
65-
```vue
66-
<template>
67-
<IonAnimation
68-
:duration="3000"
69-
:iterations="Infinity"
70-
:keyframes="[
71-
{ offset: 0, background: 'red' },
72-
{ offset: 0.72, background: 'var(--background)' },
73-
{ offset: 1, background: 'green' },
74-
]"
75-
playOnMount
76-
>
77-
<!-- Content to animate -->
78-
</IonAnimation>
79-
</template>
80-
```
82+
::
8183

8284
::alert{type=info}
8385
Currently component doesn't support grouped and chained animations. For that usage we still recommend using `createAnimation` by itself

0 commit comments

Comments
 (0)