-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgameX.html
148 lines (136 loc) · 4.81 KB
/
gameX.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#FC6A04">
<meta name="msapplication-TileImage" content="/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#FC6A04">
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
</head>
<style type="text/css">
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
background-color: black;
font-family: 'Roboto', sans-serif;
}
#content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-color: black;
}
#popup {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.6);
color: white;
padding: 20px;
border-radius: 10px;
font-size: 1.2rem;
text-align: center;
z-index: 1001;
opacity: 1;
transition: opacity 1s ease-in-out;
backdrop-filter: blur(10px);
display: none;
}
#popup.hidden {
opacity: 0;
pointer-events: none;
}
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(10px);
z-index: 1000;
opacity: 1;
transition: opacity 1s ease-in-out;
display: none;
}
#overlay.hidden {
opacity: 0;
pointer-events: none;
}
</style>
<body>
<div id="overlay"></div>
<div id="content">
<iframe id="gameIframe" width="100%" height="100%" frameborder="0"></iframe>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const popup = document.createElement('div');
popup.id = 'popup';
popup.textContent = 'You must click the screen after this popup to enable input';
document.body.appendChild(popup);
function showPopup() {
document.getElementById('overlay').style.display = 'block';
popup.style.display = 'block';
}
function hidePopup() {
popup.classList.add('hidden');
document.getElementById('overlay').classList.add('hidden');
setTimeout(() => {
popup.remove();
document.getElementById('overlay').remove();
}, 1000);
}
document.addEventListener('click', function() {
hidePopup();
});
var urlParams = new URLSearchParams(window.location.search);
var gameUrl = urlParams.get('url');
var gameTitle = urlParams.get('title');
gameUrl = gameUrl.split(' ').join('%20');
if (gameUrl) {
document.title = "VanishGames - " + gameTitle;
if (gameUrl.endsWith('.swf')) {
const ruffle = window.RufflePlayer.newest();
const player = ruffle.createPlayer();
player.style.width = '100%';
player.style.height = '100%';
const content = document.getElementById('content');
content.innerHTML = '';
content.appendChild(player);
player.load(gameUrl);
showPopup();
setTimeout(hidePopup, 2000);
} else {
var iframe = document.getElementById('gameIframe');
iframe.src = gameUrl;
iframe.addEventListener('load', function() {
showPopup();
setTimeout(hidePopup, 2000);
});
}
}
});
</script>
</body>
</html>