Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bonhomme/bonnie-parallax

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonhomme/bonnie-parallax

A Javascript parallax manager

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

🐢 bonnie-parallax

A Javascript library.

License: MIT

Getting started

Install

NPM
npm i @bonhomme/bonnie-parallax
Browser
<script type="text/javascript" src="https://unpkg.com/@loupthibault/linkedlist@0.1.0/dist/linkedlist.umd.js"></script>
<script type="text/javascript" src="https://unpkg.com/@bonhommeparis/bonnie-parallax@0.1.0/dist/linkedlist.umd.js"></script>

Usage


// For install via npm
import {Parallax, BasicRule} from '@bonhomme/bonnie-parallax';

/**
 * // For install via browser
 * var Parallax = window.bonnieParallax.Parallax;
 * var BasicRule = window.bonnieParallax.BasicRule;
 */
 

const parallax = new Parallax({
  el: document.body
});

parallax.addRule(new BasicRule({
  query: '[data-prllx-item]'
}));

const render = () => {
  parallax.current = document.scrollingElement.scrollTop;
  requestAnimationFrame(render);
};

parallax.init();
parallax.setViewPort(window.innerWidth, window.innerHeight);
requestAnimationFrame(render);

...
<div data-prllx-item data-speed='0.9'></div>
<div data-prllx-item data-delta-start='10%'></div>
<div data-prllx-item data-delta-end='-10v'></div>
...
Browser

var Parallax = window.

Parallax

Options

NameTypeDefault ValueDescription
elHTMLElementdocument.body
isHorizontalBooleanfalse
hiddenClassstring'u-hidden'
precisionNumber4
isBasedOnCurrentBooleantrue

Getters/Setters

parallax.el [Read-Only]
parallax.current

Methods

parallax.init()
parallax.addRule(rule)
parallax.setViewPort(width, height)
parallax.render()
parallax.destroy()

Basic Rule

Constructor

Attributes

License

MIT.

Keywords

FAQs

Package last updated on 24 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc