Move your cursor around to watch the bugs scurry away! Try scrolling - they stay fixed on screen.
Play around with these controls to see how the bugs behave:
Adjust these settings in real-time:
Add bugs to any page with just a few lines:
<script src="page-bugs.js"></script>
<script>
PageBugs.init({
count: 5,
speed: 8,
detectionRadius: 120
});
</script>
Use your own bug design:
PageBugs.init({
count: 3,
bugSvg: `<svg viewBox="0 0 32 32">...</svg>`
});
PageBugs.init(options) // Initialize with options
PageBugs.addBugs(count) // Add more bugs
PageBugs.removeBugs(count) // Remove bugs
PageBugs.setOptions(opts) // Update config
PageBugs.pause() // Pause animation
PageBugs.resume() // Resume animation
PageBugs.scatterFrom(x,y,f) // Scatter from point
PageBugs.destroy() // Clean up everything
PageBugs.getBugCount() // Get current count
position: fixed so they stay on screen during scrollpointer-events: none so they won't block clicks