Skip to content

estrattonbailey/paralless

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

paralless

Hyper-minimal parallax implementation for subtle animation. 349b gzipped.

js-standard-style

Usage

Import the library and pass a selector as its only argument. Then, call init() on the returned instance to start watching scroll events and animating all selected elements.

import { paralless } from 'paralless'

const para = paralless('.my-parallax-selector')

para.init()

Optionally define speeds in your markup via the data-speed attribution. This option defaults to 2 and so halves the distance scrolled, creating a effect that is half the speed of your scroll. Increase or decrease this integer to find your desired effect.

<div class='my-parallax-selector' data-speed='4'>...children...</div>
<div class='my-parallax-selector' data-speed='10'>...children...</div>

Recommended styles

.my-parallax-selector {
  transition: transform 200ms ease-in-out;
}

MIT License

About

Simple Parallax powered by CSS3 Transitions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%