[iframe-fractal]: added
This commit is contained in:
parent
571c5ec85e
commit
62ee04d884
8
docs/iframe-fractal/README.md
Normal file
8
docs/iframe-fractal/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# iframe-fractal
|
||||
|
||||
Quick 5-minute experiment where I made a menger sponge using nested iframes.
|
||||
Based on [this code](https://github.com/bryanbraun/infinitely-nested-iframes).
|
||||
|
||||
Click [here](https://dogeystamp.github.io/garbage-monorepo/iframe-fractal/) for a demo.
|
||||
|
||||
![preview](https://raw.githubusercontent.com/dogeystamp/garbage-monorepo/main/docs/iframe-fractal/preview.png)
|
52
docs/iframe-fractal/index.html
Normal file
52
docs/iframe-fractal/index.html
Normal file
@ -0,0 +1,52 @@
|
||||
<head>
|
||||
<style>
|
||||
body, html {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
grid-template-columns: 33vmin 33vmin 33vmin;
|
||||
grid-template-rows: 33vmin 33vmin 33vmin;
|
||||
grid-template-areas:
|
||||
"x1 x2 x3"
|
||||
"x4 oo x5"
|
||||
"x6 x7 x8";
|
||||
}
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
div {
|
||||
background: #444444;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<iframe style="grid-area: x1"></iframe>
|
||||
<iframe style="grid-area: x2"></iframe>
|
||||
<iframe style="grid-area: x3"></iframe>
|
||||
<iframe style="grid-area: x4"></iframe>
|
||||
<iframe style="grid-area: x5"></iframe>
|
||||
<iframe style="grid-area: x6"></iframe>
|
||||
<iframe style="grid-area: x7"></iframe>
|
||||
<iframe style="grid-area: x8"></iframe>
|
||||
<div style="grid-area: oo"></div>
|
||||
|
||||
<script>
|
||||
function func() {
|
||||
for (const iframeEl of document.querySelectorAll('iframe')) {
|
||||
const nextQueryValue = !location.search ? 1 :
|
||||
Number(location.search.split("?").pop()) + 1;
|
||||
|
||||
if (Number(location.search.split("?").pop()) > 3) {
|
||||
return
|
||||
}
|
||||
|
||||
iframeEl.src = `index.html?${nextQueryValue}`;
|
||||
}
|
||||
}
|
||||
func()
|
||||
</script>
|
BIN
docs/iframe-fractal/preview.png
Normal file
BIN
docs/iframe-fractal/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user