mirror of
https://github.com/neon443/neon443.github.io.git
synced 2026-03-11 15:16:18 +00:00
forgot that 4 of them were git repos :skull
This commit is contained in:
119
games/webEPK/decompile.html
Normal file
119
games/webEPK/decompile.html
Normal file
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>WebEPK</title>
|
||||
<script src="jszip.min.js"></script>
|
||||
<script src="pako_inflate.min.js"></script>
|
||||
<script src="EPKDecompiler.js"></script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
a:not([href]) {
|
||||
display: none;
|
||||
}
|
||||
*, ::file-selector-button {
|
||||
font-family: 'Nunito', sans-serif;
|
||||
}
|
||||
body {
|
||||
background-color: #111111;
|
||||
color: #dddddd;
|
||||
}
|
||||
input[disabled] {
|
||||
opacity: 0.8;
|
||||
}
|
||||
::file-selector-button, progress {
|
||||
background-color: #343434;
|
||||
color: #eeeeee;
|
||||
border: 1px solid #eeeeee;
|
||||
border-radius: 4px;
|
||||
}
|
||||
a, input[type=file] {
|
||||
color: #dddddd;
|
||||
}
|
||||
progress {
|
||||
height: 1em;
|
||||
}
|
||||
progress, ::-webkit-file-upload-button {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
progress[value="0"][max="1"] {
|
||||
display: none;
|
||||
}
|
||||
::-moz-progress-bar {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
::-webkit-progress-value {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
::-webkit-progress-bar {
|
||||
background-color: #343434;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<sub><a href=".">Want to compile one instead?</a></sub>
|
||||
<br>
|
||||
<sub><a href="builder.html">Want to create one instead?</a></sub>
|
||||
<h1>WebEPK</h1>
|
||||
<p>Decompile EPK files in your browser!</p>
|
||||
Select .EPK file: <input type="file" onchange="selectFile(this);" accept=".epk">
|
||||
<br>
|
||||
<progress value="0" max="1"></progress>
|
||||
<a download="my-cool.zip">Download as a ZIP!</a>
|
||||
<script>
|
||||
const downloadLink = document.querySelectorAll('a')[2];
|
||||
const progressBar = document.querySelector('progress');
|
||||
|
||||
function selectFile(fileElem) {
|
||||
downloadLink.removeAttribute('href');
|
||||
fileElem.disabled = true;
|
||||
if (fileElem.files.length > 0) {
|
||||
const epkFile = fileElem.files[0];
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
progressBar.value = 0;
|
||||
progressBar.max = 1;
|
||||
window.decompileEPK()(e.target.result, function() {
|
||||
progressBar.max++;
|
||||
progressBar.value++;
|
||||
}).then(function(fileList) {
|
||||
if (fileList == null) {
|
||||
alert('Invalid EPK!');
|
||||
fileElem.value = '';
|
||||
progressBar.value = 0;
|
||||
progressBar.max = 1;
|
||||
fileElem.removeAttribute('disabled');
|
||||
return;
|
||||
}
|
||||
const zip = new JSZip();
|
||||
progressBar.max = fileList.length;
|
||||
progressBar.value = 0;
|
||||
for (const file of fileList) {
|
||||
progressBar.value++;
|
||||
if (file.type != 'FILE') continue;
|
||||
zip.file(file.name, file.data);
|
||||
}
|
||||
|
||||
zip.generateAsync({type: 'blob'}).then(function(content) {
|
||||
downloadLink.href = window.URL.createObjectURL(content);
|
||||
fileElem.value = '';
|
||||
progressBar.value = 0;
|
||||
progressBar.max = 1;
|
||||
fileElem.removeAttribute('disabled');
|
||||
});
|
||||
});
|
||||
};
|
||||
reader.readAsArrayBuffer(epkFile);
|
||||
} else {
|
||||
fileElem.removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user