you-be-my-sun
Make one DOM element hug another while staying closest to page center
install
$ npm install --save you-be-my-sun
api
- sunEl (DOM Element - required - Element to gravitate around)
- earthEl (DOM Element - required - Element that will gravitate)
- fluidity (Number - optional [default 30] - Steps (in px) to evaluate positioning)
usage
'use strict' // Setupconst sun = documentconst earth = document // Main { let x y = earthstyleleft = `px` earthstyletop = `px`}
License
MIT © Andrew Carpenter