-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
443 lines (388 loc) · 13.4 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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Downbad Gamer Fix?</title>
</head>
<style>
#container {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
z-index: 10000;
background: black;
}
#blocker {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
z-index: 99999;
}
#player {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
z-index: 88888;
}
#fakeEndRickRollPrompt {
position: absolute;
top: 15px;
left: 42vw;
z-index: 100000;
border: 3px solid white;
border-radius: 10px;
padding: 10px;
text-align: center;
font-weight: bold;
clear: both;
background: white;
}
#hopeYouHadFun {
position: absolute;
top: 44vh;
left: 42vw;
z-index: 10001;
border: 3px solid black;
border-radius: 10px;
padding: 25px;
text-align: center;
font-weight: bold;
clear: both;
background: white;
}
#initialOverlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000000;
background-color: rgba(0, 0, 0, 0.9);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
background: black;
}
#initialOverlay img {
width: 100%;
height: auto;
object-fit: contain;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
z-index: 1;
}
#initialOverlayButtons {
position: relative;
z-index: 2;
display: flex;
justify-content: center;
width: 100%;
gap: 20px;
}
#enterButton {
background-color: #FF0000;
color: white;
border: none;
border-radius: 25px;
padding: 15px 30px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#enterButton:hover {
background-color: #cc0000;
}
#exitButton {
background-color: transparent;
color: white;
border: 2px solid white;
border-radius: 25px;
padding: 15px 30px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease, color 0.3s ease;
}
#exitButton:hover {
background-color: white;
color: #000000;
}
</style>
<body>
<!-- Main Container -->
<div id="container" {width: 100%; height: 100%;}>
<!-- YouTube Embed -->
<div id="player"></div>
<!-- YouTube Embed -->
<div id="blocker"></div>
<!-- Fake "End" Popup -->
<div id="fakeEndRickRollPrompt" style="display: none;">
<p>Would you like to end the Rick Roll Now?</p>
<button id="fakeEndRickRollButton">End Rick Roll</button>
<button id="fakeKeepRickRollButton">Keep Ricking and Rolling Me Brother</button>
</div>
<div id="hopeYouHadFun" style="display: none;">
<p>Hope you had a fun time being Rick Rolled!</p>
<p>And just remember 9+10=21!</p>
<button onclick="location.href='https://sweaty.cc'" type="button">Sweaty Gamers Discord Server</button>
<button onclick="location.href='https://github.com/TheCodingCarson/RickRoll'" type="button">See the source code on Github</button>
</div>
<!-- Initial Overlay (Fake 18+ Consent Page) -->
<div id="initialOverlay">
<img src="https://raw.githubusercontent.com/TheCodingCarson/RickRoll/refs/heads/main/images/landing.png" alt="Landing Image">
<div id="initialOverlayButtons">
<button id="enterButton">I am 18 or older - Enter</button>
<button id="exitButton">I am under 18 - Exit</button>
</div>
</div>
</div>
<script>
// -- Global Variables --
var player; // YouTube Player
var started = false; // Rick Roll Started
var ended = false; // Rick Roll Ended
const container = document.getElementById('container'); // Main Container
const playerDiv = document.getElementById('player'); // YouTube Player Div
const blocker = document.getElementById('blocker'); // Blocker Overlay
const popup = document.getElementById('fakeEndRickRollPrompt'); // Popup Prompt
const initialOverlay = document.getElementById('initialOverlay'); // Initial Overlay (Fake 18+ Consent)
// Loads the IFrame Player API
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// Creates an iframe
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: 'xm3YgoEiEDc', // 10-Hour Rickroll video ;)
playerVars: {
'playsinline': 1, // Ensuring fullscreen doesn't block overlay
'autoplay': 0, // Don't Auto play video on load
'mute': 1, // Start Muted
'loop': 1, // Loop Video (Why is the user here for 10 hours?)
'controls': 0, // Remove the Player Controls
'frameborder': 0, // Remove Border Frame
'disablekb': 1, // Disable Keyboard Controls
'enablejsapi': 1, // Enable JS Api
'iv_load_policy': 3, // Hide Annotations
'rel': 0, // Don't show related videos
'referrerpolicy': "strict-origin-when-cross-origin",
'origin': "downbad.sweaty.cc",
'allow': "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
},
events: {
'onReady': onPlayerReady
}
});
}
// Set Player Settings + Show Consent Buttons
function onPlayerReady(event) {
event.target.unMute(); // Unmute Video
event.target.setVolume(100); // Set Volume to 100%
showInitialOverlayButtons(); // Show the Fake Consent buttons
}
// Show the buttons on the initial overlay
function showInitialOverlayButtons() {
const enterButton = document.getElementById('enterButton');
const exitButton = document.getElementById('exitButton');
enterButton.style.display = 'block'; // Unhide enter button
exitButton.style.display = 'block'; // Unhide exit button
// Event handler for Enter (18 or older)
enterButton.addEventListener('click', function() {
started = false; // Set Rick Roll Started
initialOverlay.style.display = 'none'; // Hide overlay
player.playVideo(); // Play Video
document.title = "Get Rick Rolled!"; // Change Website Title
enableFullScreen(); // Start in fullscreen
});
// Event handler for Exit (under 18)
exitButton.addEventListener('click', function() {
started = false; // Set Rick Roll Started
initialOverlay.style.display = 'none'; // Hide overlay
player.playVideo(); // Play Video
document.title = "Get Rick Rolled!"; // Change Website Title
enableFullScreen(); // Start in fullscreen
});
}
// On Click Go Into Fullscreen - Blocker
blocker.addEventListener("click", function(event) {
event.preventDefault();
enableFullScreen();
});
// On Click Go Into Fullscreen - Fake Prompt
popup.addEventListener("click", function(event) {
event.preventDefault();
enableFullScreen();
});
// Enable fullscreen if any key other then "R" is pressed - Document
document.addEventListener('keydown', function(event) {
// Check to make sure still ricking the roll
if (!ended && started) {
// Prevent the default action for all key presses
event.preventDefault();
if (event.key === 'R' || event.key === 'r') {
// End Rick Roll when "R" is pressed
endRickRoll()
} else {
// If any other key is pressed open Fullscreen
enableFullScreen();
}
}
});
// Enable fullscreen if any key other then "R" is pressed - Blocker
blocker.addEventListener('keydown', function(event) {
// Check to make sure still ricking the roll
if (!ended) {
// Prevent the default action for all key presses
event.preventDefault();
if (event.key === 'R' || event.key === 'r') {
// End Rick Roll when "R" is pressed
endRickRoll()
} else {
// If any other key is pressed open Fullscreen
enableFullScreen();
}
}
});
// Enable fullscreen if any key other then "R" is pressed - Fake Prompt
popup.addEventListener('keydown', function(event) {
// Check to make sure still ricking the roll
if (!ended) {
// Prevent the default action for all key presses
event.preventDefault();
if (event.key === 'R' || event.key === 'r') {
// End Rick Roll when "R" is pressed
endRickRoll()
} else {
// If any other key is pressed open Fullscreen
enableFullScreen();
}
}
});
// Enable fullscreen if any key other then "R" is pressed - Container
container.addEventListener('keydown', function(event) {
// Check to make sure still ricking the roll
if (!ended) {
// Prevent the default action for all key presses
event.preventDefault();
if (event.key === 'R' || event.key === 'r') {
// End Rick Roll when "R" is pressed
endRickRoll()
} else {
// If any other key is pressed open Fullscreen
enableFullScreen();
}
}
});
// Enable fullscreen if any key other then "R" is pressed - Player Div
playerDiv.addEventListener('keydown', function(event) {
// Check to make sure still ricking the roll
if (!ended) {
// Prevent the default action for all key presses
event.preventDefault();
if (event.key === 'R' || event.key === 'r') {
// End Rick Roll when "R" is pressed
endRickRoll()
} else {
// If any other key is pressed open Fullscreen
enableFullScreen();
}
}
});
// Prevent the context menu from appearing on right-click anywhere in the document
document.addEventListener('contextmenu', function(event) {
event.preventDefault();
});
// Extra prevention of the context menu - Container
container.addEventListener('contextmenu', function(event) {
event.preventDefault();
});
// Extra prevention of the context menu - Blocker
blocker.addEventListener('contextmenu', function(event) {
event.preventDefault();
});
// Extra prevention of the context menu - Fake Popup
popup.addEventListener('contextmenu', function(event) {
event.preventDefault();
});
// Function to enable fullscreen
function enableFullScreen() {
if (container.requestFullscreen) {
container.requestFullscreen();
} else if (container.mozRequestFullScreen) { // Firefox
container.mozRequestFullScreen();
} else if (container.webkitRequestFullscreen) { // Chrome, Safari and Opera
container.webkitRequestFullscreen();
} else if (container.msRequestFullscreen) { // IE/Edge
container.msRequestFullscreen();
}
gif.style.display = 'fixed'; // Remove Prompt
}
// Function to exit fullscreen
function exitFullScreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) { // Chrome, Safari, and Opera
document.webkitExitFullscreen();
} else if (document.mozCancelFullScreen) { // Firefox
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) { // IE/Edge
document.msExitFullscreen();
}
}
// Adding listener to monitor full-screen changes
document.addEventListener('fullscreenchange', function() {
if (!document.fullscreenElement) {
// Show a fake "End Rick Roll Prompt"
popup.style.display = 'block';
} else {
// Remove a fake "End Rick Roll Prompt"
popup.style.display = 'none';
}
});
// Re-enter full screen when the user clicks the "End Rick Roll" button
document.getElementById('fakeEndRickRollButton').addEventListener('click', function() {
// Enable full-screen mode when the button is clicked
enableFullScreen();
// Hide the prompt after re-entering full-screen
popup.style.display = 'none';
});
// Re-enter full screen when the user clicks the "Keep Rick Roll" button
document.getElementById('fakeKeepRickRollButton').addEventListener('click', function() {
// Enable full-screen mode when the button is clicked
enableFullScreen();
// Hide the prompt after re-entering full-screen
popup.style.display = 'none';
});
// -- Actually End Rick Roll --
function endRickRoll() {
ended = true; // Set Ended variable
exitFullScreen(); // Exit Fullscreen
blocker.style.display = 'none'; // Remove Blocker
playerDiv.style.display = 'none'; // Remove YouTube Embed
popup.style.display = 'none'; // Remove Popup
initialOverlay.style.display = 'none'; // Remove Initial Overlay (Fake 18+ Consent)
document.getElementById('container').style.background = 'white'; // Set main container background to white
document.getElementById('hopeYouHadFun').style.display = 'block'; // Show Ending text
document.title = "Sorry - Classic Rick Roll"; // Change Website Title
}
</script>
</body>
</html>