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

jazzer

v0.0.5

Published

Add some visual smooth jazz to your page transitions

Downloads

7

Readme

jazzer

jazzer on npm

jazzer lets you easily freshen up your site and improve its memorability by a bunch. You know these short white flashes when changing between pages? Ugggh, right? jazzer fixes that. It lets you control exactly what should visually happen when clicking on an internal link. Install it, import it, configure it. Give your project the sexyness it deserves!

How to Install

You can install and use jazzer in one of two ways. Install it in a terminal with either yarn or npm and later import / require it somewhere along the line.

// your terminal
yarn add jazzer --save

// your script
import jazzer from 'jazzer';

Or, if this whole node stuff just isn't your style, no worries. Download the latest release from here or reference it from some CDN and add it to your DOM in a script tag.

// your html
<script src="jazzer.js"></script>

Setting up jazzer

Setting up jazzer is fast. Whip this up somewhere in your code and you're almost good to go.

// your script
jazzer();

Now you need to add two things to your DOM: An element with the id jazzer and some links with the attribute data-jazzer-trigger. When clicking on data-jazzer-trigger, jazzer will look for the href attribute on the clicked link and load the contents of the HTML document laying there. If it could identify an element with the same id, in our case jazzer, in the loaded document, it will replace the contents of the #jazzer on this document with the contents of the #jazzer of the loaded document. That's how simple it is.

A document body, ready to be manipulated by jazzer, looks something like this:

<body>
    <header>
        <a href="faq.html" data-jazzer-trigger>Imma trigger jazzer!</a>
    </header>

    <main id="jazzer">
        <p>I will be replaced via AJAX! Whoop, whoop!</p>
    </main>

    <script src="jazzer.min.js"></script>
    <script>
        jazzer();
    </script>
</body>

Adding the Jazz

jazzer will apply a class of your choosing, or if you just roll with the defaults, jazzer-changing to your container #jazzer, while performing the AJAX request and changing the markup. This gives you full control over what should visually happen on your page, while everything gets loaded and injected in the background. The CSS of the demo page looks like that:

#jazzer {
    transition: opacity .5s ease-in-out, transform .5s ease-in-out;
}

.jazzer-changing {
    opacity: 0;
    transform: scale(.75) translateY(100px);
    pointer-events: none;
}

Custom Settings

Of course you can configure jazzer to float your boat if you're not content with the defaults. The configurable values are links, container, transitionClass, duration and changeUrl. You can give jazzer an object with (some of) these properties when calling it. Here's an example:

jazzer({
    links: '.i-will-trigger-jazzer-on-click',
    container: '#my-contents-will-change',
    transitionClass: '.i-get-applied-to-container-when-changing',
    duration: 10000, // love me some long animations
    changeUrl: false // i don't want jazzer to change the url
});

When working with your own values, or in general, make sure to synchronize the duration property with the transition-duration of container. As mentioned, you don't need to overwrite all of these. You can just modify the ones you want to change and leave the rest be. The defaults are:

links = '[data-jazzer-trigger]';
container = '#jazzer';
transitionClass = 'jazzer-changing',
duration = 500;
changeUrl = true;

Browser Compatibility

This package is functional on

  • Internet Explorer 11
  • Microsoft Edge
  • Google Chrome
  • Mozilla Firefox
  • Apple Safari (WebKit in general)

Licence

MIT

Created by Robin Löffel, 2017