forked from moddio/taro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ejs
151 lines (125 loc) · 5.84 KB
/
index.ejs
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
<html>
<head>
<title>Taro</title>
<meta name="description" content="A multiplayer HTML5 game engine">
<meta name="keywords" content="modd.io, taro, multiplayer">
<!-- OpenGraph Metadata -->
<meta property="og:title" content="Taro">
<meta property="og:description" content="A multiplayer HTML5 game engine">
<!-- Icon -->
<link rel="icon" href="/assets/images/favicon.png" size="64">
<!-- CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css">
<link rel="stylesheet" href="/assets/css/common.css">
<!-- jQuery -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-contextmenu@2.9.2/dist/jquery.contextMenu.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-contextmenu@2.9.2/dist/jquery.ui.position.min.js"></script>
<!-- Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js"></script>
<!-- LZ-String -->
<script src="https://cdn.jsdelivr.net/npm/lz-string@1.4.4/libs/lz-string.min.js"></script>
<!-- Lodash -->
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
<!-- Sweet Alert -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.16.6/sweetalert2.min.js"></script>
<!-- Pixi.JS -->
<script src="https://cdn.jsdelivr.net/npm/pixi.js-legacy@6.0.4/dist/browser/pixi-legacy.min.js"></script>
<!-- Game Variables -->
<script>
var mode = 'play';
var gameId = '<%= gameId %>';
var userId = '';
var isLoggedIn = false;
window.joinGameSent = {};
function loadJS(file) {
// DOM: Create the script element
var jsElm = document.createElement('script');
// set the type attribute
jsElm.type = 'application/javascript';
// make the script element load file
jsElm.src = file;
// finally insert the element to the body element in order to load the script
document.body.appendChild(jsElm);
}
</script>
</head>
<body>
<div id="game-div" style="overflow: hidden">
<%- include('templates/dev-console'); -%>
<%- include('templates/menu'); -%>
<%- include('templates/shop'); -%>
<%- include('templates/gui'); -%>
<%- include('templates/chat'); -%>
<%- include('templates/inventory'); -%>
<%- include('templates/dialogue'); -%>
<%- include('templates/trade'); -%>
</div>
<%- include('templates/videochat.ejs'); -%>
<div class="modal fade" tabindex="-1" id="server-disconnect-modal" role="dialog" style=" top: 15%">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header d-flex hide-on-mobile">
<h5 class="modal-title">Connection Lost</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Lost connection to the game server. Please refresh this page or visit our homepage.
</div>
</div>
</div>
<!-- load engine -->
<script type="text/javascript">
var igeRoot = './engine/';
window.isStandalone = true;
gameStarted = false;
</script>
<script>
(function ($) {
$.fn.writeText = function (content, duration, callback) {
content = content || '';
var contentArray = content.split(''),
current = 0,
elem = this;
if (isNaN(duration)) {
duration = 20;
}
if (duration <= 0) {
elem.html(content);
callback();
return;
}
var handle = setInterval(function () {
if (current < contentArray.length) {
var text = elem.html();
var newText = contentArray[current];
if (newText === '<' && /\w/.test(contentArray[current + 1])) {
do {
current++;
var nextChar = contentArray[current];
newText += nextChar;
} while (nextChar !== '>');
}
elem.html(text + newText);
current++;
} else {
clearInterval(handle);
callback();
}
}, duration);
return handle;
};
})(jQuery);
</script>
<!-- below loads all uncompiled game files (your source code changes will reflect) -->
<script type="text/javascript" src="/engine/loader.js"></script>
<!-- below loads the compiled game file (much faster, your source code changes won't reflect until you compile again)-->
<!-- <script type="text/javascript" src="./src/game.js"></script> -->
</body>
</html>