Paul Chris Jones's coding blog
PHP
JS

Seizure generator

22nd June 2018

My six-month-old baby keeps watching me using my laptop. Inevitably, he then starts complaining because he wants to use the laptop himself. So I sit him in front of the screen and he begins to mash the keyboard with his fist. He's also able to move the cursor using the touchpad, albeit accidentally.

I feel bad for my baby though because his user input, while enthusiastic, rarely produces any obvious output on the screen. Therefore, to stimulate my baby while he's using my laptop, I've created "Seizure Generator". This simple website will stimulate babies and adults alike by inducing seizures upon any mouse movement. The website detects mouse movement and then transforms it into a colourful series of images that are 110% guaranteed to trigger an epileptic attack in susceptible individuals.

Try it for yourself by moving your cursor around the page, or by clicking the button below if you're on mobile. (May not work on iPhones)

Move your cursor (or press the button below if on mobile) to induce a fatal seizure.

If you're still awake and conscious, then perhaps you might like to have a look at the JavaScript I wrote, if you're interested in that sort of thing. There were two tasks to code: changing the background to a random colour upon mouse movement and returning the screen to white once the user stops moving the mouse.

window.onload = function() {
	timeout = setTimeout("",10); //declare timeout
}
onmousemove = function(e){
	document.getElementById('message').style.display = "none";
	clearTimeout(timeout);
	Change_background_to_random_color();

	//When the user stops moving the cursor, return the screen to white
	timeout = setTimeout(
		function(){
			document.body.style.backgroundColor = "white";
		}
	,10);
};

function Change_background_to_random_color(){
	RGB_colors = [0, 0, 0]; //red, green, blue
	for(i=0;i<RGB_colors.length;i++){
		RGB_colors[i] = Math.floor(Math.random()*255);
	}
	new_color = "RGB(" + RGB_colors[0] + "," + RGB_colors[1] + "," + RGB_colors[2] + ")";
	document.body.style.backgroundColor = new_color;
}

I tried Seizure Generator on my baby just now but it failed to produce any seizures. That's because he didn't bother to use the touchpad. Instead he mashed random keys and almost deleted System32. So it's back to the drawing board.

Leave a comment