GitHub - min30327/luxy.js: Inertia scroll and parallax effect plugin in Vanilla.js (original) (raw)

luxy.js

Inertia scroll and parallax effect plugin in Vanilla.js

Demo

View the demo

Installation

You can install it using npm:

npm install luxy.js --save

Or just include the script in your page:

Included luxy.js in your project and initialize:

Usage

Wrap the entire content with the element specified in the wrapper option. Please exclude fixed elements.

... Entire content

Add .luxy-el to the element for which parallax effect is to be specified.

Specify the speed of the parallax effect with the data-speed-y attribute and offset with the data-offset attribute.

If you want to move horizontally, specify data-horizontal="1" and specify the speed in the horizontal direction with the data-speed-x attribute.

Options

Name default description
wrapper '#luxy' Entire content wrapper element.
targets '.luxy-el' Parallax effect targets elements.
wrapperSpeed 0.08 Inertia scroll speed.