Smooth scrolling to given coordinates for the browser
$ npm install --save bloody-scroll
import scroll from "bloody-scroll"
coords.x
: (Number) Horizontal target for scroll.coords.y
: (Number) Vertical target for scroll.duration
: (Number) Transition duration.
promise
: (Promise) A promise that is fulfilled once the transition is done.
scroll({ x: 0, y: 1000 }, 1000)
scroll({ x: 1000 }, 1000)
scroll({ y: 400 }, 1000)