55 lines
1.4 KiB
HTML
55 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
}
|
|
iframe {
|
|
margin: 0;
|
|
margin: 10px;
|
|
padding: 0;
|
|
border-width: 5px;
|
|
border-color: rgb(67, 0, 67);
|
|
border-style:groove;
|
|
border-radius: 10%;
|
|
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
|
|
}
|
|
</style>
|
|
<script>
|
|
const params = new URLSearchParams(window.location.search);
|
|
const sketchList = params.get('sketches'); // e.g. liberay.html?sketches=2images.js,calmCircles.js
|
|
const sketchSize = params.get('size'); // e.g. liberay.html?size=500
|
|
if (sketchList) {
|
|
const sketches = sketchList.split(',');
|
|
for (let sketch of sketches) {
|
|
const iframe = document.createElement('iframe');
|
|
iframe.src = `loader.html?sketches=${encodeURIComponent(sketch.trim())}`;
|
|
iframe.onload = () => {
|
|
console.log(`Loaded iframe for ${sketch}`);
|
|
};
|
|
iframe.onerror = () => {
|
|
console.error(`Failed to load iframe for ${sketch}`);
|
|
};
|
|
// Apply size if provided
|
|
if (sketchSize) {
|
|
iframe.style.width = sketchSize + 'px';
|
|
iframe.style.height = sketchSize + 'px';
|
|
} else {
|
|
iframe.style.width = '500px';
|
|
iframe.style.height = '500px';
|
|
}
|
|
document.body.appendChild(iframe);
|
|
}
|
|
} else {
|
|
console.error('No sketches parameter provided');
|
|
}
|
|
</script>
|
|
</html>
|