You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

glitch-effect

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glitch-effect

A lightweight and customizable glitch visual effect for images using pure JavaScript.

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

GlitchEffect

A lightweight and customizable glitch visual effect for images using pure JavaScript — no dependencies, no canvas, no WebGL. Perfect for adding modern, reactive visual noise and RGB distortion to any container.

🚀 Features

  • Pure JavaScript, no external libraries
  • Self-contained: injects styles automatically
  • Customizable intensity and noise
  • Namespaced CSS to avoid conflicts

📦 Installation

You can install via npm:

npm install glitch-effect

Or use it directly in the browser with a module bundler or script tag.

🧪 Usage

HTML

<div id="my-container" style="width: 600px; height: 400px;"></div>

JavaScript (ES Module)

import GlitchEffect from 'glitch-effect';

const container = document.getElementById('my-container');
const glitch = new GlitchEffect(container, 'path/to/image.jpg', {
  intensity: 1.5,
  noise: true
});

🔧 Options

OptionTypeDefaultDescription
intensityNumber1How strong the RGB shift should be
noiseBooleantrueWhether to add pixel noise distortion

🧼 Cleanup

This class does not yet include a destroy() method, so for now you can clear the container manually if needed.

📄 License

MIT

Keywords

glitch

FAQs

Package last updated on 15 Apr 2025

Did you know?

Socket

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.

Install

Related posts