Add a splash of mischief to your web applications with delightful, interactive pranks 🎉
Scenarios combine multiple pranks for a more immersive experience. Click any scenario below to see it in action.
A simple demonstration that combines multiple pranks for quick testing.
Designed for office environments, gradually applying pranks that escalate in noticeable effect.
Perfect for creating simulated technical issues during presentations.
Combines various visual effects for maximum impact and screen disruption.
A comprehensive April 1st prank sequence with multiple effects over time.
Starts with subtle pranks that gradually escalate over time for maximum surprise.
A comprehensive collection of web-based pranks from subtle to obvious, all ready to use.
Combination pranks designed for specific situations like April Fools' Day or office environments.
Import only the pranks you need, keeping your bundle size small and efficient.
Fully typed API for better developer experience and code completion.
Works in all modern browsers with graceful fallbacks.
Most pranks accept parameters to customize their behavior and appearance.
npm install prankjs
import { Pranks, Scenarios } from 'prankjs';
// Element manipulation pranks
Pranks.shakeElement('.navigation');
Pranks.disappearingElements();
Pranks.gravitySwitch();
// Visual pranks
Pranks.invertColors(3000, 0, 1);
Pranks.flipScreen();
Pranks.mirrorEffect();
Pranks.fakeError('This is a fake error message!');
Pranks.fakeLoadingScreen();
Pranks.randomBlur();
// Interactive pranks
Pranks.floatingObject({
url: 'https://example.com/image.png',
width: '100px',
height: '100px',
animate: true,
clickable: true
});
Pranks.randomFloatingObjects('https://example.com/image.png');
Pranks.randomEmoji();
Pranks.mouseTrail();
Pranks.confettiExplosion();
// Control pranks
Pranks.keyboardLock();
Pranks.hijackScroll();
Pranks.jumbleText();
Pranks.randomTyping();
// Notification pranks
Pranks.popupPrank();
Pranks.randomSounds();
Pranks.randomRedirect(['https://example.com', 'https://github.com']);
// Basic demo of multiple pranks
Scenarios.demoDisruption();
// Office environment prank sequence (with custom timing between pranks)
Scenarios.officePrank(5000); // 5 seconds between pranks
// Disrupts meetings or presentations (optionally with sound effects)
Scenarios.meetingDisruptor(true); // with sound effects
// Visual chaos with screen effects (specify duration in ms)
Scenarios.visualChaos(15000); // 15 seconds of chaos
// April Fools' sequence (with optional URLs to redirect links to)
Scenarios.aprilFools(['https://example.com/rickroll']);
// Gradual escalation from subtle to obvious pranks
Scenarios.gradualEscalation(10000, true); // 10s base delay, fast mode