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

@grenishrai/loaderjs

v1.0.0

Published

loaderjs is a lightweight JavaScript library for adding customizable loading animations to your web projects. With various loader types and animation speeds, it provides an easy way to enhance user experience during loading processes.

Downloads

1

Readme

@grenishrai/loaderjs Documentation

Introduction

@grenishrai/loaderjs is a lightweight JavaScript library designed to enhance user experience by adding customizable loading animations to web projects. With various loader types and animation speeds, @grenishrai/loaderjs allows developers to create visually appealing and interactive loading indicators effortlessly.

Getting Started

Installation

To use @grenishrai/loaderjs in your project, you can install it through npm:

npm install @grenishrai/loaderjs

Usage

  1. Import the Loader class:
import Loader from '@grenishrai/loaderjs';
  1. Create a new Loader instance with optional configuration
const loader = new Loader({
  type: "loader-round", // Optional: Default is "loader-round"
  speed: "normal",     // Optional: Default is "normal"
});
  1. Display the loader on your webpage:
<!-- Place the loader container where you want the loader to appear -->
<div id="loader-container"></div>
  1. Customize the loader's appearance and behavior (optional):
/* Customize loader appearance using CSS variables */
:root {
  --animation-speed-slow: 3s;
  --animation-speed-normal: 2s; /* Default speed */
  --animation-speed-fast: 1s;
}
  1. Change the loader type and speed dynamically (optional):
// Change the loader type
loader.type = "loader-bar";

// Change the loader speed
loader.speed = "slow";

Options

type (string)

The type option specifies the type of loader animation to be displayed. Available types include "loader-round", "loader-bar", "loader-pulse", "loader-wave", and more. The default type is "loader-round".

speed (string)

The speed option controls the animation speed of the loader. You can set it to "slow", "normal", or "fast". The default speed is "normal".

Examples

Example 1: Basic Usage

import Loader from '@grenishrai/loaderjs';

const loader = new Loader();

Example 2: Customization

import Loader from '@grenishrai/loaderjs';

const loader = new Loader({
  type: "loader-bar",
  speed: "slow",
});

Example 3: Dynamic Changes

import Loader from '@grenishrai/loaderjs';

const loader = new Loader();

// Change the loader type after 3 seconds
setTimeout(() => {
  loader.type = "loader-pulse";
}, 3000);

// Change the loader speed after 5 seconds
setTimeout(() => {
  loader.speed = "fast";
}, 5000);

Conclusion

With @grenishrai/loaderjs, creating engaging loading animations for your web projects is quick and effortless. The library provides a range of loader types and allows you to adjust animation speeds dynamically, ensuring a smooth and visually pleasing loading experience for your users.