Update index.html

This commit is contained in:
Allan Niles 2022-02-23 10:04:46 -07:00 committed by GitHub
parent 958e684943
commit b63ca45924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,11 +2,14 @@
<head>
<title>Emulatorjs | Select Game Rom</title>
<link rel="icon" type="image/png" href="docs/Emulatorjs Logo.png">
<base href="https://allancoding.github.io/emulatorjs-allancoding/">
</head>
<body>
<style>
body{
background: #c4bdff;
margin: 0;
padding: 0;
}
.form{
position: absolute;
@ -37,6 +40,9 @@ body{
}
.eimg{
width: 250px;
}
#uploadf, #uploadf1{
display: block;
}
</style>
<script>
@ -48,10 +54,8 @@ width: 250px;
var extension = e.target.files[0].name.split('.').pop()
var gameName = e.target.files[0].name.replaceAll("'", "\\'")
var gameName = gameName.substr(0, gameName.length - extension.length - 1)
e.target.remove()
while(document.body.firstChild) {
document.body.removeChild(document.body.firstChild);
};
e.target.remove();
document.getElementById('uploadf').style.display = "none"; document.getElementById('uploadf1').style.display = "none";
if (['fds', 'nes', 'unif', 'unf'].includes(extension)) {
var core = 'nes';
} else if (['z64'].includes(extension)) {
@ -131,13 +135,13 @@ width: 250px;
}();
};
var a = document.createElement('div');
a.style = "width:640px;height:480px;max-width:100%";
a.style = "width:60%;height:100%;max-width:100%";
var b = document.createElement('div');
b.id = 'game';
a.appendChild(b);
document.body.appendChild(a);
document.getElementById("cont").appendChild(a);
var script = document.createElement('script');
script.innerHTML = "EJS_player = '#game'; EJS_gameName = '" + gameName + "'; EJS_biosUrl = ''; EJS_gameUrl = '" + gameUrl + "'; EJS_core = '" + core + "'; EJS_pathtodata = 'data/'; ";
script.innerHTML = "EJS_player = '#game'; EJS_gameName = '" + gameName + "'; EJS_biosUrl = ''; EJS_gameUrl = '" + gameUrl + "'; EJS_core = '" + core + "'; EJS_pathtodata = 'data/';";
document.body.appendChild(script);
var script = document.createElement('script');
script.src = 'data/loader.js';
@ -145,10 +149,10 @@ width: 250px;
}
})
</script>
<center>
<img class="eimg" src="docs/Emulatorjs Logo.png">
<center id="cont">
<img id="uploadf1" class="eimg" src="docs/Emulatorjs Logo.png">
</center>
<div class="form">
<div id="uploadf" class="form">
<input type="file" id="file">
<b><p>Select Game Rom: Drag your files here or click in this area.</p></b>
</div>