16
loader.html
16
loader.html
@@ -7,11 +7,25 @@
|
||||
<script id="sketch"></script>
|
||||
<script>
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const sketchName = "sketches/" + params.get('sketch');
|
||||
let sketchName = "sketches/" + params.get('sketch');
|
||||
if (sketchName == "sketches/") {
|
||||
sketchName = "sketches/" + params.get('sketches');
|
||||
}
|
||||
if (sketchName) {
|
||||
console.log(sketchName+" found");
|
||||
if (!sketchName.endsWith('.js')) {
|
||||
sketchName += '.js';
|
||||
}
|
||||
|
||||
const script = document.getElementById('sketch');
|
||||
script.src = sketchName;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
Reference in New Issue
Block a user