PowerGlitch is a standalone library with no external dependencies. It leverages CSS animations to create a glitch effect on images. No canvas or DOM manipulations are needed. It weights around 1.8kb minified and gzipped and 4kb minified.
Want to try it out? Check out the demo 😊
Like this project? Give a star 🌟
Getting started
-
Install PowerGlitch using a package manager
npm i --save powerglitch # or yarn add powerglitchor by saving the web bundle in dist/powerglitch.min.js and importing it using a script tag
<script src="./path/to/your/powerglitch.min.js"></script> -
Find an image to glitch
<img src='https://.../image.png' class='glitch' /> -
Import PowerGlitch using ES6 import
import { PowerGlitch } from 'powerglitch'or using ES5 require
const PowerGlitch = require('powerglitch').PowerGlitchif you are importing PowerGlitch using a
scripttag, thePowerGlitchglobal variable is automatically available. -
Glitch the image
PowerGlitch.glitch('img.glitch') -
That's it, your image is glitched!
-
For customization and optimization tips, check-out the usage guide.
Useful links
- Visually try out effects using the demo.
- Lookup PowerGlitch home page.
- For customization and optimization tips, check the usage guide.