31 lines
737 B
HTML
31 lines
737 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<script src="js/p5.js"></script>
|
|
</head>
|
|
<body style="background-color: beige; margin: 0;">
|
|
<script id="sketch"></script>
|
|
<script>
|
|
const params = new URLSearchParams(window.location.search);
|
|
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> |