forked from florisweb/projectcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.php
More file actions
177 lines (138 loc) · 5.79 KB
/
map.php
File metadata and controls
177 lines (138 loc) · 5.79 KB
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
<?php
include "PHP/config.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0' name='viewport'/>
<link rel="stylesheet" type="text/css" href="css/main.css?antiCache=4">
<link rel="stylesheet" type="text/css" href="css/chat.css?antiCache=1">
<title><?php echo $CONFIG["server"]["name"] . " | World Map"; ?></title>
</head>
<body style="overflow: hidden;" class="noselect">
<div id="topBar">
<img src="images/homeIcon.svg" class="button" onclick="window.location.replace('index.php')">
<img src="images/menuIcon.png" class="button infoMenuIcon" style="display: none" onclick="InfoMenu.open()">
<div class="shadowBackground"></div>
</div>
<div id="chatHolder" class="hide" onclick="Chat.toggle();">
<div class="shadowHolder"></div>
</div>
<div id="mapHolder">
<?php
$width = (int)abs($CONFIG["world"]["maxX"] - $CONFIG["world"]["minX"]);
$height = (int)abs($CONFIG["world"]["maxZ"] - $CONFIG["world"]["minZ"]);
$world = array(
"x" => (int)$CONFIG["world"]["minX"],
"z" => (int)$CONFIG["world"]["minZ"],
"width" => $width,
"height" => $height
);
echo '<img src="PHP/renderMap.php?world=overworld' .
'&x=' . (int)$CONFIG["world"]["minX"] .
'&z=' . (int)$CONFIG["world"]["minZ"] .
'&width=' . $width .
'&height=' . $height . '" id="mapImage">' .
'<canvas id="mapCanvas" width="' . $width . '" height="' . $height . '"></canvas>';
echo "<script>const World = JSON.parse('" . json_encode($world) . "');</script>";
?>
<div id="chatlog"></div>
</div>
<div class="coordinatesHolder" id="coordinatesHolder">
<span id="current_x">0</span>
<span id="current_z">0</span>
</div>
<div class="buttonHolder" id="dimensionButtonHolder">
<div class="text netherPortalButton" onclick="window.location.replace('nether.php')">
NETHER
</div>
</div>
<!-- InfoMenu html includecode -->
<div id="infoMenu">
<div class="infoMenuPage">
<div class="headerText preventTextOverflow">PROJECTS</div>
<img class="icon" src="images/exitIcon.png" onclick="InfoMenu.close()">
<img class="icon searchIcon" src="images/searchIcon.png" onclick="InfoMenu.search.open()">
<div id="projectListHolder"></div>
</div>
<div class="infoMenuPage hide">
<div class="headerText preventTextOverflow" id="projectPage_titleHolder">PROJECTS</div>
<img class="icon" src="images/exitIcon.png" onclick="InfoMenu.openPageByIndex(0)">
<div class="text" id="projectPage_coordHolder"></div>
<div class="text subHeader"><br>BUILDERS</div>
<div class="text" id="projectPage_builderNames"></div>
<div class="text subHeader"><br>DESCRIPTION</div>
<div class="text" id="projectPage_description"></div>
<br>
<div class="text netherPortalButton">TO THE NETHER</div>
<br>
<div class="text subHeader"><br>MINIMAP</div>
<div class="miniMapHolder">
<img class="miniMapImg">
</div>
<div class="text subHeader"><br>IMAGES</div>
<div id="projectPage_imageHolder"></div>
</div>
<div class="infoMenuPage hide">
<input class="headerText preventTextOverflow searchInput" placeholder="Search">
<img class="icon exitIcon" src="images/exitIcon.png" onclick="InfoMenu.openPageByIndex(0)">
<div id="projectSearchListHolder"></div>
</div>
</div>
<script type="text/javascript" src="https://florisweb.tk/JS/jQuery.js"></script>
<script type="text/javascript" src="https://florisweb.tk/JS/request2.js"></script>
<!-- <script type="text/javascript" src="js/main_min.js?ac=1"></script> -->
<script type="text/javascript" src="js/client.js?ac=1"></script>
<script>
// temperarelly so things don't get cached
let antiCache = Math.random() * 100000000;
$.getScript("js/handyFunctions.js?antiCache=" + antiCache, function() {});
$.getScript("js/chat.js?antiCache=" + antiCache, function() {});
$.getScript("js/map.js?antiCache=" + antiCache, function() {});
$.getScript("js/server.js?antiCache=" + antiCache, function() {});
$.getScript("js/infomenu.js?antiCache=" + antiCache, function() {
setup()
});
</script>
<!-- <script type="text/javascript" src="js/server.js?antiCache=4"></script> -->
<!-- <script type="text/javascript" src="js/infomenu.js?antiCache=2"></script> -->
</body>
</html>
<script>
function executeUrlCommands() {
<?php
$project = $_GET["project"];
$project = explode('"', $project);
$project = implode("", $project);
if (!empty($project))
{
echo "InfoMenu.openProjectPageByTitle(\"" . (string)$project . "\");";
echo "Map.panToItem(Server.getItemByTitle(\"" . (string)$project . "\"));";
}
?>
executeUrlCommands = null;
}
document.body.onload = function() {
setup();
}
var Server;
var Map;
var InfoMenu;
var Client;
function setup() {
Server = new _server();
Map = new _map();
InfoMenu = new _InfoMenu_mapJsExtender();
Client = new _client();
Map.onItemClick = function(_item) {InfoMenu.openProjectPageByTitle(_item.title)}
InfoMenu.onItemClick = function(_item) {Map.panToItem(_item)}
Server.getData("uploads/data.txt").then(function (_data) {
InfoMenu.createItemsByList(_data);
Map.init(_data, 1);
if (executeUrlCommands) executeUrlCommands();
});
// Server.getData("api/updaterlog.txt").then(function(_data) {
// Client.init(_data);
// });
}
</script>