Browse along a section clipped into a viewport using a mouse.
npm install @mystroken/mouse-explorer
> :mouse2: Browse along a section clipped into a viewport using a mouse.
``bash`
npm install @mystroken/mouse-explorer
Look at the sources files for more information.
`javascript
import createMouseExplorer from '@mystroken/mouse-explorer';
const viewport = document.querySelector('#viewport');
const section = document.querySelector('#container');
const explorer = createMouseExplorer({ viewport, section });
explorer.on(({ x, y }) => {
section.style.transform = translate3d(${x},${y},0);``
});