1.0.3 • Published 3 years ago

@leetajz/vue-directive v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Vue-directive

Simple directive to apply animation/class when element is scrolled into view.

Install:

npm i @leetajz/vue-directive

Register

plugins: [
    ...
    '@/node_modules/@leetajz/vue-directive'
    ...
]

Usage

<div v-animate="{ threshold: .3, animation: 'slide-in', duration: '.5s' }"></div>

<div v-addClass="{ threshold: .3, class: 'slide-in', duration: '.5s' }"></div>

Options:

OptionTypeRequiredDefault
thresholdIntegertrue
animationStringtrue
durationStringfalse.3s

CSS:

@keyframes left-slide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
1.0.3

3 years ago

1.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago