https://github.com/micorix/vue-mousefollower
Vue plugin for moving background-position on mouse move
https://github.com/micorix/vue-mousefollower
background mousemove vue vue2
Last synced: 12 months ago
JSON representation
Vue plugin for moving background-position on mouse move
- Host: GitHub
- URL: https://github.com/micorix/vue-mousefollower
- Owner: micorix
- Created: 2017-08-21T11:06:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T19:00:12.000Z (over 1 year ago)
- Last Synced: 2025-04-23T01:50:05.857Z (about 1 year ago)
- Topics: background, mousemove, vue, vue2
- Language: JavaScript
- Homepage: https://npm.im/vue-mousefollower
- Size: 5.86 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vue MouseFollower
*Vue plugin for moving background on mouse move*
*Inspired by https://codepen.io/vajkri/pen/grgQmb*
[DEMO available](https://jsfiddle.net/micorix/v9u8p54e/)
## Instalation
Get from npm: ```npm install vue-mousefollower``` or from yarn ```yarn add vue-mousefollower```
## Usage
```javascript
// main.js
import Vue from 'vue'
import VueMouseFollower from 'vue-mousefollower'
Vue.use(VueMouseFollower)
```
```html
```
```css
/* in component.vue */
#bg{
width:200px;
height: 200px;
background: url(example-background.png);
}
```
## Customizing
- Set custom friction with ```v-mousefollower:[custom number]``` (ex. ```v-mousefollower:60```, default is 30)
- You can use ```v-mf``` instead of ```v-mousefollower```