0.0.2 • Published 2 years ago

mini-parallax-js v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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

ParameterTypeDescription
elementClassstringSelector in which to display the object
wnumberwidth for object wrapper
hnumberheight for object wrapper
objectWrapperIdstringID for object wrapper
imageUrlstringpath to the image
depthnumbernumber from 0.1 - 9

Demo

Demo

0.0.2

2 years ago

0.0.1

2 years ago