[go: up one dir, main page]

Skip to content

This is a small experiment that creates a little avatar that follows mouse cursor on the page.

License

Notifications You must be signed in to change notification settings

ArtBIT/mouse-follower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub stars GitHub license GitHub issues

Mouse Follower

This is a small experiment that creates a little avatar that follows mouse cursor on the page.

Try the live demo here.

mouse-follower

Usage

    var follower = new MouseFollower();
    follower.show();

To customize the follower you can use the following options:

    var follower = new MouseFollower({
        backgroundImage:'/demos/assets/ghost_body_tartan.gif',
        followStrategy: 'basic', /* basic|wobble */
        width: 50,
        height: 50,
        offsetX: 25,
        offsetY: 25,
        opacity: 0.8,
        spring: 8,          /* springiness coeficient    */
        inertia: 30,        /* how agile the follower is */
        wobble: 50,         /* radius in pixels to wobble around the cursor */
        xflip: false,       /* should the sprite flip horizontally */
        yflip: false,       /* should the sprite flip vertically */
        eyes: {
            backgroundImage:'/demos/assets/ghost_eyes.gif',
            width:12,
            height:16,
            radius: 5,
            offsetX:19,
            offsetY:16,
            opacity: 1
        }
        /* eyes: false - to disable */
    });
    follower.show();
});

Local Build

git clone https://github.com/ArtBIT/mouse-follower.git
cd mouse-follower
npm install
npm start

License

MIT

About

This is a small experiment that creates a little avatar that follows mouse cursor on the page.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published