-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
267 lines (230 loc) · 7.05 KB
/
index.html
File metadata and controls
267 lines (230 loc) · 7.05 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infinitely Repeating Minecraft Seeds</title>
<style>
:root {
--bg-color: #ffffff;
--container-color: #f0f0f0;
--text-color: #000000;
--input-bg: #ffffff;
--highlight: #007bff;
--error-color: red;
}
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
transition: background-color 0.3s, color 0.3s;
}
.container {
background-color: var(--container-color);
max-width: 600px;
margin: 2rem auto;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
margin-top: 0;
text-align: center;
}
label {
display: block;
margin-top: 1rem;
font-weight: bold;
}
input, select, button {
width: 100%;
padding: 0.5rem;
margin-top: 0.5rem;
border-radius: 5px;
border: 1px solid #ccc;
background-color: var(--input-bg);
color: var(--text-color);
}
button {
background-color: var(--highlight);
color: white;
font-weight: bold;
cursor: pointer;
}
#results {
margin-top: 1.5rem;
white-space: pre-wrap;
word-wrap: break-word;
}
.error {
color: var(--error-color);
font-weight: bold;
}
.copy-btn {
margin-top: 1rem;
background-color: #28a745;
color: white;
font-weight: bold;
border: none;
padding: 0.5rem 1rem;
cursor: pointer;
border-radius: 5px;
}
.palette-bar {
text-align: center;
margin: 1rem auto;
}
#paletteSelect {
width: 200px;
padding: 0.5rem;
}
body.dark {
--bg-color: #262626;
--container-color: #3b3b3b;
--text-color: #f0f0f0;
--input-bg: #3b3b3b;
--highlight: #00c8ff;
}
body.night {
--bg-color: #0e1a2b;
--container-color: #1a2d3f;
--text-color: #e0f0ff;
--input-bg: #223344;
--highlight: #4fc3f7;
}
body.green {
--bg-color: #0f1e14;
--container-color: #1b2e20;
--text-color: #d0f0d0;
--input-bg: #223322;
--highlight: #34d27e;
}
body.midnight {
--bg-color: #000000;
--container-color: #111111;
--text-color: #eeeeee;
--input-bg: #1a1a1a;
--highlight: #0057ff;
}
body.sunshine {
--bg-color: #fff7e6;
--container-color: #fff3cc;
--text-color: #5c3d00;
--input-bg: #fff1b3;
--highlight: #ff9900;
}
body.crimson {
--bg-color: #2b0000;
--container-color: #3a0d0d;
--text-color: #ffe6e6;
--input-bg: #4d0d0d;
--highlight: #ff4d4d;
}
body.vibrant {
--bg-color: #fff0fb;
--container-color: #f7d0ff;
--text-color: #4a004f;
--input-bg: #ffe6f7;
--highlight: #cc00cc;
}
</style>
</head>
<body class="light">
<div class="container">
<h1>Infinitely Repeating Minecraft Seeds for 1.18+</h1>
<label for="edition">Minecraft Edition:</label>
<select id="edition" onchange="updateOptions()">
<option value="bedrock">Bedrock</option>
<option value="java">Java</option>
</select>
<label for="pattern">Repeating Pattern:</label>
<select id="pattern">
<option value="diagonal">Diagonally Repeating Decorations (Bedrock)</option>
<option value="vertical">Vertically Repeating Mineshafts</option>
<option value="horizontal">Horizontally Repeating Mineshafts (Java)</option>
</select>
<label for="amount">Number of Seeds (1-10000):</label>
<input type="number" id="amount" min="1" max="10000" value="10" />
<button onclick="generateSeeds()">Generate Seeds</button>
<div id="results"></div>
<button class="copy-btn" onclick="copySeeds()">Copy Seeds</button>
</div>
<div class="palette-bar">
<label for="paletteSelect">Theme:</label><br>
<select id="paletteSelect" onchange="applyPalette()">
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="sunshine">Sunshine</option>
<option value="midnight">Midnight</option>
<option value="vibrant">Vibrant Violet</option>
<option value="green">Neon Green</option>
<option value="night">Night Sky</option>
<option value="crimson">Crimson Red</option>
</select>
</div>
<div style="text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-color);">
Created by <a href="https://github.com/YourLocalKnight" target="_blank" style="color: var(--highlight); text-decoration: none; font-weight: bold;">YourLocalKnight</a>
</div>
<script>
function updateOptions() {
const edition = document.getElementById("edition").value;
const pattern = document.getElementById("pattern");
pattern.querySelectorAll("option").forEach(option => {
option.disabled = false;
});
if (edition === "bedrock") {
pattern.querySelector("option[value='horizontal']").disabled = true;
} else {
pattern.querySelector("option[value='diagonal']").disabled = true;
}
}
function generateSeeds() {
const edition = document.getElementById("edition").value;
const pattern = document.getElementById("pattern").value;
const amount = parseInt(document.getElementById("amount").value, 10);
const resultsDiv = document.getElementById("results");
resultsDiv.innerHTML = "";
if (amount < 1 || amount > 10000) {
resultsDiv.innerHTML = '<div class="error">Error: the number of desired seeds exceeds the limit (1-10000)</div>';
return;
}
const seeds = [];
if (edition === "bedrock") {
const baseSeed = pattern === "diagonal" ? 1669320484 : 1000686894;
const nMin = -2147483647;
const nMax = 2147483647;
for (let i = 0; i < amount; i++) {
const n = Math.floor(Math.random() * (nMax - nMin + 1)) + nMin;
const seed = BigInt(2 ** 32) * BigInt(n) + BigInt(baseSeed);
seeds.push(seed.toString());
}
} else {
const baseSeed = 164311266871034n;
const mod = 2n ** 48n;
const nMin = -32768;
const nMax = 32768;
for (let i = 0; i < amount; i++) {
const n = BigInt(Math.floor(Math.random() * (nMax - nMin + 1)) + nMin);
const seed = mod * n + baseSeed;
seeds.push(seed.toString());
}
}
resultsDiv.textContent = seeds.join("\n");
}
function copySeeds() {
const results = document.getElementById("results").textContent;
navigator.clipboard.writeText(results).then(() => {
alert("Successfully copied!");
});
}
// Needs adjustment for user interface update
function applyPalette() {
const selected = document.getElementById("paletteSelect").value;
document.body.className = selected;
}
updateOptions();
</script>
</body>
</html>