AprilApril.js

Mess with your visitors on April Fools' Day. Check out the effects below.
Download View on Github

Replace images

Look at all these beautiful photos! Would be a shame if something were to happen to them. This effect replaces all images on the page with random ones of Nic Cage and kittens. Also Steven Segal. And maybe more.

Try it

Play sound

Emits an embarassing sound at what will hopefully be a very inopportune time. In short, makes fart noises at random intervals.

Try it

Shrink

If you're looking for something a little more subtle and sophisticated, look no further. This one makes the entire web page shrink to 70% of its original size over the course of an hour.

Try it

Rotate

Same as the above except it rotates the page 90 degrees.

Try it

Scramble links

Swap around the hrefs of all links on the page. You won't know where you'll end up! How fun.

Try it

Scramble text

Scramble text when the user's not looking. Text contained in <p> tags will be subject to having two words swapped at random every second, while the element is outside of the viewport.

Try it

Say please

When you request a new page by clicking on a link you'll have to say please before your browser serves it to you.

Try it

How to use

First of all you need to include the JavaScript file to you page, like so:

<script src="AprilApril.min.js"></script>

Then you create a new AprilApril object like this, passing in the name of the effect you want to use:

var april = new AprilApril('replaceImages');

See the names of all effects below. For major shenanigans, you can even run multiple effects at the same time by passing an object:

var april = new AprilApril({
            replaceImages: true,
            playSound: true,
            shrink: true,
            scrambleLinks: true,
            scrambleText: true,
            sayPlease: true
            });

Finally, you call it thusly:

april.fool();

Using the playSound effect

Since you don't want to download the sounds if you're not going to use them, they are provided in a separate file. So if you want your page to pass wind, you'll need to include the file AprilAprilsound.min.js separately, in addition to the main file.