Move elements away from the mouse
- Cody Smith 2020
A demo is worth a thousand words.
new RepulsiveElements(document.getElementById('someElement'))
- 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.