-
Notifications
You must be signed in to change notification settings - Fork 239
/
old-save.html
44 lines (41 loc) · 1.84 KB
/
old-save.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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Old Antimatter Dimensions saves</title>
</head>
<body>
<div>Save 1:</div>
<textarea id="save-1"></textarea>
<button style="display: block" onclick="copySave(1)">Copy Save 1</button>
<div>Save 2:</div>
<textarea id="save-2"></textarea>
<button style="display: block" onclick="copySave(2)">Copy Save 2</button>
<div>Save 3:</div>
<textarea id="save-3"></textarea>
<button style="display: block" onclick="copySave(3)">Copy Save 3</button>
<script>
var rawSave = localStorage.getItem("dimensionSave");
if (rawSave !== null && !rawSave.startsWith("AntimatterDimensionsSavefile")) {
var fullSave = JSON.parse(atob(rawSave), function(k, v) { return (v === Infinity) ? "Infinity" : v; });
document.getElementById("save-1").textContent = btoa(JSON.stringify(fullSave.saves[0]));
document.getElementById("save-2").textContent = btoa(JSON.stringify(fullSave.saves[1]));
document.getElementById("save-3").textContent = btoa(JSON.stringify(fullSave.saves[2]));
}
else {
document.getElementById("save-1").textContent = "No save!";
document.getElementById("save-2").textContent = "No save!";
document.getElementById("save-3").textContent = "No save!";
}
function copySave(id) {
var copyText = document.getElementById("save-" + id);
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
}
</script>
</body>
</html>