-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
114 lines (106 loc) · 4.05 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<style>
canvas {
width: min(calc(100vh * (9 / 16)), 100vw);
max-width: 100%;
max-height: 100%;
height: auto;
aspect-ratio: 9/16;
display: block;
}
#modal {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
display: flex;
justify-content: center;
align-items: center;
visibility: hidden; /* Initially hidden */
z-index: 1;
}
</style>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity Web Player | proto</title>
<script>
const host = "https://petpop-internal.9c.gg";
// const host = "https://397e-222-101-38-84.ngrok-free.app";
</script>
<!-- <script src="https://telegram.org/js/telegram-web-app.js"></script>-->
<script>
let token;
// Move pages
// const movePage = (pageName) => {
// window.open(`${host}/${pageName}#${token}`);
// };
</script>
<!-- <script src="telegram.js"></script>-->
<script type="module" crossorigin src="./assets/index-BHMSFCJA.js"></script>
<link rel="modulepreload" crossorigin href="./assets/modulepreload-polyfill-B5Qt9EMX.js">
<link rel="stylesheet" crossorigin href="./assets/index-ByyJpuhe.css">
</head>
<body style="text-align: center; padding: 0; border: 0; margin: 0;">
<div id="modal" class="modal">
<!-- <div id="login-button" style="display: none"></div>-->
<!-- <script async src="https://telegram.org/js/telegram-widget.js?7"-->
<!-- data-telegram-login="new9cproto_bot"-->
<!-- data-size="medium"-->
<!-- data-userpic="false"-->
<!-- data-onauth="onTelegramLogin(user)"></script>-->
<div id="line-login" onclick="lineAuth()">
<div class="logo">
</div>
<div class="text">Log in with LINE</div>
</div>
</div>
<canvas id="unity-canvas" tabindex="-1" style="background: linear-gradient(to bottom, #1aa698, #EBE3CD)"></canvas>
<script src="Build/Build.loader.js"></script>
<script>
function initUnity() {
createUnityInstance(document.querySelector("#unity-canvas"), {
arguments: [],
dataUrl: "Build/public.data",
frameworkUrl: "Build/public.framework.js",
codeUrl: "Build/public.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "pl",
productName: "proto",
productVersion: "1.0",
// matchWebGLToCanvasSize: false, // Uncomment this to separately control WebGL canvas render size and DOM element size.
// devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
}).then(instance => {
lineLogin(instance);
});
}
window.addEventListener('load', () => {
// initLineDapp();
// Unity Game
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
var canvas = document.querySelector("#unity-canvas");
canvas.style.width = "100%";
canvas.style.height = "100%";
canvas.style.position = "fixed";
document.body.style.textAlign = "left";
}
// if (checkTelegramData()) {
// initUnity();
// }
checkLineData().then(result => {
if (result === true) {
initUnity();
}
});
});
</script>
</body>
</html>