1.2.1 • Published 4 years ago

v-shine v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

v-shine

A Vue directive that creates a shine effect on any element.

Installation

npm i v-shine

Registering the directive in Vue:

// Global Instance - in your main.js file
import shine from 'v-shine';

Vue.use(shine);
// Single Instance
import shine from 'v-shine';

new Vue({
  directives: { shine }
})

Options

PropertyDescriptionTypeDefault
eventThe event the animation will react to on the element.String'mouseenter'
timeThe number of seconds for the shine to complete its animation.Number1.5
easeThe easing function of the shine.String'ease'
colorThe color of the shine.String'#fff'
angleThe angle of the shine. This will default to the diagonal length of the element.Number
blurThe amount of blur applied on the shine element.Number8
delayNumber of seconds before the shine animation starts.Number0
opacityThe opacity of the shine.Number (0 - 1)0.4
shineWidthThe thickness of the shine bar. This will default to a quarter of the main element's size.Number
fromLeftDetermines if the shine will swipe from the left or from the right.Booleantrue
extraShineAdds a trailing shine to add more effect.Booleanfalse

Usage

Shine can be applied onto an element by using "v-shine".

Basic usage example:

<div v-shine></div>

Examples

<div v-shine="{ time: 1.2, ease: 'ease-in', color: '#ff0000', opacity: 0.5, fromLeft: false, extraShine: true }"></div>
<button v-shine="{ time: 0.3, ease: 'linear', blur: 10, delay: 1 }"></button>

Demo

https://codepen.io/jacobgibellini/pen/zVqLLd

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago