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

blurry-image-loader

v1.0.1

Published

A JavaScript library for loading images with a blur effect.

Downloads

10

Readme

BlurryImageLoader

Visitors GitHub GitHub last commit GitHub issues GitHub pull requests GitHub stars

A JavaScript library for loading images with a blur effect.

Demo | Codepen

Description

BlurryImageLoader is a lightweight JavaScript library that simplifies the process of loading images with a blur effect, providing a smooth transition from blurred placeholders to clear images.

Features

  • Automatically applies a blur effect to images while they are loading.
  • Supports images with data-src attributes (for lazy loading) or regular src attributes.
  • Provides a clean API for easy integration into projects.

Installation

Via npm

You can install BlurryImageLoader using npm:

npm install blurry-image-loader

Using jsDelivr CDN

You can also include BlurryImageLoader in your HTML directly from the jsDelivr CDN:

<!-- Latest version -->
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/BlurryImageLoader@latest/BlurryImageLoader.js"></script>

or

<!-- Specific version with npm (replace x.y.z with the version you need) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/BlurryImageLoader.js"></script>

Usage

Loading Specific Images

To load specific images with a blur effect, use loadImageWithBlur:

var img = document.getElementById('blurImage');
BlurryImageLoader.loadImageWithBlur(img);

Loading All Images

To load all images on a page with a blur effect, use loadAllImagesWithBlur:

BlurryImageLoader.loadAllImagesWithBlur();

Using Selectors:

// Load all images with class .blurry-image
BlurryImageLoader.loadAllImagesWithBlur('.blurry-image');

Example HTML

<div class="image-container">
    <!-- Example with data-src attribute -->
    <img class="blurry-image" data-src="path/to/image.jpg" alt="Image">
</div>

<div class="image-container">
    <!-- Example with regular src attribute -->
    <img class="blurry-image" src="path/to/image.jpg" alt="Image">
</div>

Usage in Node.js

You can also use BlurryImageLoader in Node.js environments. Here's an example:

const BlurryImageLoader = require('./blurry-image-loader');

// Example usage in Node.js
const images = [
    'path/to/image1.jpg',
    'path/to/image2.jpg',
    'path/to/image3.jpg'
];

BlurryImageLoader.loadAllImagesWithBlur(images);

You can use the cdn in Node.js or NextJS accordingly.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contribution

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

Issues and Support

If you encounter any issues or need support, please open an issue.

Credits

This library was created by SH20RAJ.


Feel free to give a ⭐️ if this project helped you!