2023-12-23 16:23:33 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8"/>
|
|
|
|
<title>Inhabitor - The Habitat Inspector</title>
|
2023-12-24 04:14:34 +00:00
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
margin:40px auto;
|
|
|
|
line-height:1.6;
|
|
|
|
font-size:18px;
|
|
|
|
color:#444;
|
|
|
|
padding:0 10px
|
|
|
|
}
|
|
|
|
h1,h2,h3 {
|
|
|
|
line-height:1.2
|
|
|
|
}
|
|
|
|
</style>
|
2023-12-28 21:10:00 +00:00
|
|
|
<script src="index.js?v=1"></script>
|
2023-12-23 16:23:33 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1 id="filename"></h1>
|
2023-12-25 23:46:04 +00:00
|
|
|
<div id="animations">
|
|
|
|
<h2>Animations</h2>
|
|
|
|
</div>
|
2023-12-23 16:23:33 +00:00
|
|
|
<div id="states">
|
|
|
|
<h2>States</h1>
|
|
|
|
</div>
|
|
|
|
<div id="cels">
|
|
|
|
<h2>Cels</h1>
|
|
|
|
</div>
|
|
|
|
<div id="data">
|
|
|
|
<h2>Data</h1>
|
|
|
|
</div>
|
|
|
|
<div id="errors"></div>
|
2023-12-24 04:14:34 +00:00
|
|
|
<a href="index.html">Back</a>
|
2023-12-23 16:23:33 +00:00
|
|
|
<script>
|
2023-12-23 16:30:07 +00:00
|
|
|
const propFilter = (key, value) => {
|
|
|
|
if (key != "bitmap" && key != "data" && key != "canvas") {
|
|
|
|
return value
|
|
|
|
}
|
|
|
|
}
|
2023-12-23 16:23:33 +00:00
|
|
|
const dumpProp = (prop, container) => {
|
2023-12-23 16:30:07 +00:00
|
|
|
container.appendChild(textNode(JSON.stringify(prop, propFilter, 2), "pre"))
|
2023-12-23 16:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const onload = async () => {
|
|
|
|
const q = new URLSearchParams(window.location.search)
|
|
|
|
const filename = q.get("f")
|
|
|
|
document.getElementById("filename").innerText = filename
|
|
|
|
try {
|
2023-12-28 21:10:00 +00:00
|
|
|
const prop = await decodeBinary(filename, PropImpl)
|
2023-12-23 16:23:33 +00:00
|
|
|
dumpProp(prop, document.getElementById("data"))
|
2023-12-24 20:41:05 +00:00
|
|
|
if (prop.error) {
|
|
|
|
showError(prop.error, filename)
|
|
|
|
} else {
|
2023-12-28 21:10:00 +00:00
|
|
|
showAnimations(prop, document.getElementById("animations"), PropImpl)
|
2023-12-24 20:41:05 +00:00
|
|
|
showStates(prop, document.getElementById("states"))
|
|
|
|
showCels(prop, document.getElementById("cels"))
|
|
|
|
}
|
2023-12-23 16:23:33 +00:00
|
|
|
} catch (e) {
|
|
|
|
showError(e, filename)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onload()
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|