Skip to content

m0ose/RepulsiveElements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RepulsiveElements

Move elements away from the mouse

  • Cody Smith 2020

Example

A demo is worth a thousand words.

Usage

new RepulsiveElements(document.getElementById('someElement')) 

Options

  • textSplitter: "", change the striing to splt text by. empty string splits up every letter.
  • friction: 0.09, How fast the element returns to it's origin.
  • springK: 1, Spring factor.
  • mouseK: 0.1, Mouse repulsion factor. 0 turns it off.
  • scrollK: 0.3, How much to bounce when you scroll. 0 is off. 1 is on.

About

Move elements away from the mouse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published