npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@apatheticwes/parallax

v0.1.0

Published

A simple parallax object for parallaxin'

Downloads

4

Readme

Parallax

Parallax. Moves stuff on scroll.

Introduction

There are several ways to approach building a parallax effect on a site. Paul Lewis has a great overview on the popular techniques and their pros and cons. In brief:

  • absolute positioning: parallax is achieved via positioning elements absolutely (this technique also includes positioning a background image attachment). In general, this is the absolute worst way to do parallax from a performance point of view. Everything must be recalculated and re-painted on scroll, so avoid this if possible. The upside: you can support IE8 this way.
  • 3D transforms: how the code herein operates. We offload elements in their own render layer to the GPU for X- or Y-transforms. Almost the most efficient (see below), but still very flexible and easy to implement. Browsers need to support transforms.
  • canvas: one fixed element background (a canvas), that animates on scroll. Elements are placed into the canvas and moved about on scroll -- this is the most efficient, but difficult to implement (or impossible if you wish to use existing DOM elements).

Getting Started

Download the production version or the development version.

Include the relevant scripts in your web page, and then:

<script>
	window.onload = parallax.init({ el: '.parallax' });
</script>

Integration into your project

You'll notice that this (by default) adds a property to the Global namespace. This isn't necessarily a bad thing; rather, the onus is now on you to do what you wish with it.

If you're using a build script (ie. Grunt, Gulp), you can deglobalify and browserify, for example, and deal with the parallax object as you'd wish. See this article on Browserify for more info.

Documentation

Elements on the page can have different attributes, as referenced through particular data-atrributes. For example:

<div class="parallax item" data-parallax-speed="1"></div>

Support

  • IE9+
  • Safari / Chrome
  • Firefox

Known Issues

Examples

Please see the demo directory

Release History

0.1

  • initial commit