Use mouse or finger to scrub the slider. Change the settings below to toggle different behaviors.
import { fscrub } from 'fpoint'
fscrub(document.querySelector('.slider'), {
onStart() {},
onMove() {},
onEnd() {},
})
import {Scrub} from 'fpoint/react'
function handleScrubMove(e) {
const pageX = e.touches ? e.touches[0].pageX : e.pageX
const pageY = e.touches ? e.touches[0].pageY : e.pageY
// ...
}
return (
<Scrub
onScrubMove={handleScrubMove}
>
{children}
</Scrub>
)