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

z-axis-hanser

v1.1.1

Published

[![npm version](https://badge.fury.io/js/z-axis-hanser.svg)](https://badge.fury.io/js/z-axis-hanser) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Downloads

7

Readme

Z-Axis UI Library

npm version License: MIT

A lightweight, high-performance 3D physics engine for the web. It turns flat HTML elements into interactive, holographic objects that respond to mouse movement and mobile gyroscope tilt.

✨ Launch Live Studio Demo


Features

  • Physics-Based Motion: Choose between "Heavy" (weighted inertia) or "Instant" (HUD-style) movement.
  • Holographic Glare: Auto-generated light reflections that react to the angle of the card.
  • Mobile Gyroscope: Uses device orientation sensors to tilt cards based on how you hold your phone.
  • 3D Parallax Depth: Automatically separates text and images into floating layers.
  • Zero Dependencies: Pure Vanilla JS. Works with React, Vue, Angular, or plain HTML.

Installation

Install via NPM:

npm install z-axis-hanser

Usage

  1. The "Plug & Play" Method (Recommended)

Just add data-z attributes to your HTML. The library handles the rest.

<!-- 1. Create your card -->
<div class="card" 
     data-z 
     data-z-force="30" 
     data-z-mode="heavy"
     data-z-glare>
     
    <!-- 2. Add depth to children -->
    <h1 data-z-depth="40px">I Float!</h1>
    <p data-z-depth="20px">I float less.</p>
</div>

<!-- 3. Initialize in your script -->
<script type="module">
    import Z from 'z-axis-hanser';
    
    // Scans the DOM and activates all [data-z] elements
    Z.init();
</script>
  1. The "Manual" Method (For React/Vue)

If you are building components dynamically, you can bind specific elements.

import Z from 'z-axis-hanser';

const myElement = document.querySelector('#my-card');

// Bind manually
Z.bind(myElement, {
    force: 30,        // Tilt limit in degrees
    mode: 'heavy',    // 'heavy' or 'instant'
    glare: true,      // Enable holographic shine
    reverse: false    // Reverse tilt direction
});

Mobile Support (Gyroscope)

Modern iOS versions require user permission to access motion sensors. You must trigger this with a user interaction (like a button click).

// Add a button to your UI
document.getElementById('btn-enable-gyro').addEventListener('click', () => {
    Z.mobile(); // Requests permission and activates tilt
});

API Reference

HTML Attributes

| Attribute | Value | Description | | :--- | :--- | :--- | | data-z | (Empty) | Required. Marks the container as a 3D element. | | data-z-force | Number | Max tilt angle in degrees (Default: 20). | | data-z-mode | heavy | instant | Physics style. heavy has inertia; instant is 1:1 tracking. | | data-z-glare | (Empty) | Adds the holographic reflection layer. | | data-z-reverse| (Empty) | Inverts the tilt axis. | | data-z-depth | 20px | Child Element. Distance the child floats above the card. |


JavaScript Options

When using Z.bind(el, options):

{
    force: 30,       // Number
    mode: 'heavy',   // String
    glare: true,     // Boolean
    reverse: false   // Boolean
}

Using the Studio Website

The repository includes a Live Studio (index.html) to help you design cards visually.

  1. Clone the repo: git clone https://github.com/hanserq/z-axis.git
  2. Install: npm install
  3. Run: npm run dev
  4. Design: Use the sliders to adjust physics, copy the generated HTML code, and paste it into your project.

License

MIT © Hanser