Socket
Socket
Sign inDemoInstall

vue-mouse-parallax

Package Overview
Dependencies
11
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    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) [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/


Version published
Maintainers
1
Created

Readme

Source

vue-mouse-parallax

npm npm vue2

An easy to use Mouse Parallax Component - Made with Vue.js

Demo

vuejs mouse parallax

Installation

npm install --save vue-mouse-parallax

Default import

Install all the components:

import Vue from 'vue'
import VueMouseParallax from 'vue-mouse-parallax'

Vue.use(VueMouseParallax)

Use specific components:

import Vue from 'vue'
import { ParallaxContainer, ParallaxElement } from 'vue-mouse-parallax'

Vue.component('parallax-container', ParallaxContainer)
Vue.component('parallax-element', ParallaxElement)

Browser

<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 :

<parallax-container>
    <parallax-element :parallaxStrength="10" type="translation" tag="div">
        <h2>Put your content here</h2>
     </parallax-element>
</parallax-container>

Props

parallax-container

PropTypeDefault ValueDescription
animationDurationNumber1000Speed of the parallax animation in ms
easingStringcubic-bezier(0.23, 1, 0.32, 1)Easing of the parallax animation
tagStringdivTakes any valid html tag
perspectiveNumber1000Effective for the 'depth' parallax type

parallax-element

PropTypeDefault ValueDescription
parallaxStrengthNumber10Strength of the Parallax Effect
typeString'translation''translation' - 'rotation' - 'depth'
tagStringdivTakes any valid html tag

Todo

  • Improve nested parallax
  • Combine multiple transform types on one element
  • filter: drop-shadow() prop on parallax-element
  • Translate on one Axis
  • Touch events

License

MIT

Keywords

FAQs

Last updated on 24 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc