-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
250 lines (230 loc) · 7.71 KB
/
Copy pathindex.html
File metadata and controls
250 lines (230 loc) · 7.71 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pond MC Map</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
<link href="https://fonts.cdnfonts.com/css/minecraft-3" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/minecraftia" rel="stylesheet">
<style>
:root {
--vh: 1vh;
--header-height: 60px;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
overflow: hidden;
}
.banner {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
box-sizing: border-box;
background-color: #333;
color: white;
padding: 15px;
text-align: center;
transition: 0.3s;
max-height: 20vh;
overflow-y: auto;
}
.banner a {
color: white;
text-decoration: none;
margin: 0 15px;
}
.banner a:hover {
text-decoration: underline;
}
.banner a.active {
font-weight: bold;
text-decoration: underline;
}
#content-wrapper {
position: fixed;
left: 0;
right: 0;
top: var(--header-height);
bottom: 0;
display: inline-block;
width: 100%;
height: calc((var(--vh, 1vh) * 100) - var(--header-height) - env(safe-area-inset-bottom));
}
.iframe-container {
width: 100%;
height: 100%;
border: none;
}
</style>
</head>
<body>
<div style="position: absolute; z-index: 30;" class="alert">
<span class="closebtn" onclick="this.parentElement.style.display='none';">×</span>
<strong>Tip!</strong> You can right click/hold map for settings
</div>
<div class="banner">
<a href="#" onclick="updateIframe(this, './paper_1_21_1_2972731/index_copy.html')" class="active">Overworld</a>
<a href="#" onclick="updateIframe(this, './paper_1_21_1_2972731_nether/index_copy.html')">Nether</a>
<a href="#" onclick="updateIframe(this, './plots251/index_copy.html')">Plots 251</a>
<a href="#" onclick="updateIframe(this, './plots75/index_copy.html')">Plots 75</a>
<p id="N_Cords">Nether Cords: NaN</p>
</div>
<div id="content-wrapper">
<iframe class="iframe-container" id="contentFrame" src="./paper_1_21_1_2972731/index_copy.html"></iframe>
</div>
<script>
function updateIframe(link, src) {
var iframe = document.getElementById('contentFrame');
iframe.src = src;
// Remove active class from all links
var links = document.querySelectorAll('.banner a');
links.forEach(function(link) {
link.classList.remove('active');
});
// Add active class to the clicked link
link.classList.add('active');
setTimeout(Nether, 1000);
}
</script>
<script type="text/javascript">
function altCords(X, Y, src) {
if (src.includes("nether")) {
let x = Math.round(X * 8);
let y = Math.round(Y * 8);
document.getElementById("N_Cords").innerHTML = "Overworld Cords: " + x + ", " + y;
} else if (src.includes("paper_1_21_1_2972731")) {
let x = Math.round(X / 8);
let y = Math.round(Y / 8);
document.getElementById("N_Cords").innerHTML = "Nether Cords: " + x + ", " + y;
} else if (src.includes("plots251")) {
let x = Math.round((X -136 )/ 272+1);
let y = Math.round((Y -136 )/ 272+1);
document.getElementById("N_Cords").innerHTML = "Plot Cords: " + x + ", " + y;
} else if (src.includes("plots75")) {
let x = Math.round((X -40 )/ 80+1);
let y = Math.round((Y -40 )/ 80+1);
document.getElementById("N_Cords").innerHTML = "Plot Cords: " + x + ", " + y;
} else {
document.getElementById("N_Cords").innerHTML = "Nether Cords: N/A";
}
}
Nether()
function Nether() {
const iframe = document.getElementById("contentFrame").contentWindow
const thing = document.getElementById("contentFrame")
iframe.addEventListener("mousemove", (e) => {
let elements = document.getElementById("contentFrame").contentWindow.document.querySelector(".ol-mouse-position")
let pos = elements.textContent;
pos = pos.split(", ");
altCords(parseInt(pos[0]),parseInt(pos[1]),thing.src)
//console.log(x, y);
});
iframe.addEventListener("touchmove", (e) => {
let elements = document.getElementById("contentFrame").contentWindow.document.querySelector(".ol-mouse-position")
let pos = elements.textContent;
pos = pos.split(", ");
altCords(parseInt(pos[0]), parseInt(pos[1]), thing.src)
});
}
// Dynamic viewport height handler for mobile
function setVhAndHeader() {
document.documentElement.style.setProperty('--vh', (window.innerHeight * 0.01) + 'px');
const banner = document.querySelector('.banner');
if (banner) {
document.documentElement.style.setProperty('--header-height', banner.offsetHeight + 'px');
}
}
setVhAndHeader();
window.addEventListener('resize', setVhAndHeader);
window.addEventListener('orientationchange', setVhAndHeader);
</script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: rgb(255, 255, 255);
}
#content-wrapper {
height: 100vh !important;
}
@media screen and (min-width: 480px) {
.banner {
position:absolute;
top: 0.5em;
left: 3em;
padding: 5px 3px;
background-color: rgba(255, 255, 255, .4);
border-radius: 4px;
backdrop-filter: blur(5px) brightness(150%);
width: fit-content;
}
.banner:hover {
background-color: rgba(255, 255, 255, .6);
}
.banner a {
height: 1.375em;
margin: 0;
padding: 3px 0.55em;
line-height: 0.4em;
color: white;
text-decoration: none;
text-align: center;
background-color: rgba(0,60,136,.5);
border: none;
border-radius: 2px;
}
.banner p {
color: rgb(98, 27, 15);
}
.banner a:hover {
background-color: rgba(0,60,136,.7);
}
.banner a.active {
font-weight: bold;
padding: 3px 0.35em;
}
#content-wrapper {
height: calc((var(--vh, 1vh) * 100) - var(--header-height) - env(safe-area-inset-bottom));
top: 0 !important;
}
}
</style>
<style>
.alert {
padding: 20px;
background-color: #2196F3;
color: white;
opacity: 0;
transform: translateY(-100%);
animation: fadeIn 1s;
animation-delay: 30s;
animation-fill-mode: forwards;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;}
.closebtn:hover {
color: black;
}
@keyframes fadeIn {
from {opacity: 0; transform: translateY(-100%);}
to {opacity: 1; transform: translateY(0); }
}
</style>
</body>
</html>