Skip to content

Commit 57d7a5e

Browse files
committed
Complete website overhaul, plus 2 new tool tabs: NBT->PNG and PNG->DAT
1 parent 27fef9e commit 57d7a5e

41 files changed

Lines changed: 4818 additions & 912 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
working-directory: website
2626
steps:
2727
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v4
29+
with:
30+
repository: EvModder/PNG-to-NBT
31+
path: png-to-nbt
2832
- uses: actions/setup-node@v4
2933
with:
3034
node-version: '20'
@@ -35,6 +39,7 @@ jobs:
3539
restore-keys: |
3640
${{ runner.os }}-npm-
3741
- run: npm install
42+
- run: npm run sync:map-colors -- ../png-to-nbt/website/src/data/mapColors.ts
3843
- run: npm run build
3944
- uses: actions/upload-pages-artifact@v3
4045
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ replay_*.log
4343
src/main/resources/assets/evmod/*.png
4444
tmp_workstuff/
4545
hashcode_*
46+
website/node_modules/
47+
website/dist/
48+
website/dist-check/

website/index.html

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,55 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Map Hasher</title>
7-
<meta name="description" content="Minecraft map tools — convert .dat and .cache files to PNG, extract map hashes" />
8-
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
6+
<title>EvMod Tools</title>
7+
<meta name="description" content="Minecraft map tools — convert .dat/.cache/.nbt/.litematic/.schem files and extract map hashes" />
8+
<link rel="icon" href="%BASE_URL%favicon.png" type="image/png" />
99

10-
<meta property="og:title" content="Map Hash Extractor" />
11-
<meta property="og:description" content="Extract map hashes from binary files and PNG images" />
10+
<meta property="og:title" content="EvMod Tools" />
11+
<meta property="og:description" content="Convert map-related files and extract map hashes" />
1212
<meta property="og:type" content="website" />
1313
<!-- GitHub Pages SPA redirect restore -->
1414
<script type="text/javascript">
1515
(function(l) {
16+
var configuredBase = "%BASE_URL%";
17+
var base = configuredBase.endsWith("/") ? configuredBase : configuredBase + "/";
18+
var baseNoSlash = base === "/" ? "/" : base.slice(0, -1);
19+
var hasAppBase = base === "/" || l.pathname === baseNoSlash || l.pathname.startsWith(base);
20+
var needsTrailingSlash = function(pathname) {
21+
var q = pathname.indexOf("?");
22+
var pathOnly = q < 0 ? pathname : pathname.slice(0, q);
23+
if (pathOnly.endsWith("/")) return false;
24+
var last = pathOnly.split("/").pop() || "";
25+
return last.indexOf(".") < 0;
26+
};
27+
var withSlash = function(pathname) {
28+
var q = pathname.indexOf("?");
29+
if (q < 0) return pathname.endsWith("/") ? pathname : pathname + "/";
30+
var pathOnly = pathname.slice(0, q);
31+
var query = pathname.slice(q);
32+
return (pathOnly.endsWith("/") ? pathOnly : pathOnly + "/") + query;
33+
};
34+
35+
if (configuredBase !== "/" && l.pathname === baseNoSlash) {
36+
l.replace(base + l.search + l.hash);
37+
return;
38+
}
39+
1640
if (l.search[1] === '/') {
1741
var decoded = l.search.slice(1).split('&').map(function(s) {
1842
return s.replace(/~and~/g, '&')
1943
}).join('?');
44+
var basePath = l.pathname.endsWith("/") ? l.pathname.slice(0, -1) : l.pathname;
45+
var restored = basePath + decoded;
46+
if (hasAppBase && needsTrailingSlash(restored)) restored = withSlash(restored);
2047
window.history.replaceState(null, null,
21-
l.pathname.slice(0, -1) + decoded + l.hash
48+
restored + l.hash
2249
);
50+
return;
51+
}
52+
53+
if (hasAppBase && needsTrailingSlash(l.pathname)) {
54+
l.replace(withSlash(l.pathname) + l.search + l.hash);
2355
}
2456
}(window.location))
2557
</script>

0 commit comments

Comments
 (0)