1
0

Fix blank page: CSS height fix + error handling

This commit is contained in:
avi
2026-05-18 14:16:16 -05:00
parent ada21474a4
commit ccea0c96d6
3 changed files with 48 additions and 34 deletions

BIN
apk.apk

Binary file not shown.

View File

@@ -5,8 +5,9 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<title>Signal Elsewhere</title>
<style>
html,body{height:100%;width:100%;margin:0;padding:0}
*{margin:0;padding:0;box-sizing:border-box}
body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#0f0;width:100vw;height:100dvh}
body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#0f0;min-height:100vh}
#matrixCanvas{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;opacity:.15;pointer-events:none}
#game{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;display:flex;flex-direction:column;padding:4px}
#status{display:flex;gap:8px;padding:4px 6px;font-size:11px;color:#0a0;border-bottom:1px solid #030;flex-wrap:wrap;letter-spacing:1px;min-height:22px;background:#001005}
@@ -87,6 +88,7 @@ body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#
</div>
<div id="actions"></div>
</div>
<div id="loadingMsg" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;color:#0f0;font-family:'Courier New',monospace;font-size:16px;text-align:center;letter-spacing:2px">INITIALIZING...</div>
<div id="panels">
<div class="panel" id="specPanel">
<div class="panel-title">SPECTRUM ANALYZER <button class="panel-close" data-panel="specPanel">X</button></div>
@@ -98,6 +100,7 @@ body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#
</div>
</div>
<div id="overlay"></div>
<div id="errorBox" style="position:fixed;bottom:0;left:0;width:100%;z-index:999;background:#100;color:#f00;padding:8px;font:11px monospace;display:none;white-space:pre-wrap"></div>
<script>
// ── CONFIG ──
const DATA = {
@@ -987,7 +990,7 @@ function showTitle(){
}
// ── INIT ──
// Check for save
try {
const hasSave=localStorage.getItem('signalelsewhere_save')!==null;
initGame();
showTitle();
@@ -996,14 +999,18 @@ if(hasSave&&G.phase==='title'){
addLine('Save file detected. Type LOAD to continue or START for new game.','info');
G.unlockedCmds.push('load');
}
// Handle overlay close on click outside
overlay.addEventListener('click',e=>{if(e.target===overlay)hideOverlay();});
// Expose for mobile buttons
window.handleCommand=handleCommand;
window.startSpectrum=startSpectrum;
window.startMap=startMap;
const lm=document.getElementById('loadingMsg');
if(lm)lm.style.display='none';
} catch(e) {
const eb=document.getElementById('errorBox');
if(eb){eb.style.display='block';eb.textContent='ERROR: '+e.message+'\n'+e.stack;}
document.body.style.background='#100';
document.body.innerHTML='<div style="color:#f00;padding:20px;font:14px monospace">ERROR: '+e.message+'</div>';
}
</script>
</body>
</html>

View File

@@ -5,8 +5,9 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<title>Signal Elsewhere</title>
<style>
html,body{height:100%;width:100%;margin:0;padding:0}
*{margin:0;padding:0;box-sizing:border-box}
body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#0f0;width:100vw;height:100dvh}
body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#0f0;min-height:100vh}
#matrixCanvas{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;opacity:.15;pointer-events:none}
#game{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;display:flex;flex-direction:column;padding:4px}
#status{display:flex;gap:8px;padding:4px 6px;font-size:11px;color:#0a0;border-bottom:1px solid #030;flex-wrap:wrap;letter-spacing:1px;min-height:22px;background:#001005}
@@ -87,6 +88,7 @@ body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#
</div>
<div id="actions"></div>
</div>
<div id="loadingMsg" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;color:#0f0;font-family:'Courier New',monospace;font-size:16px;text-align:center;letter-spacing:2px">INITIALIZING...</div>
<div id="panels">
<div class="panel" id="specPanel">
<div class="panel-title">SPECTRUM ANALYZER <button class="panel-close" data-panel="specPanel">X</button></div>
@@ -98,6 +100,7 @@ body{background:#000;overflow:hidden;font-family:'Courier New',monospace;color:#
</div>
</div>
<div id="overlay"></div>
<div id="errorBox" style="position:fixed;bottom:0;left:0;width:100%;z-index:999;background:#100;color:#f00;padding:8px;font:11px monospace;display:none;white-space:pre-wrap"></div>
<script>
// ── CONFIG ──
const DATA = {
@@ -987,7 +990,7 @@ function showTitle(){
}
// ── INIT ──
// Check for save
try {
const hasSave=localStorage.getItem('signalelsewhere_save')!==null;
initGame();
showTitle();
@@ -996,14 +999,18 @@ if(hasSave&&G.phase==='title'){
addLine('Save file detected. Type LOAD to continue or START for new game.','info');
G.unlockedCmds.push('load');
}
// Handle overlay close on click outside
overlay.addEventListener('click',e=>{if(e.target===overlay)hideOverlay();});
// Expose for mobile buttons
window.handleCommand=handleCommand;
window.startSpectrum=startSpectrum;
window.startMap=startMap;
const lm=document.getElementById('loadingMsg');
if(lm)lm.style.display='none';
} catch(e) {
const eb=document.getElementById('errorBox');
if(eb){eb.style.display='block';eb.textContent='ERROR: '+e.message+'\n'+e.stack;}
document.body.style.background='#100';
document.body.innerHTML='<div style="color:#f00;padding:20px;font:14px monospace">ERROR: '+e.message+'</div>';
}
</script>
</body>
</html>