Vue Animation on Scroll Component
npm install aos-vueVue 3 lightweight animate on scroll component. Full website example coming soon.
For a quick small demonstation check out https://quelchlax.tech to see this package being used.
!npm

!npm
!GitHub issues
!GitHub last commit
- Notes
- Prerequisites
- Installation
- NPM
- CDN
- Usage
- Global
- Local
- Props
- Animation
- Animation Options
- Fade
- Flip
- Slide
- Zoom
- Offset
- Duration
- Easing
- Easing Options
- Anchor
- Placement
- Placement Options
- Once
---
This package utilizes a library called aos.js, which you can find at https://www.npmjs.com/package/aos. The design of This component is to leverage the aos.js library and its features -- but more customized towards the Vue way.
This package was built using vue-sfc-rollup. Other than using what comes default with this package -- they're no other dependancies this project relies on (other than aos.js).
- Vue v.3.x
- Package has been testing with Vue 3 only, but should work without any issues if using older versions of Vue.
- If any issues persist please visit https://github.com/quelchx/aos-vue/issues to report an issue -- and I will review it asap.
NPM
(Recommended)
``sh`
npm install aos-vue
CDN
`html`
src="https://cdn.jsdelivr.net/npm/aos-vue@0.0.2/dist/aos-vue.esm.js"
integrity="sha256-yEdgzK8/sKALhYXt7Wx989np5BDj6laj+r4bnEhx6Hw="
crossorigin="anonymous"
>
---
Registering the component globally, simple usage demonstration.
main.js
`js
import { createApp } from "vue";
import App from "./App.vue";
import AosVue from "aos-vue";
createApp(App)
.use(AosVue)
.mount("#app");
`
App.vue
`html
{{message}}
`
---
Simple usage
Registering the package locally, simple usage demonstration.
App.vue
` Hello Worldhtml
`
---
#### animation
Property will determine which animation is to occur depending on what parameter is passed.
- type: String
- required: true
- usage:
`html`
- #### animations options:
#### fade animations:
- fade
- fade-up
- fade-down
- fade-left
- fade-right
- fade-up-right
- fade-up-left
- fade-down-right
- fade-down-left
#### flip animations:
- flip-up
- flip-down
- flip-right
- flip-left
#### slide animations:
- slide-down
- slide-up
- slide-right
- slide-left
#### zoom animations
- zoom-in
- zoom-in-up
- zoom-in-down
- zoom-in-left
- zoom-in-right
- zoom-out
- zoom-out-up
- zoom-out-down
- zoom-out-left
- zoom-out-right
---
#### offset
Change offset to trigger animations sooner or later
- type: Number
- required: false
- default: 0
- usage:
`html`
- note: amounts are pixel (px) amounts
---
#### duration
Duration of the animation play time (ms)
- type: Number
- required: false
- default: 400
- usage:
`html`
- note: duration accepts values from 50 to 3000, with step 50ms -- this should be good for all use cases. If this is an issue with the set range, you can change the css animation the element you wish to target like the example shown below
> (Example overriding default animation time)
`css`
body [data-aos-duration="4000"] [data-aos],
[data-aos][data-aos][data-aos-duration="4000"] {
transition-duration: 4000ms;
}
---
#### easing
Change and choose timing function to ease elements in different ways
- type: String
- required: false
- default: 'ease-in-out'
- usage:
`html`
#### - easing options
- linear
- ease
- ease-in
- ease-out
- ease-in-out
- ease-in-back
- ease-out-back
- ease-in-out-back
- ease-in-sine
- ease-out-sine
- ease-in-out-sine
- ease-in-quad
- ease-out-quad
- ease-in-out-quad
- ease-in-cubic
- ease-out-cubic
- ease-in-out-cubic
- ease-in-quart
- ease-out-quart
- ease-in-out-quart
---
#### delay
Delays the animation by milliseconds (ms).
- type: Number
- required: false
- default: 0
- usage:
`html`
---
#### anchor
Anchor element, whose offset will be counted to trigger animation instead of actual elements offset
- type: String
- required: false
- default: null
- usage
`html`
---
#### placement
Anchor placement - which one position of element on the screen should trigger animation
- type: String
- required: false
- default: 'top-center'
- usage:
`html`
#### - placement options
- top-bottom
- top-center
- top-top
- center-bottom
- center-center
- center-top
- bottom-bottom
- bottom-center
- bottom-top
---
#### once
Choose wheter animation should fire once, or every time you scroll up/down to the element
- type: Boolean
- required: false
- default: false
- usage:
`html``
---
If your interested in contributing to this package please contact me by email through my website at https://quelchlax.tech
If you encounter any issues or have any concerns please refer to https://github.com/quelchx/oas-vue/issues and report a detailed description of what is occuring.
Package Repository: https://github.com/quelchx/aos-vue
Author: Eric Quelch Github: https://github.com/quelchx Website: https://quelchlax.tech