This commit is contained in:
2026-05-03 03:37:09 -04:00
parent f66cfbbde8
commit a2a7bad70c
3 changed files with 57 additions and 0 deletions

View File

@@ -165,6 +165,12 @@
</svg>
<span>DEBUG</span>
</button>
<button id="hangup-btn" class="hangup-btn" title="Hang up and close the tab">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7 0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.1-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9z"/>
</svg>
<span>HANGUP</span>
</button>
</div>
</div>
</div>

View File

@@ -85,6 +85,21 @@ document.addEventListener('DOMContentLoaded', async () => {
toggleDebugModal();
});
}
// Hangup button - cleanly leaves and tries to close the tab.
const hangupBtn = $('hangup-btn');
if (hangupBtn) {
const hangup = () => {
try { send({ type: 'leave' }); } catch (e) {}
try { state.ws?.close(); } catch (e) {}
window.close();
// window.close() is a no-op if the tab wasn't opened by script. As a
// fallback, navigate away so they at least leave the chat surface.
setTimeout(() => { try { location.href = 'about:blank'; } catch (e) {} }, 50);
};
hangupBtn.addEventListener('click', hangup);
hangupBtn.addEventListener('touchend', (e) => { e.preventDefault(); hangup(); });
}
// Debug modal close button
$('debug-close')?.addEventListener('click', closeDebugModal);

View File

@@ -2200,6 +2200,42 @@ body.pong-mode.schizo-mode .video-tile video {
letter-spacing: 1px;
}
.hangup-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 10px 16px;
margin-top: 8px;
background: var(--bg-tertiary);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-muted);
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
text-transform: uppercase;
letter-spacing: 1px;
}
.hangup-btn svg {
width: 18px;
height: 18px;
transform: rotate(135deg);
}
.hangup-btn:hover {
background: rgba(239, 68, 68, 0.15);
border-color: #ef4444;
color: #ef4444;
}
.hangup-btn:active {
background: rgba(239, 68, 68, 0.25);
}
.record-call-btn svg { width: 14px; height: 14px; }
.record-call-btn:hover {