forked from ranguyafk/duckhtml2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay.html
366 lines (317 loc) · 8.25 KB
/
play.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #353839;
overflow: hidden;
/* Add this line to remove scrollbars */
}
nav {
background-color: #353839;
text-align: center;
padding: 10px;
display: flex;
align-items: center;
}
.logo {
display: flex;
align-items: center;
margin-right: auto;
}
.logo img {
width: 40px;
height: auto;
margin-right: 10px;
}
.logo span {
font-size: 24px;
color: #ffd700;
font-weight: bold;
}
nav a {
display: inline-block;
margin: 0 15px;
text-decoration: none;
color: white;
font-weight: bold;
font-size: 16px;
transition: color 0.3s ease-in-out;
border: 2px solid #ffd700;
border-radius: 8px;
padding: 8px 16px;
}
nav a:hover {
color: #ffd700;
border-color: #363636;
}
nav a.active {
background-color: #ffd700;
color: #363636;
border-color: #363636;
}
h1 {
font-size: 36px;
text-align: center;
color: #363636;
}
p {
font-size: 18px;
text-align: center;
color: #333;
font-family: 'Arial', sans-serif;
}
#cookieNotice {
position: fixed;
bottom: 10px;
right: 10px;
width: 150px;
background-color: #333;
color: white;
text-align: center;
padding: 10px;
border-radius: 8px;
display: none;
}
#cookieNotice button {
background-color: #ffd700;
color: #363636;
border: none;
padding: 8px 16px;
margin: 5px;
border-radius: 5px;
cursor: pointer;
}
#playNowButton {
position: absolute;
top: 103%;
left: 50%;
transform: translateX(-50%);
background-color: #ffd700;
color: #363636;
border: none;
padding: 15px 30px;
font-size: 18px;
font-weight: bold;
border-radius: 8px;
cursor: pointer;
}
#playNowButton img {
width: 20px;
height: auto;
margin-left: 10px;
}
.bottom {
postion: bottom-right;
}
.nav-bar {
display: flex;
justify-content: center;
/* Center horizontally */
align-items: center;
background-color: #000;
/* Black background */
height: 3rem;
/* Set navbar height */
padding: 0 1rem;
/* Add some padding on the sides */
width: 100%;
/* Set navbar width */
}
.nav-btn {
text-decoration: none;
color: #fff;
/* White text color */
font-weight: bold;
margin-right: 3%;
/* Add margin-right for space */
margin-left: 3%;
/* Add margin-right for space */
cursor: pointer;
display: inline-block;
/* Needed for padding to work */
padding: 0.5rem 1rem;
border: none;
font-family: Tahoma;
background-color: #454545;
border-radius: 5px;
}
.ad-spot {
position: fixed;
bottom: 40px;
/* Adjust distance from bottom */
left: 50%;
transform: translateX(-50%);
/* Center horizontally */
width: 200px;
/* Adjust width as needed */
height: 50px;
/* Adjust height as needed */
background-color: rgba(0, 0, 0, 0.5);
/* Adjust transparency */
text-align: center;
padding: 10px;
font-size: 16px;
color: white;
border: 2px solid yellow;
/* adjust border thickness */
border-radius: 5px;
/* adjust corner roundness */
cursor: pointer;
}
.ad-spot p {
margin: 0;
line-height: 1.4;
}
.ad-spot a {
text-decoration: none;
}
.ad-spot a:hover {
background-color: rgba(255, 255, 0, 0.2);
/* Optional hover effect */
}
.social-media-icons {
position: absolute;
bottom: 10px;
/* Adjust distance from bottom */
right: 10px;
/* Adjust distance from right */
display: flex;
/* Arrange icons horizontally */
}
.social-media-icons a {
margin-right: 5px;
}
.social-media-icons img {
width: 35px;
/* Adjust image size */
height: 35px;
/* Adjust image size */
border-radius: 50%;
/* Make images round */
position: bottom-right;
}
iframe {
width: 70vw;
height: calc(75vh - 30px);
/* Adjusted to leave space for the navbar */
border: none;
}
.rounded-image {
position: fixed;
bottom: 40px;
/* Adjust as needed */
left: 50%;
transform: translateX(-50%);
border-radius: 20px;
/* Adjust border radius as needed */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
/* Optional: Add shadow */
}
.rounded-imagetext {
position: fixed;
bottom: 5px;
/* Adjust as needed */
left: 50%;
transform: translateX(-50%);
border-radius: 20px;
/* Adjust border radius as needed */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
/* Optional: Add shadow */
}
.discord-btn {
text-decoration: none;
cursor: pointer;
display: inline-block;
padding: 0.5rem 1rem;
border: none;
background-color: #454545;
border-radius: 5px;
}
.discord-btn img {
width: 20px;
height: auto;
margin-right: 5px;
}
</style>
<script>
function checkQueryParam(param) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.has(param);
}
function createGameIframe(param, title) {
const hostUrl = window.location.origin;
const iframeSrc = `${hostUrl}/gf/${param}`;
const iframe = document.createElement('iframe');
iframe.setAttribute('src', iframeSrc);
iframe.setAttribute('id', 'gameIframe'); // Set an ID for easier reference
const container = document.getElementById('iframe-container');
container.appendChild(iframe);
document.getElementById('gameTitle').innerText = title;
}
window.onload = function () {
if (checkQueryParam('game')) {
const gameParamValue = new URLSearchParams(window.location.search).get('game');
const titleParamValue = new URLSearchParams(window.location.search).get('title');
createGameIframe(gameParamValue, titleParamValue);
} else {
console.log("The 'game' parameter is not present in the URL.");
}
};
// Function to toggle fullscreen mode for the iframe
function toggleFullscreen() {
// Get the iframe element
const iframe = document.querySelector('iframe');
// Check if fullscreen mode is enabled
if (!document.fullscreenElement) {
// If not, request fullscreen
iframe.requestFullscreen();
} else {
// Otherwise, exit fullscreen
document.exitFullscreen();
}
}
</script>
</head>
<body>
<nav class="nav-bar">
< <a href="/index.html" class="nav-btn">Home</a>
<a href="/games.html" class="nav-btn">Games</a>
<img src="https://ucarecdn.com/cf91fdbc-e959-4737-9276-c5ddb93799a8/duckhtml.png" alt="Image description"
style="height: 2rem; margin: 0 3%;">
<a href="/settings.html" class="nav-btn">Settings</a>
<a href="https://discord.gg/WJrVhYbrdQ" class="nav-btn">Discord</a>
</nav>
<center>
<br><br>
<h1 id="gameTitle" style="color: white;">GAMENAMEHERE</h1>
<div id="iframe-container"></div>
<br>
<script>
// Function to toggle fullscreen mode for the iframe
function toggleFullscreen() {
// Get the iframe element
const iframe = document.querySelector('iframe');
// Check if fullscreen mode is enabled
if (!document.fullscreenElement) {
// If not, request fullscreen
iframe.requestFullscreen();
} else {
// Otherwise, exit fullscreen
document.exitFullscreen();
}
}
</script>
</body>
</html>
<button class="nav-btn" onclick="toggleFullscreen()">Fullscreen</button>
</center>
<br><br><br><br>
</body>
</html>