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 🙏

© 2026 – Pkg Stats / Ryan Hefner

parallaxx-js

v1.0.2

Published

Efek parallax sederhana untuk hero section

Readme

parallaxx-js

A lightweight, dependency-free JavaScript library for creating simple parallax scrolling effects with minimal configuration.

Works with plain HTML, CSS, and JavaScript—perfect for hero sections, banners, and backgrounds.


FEATURES

  • Vanilla JS: No external dependencies.
  • Easy setup: Just add data-* attributes to your HTML elements.
  • Customizable speed: Control the parallax movement with the data-speed attribute.
  • Optional height: Set a custom section height via data-height (defaults to 100vh).
  • Responsive: Works seamlessly with frameworks like Bootstrap or Tailwind, or with plain HTML.
  • CDN-ready: Use it directly from a CDN without any installation.

INSTALLATION

NPM

npm install parallaxx-js

Import in your HTML:

<link rel="stylesheet" href="./node_modules/parallaxx-js/dist/parallax.css" />
<script src="./node_modules/parallaxx-js/dist/parallax.js"></script>

CDN

jsDelivr
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/parallaxx-js/dist/parallax.css"
/>
<script src="https://cdn.jsdelivr.net/npm/parallaxx-js/dist/parallax.js"></script>
unpkg
<link
  rel="stylesheet"
  href="https://unpkg.com/parallaxx-js/dist/parallax.css"
/>
<script src="https://unpkg.com/parallaxx-js/dist/parallax.js"></script>

🚀 Basic Usage

<html>
<head>
  <title>Parallax Effect</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/parallaxx-js/dist/parallax.css">
<body>

  <div class="parallax"
       data-speed="0.5"
       data-image="https://picsum.photos/id/1018/1000/600">
    <h1>Parallax Effect</h1>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/parallaxx-js/dist/parallax.js"></script>
</body>
</html>

The .parallax class automatically applies the parallax background effect using data-image, data-speed, and optional data-height without requiring extra HTML wrappers.


Configuration Options

| Attribute | Type | Default | Description | | ----------- | ------ | ------- | ------------------------------------------------------------------------ | | data-image | URL | – | The background image URL. This is a REQUIRED attribute. | | data-speed | Number | 0.3 | A multiplier for the scroll speed. A higher value means a faster effect. | | data-height | String | 100vh | A custom height for the parallax section (e.g., 500px, 80vh). |


🧩 How .parallax Works

When you add the class .parallax to an element, the library will:

  1. Wrap it automatically in a .parallax-container element.
  2. Create a .parallax-layer behind it using the data-image attribute for the background.
  3. Apply the scroll transform effect to .parallax-layer based on the value of data-speed.
  4. Keep your original .parallax content on top (foreground) with a higher z-index.

Default Styling

By default:

  • .parallax has position: relative, display: flex, align-items: center, justify-content: center.

  • Height is 100vh unless overridden via data-height.

  • .parallax-layer is position: absolute, full width/height, and uses background-size: cover and background-position: center.

This means:

  • You only need to provide your content and data-* attributes.

  • No need to manually create .parallax-container or .parallax-layer in your HTML.

  • Works seamlessly with Bootstrap, Tailwind, or any CSS framework.


EXAMPLES

Hero Section with Bootstrap

Combine parallaxx-js with Bootstrap for a responsive and stunning hero section.

<section
  class="parallax"
  data-speed="0.4"
  data-image="https://picsum.photos/id/1005/1600/900"
>
  <div
    class="container h-100 d-flex flex-column justify-content-center align-items-center text-white"
  >
    <h1 class="display-3 fw-bold text-center">Welcome to My Site</h1>
    <p class="lead text-center">Bootstrap Hero with Parallax Effect</p>
    <a href="#content" class="btn btn-primary btn-lg mt-3">Explore More</a>
  </div>
</section>

Multiple Parallax Sections

You can use parallaxx-js for multiple sections on a single page, each with its own configuration.

<div
  class="parallax"
  data-speed="0.2"
  data-image="https://picsum.photos/id/1022/1200/800"
  data-height="80vh"
>
  <h2>Section One</h2>
</div>

<div style="height: 500px; background: #eee; padding: 2rem;">
  <p>Regular content...</p>
</div>

<div
  class="parallax"
  data-speed="0.5"
  data-image="https://picsum.photos/id/1043/1200/800"
>
  <h2>Section Two</h2>
</div>

LIVE DEMO

Want to see it in action? Check out the live CodePen example.

Link to CodePen: https://codepen.io/razorzero0/pen/KwdZZoG


LICENSE

MIT License © 2025 Ainun