🎨Vue Breathing Colors
Vue Breathing Colors is a vue directive used to change background color of any component in a "breathing like" manner.
Installation
Yarn
NPM
CDN
Usage
Sample
Auto
The colors will change from array index 0
to array index n
and back to 0
again.
HTML
JavaScript
API
The main data needed by the directive is an object with 3 required fields colors:Array
, intervale:Number
, transition:[Object, duration:Number]
.
Object | Type | Decription |
---|---|---|
| Array | Array of string colors. E.g. |
| Number (millis) | Interval indicates how often the color should change. |
| Number (millis) | The duration of transition timing. |
Modifiers
There 2 modifiers for this version, the hover
and random
.
Modifier | Usage | Description |
---|---|---|
|
| Using the random modifier will... you know, change the colors in random. |
|
| Unlike the auto, hover will disrespect the inverval from the data object. The color will change in the auto order |
Tips
Modifiers can be combined like
v-breathing-colors.random.hover
.For best result, always keep in mind that the
interval
should always be greater of at least200%
than thetransition.duration
. Say, thetransition.duration
is 1000, the minimuminterval
should be at least 2000.
More coming soon
More modifiers will be added for future versions.
Last updated