-
Notifications
You must be signed in to change notification settings - Fork 1
/
kahoot.html
155 lines (139 loc) · 4.34 KB
/
kahoot.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<title>Kahoot Smasher</title>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/darktheme.css"
/>
<!-- OG Meta Share -->
<meta property="og:title" content="Kahoot Smasher">
<meta name="desc" property="og:description" content="A free kahoot smasher. Fair Use Only!">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Kahoot Smasher">
<meta property="og:image" content="https://cdn.ntaheij.dev/parked/images/logo-blob.png">
<meta name="theme-color" content="#FF664A">
<meta name="robots" content="noindex,nofollow">
</head>
<body class="darkbg">
<script src="https://unpkg.com/[email protected]/dist/theme.js">
const themeConfig = new ThemeConfig();
// place customizations here
const themeConfig = new ThemeConfig();
// place customizations here
themeConfig.initTheme();
const darkSwitch = writeDarkSwitch(themeConfig);
config.themeChangeHandlers.push(theme => console.log(`using theme: ${theme}`));
themeConfig.loadTheme = () => {
// custom logic
return 'dark';
};
themeConfig.saveTheme = theme => {
// custom logic
console.log(theme);
};
</script>
<h1 class="text-center">Kahoot Smasher</h1>
</br>
<div class="col">
<div class="row">
<input
type="text"
class="form-control lighterdark"
id="name"
placeholder="Name"
style="width: 400px;margin-bottom: 1em;background-color: rgb(22, 24, 30)"
oninput="updateJSON()"
/>
</div>
<div class="row">
<input
type="text"
class="form-control lighterdark"
id="pin"
placeholder="PIN"
style="width: 400px;background-color: rgb(22, 24, 30)"
oninput="updateJSON()"
/>
</div>
</br>
<div class="row">
<input
type="text"
class="form-control lighterdark"
id="amount"
placeholder="Amount"
style="width: 400px;background-color: rgb(22, 24, 30)"
oninput="updateJSON()"
/>
</div>
</br>
</div>
<button id="send" class="form-control lighterdark" onclick="send()">Send Bots</button>
</body>
</html>
<style>
@import "~bootstrap-darkmode/darktheme";
body {
position: absolute;
left: 40%;
top: 40%;
}
.darkbg{
background-color:#0F1014;
color: #819595;
}
.lighterdark{
background-color:#16181E;
color: #819595;
border-color: #2A2E3A;
}
.lighterdark:active{
background-color:#383E4F;
}
.lighterdark:visited{
background-color:#383E4F;
}
</style>
<script>
function send() {
var pin = document.querySelector('#pin')
var _name = document.querySelector("#name")
var _amount = document.querySelector("#amount")
var invalid = (isNaN(pin.value) || pin.value === '' || pin.value < 0 || pin.value != Math.round(pin.value)) ? true : _name.value == undefined || _name.value == ""
var invalid2 = (isNaN(_amount.value) || _amount.value === '' || _amount.value < 0 || _amount.value != Math.round(_amount.value)) ? true : _name.value == undefined || _name.value == ""
if (invalid) {
pin.value = ''
alert('invalid pin!')
} else if(invalid2) {
pin.value = ''
alert('invalid pin!')
} else {
var data = JSON.stringify({
"gamePin": pin.value,
"name": _name.value,
"amount": _amount.value
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", window.location.href+"start");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);
alert('Started attack. Bots are joining now!')
}
}
</script>