You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-23Lines changed: 86 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
</p>
5
5
6
6
---
7
-
**Animate4vue** is a library for ready-to-use animations designed for Vue.js applications, featuring over 100 high-performance UI animations crafted with GSAP, offering GPU-accelerated rendering with better performance and efficiency across all devices, as well as callbacks and async handling. Unlike traditional CSS animation libraries that can be tasking and less efficient on low-end devices. Animate4vue make your animations look and feel flawless.
7
+
**Animate4vue** is a library for ready-to-use animations designed for Vue.js applications, featuring over 100 high-performance UI animations crafted with GSAP, offering GPU-accelerated rendering with better performance and efficiency across all devices, as well as callbacks and async handling. Unlike traditional CSS animation libraries that can be tasking and less efficient on low-end devices, Animate4vue make your animations look and feel flawless.
8
8
9
9
Offers TypeScript support, and tree-shaking, so only the animations you use are bundled, keeping your application lean and fast.
10
10
@@ -39,7 +39,32 @@ Traditional CSS animations often struggle with performance issues, especially on
Animate4vue seamlessly integrates with Vue's `<Transition>` and `<TransitionGroup>` components, giving you the flexibility to add animations with ease. There are two primary methods for incorporating animations with these components:
59
-
### 1. Through direct invocation.
84
+
### 1. Through direct invocation
60
85
This involves applying animations directly by hooking into the lifecycle events of Transition components. Here’s how you can do it:
> Elements should be conditionally displayed using v-if for animations to work.
99
+
> **Important**: Elements should be conditionally displayed using v-if for animations to work.
75
100
76
-
> Make sure there are no animations or CSS transitions applied or conflicting with elements to animate, they might interfere and mess things up. For example, avoid specifying CSS transitions globally.
101
+
> **Tip**: Make sure there are no animations or CSS transitions applied or conflicting with elements to animate, they might interfere and mess things up. For example, avoid specifying CSS transitions globally.
77
102
78
-
You may use the `<TransitionGroup>` for animating multiple elements as they enter and leave the DOM:
103
+
#### Animate on initial load
104
+
To animate elements on initial load, use the `appear` directive to trigger animations without conditional rendering with `v-if`:
Vue's transition components also provide a range of callback events, giving you finer control over the animation lifecycle. These include events like before-enter, after-enter, enter-cancelled, before-leave, after-leave, and leave-cancelled. Here's an example of how to use these callbacks:
<p align="right"><small><a href="#table-of-contents">Table of Contents</a></small></p>
147
191
148
-
All animations return a Promise and support asynchronous operations with await and .then().catch():
192
+
### Asynchronous Support <a id="asynchronous-support-anim"></a>
193
+
All animations return a Promise that resolves when the animation completes, allowing you to handle asynchronous operations using `await` or by chaining `.then()` and `.catch()`:
👆 In this example, only the data-av-delay option from dataset attributes will be applied, as the duration and ease options are specified in the function invocation.
347
+
<p align="right"><small><a href="#table-of-contents">Table of Contents</a></small></p>
[View live demo of animations](https://animate4vue.netlify.app)
400
+
<p align="right"><small><a href="#table-of-contents">Table of Contents</a></small></p>
354
401
355
402
356
403
## Attention Seekers
357
404
Attention seekers are animations designed to grab users' attention, such as a ringing bell icon or shaking elements. These animations enhance user engagement and provide a compelling experience. Animate4vue offers a variety of dynamic attention-seeking animations to fit any scenario.
358
405
359
-
### Available Attention-Seeker Animations
406
+
### Available Attention-Seeker Animations <a id="att-animations"></a>
You can pass options to customize the animation behavior. For example:
387
435
```javascript
388
436
headShake(el, {
@@ -420,10 +468,12 @@ headShake(el, {
420
468
421
469
> Delay before the animation in seconds. Numbers below 0 denotes milliseconds(e.g 0.3). Also specify repeat delay of the animation when is on loop.
422
470
471
+
<p align="right"><small><a href="#table-of-contents">Table of Contents</a></small></p>
472
+
423
473
### Stopping Attention Seekers
424
474
Attention seekers provide a `kill()` method to stop ongoing animations, especially when set to loop. This allows you to halt the animation at any time.
> Keep in mind that the animation properties defined for 'enter' dictate how the element appears when it enters, while those specified for 'leave' determine how it disappears.
504
564
505
-
### Asynchronous Support
506
-
The `customAnimation()` method returns a Promise, allowing you to use await or .then().catch() for asynchronous operations:
565
+
<p align="right"><small><a href="#table-of-contents">Table of Contents</a></small></p>
566
+
567
+
### Asynchronous Support <a id="asynchronous-support-custom"></a>
568
+
The `customAnimation()` method returns a Promise that resolves when the animation is complete, allowing you to use `await` or chain `.then()` and `.catch()` for asynchronous operations:
0 commit comments