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

spinner-lord

v0.2.6

Published

A CSS bulk of animated spinners used for loading

Downloads

3

Readme

spinner-lord

A CSS bulk of animated spinners used for loading

What is spinner-lord ?

spinner-lord is a CSS only library that provides multiple lightweight circular loading spinners.

It provides several ready-to-use spinners as well as the ability to create your own easily.

Why should I care ? Do I even need a loading spinner ?

The web as evolve since its first premises, now many rely on web applications, single page applications, heavy websites and so on.

The common factor is that sometimes, it is not easy for you to provide every single resource needed in a correct amount of time, even for the very minimal requirements (the page itself, stylesheets, scripts, etc...).

One solution to this problem would be to use a loading icon, in our case a loading spinner. This should grant you enough time to load your precious resources in the background while keeping the user visually distracted.

How do I get started ?

First things first, you need to download this library.

You can :

  • Download the source files directly from github
  • Download it using npm : npm install --save spinner-lord

Once downloaded, you'll find yourself with a css folder within which a variants folder is contained.

You'll need two (or three) thing(s) : the library's core file (spinner-lord.css), a reset sheet (don't panic, reset.css is here if you don't have one) and your eventual variant.

Once those two are ready, you can proceed to use them in your page :

<!DOCTYPE html>
<html>
  <head>
    <!-- [...] -->
    <link rel="stylesheet" href="path/to/your/reset/sheet"/>
    <link rel="stylesheet" href="path/to/spinner-lord.css"/>
    <link rel="stylesheet" href="path/to/variant/if/you/want/to/use/one.css"/>
    <!-- [...] -->
  </head>
  <body>
    <div id="spinner-lord" class="active"> <!-- your variant might need a class here -->
      <span></span>
      <!-- eventual additionnal spans (for variants), check the @span-amount in your variant's stylesheet -->
    </div>
    <!-- [...] -->
  </body>
</html>

However, the above will only display the spinner and nothing else, you might want to remove it dynamically :

- add the "active" class dynamically upon start
- replace the "active" class by the "inactive" class once everything is fully loaded
- Once the transition finished, you can remove #spinner-lord from the DOM

If you use jQuery or a jQuery-like library, the js/removeSpinnerLord.js file provides a function to remove it from the DOM (as well as js/removeSpinnerLord.esm.js which is the es6 module version of the above).