vue-mouse-parallax
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "vue-mouse-parallax", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"licence": "MIT", | ||
@@ -10,7 +10,6 @@ "author": { | ||
"scripts": { | ||
"build-bundle": "vue-cli-service build --target lib --name vue-mouse-parallax ./src/components/index.js", | ||
"build": "npm run build:umd & npm run build:es & npm run build:unpkg", | ||
"build:umd": "rollup --config rollup.config.js --format umd --file dist/vue-kinesis.umd.js", | ||
"build:es": "rollup --config rollup.config.js --format es --file dist/vue-kinesis.esm.js", | ||
"build:unpkg": "rollup --config rollup.config.js --format iife --file dist/vue-kinesis.min.js" | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"build-bundle": "vue-cli-service build --target lib --name vue-mouse-parallax ./src/legacycomponents/index.js", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
@@ -32,3 +31,2 @@ "main": "./dist/vue-kinesis.umd.js", | ||
"@rollup/plugin-buble": "^0.21.0", | ||
"@rollup/plugin-commonjs": "^11.0.0", | ||
"@vue/cli-plugin-babel": "^3.11.0", | ||
@@ -43,3 +41,3 @@ "@vue/cli-plugin-eslint": "^3.11.0", | ||
"rollup": "^1.27.14", | ||
"rollup-plugin-vue": "^5.1.1", | ||
"rollup-plugin-buble": "^0.19.8", | ||
"sass": "^1.18.0", | ||
@@ -46,0 +44,0 @@ "sass-loader": "^7.1.0", |
# vue-mouse-parallax | ||
[![npm](https://img.shields.io/npm/v/vue-mouse-parallax.svg) ![npm](https://img.shields.io/npm/dm/vue-mouse-parallax.svg)](https://www.npmjs.com/package/vue-mouse-parallax) | ||
[![npm](https://img.shields.io/npm/v/vue-kinesis.svg) | ||
[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/) | ||
An easy to use Mouse Parallax Component - Made with Vue.js | ||
vue-mouse-parallax has been deprecated. Use [vue-kinesis](https://www.npmjs.com/package/vue-kinesis) instead. | ||
## Demo | ||
[vuejs mouse parallax](https://aminerman.com/playground/vuejs-mouse-parallax/) | ||
[Kinesis](https://aminerman.com/kinesis/) | ||
# Installation | ||
``` | ||
npm install --save vue-mouse-parallax | ||
``` | ||
## Default import | ||
Install all the components: | ||
```javascript | ||
import Vue from 'vue' | ||
import VueMouseParallax from 'vue-mouse-parallax' | ||
Vue.use(VueMouseParallax) | ||
``` | ||
Use specific components: | ||
```javascript | ||
import Vue from 'vue' | ||
import { ParallaxContainer, ParallaxElement } from 'vue-mouse-parallax' | ||
Vue.component('parallax-container', ParallaxContainer) | ||
Vue.component('parallax-element', ParallaxElement) | ||
``` | ||
## Browser | ||
```html | ||
<script src="vue.js"></script> | ||
<script src="vue-mouse-parallax/dist/vue-mouse-parallax.common.js"></script> | ||
``` | ||
# Usage | ||
In order for the effect to work, the `<parallax-element />` should be contained within `<parallax-container />` | ||
Options can then be passed to `<parallax-element />` like so : | ||
```html | ||
<parallax-container> | ||
<parallax-element :parallaxStrength="10" type="translation" tag="div"> | ||
<h2>Put your content here</h2> | ||
</parallax-element> | ||
</parallax-container> | ||
``` | ||
## Props | ||
### parallax-container | ||
| Prop | Type | Default Value | Description | ||
|----------|:-------------:|------|------| | ||
| animationDuration | Number | 1000 | Speed of the parallax animation in ms | | ||
| easing | String | cubic-bezier(0.23, 1, 0.32, 1) | Easing of the parallax animation | | ||
| tag | String | div | Takes any valid html tag | | ||
| perspective | Number | 1000 | Effective for the 'depth' parallax type | | ||
### parallax-element | ||
| Prop | Type | Default Value | Description | ||
|----------|:-------------:|------|------| | ||
| parallaxStrength | Number | 10 | Strength of the Parallax Effect | | ||
| type | String | 'translation' | 'translation' - 'rotation' - 'depth' | | ||
| tag | String | div | Takes any valid html tag | | ||
# Todo | ||
- Combine multiple transform types on one element | ||
- filter: drop-shadow() prop on parallax-element | ||
- Translate on one direction | ||
- Touch events | ||
- Gyroscope | ||
- Events | ||
- Active prop | ||
- Cycle | ||
- Min - Max | ||
- scroll: https://gomakethings.com/how-to-test-if-an-element-is-in-the-viewport-with-vanilla-javascript/ | ||
- optimizations: https://www.sitepoint.com/7-performance-tips-jank-free-javascript-animations/ | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) |
@@ -6,3 +6,3 @@ import commonjs from '@rollup/plugin-commonjs'; | ||
export default { | ||
input: 'src/kcomponents/wrapper.js', | ||
input: 'src/components/wrapper.js', | ||
output: { | ||
@@ -9,0 +9,0 @@ name: 'VueKinesis', |
798245
14
32
16142
16