-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
311 lines (254 loc) · 9.72 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title>Register / PongDog</title>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS and Font Awesome -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<!--bUTTON-->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
<!--Moment js javascript (for plotting time on x-axis) MUST BE INCLUDED BEFORE CHART JS-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Chart.js javascript-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.js"></script>
</head>
<body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<!-- Bootstrap uses slim build of jquery, which does not have ajax. Using ajax from google -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<div class="container hero-text">
<h1 style="font-size:50px">PongDog</h1>
<p>Sniffing ID cards for Ping pong data. Sniff sniff...<br>Join today for the ultimate ping pong experience!</p>
<a data-toggle="modal" data-target="#modal_work" type="submit"><button>Register card</button></a>
<br>
</div>
<div class="container fixed-bottom" style="text-align:center; color:white;">
<div class="row">
<div class ="col-md-4" id="players">
</div>
<div class ="col-md-4">
<a href="http://jakobvahlin.com/pongdog/leaderboard"><button class="button2">VIEW LEADERBOARD</button></a>
</div>
<div class ="col-md-4" id="games">
</div>
</div>
<div class="row">
<div class="col-md-12">
<footer class="page-footer font-small special-color-dark pt-4">
<div style="border:1px solid-yellow;" class="footer-copyright text-center py-3"> Created by Yånkerz Consulting © 2021
</div>
</footer>
</div>
</div>
</div>
</body>
<!-- Modal for adding match -->
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id="modal_work">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Register student card</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidd en="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Register your NTNU student card to get started with your PongDogging experience.</p>
<p><i>Note that registering a card might take a couple of seconds. Be patient!</i></p>
<form action="https://jakvah.pythonanywhere.com/add_new_pong_user" enctype=multipart/form-data method="POST">
<div class="form-group">
<label for="exampleInputEmail1">Card ID</label>
<input name="card_id" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter card ID" required>
<small id="emailHelp" class="form-text text-muted">This is the <strong>EM </strong>number at your card NTNU card.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Card name</label>
<input name="card_name" class="form-control" id="exampleInputPassword1" placeholder="Name associated with card">
</div>
<div class="form-group">
<label for="userImg">Add user image</label>
<input type="file" class="form-control-file" id="file" name="file">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" required>
<label class="form-check-label" for="exampleCheck1" required>I'm not a robot</label>
</div>
<button onclick="showDiv()" type="submit" class="btn btn-success">Register card</button>
</form>
<div id="hiddenMeme" style="display:none;" class="container">
<!-- 2 -->
<div class="loader loader--style2" title="1">
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
<path fill="#000" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z">
<animateTransform attributeType="xml"
attributeName="transform"
type="rotate"
from="0 25 25"
to="360 25 25"
dur="0.6s"
repeatCount="indefinite"/>
</path>
</svg>
</div>
<h5 style="padding-top: 1em;display: inline;">Adding match! While waiting, here is meme!</h5>
<img src="https://media.discordapp.net/attachments/629733041199251495/786296489877307482/10_man.png?width=690&height=675" img-fluid alt="10manMeme">
</div>
</div>
</div>
</div>
</div>
</body>
<script>
var gamesHTML;
var playersHTML;
$(document).ready( function () {
$.ajax({
type: "get",
url: "https://jakvah.pythonanywhere.com/get_total_games_played",
success:function(res) {
document.getElementById("players").innerHTML ='<h3>' +res + ' games played</h3>';
}
});
$.ajax({
type: "get",
url: "https://jakvah.pythonanywhere.com/get_total_players",
success:function(res) {
document.getElementById("games").innerHTML ='<h3>' +res + ' players registered</h3>';
}
});
$("#players").html(playersHTML);
$("#games").html(gamesHTML);
});
</script>
<!-- Modal content ends-->
<style>
body {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://jakvah.pythonanywhere.com/static/imgs/pongdog.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.hero-text {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
.hero-text button {
border: none;
outline: 0;
display: inline-block;
padding: 10px 25px;
color: black;
background-color: #ddd;
text-align: center;
cursor: pointer;
}
.hero-text button:hover {
background-color:orange;
color: white;
}
</style>
<!--BUtton-->
<style>
.button2,
.button2::after {
width: 380px;
height: 86px;
font-size: 36px;
font-family: "Bebas Neue", cursive;
background: linear-gradient(45deg, transparent 5%, #ff013c 5%);
border: 0;
color: #fff;
letter-spacing: 3px;
line-height: 88px;
box-shadow: 6px 0px 0px #00e6f6;
outline: transparent;
position: relative;
}
.button2::after {
--slice-0: inset(50% 50% 50% 50%);
--slice-1: inset(80% -6px 0 0);
--slice-2: inset(50% -6px 30% 0);
--slice-3: inset(10% -6px 85% 0);
--slice-4: inset(40% -6px 43% 0);
--slice-5: inset(80% -6px 5% 0);
content: "PONG DOG";
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(
45deg,
transparent 3%,
#00e6f6 3%,
#00e6f6 5%,
#ff013c 5%
);
text-shadow: -3px -3px 0px #f8f005, 3px 3px 0px #00e6f6;
clip-path: var(--slice-0);
}
.button2:hover::after {
animation: 1s glitch;
animation-timing-function: steps(2, end);
}
@keyframes glitch {
0% {
clip-path: var(--slice-1);
transform: translate(-20px, -10px);
}
10% {
clip-path: var(--slice-3);
transform: translate(10px, 10px);
}
20% {
clip-path: var(--slice-1);
transform: translate(-10px, 10px);
}
30% {
clip-path: var(--slice-3);
transform: translate(0px, 5px);
}
40% {
clip-path: var(--slice-2);
transform: translate(-5px, 0px);
}
50% {
clip-path: var(--slice-3);
transform: translate(5px, 0px);
}
60% {
clip-path: var(--slice-4);
transform: translate(5px, 10px);
}
70% {
clip-path: var(--slice-2);
transform: translate(-10px, 10px);
}
80% {
clip-path: var(--slice-5);
transform: translate(20px, -10px);
}
90% {
clip-path: var(--slice-1);
transform: translate(-10px, 0px);
}
100% {
clip-path: var(--slice-1);
transform: translate(0);
}
}
</style>