forked from sayofthelor/sz-games.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unity.html
380 lines (296 loc) · 10.7 KB
/
unity.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
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
<link rel="icon" href="https://github.com/sz-games/home/blob/main/G.png?raw=true">
<title>Sz Games - Game (UNITY)</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('https://sz-games.github.io/service-worker.js');
}
</script>
<!--PageScript1-->
<!--script id="CHECK">
function getCookie2(name) {
const cookieName = name + "=";
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i];
while (cookie.charAt(0) === ' ') {
cookie = cookie.substring(1);
}
if (cookie.indexOf(cookieName) === 0) {
return cookie.substring(cookieName.length, cookie.length);
}
}
return '';
}
let Setting14bu = getCookie2("PagePrevent");
function checkPageClose(event) {
event.returnValue = "Prevent Page Close Is Active, You Can Click Off Of This";
}
function checkPageClose2() {
if(Setting14bu==="true") {
window.onbeforeunload = function(event) {
// return a string to prevent the page from closing
event.preventDefault();
return "Prevent Page Close Is Active, You Can Click Off Of This";
};
window.addEventListener("beforeunload", checkPageClose);
}
if(Setting14bu==="false") {
}
}
console.log('CookiePAGE Value: ' + Setting14bu + "SzGames-Scripts Loaded")
checkPageClose2()
</script-->
<!--PageScript1-->
<link rel="manifest" href="https://sz-games.github.io/manifest.json">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C78TXR0XFK"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-C78TXR0XFK');
</script>
<script src=".GobalSettings.js"></script>
<style>
body {
margin: 0;
overflow: hidden;
font-family: Arial, Helvetica, sans-serif;
background-color: rgb(117, 117, 117);
}
.btn-group button {
background-color: black; /* Green background */
color: white; /* White text */
padding: 10px 24px; /* Some padding */
cursor: pointer; /* Pointer/hand icon */
float: left; /* Float the buttons side by side */
}
/* Clear floats (clearfix hack) */
.btn-group:after {
content: "";
clear: both;
display: table;
}
.btn-group button:not(:last-child) {
border-right: none; /* Prevent double borders */
}
/* Add a background color on hover */
.btn-group button:hover {
background-color: grey;
}
/* Header/Logo Title */
.header {
padding: 60px;
text-align: center;
background: linear-gradient(to bottom right, #9a9a9a, rgb(39, 39, 39));
color: white;
width: auto;
font-size: 30px;
border-radius: 15px;
}
/* Page Content */
</style>
</head>
<body onresize="resize()">
<style>
.game {
position: absolute;
color: white;
transform: scale(1.8);
z-index: 3;
font-family: Arial, Helvetica, sans-serif;
}
.fade {
position: absolute;
background: linear-gradient(to bottom, #1d1d1d, #1d1d1d5d, rgba(39, 39, 39, 0));
width: 300px;
height: 150px;
border-radius: 15px;
}
.buttonForMenu {
transition: 0.5s;
}
.buttonForMenu:hover {
color: #9a9a9a;
}
.loader {
display: block;
--height-of-loader: 4px;
--loader-color: #7c7c7c;
width: 400px;
height: var(--height-of-loader);
border-radius: 30px;
background-color: rgba(0,0,0,0.2);
position: relative;
}
.loader::before {
content: "";
position: absolute;
background: var(--loader-color);
top: 0;
left: 0;
width: 0%;
height: 100%;
border-radius: 30px;
animation: moving 1.5s ease-in-out infinite;
;
}
@keyframes moving {
50% {
width: 100%;
}
100% {
width: 0;
right: 0;
left: unset;
}
}
button {
display: flex;
height: 3em;
width: 100px;
color: rgb(0, 0, 0);
align-items: center;
justify-content: center;
background-color: #9494944b;
border-radius: 3px;
letter-spacing: 1px;
transition: all 0.2s linear;
cursor: pointer;
border: none;
background: #dbdbdb;
}
button > svg {
margin-right: 5px;
margin-left: 5px;
font-size: 20px;
color: white;
transition: all 0.4s ease-in;
}
button:hover > svg {
font-size: 1.2em;
transform: translateX(-5px);
}
button:hover {
transform: translateY(-2px);
}
</style>
<div id="LOADINGSCREEN11" style="display: block; opacity: 1; transition: 0.8s; background-color: #525252; z-index: 100; position: fixed; width: 100%; height: 100%;">
<div id="FRONT" style="z-index: 103;">
<div style="position: absolute; top: 25%; left: 5px; width: 100%; height: 200px;">
<img src="https://raw.githubusercontent.com/sz-games/home/main/G.png" style="position:relative; z-index: 107; width: 100px; height: 100px; left: 30px; " alt="Sz Games">
<h1 style=" z-index: 103; bottom: 60%; transform: translate(-0%, 50%); font-size: 40px; left: 150px; color: white; font-family: Arial, Helvetica, sans-serif; position: relative;">Sz Games</h1>
<p style="font-family: Arial, Helvetica, sans-serif; position: absolute; z-index: 103; color: rgb(164, 164, 164); left: 405px; top: 85px; " id="loading-percentage">0%</p>
<button style="left: 40px; z-index: 107; position: relative;">
<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1024 1024"><path d="M874.690416 495.52477c0 11.2973-9.168824 20.466124-20.466124 20.466124l-604.773963 0 188.083679 188.083679c7.992021 7.992021 7.992021 20.947078 0 28.939099-4.001127 3.990894-9.240455 5.996574-14.46955 5.996574-5.239328 0-10.478655-1.995447-14.479783-5.996574l-223.00912-223.00912c-3.837398-3.837398-5.996574-9.046027-5.996574-14.46955 0-5.433756 2.159176-10.632151 5.996574-14.46955l223.019353-223.029586c7.992021-7.992021 20.957311-7.992021 28.949332 0 7.992021 8.002254 7.992021 20.957311 0 28.949332l-188.073446 188.073446 604.753497 0C865.521592 475.058646 874.690416 484.217237 874.690416 495.52477z"></path></svg>
<span>Home</span>
</button>
<div style="z-index: 103; left: 50px; top: 125px; position: absolute;" class="loader"></div>
</div>
</div>
<div id="BACKLOAD" style="z-index: 101;">
<div style="position: absolute; transform: scale(1.0) translate(-0%, -50%); right: -10px; top: 50%;" id="SCREENSHOT">
<img style="border-radius: 15px;" src="https://raw.githubusercontent.com/sz-games/sz-games.github.io/main/SZ-BG.png"/>
<div style="width: 100%; height: 85px; z-index: 102; position: absolute; right: 0; bottom: 0%; background-image: linear-gradient(to top, #525252, #525252, rgba(255, 255, 0, 0));">
</div>
</div>
</div>
</div>
<script>
var LoadPWA = false
let LOADCHECK = sessionStorage.getItem("HasLoadedPWA0");
document.getElementById('LOADINGSCREEN11').style.display = "block"
//LOADING PERCENTAGE
window.addEventListener('load', function() {
// All resources have finished loading
document.getElementById('loading-percentage').textContent = '100%';
});
window.addEventListener('DOMContentLoaded', function() {
// DOM content has finished loading
const totalResources = document.getElementsByTagName('*').length;
let loadedResources = 0;
const loadingPercentage = document.getElementById('loading-percentage');
function updateLoadingPercentage() {
loadedResources++;
const percentage = ((loadedResources / totalResources) * 100).toFixed(2);
loadingPercentage.textContent = percentage + '%';
}
const elements = document.getElementsByTagName('*');
for (let i = 0; i < elements.length; i++) {
elements[i].addEventListener('load', updateLoadingPercentage);
elements[i].addEventListener('error', updateLoadingPercentage); // Handle resource load errors
}
});
//END
window.addEventListener('load', function() {
document.getElementById('LOADINGSCREEN11').style.opacity = 0
setTimeout(() => {
document.getElementById('LOADINGSCREEN11').style.display = 'none'
}, 800);
});
</script>
<iframe frameBorder="0" id="game" style="text-align: center; align-items: center; overflow: hidden; width: 100%; " src="" allowfullscreen></iframe>
<!--h2 onclick="window.location = 'https://sz-games.github.io'" style="display: none; cursor: pointer; position: fixed; bottom: -20px; ">Back</h2>
<h2 style="position: fixed; bottom: 10px;">____</h2>
<h2 onclick="makeFullScreen()" style="cursor: pointer; position: fixed; bottom: 20px;">Fullscreen</h2-->
<div style="cursor: pointer; position: fixed; border-radius: 15px; color: rgb(224, 224, 224); background-color: #1d1d1dc0; left: 0; bottom: 0px; margin: 10px;" id="Menu">
<span class="material-icons buttonForMenu" style="margin: 5px;" onclick="window.location = 'https://sz-games.github.io'" >
arrow_back
</span>
<span class="material-icons buttonForMenu" style="margin: 5px;" onclick="document.getElementById('game').contentWindow.gameInstance.SetFullscreen(1)" >
fullscreen
</span>
</div>
</body>
<script>
var isFUll = false
document.body.onkeyup = function(e) {
if( e.keyCode == 27 ) {
if(isFUll) {
//document.getElementById('game').style.width = '800px';
}
}
}
function requestFullScreen(element) {
// Supports most browsers and their versions.
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
if (requestMethod) { // Native full screen.
requestMethod.call(element);
let hh = window.innerHeight;
document.getElementById('game').height = hh;
} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
}
var canvas = document.getElementById('game');
function makeFullScreen() {
isFUll = true
requestFullScreen(canvas);
}
let hh = window.innerHeight;
document.getElementById('game').height = hh;
window.onresize = function(event) {
let hh = window.innerHeight;
document.getElementById('game').height = hh;
}
// Get the text element
var textElement = document.getElementById("game");
// Get the current URL
var currentUrl = new URL(window.location.href);
// Check for the presence of the "text" parameter in the URL
if (currentUrl.searchParams.has("game")) {
// Set the text of the element to the value of the "text" parameter
textElement.src = currentUrl.searchParams.get("game");
}
console.log(currentUrl.searchParams.get("game"))
</script>
</html>