-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
130 lines (121 loc) · 3.76 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="buttons.css">
<style>
body {
background-image: url('https://rare-gallery.com/uploads/posts/524801-agriculture.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<title>FloodOfPeas</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.active {
background-color: green; /* Change to your desired active color */
}
</style>
</head>
<body>
<div class="center">
<button id="start" class="button">
<span>BEGIN!</span>
<span>Start The Fun!</span>
</button>
<button id="end" class="button">
<span>STOP!</span>
<span>Stop The Insanity!</span>
</button>
<button id="hyperMode" class="button">
<span>HYPER MODE!</span>
<span>Activate Hyper Mode!</span>
</button>
<h1 style="color:purple;" style=font-family: Tahoma, sans-serif;"><b>Google windows will popup. And they will randomly open new different ones.</b></h1>
</div>
<script>
var stop = false;
var hyperMode = false;
var popups = {};
var minWords = 2;
var maxWords = 6;
var words = ["pea", "peas", "p", "p's"]
var iwords = words.length - 1;
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randomWord() {
return words[randomNumber(0, iwords)];
}
function randomSentence() {
var words = [];
var n = randomNumber(minWords, maxWords);
for (var i = 0; i < n; i++) {
words.push(randomWord());
}
return words;
}
function flood(words, name) {
words = encodeURIComponent(words.join(" "));
var url = "https://www.google.com/search?q=##&oq=##&sourceid=chrome&ie=UTF-8".replace("##", words).replace("##", words);
if (name in popups && !popups[name]) {
// If browser is blocking our pop-ups, return.
return;
}
if (popups[name] && !popups[name].closed) {
popups[name].location = url;
} else {
popups[name] = window.open(url, name);
}
self.focus();
var delay = hyperMode ? Math.floor(Math.random() * 100) + 80 : Math.floor(Math.random() * 10000) + 8000;
setTimeout(function() {
if (!stop) startFlood(name);
}, delay);
}
function startFlood(name) {
stop = false;
flood(randomSentence(), name);
}
document.getElementById("start").addEventListener("click", function(e) {
if (hyperMode) {
stop = false;
startFlood("queueOne");
startFlood("queueTwo");
} else {
stop = false;
startFlood("queueOne");
startFlood("queueTwo");
}
});
document.getElementById("end").addEventListener("click", function(e) {
stop = true;
});
document.getElementById("hyperMode").addEventListener("click", function(e) {
hyperMode = !hyperMode;
if (hyperMode) {
document.getElementById("hyperMode").classList.add("active");
document.getElementById("hyperMode").childNodes[1].textContent = "Disable Hyper Mode";
document.getElementById("start").childNodes[1].textContent = "Start Hyper Mode!";
alert("Hyper mode activated! Click start the fun for SPEED!");
} else {
document.getElementById("hyperMode").classList.remove("active");
document.getElementById("hyperMode").childNodes[1].textContent = "Activate Hyper Mode!";
document.getElementById("start").childNodes[1].textContent = "BEGIN!";
}
});
</script>
</body>
</html>