1.0.8 • Published 3 years ago

@llagache/bloody-parallax v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

BloodyParallax

A quick to setup Javascript ES6 Parallax Library

Usage

npm install @llagache/bloody-parallax

Example :

index.js :

import BloodyParallax from "@llagache/bloody-parallax";
const parallax = new BloodyParallax({
    mouseIntensity: 0.2, 
    scrollIntensity: 0.5, 
    damping: 0.1, 
    attribute: "data-depth"
});

index.html :

<div data-depth="0.1">I have parallax</div>

Constructor :

/**
 * @param {object} config { 
 *   {number} scrollIntensity : 0.1, 
 *   {number} mouseIntensity : 0.1, 
 *   {number} damping : 0.1, 
 *   {string} attribute : "data-depth"
 * }
 */
new BloodyParallax({ 
    scrollIntensity, 
    mouseIntensity, 
    damping, 
    attribute
})

Methods :

/**
 * Query all the elements with the parallax attribute
 * must be called after when new elements are createds
 */
queryElements()

Author

Lagache Louis (@llagache_dev)

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago