Code Monkey home page Code Monkey logo

luxy.js's Introduction

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:

<script src="path/to/luxy.js" charset="utf-8"></script>

Included luxy.js in your project and initialize:

<script charset="utf-8">
    luxy.init();
</script>

Usage

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

<div id="luxy">
    ... Entire content
</div>

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

<div id="luxy">
    <div class="luxy-el"></div>
</div>

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

<div id="luxy">
    <div class="luxy-el" data-speed-y="5" data-offset="-50"></div>
</div>

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

<div id="luxy">
    <div class="luxy-el" data-horizontal="1" data-speed-x="-5"></div>
</div>

Options

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

luxy.js's People

Contributors

dependabot[bot] avatar min30327 avatar mineo-okuda avatar pocchi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.