-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
165 lines (131 loc) · 5.39 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
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
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.cdnfonts.com/css/minecraft-3" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/minecraftia" rel="stylesheet">
<title>uNmINeD</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- OpenLayers CSS -->
<link rel="stylesheet" type="text/css"
href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/css/ol.css"
integrity="sha256-jckPZk66EJrEBQXnJ5QC2bD+GxWPDRVVoMGr5vrMZvM=" crossorigin="anonymous">
<!-- OpenLayers JS -->
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/build/ol.js"
integrity="sha256-77dogUPZ1WVoK9BDF0CxsKnAouX3YzK6n4tIcbDgtFI=" crossorigin="anonymous"></script>
<!-- Map metadata generated by uNmINeD -->
<script type="text/javascript" src="unmined.map.properties.js"></script>
<script type="text/javascript" src="unmined.map.regions.js"></script>
<script type="text/javascript" src="unmined.map.players.js"></script>
<script type="text/javascript">
var UnminedMapProperties2 = UnminedMapProperties
</script>
<!-- Custom markers -->
<script type="text/javascript" src="custom.markers.js"></script>
<!-- uNmINeD JS -->
<script type="text/javascript" src="unmined.openlayers.js"></script>
<style type="text/css">
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
width: 100%;
image-rendering: pixelated;
}
.mouseposition {
background-color: white;
padding: 3px;
text-align: right;
}
.mousepositioncoord {
min-width: 40px;
display: inline-block;
}
div.ol-mouse-position {
background-color: white;
padding: 6px;
border-radius: 3px;
box-shadow: 3px 3px 2px rgba(0, 0, 0, 0.2);
}
#buttons {
bottom: 8px;
top: auto;
}
</style>
<script>
const intervalID = setInterval(myCallback, 500);
function myCallback() {
let elements = document.querySelector(".ol-mouse-position")
let pos = elements.textContent;
pos = pos.split(", ");
let x = Math.round(parseInt(pos[0]) / 8);
let y = Math.round(parseInt(pos[1]) / 8);
console.log(x, y);
document.getElementById("N_Cords").innerHTML = "Nether Cords: " + x + ", " + y;
}
function fish() {
console.log("hi2")
console.log(path)
var observer = new MutationObserver(function (mutations) {
console.log("banana3");
mutations.forEach(function (mutation) {
console.log("banana");
let pos = mutation.target.textContent;
pos = pos.split(", ");
let x = Math.round(parseInt(pos[0]) / 8);
let y = Math.round(parseInt(pos[1]) / 8);
console.log(x, y);
document.getElementById("N_Cords").innerHTML = "Nether Cords: " + x + ", " + y;
});
});
console.log(observer)
var config = { characterData: true, subtree: true, attributes: true };
let elements = document.querySelector(".ol-mouse-position")
console.log(elements)
observer.observe(elements, config);
}
</script>
</head>
<body>
<div id="map"></div>
<div class="ol-mouse-position" id="buttons"><a href="#night mode">Night Mode</a> | <a
href="#portals">nether portal
locations </a> | <a href="#tiles">Normal</a>
<p id="N_Cords" >Nether Cords: </p>
</div>
<script>
var Anchors = document.getElementsByTagName("a");
for (var i = 0; i < Anchors.length; i++) {
console.log("hi")
Anchors[i].addEventListener("click",
function (event) {
console.log("hi")
window.location = this.href;
location.reload()
},
false);
}
</script>
<script type="text/javascript" src="unmined.map.properties.js"></script>
<script type="text/javascript">
document.title = UnminedMapProperties.worldName + " - " + document.title;
if (UnminedCustomMarkers && UnminedCustomMarkers.isEnabled && UnminedCustomMarkers.markers) {
UnminedMapProperties.markers = UnminedMapProperties.markers.concat(UnminedCustomMarkers.markers);
}
let unmined = new Unmined();
if (UnminedPlayers && UnminedPlayers.length > 0) {
UnminedMapProperties.markers = UnminedMapProperties.markers.concat(unmined.createPlayerMarkers(UnminedPlayers));
}
var path = window.location.hash.replace('#', '')
if (path.hash == '') {
path = "tiles"
}
unmined.map('map', UnminedMapProperties, UnminedRegions, path);
</script>
</body>
</html>