Bookmarklets, they are book marks that do things to your webpage, a lot of diversity when it comes to these, just copy and drag the JavaScript code into your bookmarks tabÂ
Asteroids
javascript:var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='https://cdn.jsdelivr.net/gh/skysthelimitt/Selenite/js/asteroids.min.js';void(0);
History Flooder
javascript:var num=prompt("How many times do you want this page to show up in your history?\n");done=false;x=window.location.href;for (var i=1; i<=num; i++){history.pushState(0, 0, i==num?x:i.toString());if(i==num){done=true}}if(done===true){alert("History flooding successful!\n "+window.location.href+" \now appears in your history "+num+(num==1?" time.":" times. \n"))}
Inspect
javascript:(function () {var script=document.createElement('script');script.src='https://x-ray-goggles.mouse.org/webxray.js';script.className='webxray';script.setAttribute('data-lang','en-US');script.setAttribute('data-baseuri','https://x-ray-goggles.mouse.org');document.body.appendChild(script);}())
Tab Cloaker
javascript:fetch('https://cdn.jsdelivr.net/gh/wea-f/Norepted@f1eb7a9/bookmarklets/tabcloak.js').then(r => r.text()).then(eval)
Dark Mode
javascript:document.querySelectorAll('*').forEach(e=>e.setAttribute('style','background-color:#222;background-image:none;color:#'+(/^A|BU/.test(e.tagName)?'36c;text-decoration:underline;':'eee;')+e.getAttribute('style')))
Piano
javascript:void(document.head.appendChild(document.createElement("script")).src="https://cdn.jsdelivr.net/gh/Krazete/bookmarklets/piano.min.js")
Ad Blocker
javascript:fetch('https://cdn.jsdelivr.net/gh/wea-f/Norepted@1bbb8e7/bookmarklets/adblocker.js').then(r => r.text()).then(eval)
Rock, Paper, Scissors
javascript:var choices=['rock','paper','scissors'];var x=0;alert("--ROCK PAPER SCISSORS-- rules: choose rock, paper, or scissors.");function getRandomChoice(){return choices[Math.floor(Math.random()*choices.length)];};for(var i=1;i<=5;i++){var playerChoice=prompt("Round "+i+"/5: Please choose rock, paper, or scissors");var computerChoice=getRandomChoice();if(playerChoice===null){break;}else if(!choices.includes(playerChoice)){alert("Invalid selection. Please choose rock, paper, or scissors.");}else{if(playerChoice===computerChoice){alert("It's a tie!");}else if((playerChoice==='rock'&&computerChoice==='scissors')||(playerChoice==='paper'&&computerChoice==='rock')||(playerChoice==='scissors'&&computerChoice==='paper')){x+=1;alert("You win!");}else{x+=1;alert("Computer wins!");}console.log("Player: "+playerChoice);console.log("Computer: "+computerChoice);console.log("-----------------");}}alert("Game over! You played "+x+" rounds.");
Dodgysquare
javascript:alert("--DODGYSQUARE--rules: use the left and right arrow keys, to dodge the red squares. the red squares get really fast, so be careful!"); var xpos=80; var ypos=350; var enemyxpos=0; var enemyypos=-120; var enemyspeed=2.5; var playerspeed=4; var scorecount=0; var left=0; var right=0; (function () { var bg = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(bg); bg.style.position = 'fixed'; bg.style.top = '0px'; bg.style.left = '0px'; bg.style.margin = '0px'; bg.style.paddingTop = '10px'; bg.style.width = '300px'; bg.style.height = '500px'; bg.style.zIndex = 10000; bg.style.opacity = 1; bg.style.color = 'white'; bg.style.backgroundColor = 'black'; bg.style.border = '0px solid white'; bg.style.textAlign = 'center'; bg.id = 'bg'; bg.style.display = 'block'; bg.innerText = ''; }()); (function () { var me = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(me); me.style.position = 'fixed'; me.style.top = '535px'; me.style.left = '0px'; me.style.margin = '0px'; me.style.paddingTop = '5px'; me.style.width = '300px'; me.style.height = '35px'; me.style.zIndex = 10000; me.style.opacity = 1; me.style.color = 'black'; me.style.backgroundColor = 'white'; me.style.border = '4px solid black'; me.style.textAlign = 'center'; me.id = 'me'; me.style.display = 'block'; me.innerText = 'by dragonmaster73101'; document.getElementById('me').addEventListener('click',function(){ window.open('https://github.com/dragon731012'); }); }()); (function () { var score = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(score); score.style.position = 'fixed'; score.style.top = '500px'; score.style.left = '0px'; score.style.margin = '0px'; score.style.paddingTop = '5px'; score.style.width = '300px'; score.style.height = '35px'; score.style.zIndex = 10000; score.style.opacity = 1; score.style.color = 'black'; score.style.backgroundColor = 'white'; score.style.border = '4px solid black'; score.style.textAlign = 'center'; score.id = 'score'; score.style.display = 'block'; score.innerText = 'score: '+scorecount+''; }()); (function () { var you = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(you); you.style.position = 'fixed'; you.style.top = ''+ypos+'px'; you.style.left = ''+xpos+'px'; you.style.margin = '0px'; you.style.paddingTop = '10px'; you.style.width = '70px'; you.style.height = '120px'; you.style.zIndex = 10000; you.style.opacity = 1; you.style.color = 'blue'; you.style.backgroundColor = 'blue'; you.style.border = '0px solid white'; you.style.textAlign = 'center'; you.id = 'you'; you.style.display = 'block'; you.innerText = ''; function mover(){ if (left==1){ if (xpos-12>=0){ xpos=xpos-playerspeed; you.style.left = ''+xpos+'px'; } } if (right==1){ if (xpos+10<=230){ xpos=xpos+playerspeed; you.style.left = ''+xpos+'px'; } } } setInterval(mover,5); window.addEventListener("keydown",function(event){ if(event.key=="ArrowLeft"){ left=1; } }); window.addEventListener("keyup",function(event){ if(event.key=="ArrowLeft"){ left=0; } }); window.addEventListener("keydown",function(event){ if(event.key=="ArrowRight"){ right=1; } }); window.addEventListener("keyup",function(event){ if(event.key=="ArrowRight"){ right=0; } }); }()); function makeenemy(){ (function () { var enemy = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(enemy); enemyxpos=Math.floor(Math.random()*(230-0+1)+0); enemyypos=-120; enemy.style.position = 'fixed'; enemy.style.top = ''+enemyypos+'px'; enemy.style.left = ''+enemyxpos+'px'; enemy.style.margin = '0px'; enemy.style.paddingTop = '10px'; enemy.style.width = '70px'; enemy.style.height = '120px'; enemy.style.zIndex = 10000; enemy.style.opacity = 1; enemy.style.color = 'red'; enemy.style.backgroundColor = 'red'; enemy.style.border = '0px solid white'; enemy.style.textAlign = 'center'; enemy.id = 'enemy'; enemy.style.display = 'block'; enemy.innerText = ''; function enemymove(){ enemyypos=enemyypos+enemyspeed; enemy.style.top = ''+enemyypos+'px'; if (enemyypos>380){ enemy.parentNode.removeChild(enemy); scorecount=scorecount+1; score.innerText = 'score: '+scorecount+''; makeenemy(); } } setInterval(enemymove,50); }()); } makeenemy(); function colliding() { if (xpos < enemyxpos + 70 && xpos + 70 > enemyxpos && ypos < enemyypos + 120 && ypos + 120 > enemyypos) { clearInterval(colliding); document.getElementById("enemy"); enemy.parentNode.removeChild(enemy); document.getElementById("you"); you.parentNode.removeChild(you); document.getElementById("bg"); bg.parentNode.removeChild(bg); document.getElementById("score"); score.parentNode.removeChild(score); document.getElementById("me"); me.parentNode.removeChild(me); alert("game over. your score was "+scorecount+"."); } } setInterval(colliding,5);
Simon Says
javascript:const list=[]; var counted=0; var maxcount=4; var num=0; var allclicked=0; var clicked=0; var score=0; function gameover(){ alert("game over. your score was "+score+"."); green.parentNode.removeChild(green); blue.parentNode.removeChild(blue); yellow.parentNode.removeChild(yellow); red.parentNode.removeChild(red); me.parentNode.removeChild(me); scorer.parentNode.removeChild(scorer); } (function () { var green = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(green); green.style.position = 'fixed'; green.style.top = '0px'; green.style.left = '0px'; green.style.margin = '10px'; green.style.paddingTop = '40px'; green.style.width = '100px'; green.style.height = '100px'; green.style.zIndex = 10000; green.style.opacity = 0.6; green.style.color = 'black'; green.style.backgroundColor = 'green'; green.style.border = '0px solid white'; green.style.textAlign = 'center'; green.style.cursor = 'pointer'; green.id = 'green'; green.style.display = 'block'; green.innerText = 'green'; document.getElementById('green').addEventListener('click', function() { green.style.opacity = 1; if (list[clicked] != 1){ gameover(); } clicked=clicked+1; setTimeout(function() { green.style.opacity = 0.6; }, 500); }); }()); (function () { var red = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(red); red.style.position = 'fixed'; red.style.top = '0px'; red.style.left = '110px'; red.style.margin = '10px'; red.style.paddingTop = '40px'; red.style.width = '100px'; red.style.height = '100px'; red.style.zIndex = 10000; red.style.opacity = 0.6; red.style.color = 'black'; red.style.backgroundColor = 'red'; red.style.border = '0px solid white'; red.style.textAlign = 'center'; red.style.cursor = 'pointer'; red.id = 'red'; red.style.display = 'block'; red.innerText = 'red'; document.getElementById('red').addEventListener('click', function() { red.style.opacity = 1; if (list[clicked] != 2){ gameover(); } clicked=clicked+1; setTimeout(function() { red.style.opacity = 0.6; }, 500); }); }()); (function () { var yellow = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(yellow); yellow.style.position = 'fixed'; yellow.style.top = '110px'; yellow.style.left = '0px'; yellow.style.margin = '10px'; yellow.style.paddingTop = '40px'; yellow.style.width = '100px'; yellow.style.height = '100px'; yellow.style.zIndex = 10000; yellow.style.opacity = 0.6; yellow.style.color = 'black'; yellow.style.backgroundColor = 'yellow'; yellow.style.border = '0px solid white'; yellow.style.textAlign = 'center'; yellow.style.cursor = 'pointer'; yellow.id = 'yellow'; yellow.style.display = 'block'; yellow.innerText = 'yellow'; document.getElementById('yellow').addEventListener('click', function() { yellow.style.opacity = 1; if (list[clicked] != 3){ gameover(); } clicked=clicked+1; setTimeout(function() { yellow.style.opacity = 0.6; }, 500); }); }()); (function () { var blue = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(blue); blue.style.position = 'fixed'; blue.style.top = '110px'; blue.style.left = '110px'; blue.style.margin = '10px'; blue.style.paddingTop = '40px'; blue.style.width = '100px'; blue.style.height = '100px'; blue.style.zIndex = 10000; blue.style.opacity = 0.6; blue.style.color = 'black'; blue.style.backgroundColor = 'blue'; blue.style.border = '0px solid white'; blue.style.textAlign = 'center'; blue.style.cursor = 'pointer'; blue.id = 'blue'; blue.style.display = 'block'; blue.innerText = 'blue'; document.getElementById('blue').addEventListener('click', function() { blue.style.opacity = 1; if (list[clicked] != 4){ gameover(); } clicked=clicked+1; setTimeout(function() { blue.style.opacity = 0.6; }, 500); }); }()); (function () { var me = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(me); me.style.position = 'fixed'; me.style.top = '260px'; me.style.left = '0px'; me.style.margin = '10px'; me.style.paddingTop = '0px'; me.style.width = '210px'; me.style.height = '30px'; me.style.zIndex = 10000; me.style.opacity = 1; me.style.color = 'black'; me.style.backgroundColor = 'white'; me.style.border = '4px solid black'; me.style.textAlign = 'center'; me.style.cursor = 'pointer'; me.id = 'me'; me.style.display = 'block'; me.innerText = 'by dragonmaster73101'; document.getElementById('me').addEventListener('click', function() { window.open("https://github.com/dragon731012"); }); }()); (function () { var scorer = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(scorer); scorer.style.position = 'fixed'; scorer.style.top = '300px'; scorer.style.left = '0px'; scorer.style.margin = '10px'; scorer.style.paddingTop = '0px'; scorer.style.width = '210px'; scorer.style.height = '30px'; scorer.style.zIndex = 10000; scorer.style.opacity = 1; scorer.style.color = 'black'; scorer.style.backgroundColor = 'white'; scorer.style.border = '4px solid black'; scorer.style.textAlign = 'center'; scorer.style.cursor = 'pointer'; scorer.id = 'scorer'; scorer.style.display = 'block'; scorer.innerText = 'score: '+score+''; }()); (function () { var start = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(start); start.style.position = 'fixed'; start.style.top = '220px'; start.style.left = '0px'; start.style.margin = '10px'; start.style.paddingTop = '0px'; start.style.width = '210px'; start.style.height = '30px'; start.style.zIndex = 10000; start.style.opacity = 1; start.style.color = 'black'; start.style.backgroundColor = 'white'; start.style.border = '4px solid black'; start.style.textAlign = 'center'; start.style.cursor = 'pointer'; start.id = 'start'; start.style.display = 'block'; start.innerText = 'start'; document.getElementById('start').addEventListener('click', function() { scorer.style.top = '260px'; start.style.left='-99999999999999999999999999999px'; me.style.top='220px'; counted=0; maxcount=1; function show(){ if (counted<maxcount){ num=Math.floor(Math.random()*(4-1+1)+1); list.push(num); if (list[counted]==1){ green.style.opacity = 1; setTimeout(function() { green.style.opacity = 0.6; }, 500); } if (list[counted]==2){ red.style.opacity = 1; setTimeout(function() { red.style.opacity = 0.6; }, 500); } if (list[counted]==3){ yellow.style.opacity = 1; setTimeout(function() { yellow.style.opacity = 0.6; }, 500); } if (list[counted]==4){ blue.style.opacity = 1; setTimeout(function() { blue.style.opacity = 0.6; }, 500); } counted=counted+1; } } setInterval(show,1000); }); }()); function checkifallclicked(){ if (counted>=maxcount){ if (clicked>=maxcount){ score=score+1; clicked=0; maxcount=maxcount+1; counted=0; } } } function update(){ scorer.innerText = 'score: '+score+''; } setInterval(checkifallclicked,15); setInterval(update,15);
Ping Pong
javascript:(function(){var me=document.createElement('div');var body=document.getElementsByTagName('body')[0];body.appendChild(me);me.style.position='fixed';me.style.bottom='0px';me.style.right='0px';me.style.margin='0px';me.style.paddingTop='0px';me.style.width='1366px';me.style.height='20px';me.style.zIndex=10000;me.style.opacity=0.8;me.style.color='white';me.style.backgroundColor='black';me.style.border='0px solid black';me.style.textAlign='center';me.style.cursor='pointer';me.id='me';me.style.display='circle';me.innerText='by dragonmaster73101';document.getElementById('me').addEventListener('click',function(){window.open('https://github.com/dragon731012');});}()); var xmove=1; var startnum=Math.floor(Math.random()*(10-1+1)+1); startnum=startnum/10; var ymove=startnum; var xpos=1366/2; var ypos=665/2; var ballspeed=3; var p1ypos=665/2; var p1xpos=80; var p1ymove=0; var playerspeed=6; var p2ymove=0; var p2ypos=665/2; var p2xpos=1366-80; var ailevel=400; (function () { var ball = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(ball); ball.style.position = 'fixed'; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; ball.style.margin = '0px'; ball.style.paddingTop = '10px'; ball.style.width = '30px'; ball.style.height = '30px'; ball.style.zIndex = 10000; ball.style.opacity = 1; ball.style.color = 'white'; ball.style.backgroundColor = 'white'; ball.style.textAlign = 'center'; ball.style.cursor = 'pointer'; ball.style.border = '2px solid black'; ball.id = 'ball'; ball.style.display = 'block'; ball.innerText = ''; }()); (function () { var p1 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(p1); p1.style.position = 'fixed'; p1.style.top = ''+p1ypos+'px'; p1.style.left = ''+p1xpos+'px'; p1.style.margin = '0px'; p1.style.paddingTop = '10px'; p1.style.width = '20px'; p1.style.height = '100px'; p1.style.zIndex = 10000; p1.style.opacity = 1; p1.style.color = 'white'; p1.style.backgroundColor = 'white'; p1.style.textAlign = 'center'; p1.style.cursor = 'pointer'; p1.style.border = '2px solid black'; p1.id = 'p1'; p1.style.display = 'block'; p1.innerText = ''; }()); (function () { var p2 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(p2); p2.style.position = 'fixed'; p2.style.top = ''+p2ypos+'px'; p2.style.left = ''+p2xpos+'px'; p2.style.margin = '0px'; p2.style.paddingTop = '10px'; p2.style.width = '20px'; p2.style.height = '100px'; p2.style.zIndex = 10000; p2.style.opacity = 1; p2.style.color = 'white'; p2.style.backgroundColor = 'white'; p2.style.textAlign = 'center'; p2.style.cursor = 'pointer'; p2.style.border = '2px solid black'; p2.id = 'p2'; p2.style.display = 'block'; p2.innerText = ''; }()); function move(){ if (p2ymove==1){ if (p2ypos+playerspeed <= 565){ p2ypos=p2ypos+playerspeed; p2.style.top = ''+p2ypos+'px'; } } if (p2ymove==-1){ if (p2ypos-playerspeed >= 0){ p2ypos=p2ypos-playerspeed; p2.style.top = ''+p2ypos+'px'; } } if (p1ymove==1){ if (p1ypos+playerspeed <= 565){ p1ypos=p1ypos+playerspeed; p1.style.top = ''+p1ypos+'px'; } } if (p1ymove==-1){ if (p1ypos-playerspeed >= 0){ p1ypos=p1ypos-playerspeed; p1.style.top = ''+p1ypos+'px'; } } if (xmove==1){ xpos=xpos+ballspeed; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } if (xmove==-1){ xpos=xpos-ballspeed; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } if (ymove==-1){ ypos=ypos-ballspeed; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } if (ymove==1){ ypos=ypos+ballspeed; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } if (ymove>-1 && ymove<0){ ypos=ypos-ymove*3; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } if (ymove<1 && ymove>0){ ypos=ypos-ymove*3; ball.style.top = ''+ypos+'px'; ball.style.left = ''+xpos+'px'; } } function bounce(){ if (xpos>=1336){ xpos=-99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; clearInterval(bounce); ball.parentNode.removeChild(ball); p1.parentNode.removeChild(p1); p2.parentNode.removeChild(p2); me.parentNode.removeChild(me); clearInterval(move); clearInterval(movep2); clearInterval(colliding); alert("game over. you win"); } if (xpos<=0){ xpos=99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; clearInterval(bounce); ball.parentNode.removeChild(ball); me.parentNode.removeChild(me); p1.parentNode.removeChild(p1); p2.parentNode.removeChild(p2); clearInterval(move); clearInterval(movep2); clearInterval(colliding); alert("game over. you lose"); } if (ypos>=635){ ymove=ymove*-1; } if (ypos<=0){ ymove=ymove*-1; } } function colliding(){ if (xpos < p1xpos + 20 && xpos + 30 > p1xpos && ypos < p1ypos + 100 && ypos + 30 > p1ypos) { xmove=xmove*-1; ballspeed=ballspeed+0.5; } if (xpos < p2xpos + 20 && xpos + 30 > p2xpos && ypos < p2ypos + 100 && ypos + 30 > p2ypos) { xmove=xmove*-1; ballspeed=ballspeed+0.5; } } window.addEventListener("keydown", function(event) { if (event.key == "ArrowUp") { p1ymove=-1; } }); window.addEventListener("keyup", function(event) { if (event.key == "ArrowUp") { p1ymove=0; } }); window.addEventListener("keydown", function(event) { if (event.key == "ArrowDown") { p1ymove=1; } }); window.addEventListener("keyup", function(event) { if (event.key == "ArrowDown") { p1ymove=0; } }); function movep2(){ if (xpos>683){ if (ypos<p2ypos){ if (p2ypos != ypos){ p2ymove=-1; } } if (ypos>p2ypos){ if (p2ypos != ypos){ p2ymove=1; } } } if (xpos<=683){ p2ymove=0; } } setInterval(colliding,15); setInterval(move,15); setInterval(bounce,15); setInterval(movep2,5);
Jumpy Square
javascript:alert("--JUMPY SQUARE-- rules: press the up arrow to dodge the red squares and get points! jump speeds up at 5 points. please check out my github profile and star some resporitories. thanks!"); javascript:(function(){var me=document.createElement('div');var body=document.getElementsByTagName('body')[0];body.appendChild(me);me.style.position='fixed';me.style.bottom='0px';me.style.right='0px';me.style.margin='0px';me.style.paddingTop='0px';me.style.width='1366px';me.style.height='20px';me.style.zIndex=10000;me.style.opacity=0.8;me.style.color='white';me.style.backgroundColor='black';me.style.border='0px solid black';me.style.textAlign='center';me.style.cursor='pointer';me.id='me';me.style.display='circle';me.innerText='by dragonmaster73101';document.getElementById('me').addEventListener('click',function(){window.open('https://github.com/dragon731012');});}()); var xpos = 70; var ypos = 400; var enemyspeed = 8; var enemyxpos = 1406; var enemyypos = 420; var jumping=0; var speedallowed=1; var playerspeed=2.5; var speedup=0; var enemywidth=0; var scorecount=0; function makeyou() { var you = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(you); you.style.position = 'fixed'; you.style.top = '' + ypos + 'px'; you.style.left = '' + xpos + 'px'; you.style.margin = '10px'; you.style.paddingTop = '10px'; you.style.width = '70px'; you.style.height = '70px'; you.style.zIndex = 10000; you.style.opacity = 1; you.style.color = 'black'; you.style.backgroundColor = 'black'; you.style.border = '0px solid white'; you.style.textAlign = 'center'; you.id = 'you'; you.style.display = 'block'; function goup() { if (jumping==0){ setInterval(function() { if (jumping==0){ if (ypos != 220){ if (jumping==0){ ypos=ypos-playerspeed; you.style.top = '' + ypos + 'px'; } } else{ jumping=1; return; } } if (jumping==1){ if (ypos != 400){ if (jumping==1){ ypos=ypos+playerspeed; you.style.top = '' + ypos + 'px'; } } else{ speedallowed=1; return; } } }, 15); } } goup(); window.addEventListener("keydown", function(event) { if (event.key == "ArrowUp") { if (ypos == 400){ speedallowed=0; jumping=0; } } }); } makeyou(); (function() { var ground = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(ground); ground.style.position = 'fixed'; ground.style.top = '480px'; ground.style.left = '0px'; ground.style.margin = '0px'; ground.style.paddingTop = '10px'; ground.style.width = '999999px'; ground.style.height = '5px'; ground.style.zIndex = 10000; ground.style.opacity = 1; ground.style.color = 'gray'; ground.style.backgroundColor = 'gray'; ground.style.border = '0px solid white'; ground.style.textAlign = 'center'; ground.id = 'ground'; ground.style.display = 'block'; }()); function makeenemy() { (function() { var enemy = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(enemy); enemywidth=Math.floor(Math.random()*(160-40+1)+160); enemy.style.position = 'fixed'; enemy.style.top = '' + enemyypos + 'px'; enemy.style.left = '' + enemyxpos + 'px'; enemy.style.margin = '0px'; enemy.style.paddingTop = '10px'; enemy.style.width = ''+enemywidth+'px'; enemy.style.height = '60px'; enemy.style.zIndex = 10000; enemy.style.opacity = 1; enemy.style.color = 'red'; enemy.style.backgroundColor = 'red'; enemy.style.border = '0px solid white'; enemy.style.textAlign = 'center'; enemy.id = 'enemy'; enemy.style.display = 'block'; }()); } makeenemy(); function move() { document.getElementById("enemy"); enemyxpos = enemyxpos - enemyspeed; enemy.style.left = '' + enemyxpos + 'px'; if (enemyxpos <= -160) { speedup=speedup+1; scorecount=scorecount+1; score.innerText='score: '+scorecount+''; document.getElementById("enemy"); enemy.parentNode.removeChild(enemy); enemyxpos = 1406; if (speedup<8){ enemyspeed=enemyspeed+1; } makeenemy(); } } setInterval(move, 20); (function() { var score = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(score); score.style.position = 'fixed'; score.style.top = '0px'; score.style.left = '0px'; score.style.margin = '10px'; score.style.paddingTop = '0px'; score.style.width = '100px'; score.style.height = '30px'; score.style.zIndex = 10000; score.style.opacity = 1; score.style.color = 'black'; score.style.backgroundColor = 'white'; score.style.border = '4px solid black'; score.style.textAlign = 'center'; score.id = 'score'; score.innerText='score: '+scorecount+''; score.style.display = 'block'; }()); function colliding() { if (xpos < enemyxpos + enemywidth && xpos + 70 > enemyxpos && ypos < enemyypos + 60 && ypos + 70 > enemyypos) { alert("Game over. Your score was "+scorecount+"."); xpos=xpos-99999999999999999999999999999999999999999999999999999999999999999999999; clearInterval(colliding); clearInterval(tick); document.getElementById("enemy"); enemy.parentNode.removeChild(enemy); document.getElementById("you"); you.parentNode.removeChild(you); document.getElementById("ground"); ground.parentNode.removeChild(ground); document.getElementById("me"); me.parentNode.removeChild(me); document.getElementById("score"); score.parentNode.removeChild(score); } } function tick(){ if (speedup>=5){ if (speedallowed==1){ playerspeed=5; } } } setInterval(colliding,5); setInterval(tick,15);
Breakout
javascript:alert("--BREAKOUT-- hit the ball to break all the blocks! speeds up every time you break all of them! by dragonmaster73101 a school student who got bored"); var width = window.innerWidth; var height = window.innerHeight; var ballxpos = 683; var ballypos = 200; var randomnum = Math.floor(Math.random() * (2 - 1 + 1) + 1); if (randomnum == 1) { var ballchangex = 1; } if (randomnum == 2) { var ballchangex = -1; } var ballchangey = 1; var ballspeed = 3; var xpos = 683; var ypos = window.innerHeight-100; var playerxmove = 0; var playerspeed = 5; var score = 0; var done = 0; var s1width = 180; var s1height = 40; var s1xpos = 1366 / 2; s1xpos = s1xpos - s1width / 2; var s1ypos = 10; var s2width = 180; var s2height = 40; var s2xpos = 1366 / 2; s2xpos = s2xpos - s2width / 2 + s2width + 10; var s2ypos = 10; var s3width = 180; var s3height = 40; var s3xpos = 1366 / 2; s3xpos = s3xpos - s3width / 2 - s3width - 10; var s3ypos = 10; var s4width = 180; var s4height = 40; var s4xpos = 1366 / 2; s4xpos = s4xpos - s4width / 2 - s4width - 10; var s4ypos = 10; s4ypos = s4ypos + s4height + 10; var s5width = 180; var s5height = 40; var s5xpos = 1366 / 2; s5xpos = s5xpos - s5width / 2 + s5width + 10; var s5ypos = 10; s5ypos = s5ypos + s5height + 10; var s6width = 180; var s6height = 40; var s6xpos = 1366 / 2; s6xpos = s6xpos - s6width / 2; var s6ypos = 10; s6ypos = s6ypos + s6height + 10; var s7width = 180; var s7height = 40; var s7xpos = 1366 / 2; s7xpos = s7xpos - s7width / 2 - s7width - 10; var s7ypos = 10; s7ypos = s7ypos + s7height + s7height + 20; var s8width = 180; var s8height = 40; var s8xpos = 1366 / 2; s8xpos = s8xpos - s8width / 2 + s8width + 10; var s8ypos = 10; s8ypos = s8ypos + s8height + 10 + s8height + 10; var s9width = 180; var s9height = 40; var s9xpos = 1366 / 2; s9xpos = s9xpos - s9width / 2; var s9ypos = 10; s9ypos = s9ypos + s9height + 10 + s9height + 10; var s10width = 180; var s10height = 40; var s10xpos = 1366 / 2; s10xpos = s10xpos - s10width / 2 - s10width - 10; var s10ypos = 10; s10ypos = s10ypos + s10height + s10height + s10height + 30; var s11width = 180; var s11height = 40; var s11xpos = 1366 / 2; s11xpos = s11xpos - s11width / 2 + s11width + 10; var s11ypos = 10; s11ypos = s11ypos + s11height + 10 + s11height + 10 + s11height + 10; var s12width = 180; var s12height = 40; var s12xpos = 1366 / 2; s12xpos = s12xpos - s12width / 2; var s12ypos = 10; s12ypos = s12ypos + s12height + 10 + s12height + 10 + s12height + 10; (function() { var me = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(me); me.style.position = 'fixed'; me.style.bottom = '0px'; me.style.right = '0px'; me.style.margin = '0px'; me.style.paddingTop = '0px'; me.style.width = '' + width + 'px'; me.style.height = '20px'; me.style.zIndex = 10000; me.style.opacity = 0.8; me.style.color = 'white'; me.style.backgroundColor = 'black'; me.style.border = '0px solid black'; me.style.textAlign = 'center'; me.style.cursor = 'pointer'; me.id = 'me'; me.style.display = 'circle'; me.innerText = 'by dragonmaster73101'; document.getElementById('me').addEventListener('click', function() { window.open('https://github.com/dragon731012'); }); }()); (function() { var you = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(you); you.style.position = 'fixed'; you.style.top = '' + ypos + 'px'; you.style.left = '' + xpos + 'px'; you.style.margin = '0px'; you.style.width = '200px'; you.style.height = '30px'; you.style.zIndex = 10000; you.style.opacity = 1; you.style.color = 'black'; you.style.backgroundColor = 'white'; you.style.border = '2px solid black'; you.style.textAlign = 'center'; you.id = 'you'; you.style.display = 'block'; }()); (function() { var ball = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(ball); ball.style.position = 'fixed'; ball.style.top = '' + ballypos + 'px'; ball.style.left = '' + ballxpos + 'px'; ball.style.margin = '0px'; ball.style.width = '50px'; ball.style.height = '50px'; ball.style.zIndex = 10000; ball.style.opacity = 1; ball.style.color = 'black'; ball.style.backgroundColor = 'white'; ball.style.border = '2px solid black'; ball.style.textAlign = 'center'; ball.id = 'ball'; ball.style.display = 'block'; }()); (function() { var scorer = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(scorer); scorer.style.position = 'fixed'; scorer.style.top = '10px'; scorer.style.left = '10px'; scorer.style.margin = '0px'; scorer.style.width = '100px'; scorer.style.height = '40px'; scorer.style.zIndex = 10000; scorer.style.opacity = 1; scorer.style.color = 'black'; scorer.style.backgroundColor = 'white'; scorer.style.paddingTop = '5px'; scorer.style.border = '3px solid black'; scorer.style.textAlign = 'center'; scorer.id = 'scorer'; scorer.style.display = 'block'; scorer.innerText = 'score: ' + score + ''; }()); function start() { ballspeed = ballspeed + 0.3; playerspeed = playerspeed + 0.3; s1width = 180; s1height = 40; s1xpos = 1366 / 2; s1xpos = s1xpos - s1width / 2; s1ypos = 10; s2width = 180; s2height = 40; s2xpos = 1366 / 2; s2xpos = s2xpos - s2width / 2 + s2width + 10; s2ypos = 10; s3width = 180; s3height = 40; s3xpos = 1366 / 2; s3xpos = s3xpos - s3width / 2 - s3width - 10; s3ypos = 10; s4width = 180; s4height = 40; s4xpos = 1366 / 2; s4xpos = s4xpos - s4width / 2 - s4width - 10; s4ypos = 10; s4ypos = s4ypos + s4height + 10; s5width = 180; s5height = 40; s5xpos = 1366 / 2; s5xpos = s5xpos - s5width / 2 + s5width + 10; s5ypos = 10; s5ypos = s5ypos + s5height + 10; s6width = 180; s6height = 40; s6xpos = 1366 / 2; s6xpos = s6xpos - s6width / 2; s6ypos = 10; s6ypos = s6ypos + s6height + 10; s7width = 180; s7height = 40; s7xpos = 1366 / 2; s7xpos = s7xpos - s7width / 2 - s7width - 10; s7ypos = 10; s7ypos = s7ypos + s7height + s7height + 20; s8width = 180; s8height = 40; s8xpos = 1366 / 2; s8xpos = s8xpos - s8width / 2 + s8width + 10; s8ypos = 10; s8ypos = s8ypos + s8height + 10 + s8height + 10; s9width = 180; s9height = 40; s9xpos = 1366 / 2; s9xpos = s9xpos - s9width / 2; s9ypos = 10; s9ypos = s9ypos + s9height + 10 + s9height + 10; s10width = 180; s10height = 40; s10xpos = 1366 / 2; s10xpos = s10xpos - s10width / 2 - s10width - 10; s10ypos = 10; s10ypos = s10ypos + s10height + s10height + s10height + 30; s11width = 180; s11height = 40; s11xpos = 1366 / 2; s11xpos = s11xpos - s11width / 2 + s11width + 10; s11ypos = 10; s11ypos = s11ypos + s11height + 10 + s11height + 10 + s11height + 10; s12width = 180; s12height = 40; s12xpos = 1366 / 2; s12xpos = s12xpos - s12width / 2; s12ypos = 10; s12ypos = s12ypos + s12height + 10 + s12height + 10 + s12height + 10; (function() { var s1 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s1); s1.style.position = 'fixed'; s1.style.top = '' + s1ypos + 'px'; s1.style.left = '' + s1xpos + 'px'; s1.style.margin = '0px'; s1.style.width = '' + s1width + 'px'; s1.style.height = '' + s1height + 'px'; s1.style.zIndex = 10000; s1.style.opacity = 1; s1.style.color = 'black'; s1.style.backgroundColor = 'green'; s1.style.paddingTop = '5px'; s1.style.border = '3px solid black'; s1.style.textAlign = 'center'; s1.id = 's1'; s1.style.display = 'block'; }()); (function() { var s2 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s2); s2.style.position = 'fixed'; s2.style.top = '' + s2ypos + 'px'; s2.style.left = '' + s2xpos + 'px'; s2.style.margin = '0px'; s2.style.width = '' + s2width + 'px'; s2.style.height = '' + s2height + 'px'; s2.style.zIndex = 10000; s2.style.opacity = 1; s2.style.color = 'black'; s2.style.backgroundColor = 'green'; s2.style.paddingTop = '5px'; s2.style.border = '3px solid black'; s2.style.textAlign = 'center'; s2.id = 's2'; s2.style.display = 'block'; }()); (function() { var s3 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s3); s3.style.position = 'fixed'; s3.style.top = '' + s3ypos + 'px'; s3.style.left = '' + s3xpos + 'px'; s3.style.margin = '0px'; s3.style.width = '' + s3width + 'px'; s3.style.height = '' + s3height + 'px'; s3.style.zIndex = 10000; s3.style.opacity = 1; s3.style.color = 'black'; s3.style.backgroundColor = 'green'; s3.style.paddingTop = '5px'; s3.style.border = '3px solid black'; s3.style.textAlign = 'center'; s3.id = 's3'; s3.style.display = 'block'; }()); (function() { var s7 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s7); s7.style.position = 'fixed'; s7.style.top = '' + s7ypos + 'px'; s7.style.left = '' + s7xpos + 'px'; s7.style.margin = '0px'; s7.style.width = '' + s7width + 'px'; s7.style.height = '' + s7height + 'px'; s7.style.zIndex = 10000; s7.style.opacity = 1; s7.style.color = 'black'; s7.style.backgroundColor = 'orange'; s7.style.paddingTop = '5px'; s7.style.border = '3px solid black'; s7.style.textAlign = 'center'; s7.id = 's7'; s7.style.display = 'block'; }()); (function() { var s8 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s8); s8.style.position = 'fixed'; s8.style.top = '' + s8ypos + 'px'; s8.style.left = '' + s8xpos + 'px'; s8.style.margin = '0px'; s8.style.width = '' + s8width + 'px'; s8.style.height = '' + s8height + 'px'; s8.style.zIndex = 10000; s8.style.opacity = 1; s8.style.color = 'black'; s8.style.backgroundColor = 'orange'; s8.style.paddingTop = '5px'; s8.style.border = '3px solid black'; s8.style.textAlign = 'center'; s8.id = 's8'; s8.style.display = 'block'; }()); (function() { var s9 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s9); s9.style.position = 'fixed'; s9.style.top = '' + s9ypos + 'px'; s9.style.left = '' + s9xpos + 'px'; s9.style.margin = '0px'; s9.style.width = '' + s9width + 'px'; s9.style.height = '' + s9height + 'px'; s9.style.zIndex = 10000; s9.style.opacity = 1; s9.style.color = 'black'; s9.style.backgroundColor = 'orange'; s9.style.paddingTop = '5px'; s9.style.border = '3px solid black'; s9.style.textAlign = 'center'; s9.id = 's9'; s9.style.display = 'block'; }()); (function() { var s6 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s6); s6.style.position = 'fixed'; s6.style.top = '' + s6ypos + 'px'; s6.style.left = '' + s6xpos + 'px'; s6.style.margin = '0px'; s6.style.width = '' + s6width + 'px'; s6.style.height = '' + s6height + 'px'; s6.style.zIndex = 10000; s6.style.opacity = 1; s6.style.color = 'black'; s6.style.backgroundColor = 'orange'; s6.style.paddingTop = '5px'; s6.style.border = '3px solid black'; s6.style.textAlign = 'center'; s6.id = 's6'; s6.style.display = 'block'; }()); (function() { var s5 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s5); s5.style.position = 'fixed'; s5.style.top = '' + s5ypos + 'px'; s5.style.left = '' + s5xpos + 'px'; s5.style.margin = '0px'; s5.style.width = '' + s5width + 'px'; s5.style.height = '' + s5height + 'px'; s5.style.zIndex = 10000; s5.style.opacity = 1; s5.style.color = 'black'; s5.style.backgroundColor = 'orange'; s5.style.paddingTop = '5px'; s5.style.border = '3px solid black'; s5.style.textAlign = 'center'; s5.id = 's5'; s5.style.display = 'block'; }()); (function() { var s4 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s4); s4.style.position = 'fixed'; s4.style.top = '' + s4ypos + 'px'; s4.style.left = '' + s4xpos + 'px'; s4.style.margin = '0px'; s4.style.width = '' + s4width + 'px'; s4.style.height = '' + s4height + 'px'; s4.style.zIndex = 10000; s4.style.opacity = 1; s4.style.color = 'black'; s4.style.backgroundColor = 'orange'; s4.style.paddingTop = '5px'; s4.style.border = '3px solid black'; s4.style.textAlign = 'center'; s4.id = 's4'; s4.style.display = 'block'; }()); (function() { var s10 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s10); s10.style.position = 'fixed'; s10.style.top = '' + s10ypos + 'px'; s10.style.left = '' + s10xpos + 'px'; s10.style.margin = '0px'; s10.style.width = '' + s10width + 'px'; s10.style.height = '' + s10height + 'px'; s10.style.zIndex = 10000; s10.style.opacity = 1; s10.style.color = 'black'; s10.style.backgroundColor = 'orange'; s10.style.paddingTop = '5px'; s10.style.border = '3px solid black'; s10.style.textAlign = 'center'; s10.id = 's10'; s10.style.display = 'block'; }()); (function() { var s11 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s11); s11.style.position = 'fixed'; s11.style.top = '' + s11ypos + 'px'; s11.style.left = '' + s11xpos + 'px'; s11.style.margin = '0px'; s11.style.width = '' + s11width + 'px'; s11.style.height = '' + s11height + 'px'; s11.style.zIndex = 10000; s11.style.opacity = 1; s11.style.color = 'black'; s11.style.backgroundColor = 'orange'; s11.style.paddingTop = '5px'; s11.style.border = '3px solid black'; s11.style.textAlign = 'center'; s11.id = 's11'; s8.style.display = 'block'; }()); (function() { var s12 = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(s12); s12.style.position = 'fixed'; s12.style.top = '' + s12ypos + 'px'; s12.style.left = '' + s12xpos + 'px'; s12.style.margin = '0px'; s12.style.width = '' + s12width + 'px'; s12.style.height = '' + s12height + 'px'; s12.style.zIndex = 10000; s12.style.opacity = 1; s12.style.color = 'black'; s12.style.backgroundColor = 'orange'; s12.style.paddingTop = '5px'; s12.style.border = '3px solid black'; s12.style.textAlign = 'center'; s12.id = 's12'; s12.style.display = 'block'; }()); function moveball() { if (ballchangex == 1) { ballxpos = ballxpos + ballspeed; ball.style.top = '' + ballypos + 'px'; ball.style.left = '' + ballxpos + 'px'; } if (ballchangey == 1) { ballypos = ballypos + ballspeed; ball.style.top = '' + ballypos + 'px'; ball.style.left = '' + ballxpos + 'px'; } if (ballchangex == -1) { ballxpos = ballxpos - ballspeed; ball.style.top = '' + ballypos + 'px'; ball.style.left = '' + ballxpos + 'px'; } if (ballchangey == -1) { ballypos = ballypos - ballspeed; ball.style.top = '' + ballypos + 'px'; ball.style.left = '' + ballxpos + 'px'; } } function bounce() { if (ballypos >= height - 50) { ballxpos = -9999999999999999999; ballypos = -9999999999999999999999999; ballchangex = 0; ballchangey = 0; clearInterval(bounce); clearInterval(moveplayer); clearInterval(moveball); clearInterval(colliding); alert("game over. your score was " + score + "."); window.location.reload(1); s1.parentNode.removeChild(s1); s1width = 0; s1height = 0; s1xpos = -999999; s1ypos = -999999; s2.parentNode.removeChild(s2); s2width = 0; s2height = 0; s2xpos = -999999; s2ypos = -999999; s3.parentNode.removeChild(s3); s3width = 0; s3height = 0; s3xpos = -999999; s3ypos = -999999; s4.parentNode.removeChild(s4); s4width = 0; s4height = 0; s4xpos = -999999; s4ypos = -999999; s5.parentNode.removeChild(s5); s5width = 0; s5height = 0; s5xpos = -999999; s5ypos = -999999; s6.parentNode.removeChild(s6); s6width = 0; s6height = 0; s6xpos = -999999; s6ypos = -999999; s7.parentNode.removeChild(s7); s7width = 0; s7height = 0; s7xpos = -999999; s7ypos = -999999; s8.parentNode.removeChild(s8); s8width = 0; s8height = 0; s8xpos = -999999; s8ypos = -999999; s9.parentNode.removeChild(s9); s9width = 0; s9height = 0; s9xpos = -999999; s9ypos = -999999; s10.parentNode.removeChild(s10); s10width = 0; s10height = 0; s10xpos = -999999; s10ypos = -999999; s11.parentNode.removeChild(s11); s11width = 0; s11height = 0; s11xpos = -999999; s11ypos = -999999; s12.parentNode.removeChild(s12); s12width = 0; s12height = 0; s12xpos = -999999; s12ypos = -999999; you.parentNode.removeChild(you); ball.parentNode.removeChild(ball); ballchangex = 0; ballchangey = 0; scorer.parentNode.removeChild(scorer); me.parentNode.removeChild(me); return; } if (ballxpos <= 0) { ballchangex = 1; } if (ballypos <= 0) { ballchangey = 1; } if (ballxpos >= width - 50) { ballchangex = -1; } } function moveplayer() { if (playerxmove == 1) { if (xpos + playerspeed >= 1366 - 200) {} else { xpos = xpos + playerspeed; you.style.top = '' + ypos + 'px'; you.style.left = '' + xpos + 'px'; } } if (playerxmove == -1) { if (xpos + playerspeed <= 0) {} else { xpos = xpos - playerspeed; you.style.top = '' + ypos + 'px'; you.style.left = '' + xpos + 'px'; } } } window.addEventListener("keydown", function(event) { if (event.key == "ArrowLeft") { playerxmove = -1; } if (event.key == "ArrowRight") { playerxmove = 1; } }); window.addEventListener("keyup", function(event) { if (event.key == "ArrowLeft") { playerxmove = 0; } if (event.key == "ArrowRight") { playerxmove = 0; } }); function colliding() { if (ballxpos < s1xpos + s1width && ballxpos + 50 > s1xpos && ballypos < s1ypos + s1height && ballypos + 50 > s1ypos) { score = score + 1; done = done + 1; s1.parentNode.removeChild(s1); s1width = 0; s1height = 0; s1xpos = -999999; s1ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s2xpos + s2width && ballxpos + 50 > s2xpos && ballypos < s2ypos + s2height && ballypos + 50 > s2ypos) { score = score + 1; done = done + 1; s2.parentNode.removeChild(s2); s2width = 0; s2height = 0; s2xpos = -999999; s2ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s3xpos + s3width && ballxpos + 50 > s3xpos && ballypos < s3ypos + s3height && ballypos + 50 > s3ypos) { score = score + 1; done = done + 1; s3.parentNode.removeChild(s3); s3width = 0; s3height = 0; s3xpos = -999999; s3ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s4xpos + s4width && ballxpos + 50 > s4xpos && ballypos < s4ypos + s4height && ballypos + 50 > s4ypos) { score = score + 1; done = done + 1; s4.parentNode.removeChild(s4); s4width = 0; s4height = 0; s4xpos = -999999; s4ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s5xpos + s5width && ballxpos + 50 > s5xpos && ballypos < s5ypos + s5height && ballypos + 50 > s5ypos) { score = score + 1; done = done + 1; s5.parentNode.removeChild(s5); s5width = 0; s5height = 0; s5xpos = -999999; s5ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s6xpos + s6width && ballxpos + 50 > s6xpos && ballypos < s6ypos + s6height && ballypos + 50 > s6ypos) { score = score + 1; done = done + 1; s6.parentNode.removeChild(s6); s6width = 0; s6height = 0; s6xpos = -999999; s6ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s7xpos + s7width && ballxpos + 50 > s7xpos && ballypos < s7ypos + s7height && ballypos + 50 > s7ypos) { score = score + 1; done = done + 1; s7.parentNode.removeChild(s7); s7width = 0; s7height = 0; s7xpos = -999999; s7ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s8xpos + s8width && ballxpos + 50 > s8xpos && ballypos < s8ypos + s8height && ballypos + 50 > s8ypos) { score = score + 1; done = done + 1; s8.parentNode.removeChild(s8); s8width = 0; s8height = 0; s8xpos = -999999; s8ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s9xpos + s9width && ballxpos + 50 > s9xpos && ballypos < s9ypos + s9height && ballypos + 50 > s9ypos) { score = score + 1; done = done + 1; s9.parentNode.removeChild(s9); s9width = 0; s9height = 0; s9xpos = -999999; s9ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s12xpos + s12width && ballxpos + 50 > s12xpos && ballypos < s12ypos + s12height && ballypos + 50 > s12ypos) { score = score + 1; done = done + 1; s12.parentNode.removeChild(s12); s12width = 0; s12height = 0; s12xpos = -999999; s12ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s11xpos + s11width && ballxpos + 50 > s11xpos && ballypos < s11ypos + s11height && ballypos + 50 > s11ypos) { score = score + 1; done = done + 1; s11.parentNode.removeChild(s11); s11width = 0; s11height = 0; s11xpos = -999999; s11ypos = -999999; ballchangey = ballchangey * -1; } if (ballxpos < s10xpos + s10width && ballxpos + 50 > s10xpos && ballypos < s10ypos + s10height && ballypos + 50 > s10ypos) { score = score + 1; done = done + 1; s10.parentNode.removeChild(s10); s10width = 0; s10height = 0; s10xpos = -999999; s10ypos = -999999; ballchangey = ballchangey * -1; } scorer.innerText = 'score: ' + score + ''; } setInterval(colliding, 5); setInterval(moveball, 15); setInterval(bounce, 3); setInterval(moveplayer, 15); } start(); function next() { if (done >= 12) { start(); done = 0; } } function hit() { if (xpos < ballxpos + 50 && xpos + 200 > ballxpos && ypos < ballypos + 50 && ypos + 30 > ballypos) { if (xpos+35>ballxpos){ ballchangex = -1; } if (xpos+165<ballxpos){ ballchangex = 1; } ballchangey = -1; } } setInterval(next, 2); setInterval(hit, 2);
Make Your Computer Say Something
javascript:var a=prompt("What do you want me to say?");alert(a);alert("Successful")
Slow Auto Clicker
javascript:var DELAY = 0.01;var autoClickerStyleElement = document.createElement("style");autoClickerStyleElement.innerHTML="*{cursor: crosshair !important;}";document.body.appendChild(autoClickerStyleElement);function addClicker(e) {if(!e.isTrusted) {return;}if(e.target.classList.contains("auto-clicker-target")) {e.target.classList.remove("auto-clicker-target");} else {e.target.classList.add("auto-clicker-target");}document.body.removeChild(autoClickerStyleElement);document.body.removeEventListener("click", addClicker);e.preventDefault();autoClick(e.target);}function autoClick(element) {if(element.classList.contains("auto-clicker-target")) {element.click();setTimeout(function(){ autoClick(element); }, DELAY);}}document.body.addEventListener("click", addClicker, 0);
Mouse Trail
javascript: var opt = 0.1; var pen = 'block'; var size = 10; var clr = "blue"; var rate = 0.005; var userrate=5; alert("mouse trail. by dragonmaster73101. press c to change color and r to change rate."); function mousemove(event) { var x = event.clientX; var y = event.clientY; x=x-8; y=y-8; (function() { var elem = document.createElement('div'); var body = document.getElementsByTagName('body')[0]; body.appendChild(elem); elem.style.position = 'fixed'; elem.style.top = '' + y + 'px'; elem.style.left = '' + x + 'px'; elem.style.margin = '10px'; elem.style.paddingTop = '10px'; elem.style.width = '' + size + 'px'; elem.style.height = '' + size + 'px'; elem.style.zIndex = 10000; elem.style.opacity = opt; elem.style.color = '' + clr + ''; elem.style.backgroundColor = '' + clr + ''; elem.style.border = '0px solid white'; elem.style.textAlign = 'center'; elem.id = 'paint'; elem.style.display = '' + pen + ''; elem.innerText = ''; function repeat() { elem.style.opacity = elem.style.opacity - rate; } setInterval(repeat, 15); }()); } window.addEventListener("keydown", function(event) { if (event.key == "r") { userrate=prompt("what do you want the rate to be? the lower the number, the faster the trail disappears. recommended: 5"); rate=userrate/1000; } if (event.key == "c") { clr=prompt("what do you want the color to be? must be very broad. ex: blue"); } }); window.addEventListener(%27mousemove%27, mousemove);
Change Cursor
javascript:var c=prompt("what crusor do you want? the options are none,alias,all-scroll,auto,cell,col-resize,copy,e-resize,help,not-allowed,progress, and grabbing. be sure you write them exactly how I did.");(function(){var x = document.getElementsByTagName("*");for (i=0;i<x.length;i++){x[i].style.cursor=c};}());
Pain
javascript:function a(e){var n=e.childNodes;for(var i in n){a(n[i]);if(n[i].style) n[i].style.backgroundImage="url(https://i.chzbgr.com/full/5759452672/h934FBF16/my-eyes-my-eyessssssssss)";}} a(document);