@mystroken/mouse-explorer

0.0.1 • Public • Published

mouse-explorer

contributions welcome

🐁 Browse along a section clipped into a viewport using a mouse.


Installation

npm install @mystroken/mouse-explorer

Usage

Look at the sources files for more information.

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)`;
});

/@mystroken/mouse-explorer/

    Package Sidebar

    Install

    npm i @mystroken/mouse-explorer

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    9.93 kB

    Total Files

    4

    Last publish

    Collaborators

    • mystroken