Spaces:
Paused
Paused
F2: popup fits viewport when studios grow (image/music results)
Browse files- app.js +1 -1
- index.html +2 -2
- style.css +1 -0
app.js
CHANGED
|
@@ -121,7 +121,7 @@ const labels = STUDIOS.map((s, i) => { const d = document.createElement('div');
|
|
| 121 |
d.onkeydown = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); select(i); open(i); } }; d.onfocus = () => select(i);
|
| 122 |
d.onmouseenter = () => select(i); d.onclick = (e) => { e.stopPropagation(); select(i); open(i); }; $('#labels').append(d); return d; });
|
| 123 |
function select(i) { if (i == null) return; if (sel !== i) beep(660, .03); sel = i; labels.forEach((l, k) => l.classList.toggle('sel', k === i)); }
|
| 124 |
-
const pop = $('#pop');
|
| 125 |
function open(i) {
|
| 126 |
stopLoops(); openId = i; const s = STUDIOS[i]; beep(990, .08, 'triangle');
|
| 127 |
pop.innerHTML = `<div class="ph"><span class="pi">${icon(s.id)}</span><span class="pt"><b>${s.name}</b><small>${s.cat === '+' ? 'Modul' : s.cat} · ${s.like}</small></span><button aria-label="schließen">${icon('close')}</button></div><div class="pb"></div><div class="pf"><span>STUDIO ${String(i + 1).padStart(2, '0')}/${STUDIOS.length}</span><span>● SIMULATION</span></div>`;
|
|
|
|
| 121 |
d.onkeydown = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); select(i); open(i); } }; d.onfocus = () => select(i);
|
| 122 |
d.onmouseenter = () => select(i); d.onclick = (e) => { e.stopPropagation(); select(i); open(i); }; $('#labels').append(d); return d; });
|
| 123 |
function select(i) { if (i == null) return; if (sel !== i) beep(660, .03); sel = i; labels.forEach((l, k) => l.classList.toggle('sel', k === i)); }
|
| 124 |
+
const pop = $('#pop'); if (window.ResizeObserver) new ResizeObserver(() => placePop()).observe(pop);
|
| 125 |
function open(i) {
|
| 126 |
stopLoops(); openId = i; const s = STUDIOS[i]; beep(990, .08, 'triangle');
|
| 127 |
pop.innerHTML = `<div class="ph"><span class="pi">${icon(s.id)}</span><span class="pt"><b>${s.name}</b><small>${s.cat === '+' ? 'Modul' : s.cat} · ${s.like}</small></span><button aria-label="schließen">${icon('close')}</button></div><div class="pb"></div><div class="pf"><span>STUDIO ${String(i + 1).padStart(2, '0')}/${STUDIOS.length}</span><span>● SIMULATION</span></div>`;
|
index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<title>STUDIUS · DAS Studio — Einswarm</title>
|
| 9 |
<link rel="icon" href="assets/einswarm-mascot.webp">
|
| 10 |
<link rel="preload" href="fonts/outfit-latin-wght.woff2" as="font" type="font/woff2" crossorigin>
|
| 11 |
-
<link rel="stylesheet" href="style.css?v=
|
| 12 |
</head>
|
| 13 |
<body>
|
| 14 |
<canvas id="gl"></canvas>
|
|
@@ -49,6 +49,6 @@
|
|
| 49 |
|
| 50 |
<a id="bmc" href="https://www.buymeacoffee.com/2btainment" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
|
| 51 |
<noscript><p style="color:#f2c94c;padding:2em">STUDIUS braucht JavaScript.</p></noscript>
|
| 52 |
-
<script type="module" src="app.js?v=
|
| 53 |
</body>
|
| 54 |
</html>
|
|
|
|
| 8 |
<title>STUDIUS · DAS Studio — Einswarm</title>
|
| 9 |
<link rel="icon" href="assets/einswarm-mascot.webp">
|
| 10 |
<link rel="preload" href="fonts/outfit-latin-wght.woff2" as="font" type="font/woff2" crossorigin>
|
| 11 |
+
<link rel="stylesheet" href="style.css?v=41">
|
| 12 |
</head>
|
| 13 |
<body>
|
| 14 |
<canvas id="gl"></canvas>
|
|
|
|
| 49 |
|
| 50 |
<a id="bmc" href="https://www.buymeacoffee.com/2btainment" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
|
| 51 |
<noscript><p style="color:#f2c94c;padding:2em">STUDIUS braucht JavaScript.</p></noscript>
|
| 52 |
+
<script type="module" src="app.js?v=41"></script>
|
| 53 |
</body>
|
| 54 |
</html>
|
style.css
CHANGED
|
@@ -181,3 +181,4 @@ kbd{font:inherit;font-size:9px;color:var(--gold);border:1px solid var(--line);pa
|
|
| 181 |
#pop iframe{width:100%;height:150px;border:1px solid rgba(242,201,76,.2);background:#fff;margin-top:6px}
|
| 182 |
#pop .chat{max-height:200px;overflow:auto}
|
| 183 |
#pop a.btn{text-decoration:none;display:inline-block}
|
|
|
|
|
|
| 181 |
#pop iframe{width:100%;height:150px;border:1px solid rgba(242,201,76,.2);background:#fff;margin-top:6px}
|
| 182 |
#pop .chat{max-height:200px;overflow:auto}
|
| 183 |
#pop a.btn{text-decoration:none;display:inline-block}
|
| 184 |
+
@media (min-width:700px){#pop{max-height:calc(100vh - 96px);overflow-y:auto;overscroll-behavior:contain}}
|