0.0.2 • Published 2 years ago
mini-parallax-js v0.0.2
mini-parallax-js
Mouse move parallax effect
Installation
Install mini-parallax-js with npm
npm i mini-parallax-js
Usage/Examples
import {createPrlxObjects} from "../node_modules/mini-parallax-js/index.js";
//your objects
let obj = [
{
elementClass: "section1",
w: 50,
h: 50,
objectWrapperId: "circleWrapper",
imageUrl: "/images/circle.png",
depth: 2,
},
{
elementClass: "section2",
w: 50,
h: 50,
objectWrapperId: "triangleWrapper",
imageUrl: "/images/triangle.png",
depth: 2,
}
...
];
//call function
createPrlxObjects(obj);
Parameters
Parameter | Type | Description |
---|---|---|
elementClass | string | Selector in which to display the object |
w | number | width for object wrapper |
h | number | height for object wrapper |
objectWrapperId | string | ID for object wrapper |
imageUrl | string | path to the image |
depth | number | number from 0.1 - 9 |