Skip to content

Commit e2e8466

Browse files
committed
Editor: loading spinner overlay while compiling
1 parent 78e186f commit e2e8466

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

editor/index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#status.compiling { color: #b07000; }
3030
#status.error { color: #c00; }
3131
#status.ok { color: #080; }
32+
@keyframes spin { to { transform: rotate(360deg); } }
3233
.btn-run { background: #e8b400; color: #111; border: none; padding: 5px 14px; border-radius: 4px; font-size: 13px; font-weight: 700; cursor: pointer; }
3334
.btn-run:hover { background: #f5c400; }
3435
.btn-run:disabled { background: #ccc; color: #888; cursor: not-allowed; }
@@ -68,7 +69,11 @@
6869
<span class="pane-label">Output</span>
6970
<button class="btn-stop" onclick="stopSketch()" tabindex="-1">&#9632; Stop</button>
7071
</div>
71-
<div id="preview-area">
72+
<div id="preview-area" style="position:relative;">
73+
<div id="loading-overlay" style="display:none;position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.75);z-index:10;align-items:center;justify-content:center;flex-direction:column;gap:1rem;">
74+
<div style="width:40px;height:40px;border:3px solid #444;border-top-color:#e8b400;border-radius:50%;animation:spin 0.8s linear infinite;"></div>
75+
<div style="color:#e8b400;font-size:13px;font-family:monospace;">Compiling...</div>
76+
</div>
7277
<div id="preview-placeholder">Press Run or Ctrl+Enter</div>
7378
</div>
7479
</div>
@@ -218,6 +223,8 @@
218223
ep.textContent = '';
219224
btn.disabled = true;
220225
setStatus('Compiling...', 'compiling');
226+
const overlay = document.getElementById('loading-overlay');
227+
if (overlay) overlay.style.display = 'flex';
221228

222229
let resp, data;
223230
try {
@@ -232,6 +239,7 @@
232239
ep.textContent = e.message;
233240
ep.style.display = 'block';
234241
btn.disabled = false;
242+
if (typeof overlay !== 'undefined' && overlay) overlay.style.display = 'none';
235243
return;
236244
}
237245

0 commit comments

Comments
 (0)