forked from 1727859/cyanidegames
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gba.html
126 lines (109 loc) · 2.92 KB
/
gba.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="!contributors/moondoge.gif">
<style type="style" src="default"></style>
<title id="pageTitle">Game Selected | cyanide</title>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
background-color: #121212;
border: none;
}
#gameContainer {
width: 100%;
height: 100%;
}
#fullscreenButton, #gobackButton {
background-color: #121212;
color: aliceblue;
border: none;
border-radius: 4px;
cursor: pointer;
transition-duration: 0.5s;
}
#fullscreenButton:hover, #gobackButton:hover {
background-color: aliceblue;
color: #121212;
border: none;
border-radius: 10px;
cursor: pointer;
animation: bigui 1s ease-in-out infinite;
}
#fullscreenButton {
position: absolute;
top: 10px;
right: 10px;
z-index: 999;
padding: 10px;
}
#gobackButton {
position: absolute;
top: 10px;
left: 10px;
z-index: 999;
padding: 10px;
}
@keyframes bigui {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1.0);
}
}
</style>
</head>
<body>
<button id="gobackButton" onclick="goBack()">Go Back</button>
<div id="gameContainer"></div>
<button id="fullscreenButton" onclick="toggleFullscreen()">Fullscreen</button>
<script>
function goBack() {
window.history.back();
}
function toggleFullscreen() {
const elem = document.body;
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { /* Firefox */
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE/Edge */
elem.msRequestFullscreen();
}
}
window.addEventListener('fullscreenchange', function() {
const isFullscreen = document.fullscreenElement || document.mozFullScreenElement || document.webkitIsFullScreen;
document.getElementById('fullscreenButton').textContent = isFullscreen ? 'Exit Fullscreen' : 'Fullscreen';
});
const queryParams = new URLSearchParams(window.location.search);
const gameParam = queryParams.get('game');
const nameParam = queryParams.get('name');
const gameContainer = document.getElementById('gameContainer');
const pageTitle = document.getElementById('pageTitle');
if (gameParam) {
const iframe = document.createElement('iframe');
iframe.src = gameParam;
iframe.width = '100%';
iframe.height = '100%';
gameContainer.appendChild(iframe);
if (nameParam) {
pageTitle.textContent = nameParam + " | cyanide";
}
} else {
gameContainer.textContent = 'No game selected.';
}
</script>
</body>
</html>