Skip to content

Simple pure javascript library to pixelate images and, optionally, reveal on hover (available as jQuery plugin too)

Notifications You must be signed in to change notification settings

secondfry/pixelate.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixelate.js

pixelate.js is a simple library and jQuery plugin to pixelate any set of images and optionally reveal them on hover. Check that by yourself.

Usage

pixelate.js can be used with or without jQuery.

// Following two lines are near identical
$('img').pixelate();
document.querySelector('img').pixelate();

Or via HTML data attributes:

<img src="test.jpg" alt="" data-pixelate />

Options

  • value The percentage of pixelation to perform, a value between 0 and 1.
  • reveal_on_hover Reveal the image on hover.
  • reveal_on_click Reveal the image on click.

These options may be specified by data tags, like so:

<img src="img.jpg" alt="" data-pixelate data-value="0.5" data-reveal_on_hover="false" data-reveal_on_click="false">

or by jQuery/JavaScript:

$('#myimage').pixelate({ value: 0.5, reveal_on_hover: false, reveal_on_click: false });

License

https://raw.githubusercontent.com/secondfry/license/master/LICENSE

About

Simple pure javascript library to pixelate images and, optionally, reveal on hover (available as jQuery plugin too)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%