Skip to content

pixelcollective/hoverflair.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

hoverflair.js

Fifteen is the minimum, okay?

This is just a cute little JS package that allows you to make hover interactions a little more playful.

Specify a CSS property, a set of possible values and a dom selector. hoverflair will apply a random value from the set to the element's property on hover.

Install

yarn add hoverflair.js

Example

Applies a random color to a link on hover.

const hoverThing = document.querySelectorAll('a.my-fancy-link')

const options = {
  colors: [
    '#00f',
    '#ffe716',
    '#f92672',
  ],
  transitionClass: `fadeTransition`, // optional
}

hoverFlair
  .init(options)
  .addFlair(hoverThing, 'color')

About

Fifteen is the minimum, okay?

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published