-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.html
389 lines (377 loc) · 18.6 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
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="" />
<meta name="author" content="" />
<title>DK64 Randomizer</title>
<link href="./static/img/dk.png" rel="icon" />
<script src="https://use.fontawesome.com/releases/v5.15.4/js/all.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"
rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i"
rel="stylesheet"/>
<link href="static/styles/styles.css" rel="stylesheet" />
<link href="./static/styles/gui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
</head>
<body id="page-top">
<nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top">
<div class="container px-5">
<a class="navbar-brand" href="#page-top">DK64 Randomizer</a>
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarResponsive"
aria-controls="navbarResponsive"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="./">Overview</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="./wiki/Consoles-and-Emulators.html">Setup</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="./wiki/home.html">Wiki</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="https://discord.dk64randomizer.com"
target="_blank">Discord</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead text-center text-white">
<div class="masthead-content">
<div class="container px-5">
<img src="/base-hack/assets/DKTV/logo.png" width="50%">
<p style="font-weight: bold; font-size: 48px;" id="version">Version {{ version }}</p>
<a class="btn btn-success btn-xl rounded-pill mt-5" href="./randomizer.html">Play Now</a>
<a class="btn btn-info btn-xl rounded-pill mt-5" href="#overview">More Info</a>
</div>
</div>
</header>
<div class="card">
<section id="overview">
<div class="container px-5">
<div class="row gx-5 align-items-center">
<div class="col-lg-6 order-lg-2">
<br />
<iframe width="100%"
height="315"
src="https://www.youtube.com/embed/6_aW-iVbDiM"
data-toggle="tooltip"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>
<div class="col-lg-6 order-lg-1">
<div class="p-5">
<h2 class="display-6">What is DK64 Randomizer?</h2>
<p>
Experience DK64 like you never have before! Change up where
the loading zones take you, where moves are purchased and even
the difficulty of the game! Built-in game logic ensures every
generated game is beatable and every item is reachable. <!--Check
out the video for an introduction to DK64 Randomizer along
with the full features list!--> Check out the video for an
introduction to the new features within DK64 Randomizer Version
3.0 brought to you by some of the developers.
</p>
</div>
</div>
</div>
</div>
</section>
<section id="compatibility">
<div class="container px-5">
<div class="row gx-5 align-items-center">
<div class="col-lg-6 order-lg-2">
<div class="p-5">
<h2 class="display-6">Feature List</h2>
<p>
DK64 Randomizer features tons of features that change up the
game! A few of the features include:
</p>
<ul>
<li>Loading Zone Randomizer</li>
<li>Kong Starter and Location Randomizer</li>
<li>Move and Shop Price Randomizer</li>
<li>Bonus Barrel Game Randomizer</li>
<li>Enemy Randomizer</li>
<li>B Locker and Troff n Scoff Amount Randomizer</li>
<li>Difficulty Modifiers</li>
</ul>
<p>And much more!</p>
<a class="btn btn-success rounded-pill"
href="./wiki/Feature-List.html">Full Feature List</a
>
</div>
</div>
<div class="col-lg-6 order-lg-1">
<div class="p-5">
<h2 class="display-6">Compatibility</h2>
<p>
The NTSC-U version of the game (the US release) is the
compatible DK64 version for DK64 Randomizer. The NTSC-J
(Japan) and PAL (Europe) versions of the game are
incompatible. The following are the supported platforms:
</p>
<ul>
<li>Most Nintendo 64 Flashcarts</li>
<li>Wii U VC inject</li>
<li>Bizhawk DK64 Fork</li>
<li>Project 64 Version 3.0 or above</li>
</ul>
<p>
Other platforms may be compatible but are not supported at
this time. Check out the video for setting up DK64 Randomizer.
</p>
<a class="btn btn-success rounded-pill"
href="./wiki/Consoles-and-Emulators.html">Wiki Version of Setup</a
>
</div>
</div>
</div>
</div>
</section>
<section id="community">
<div class="container px-5">
<div class="row gx-5 align-items-center">
<div class="col-lg-6 order-lg-2">
<div class="p-5">
<h2 class="display-6">Development</h2>
<p>
Interested in contributing various features to DK64
randomizer? Want to run DK64 randomizer locally? Just want to
check out the inner workings? The DK64 Randomizer project is
open source and is available for view on Github!
</p>
<a class="btn btn-success rounded-pill"
href="https://github.com/2dos/DK64-Randomizer">View on Github</a
>
</div>
</div>
<div class="col-lg-6 order-lg-1">
<div class="p-5">
<h2 class="display-6">
Community
</h2>
<p>
The DK64 Randomizer Discord server is available to talk about
DK64 Randomizer with other players! Share your playthrough,
get help, and talk about strategies and tricks!
</p>
<a class="btn btn-success rounded-pill"
href="https://discord.dk64randomizer.com">Join the Discord</a
>
</div>
</div>
</div>
</div>
</section>
</div>
<footer id="footer">
<div style="display: flex; justify-content: space-between; align-items: center; padding: 20px;">
<!-- Left Section: Statistics -->
<div id="footer-left" style="text-align: center;">
<h3>Statistics</h3>
<p id="total_generated_seeds"><strong>Total Generated Seeds:</strong> 0</p>
<p id="last_seed_generated"><strong>Last Seed Generated:</strong> -1 seconds ago</p>
</div>
<script>
// Update the statistics every 60 seconds by querying the API for the latest data
// if the site is dev.dk64randomizer.com or dk64randomizer.com
if (window.location.hostname == "dev.dk64randomizer.com") {
current_total_url = "https://dev-generate.dk64rando.com/current_total";
}
else if (window.location.hostname == "dk64randomizer.com") {
current_total_url = "https://generate.dk64rando.com/current_total";
}
else {
current_total_url = "http://" + window.location.hostname + ":8000/current_total";
}
function query_stats(){
$.ajax({
url: current_total_url,
type: "GET",
dataType: "json",
success: function (data) {
// we want to parse the last_generated_time to just how long its been since then the format is "2023-12-20 10:40:42.962004"
// We want to tell them X Minutes/Seconds/Days ago
var last_generated_time = data.last_generated_time;
var last_generated_time_utc = new Date(last_generated_time + 'Z');
var now_utc = new Date(Date.now());
var diff = now_utc - last_generated_time_utc;
var seconds = Math.floor(diff / 1000);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var days = Math.floor(hours / 24);
var months = Math.floor(days / 30);
var years = Math.floor(months / 12);
var time_since_generated = "";
if (years > 0) {
time_since_generated = years + " years ago";
}
else if (months > 0) {
time_since_generated = months + " months ago";
}
else if (days > 0) {
time_since_generated = days + " days ago";
}
else if (hours > 0) {
time_since_generated = hours + " hours ago";
}
else if (minutes > 0) {
time_since_generated = minutes + " minutes ago";
}
else if (seconds > 0) {
time_since_generated = seconds + " seconds ago";
}
else {
time_since_generated = "just now";
}
$("#total_generated_seeds").html("<strong>Total Generated Seeds:</strong> " + data.total_seeds);
$("#last_seed_generated").html("<strong>Last Seed Generated:</strong> " + time_since_generated);
}
})
}
setInterval(function () {
query_stats();
}, 60000);
// trigger it once on page load
query_stats();
</script>
<!-- Middle Section: Existing Data -->
<div id="footer-middle" style="text-align: center;">
<a href="https://github.com/2dos/DK64-Randomizer" target="_blank" style="text-decoration: none">
<img src="./static/img/github.png" alt="GitHub" />
</a>
<a href="./wiki/home.html" style="text-decoration: none">
<img src="./static/img/wiki.png" alt="Wiki" />
</a>
<a href="https://discord.dk64randomizer.com" target="_blank" style="text-decoration: none">
<img src="./static/img/discord.png" alt="Discord" />
</a>
<div class="footer-info">
<a id="live-version">DK64 Randomizer | </a>
<a href="https://dev.dk64randomizer.com">Dev Branch</a>
<br />
Randomizer by 2dos and Ballaam | Web Generator by Killklli
<br />
In-game characters, images and logos copyright © 1999-2024 Nintendo or Rareware respectively.
<br />
DK64Randomizer.com does not distribute copyright material.
</div>
</div>
<!-- Right Section: User Data -->
<div id="footer-right" style="text-align: center;">
<h4>Your Most Recent Seed</h4>
<p id="most_recent_seed_id"><strong>Most Recent Seed ID:</strong> None</p>
<p id="most_recent_seed_date"><strong>Most Recent Seed Date:</strong> None</p>
</div>
<script>
function load_old_seeds() {
try {
// If we actually have a file in the DB load it
var seed_db = seeddatabase.result;
var seed_tx = seed_db.transaction("SeedStorage", "readwrite");
var seed_store = seed_tx.objectStore("SeedStorage");
var all_seeds = seed_store.getAll();
all_seeds.onsuccess = function () {
try {
var arrayLength = all_seeds.result.length;
var sorted_array = all_seeds.result;
sorted_array.sort(function (a, b) {
return new Date(b.date) - new Date(a.date);
});
// Write the most recent seed to the UI
document.getElementById("most_recent_seed_id").innerHTML = "<strong>Most Recent Seed ID:</strong> " + sorted_array[0].seed_id;
document.getElementById("most_recent_seed_date").innerHTML = "<strong>Most Recent Seed Date:</strong> " + sorted_array[0].date.toLocaleDateString( undefined, { year: "numeric", month: "short", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit",});
} catch {}
};
} catch {}
}
var indexedDB =
window.indexedDB ||
window.mozIndexedDB ||
window.webkitIndexedDB ||
window.msIndexedDB ||
window.shimIndexedDB;
// Open (or create) the database
var seeddatabase = indexedDB.open("SeedStorage", 1);
seeddatabase.onupgradeneeded = function () {
try {
var seed_db = seeddatabase.result;
seed_db.createObjectStore("SeedStorage", {
keyPath: "id",
});
} catch {}
};
seeddatabase.onsuccess = function () {
load_old_seeds();
};
</script>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
function render_page(page) {
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", page + ".html", false);
xmlhttp.send();
var data = xmlhttp.responseText;
document.documentElement.innerHTML = "";
document.open();
document.write(data);
document.close();
history.pushState({}, "page 1", "randomizer");
}
if (window.location.protocol != 'https:') {
if (location.hostname != "localhost" && location.hostname != "127.0.0.1") {
location.href = location.href.replace("http://", "https://");
}
}
$(function() {
$('[data-toggle="tooltip"]').tooltip({
trigger: 'hover'
})
})
async function fetchVersion(url) {
try {
// Fetch the contents of the file
const response = await fetch(url);
const text = await response.text();
// Regular expression to match the version pattern
const versionPattern = /version\s*=\s*"([0-9]+\.[0-9]+\.[0-9]+)"/;
const match = versionPattern.exec(text);
// Check if the version is found and return it
if (match && match[1]) {
return match[1];
} else {
throw new Error("Version not found in file");
}
} catch (error) {
console.error("Error fetching version:", error);
return null;
}
}
// Example usage
fetchVersion("version.py")
.then(version => document.getElementById("version").innerHTML = "Version " + version)
.catch(error => console.error('Error:', error));
</script>
</body>
</html>