Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
blurry-image-loader
Advanced tools
A JavaScript library for loading images with a blur effect.
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.
data-src
attributes (for lazy loading) or regular src
attributes.You can install BlurryImageLoader
using npm:
npm install blurry-image-loader
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/blurry-image-loader@x.y.z/BlurryImageLoader.js"></script>
To load specific images with a blur effect, use loadImageWithBlur
:
var img = document.getElementById('blurImage');
BlurryImageLoader.loadImageWithBlur(img);
To load all images on a page with a blur effect, use loadAllImagesWithBlur
:
BlurryImageLoader.loadAllImagesWithBlur();
// Load all images with class .blurry-image
BlurryImageLoader.loadAllImagesWithBlur('.blurry-image');
<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>
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.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Fork the repository, make your changes, and submit a pull request.
If you encounter any issues or need support, please open an issue.
This library was created by SH20RAJ.
Feel free to give a ⭐️ if this project helped you!
FAQs
A JavaScript library for loading images with a blur effect.
We found that blurry-image-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.