Files
timmy-tower/the-matrix/index.html

296 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>The Workshop — Timmy</title>
<link rel="manifest" href="/tower/manifest.json" />
<meta name="theme-color" content="#0a0610" />
<!-- iOS PWA -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="The Workshop" />
<link rel="apple-touch-icon" href="/tower/icons/icon-192.png" />
<style>
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #080610;
overflow: hidden;
font-family: 'Courier New', monospace;
touch-action: none;
user-select: none;
-webkit-user-select: none;
}
canvas { display: block; }
/* ── HUD ─────────────────────────────────────────────────────────── */
#hud {
position: fixed; top: 16px; left: 16px;
color: #5588bb; font-size: 11px; line-height: 1.7;
text-shadow: 0 0 6px #2244aa;
pointer-events: none; z-index: 10;
}
#hud h1 {
font-size: 13px; letter-spacing: 3px; margin-bottom: 4px;
color: #7799cc; text-shadow: 0 0 10px #4466aa;
}
#connection-status {
position: fixed; top: 16px; right: 16px;
font-size: 11px; color: #333355;
pointer-events: none; z-index: 10;
text-shadow: none;
}
#connection-status.connected {
color: #5588bb;
text-shadow: 0 0 6px #3366aa;
}
/* ── Event log ────────────────────────────────────────────────────── */
#event-log {
position: fixed; bottom: 80px; left: 16px;
width: 280px; max-height: 100px; overflow-y: auto;
color: #445566; font-size: 10px; line-height: 1.6;
pointer-events: none; z-index: 10;
}
.log-entry { opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ── Open payment panel button ───────────────────────────────────── */
#open-panel-btn {
position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
font-family: 'Courier New', monospace; font-size: 11px; font-weight: bold;
color: #000; background: #4466aa; border: none;
padding: 7px 18px; cursor: pointer; z-index: 20; letter-spacing: 2px;
box-shadow: 0 0 14px #2244aa66;
transition: background 0.15s, box-shadow 0.15s;
border-radius: 2px;
min-height: 36px;
}
#open-panel-btn:hover, #open-panel-btn:active {
background: #5577cc;
box-shadow: 0 0 20px #3355aa88;
}
/* ── Input bar ───────────────────────────────────────────────────── */
#input-bar {
position: fixed; bottom: 0; left: 0; right: 0;
display: flex; align-items: center; gap: 8px;
padding: 10px 16px;
background: rgba(8, 6, 16, 0.88);
border-top: 1px solid #1a1a2e;
z-index: 20;
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}
#visitor-input {
flex: 1;
background: rgba(20, 16, 36, 0.9);
border: 1px solid #2a2a44;
color: #aabbdd;
font-family: 'Courier New', monospace;
font-size: 14px;
padding: 10px 12px;
outline: none;
min-height: 44px;
border-radius: 3px;
transition: border-color 0.2s;
-webkit-appearance: none;
}
#visitor-input::placeholder { color: #333355; }
#visitor-input:focus { border-color: #4466aa; }
#send-btn {
background: rgba(30, 40, 80, 0.9);
border: 1px solid #2a2a44;
color: #5577aa;
font-family: 'Courier New', monospace;
font-size: 16px;
width: 44px; height: 44px;
cursor: pointer;
border-radius: 3px;
transition: background 0.15s, border-color 0.15s, color 0.15s;
display: flex; align-items: center; justify-content: center;
}
#send-btn:hover, #send-btn:active {
background: rgba(50, 70, 140, 0.9);
border-color: #4466aa;
color: #88aadd;
}
/* ── Payment panel ────────────────────────────────────────────────── */
#payment-panel {
position: fixed; top: 0; right: -420px;
width: 400px; height: 100%;
background: rgba(5, 3, 12, 0.97);
border-left: 1px solid #1a1a2e;
padding: 24px 20px;
overflow-y: auto; z-index: 100;
font-family: 'Courier New', monospace;
transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: -8px 0 32px rgba(40, 60, 120, 0.15);
}
#payment-panel.open { right: 0; }
#payment-panel h2 {
font-size: 13px; letter-spacing: 3px; color: #6688bb;
text-shadow: 0 0 10px #2244aa;
margin-bottom: 20px; border-bottom: 1px solid #1a1a2e; padding-bottom: 10px;
}
#payment-close {
position: absolute; top: 16px; right: 16px;
background: transparent; border: 1px solid #1a1a2e;
color: #333355; font-family: 'Courier New', monospace;
font-size: 16px; width: 28px; height: 28px;
cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
#payment-close:hover { color: #6688bb; border-color: #4466aa; }
.panel-label { font-size: 10px; letter-spacing: 2px; color: #334466; margin-bottom: 6px; margin-top: 16px; }
#job-input {
width: 100%; background: #060310; border: 1px solid #1a1a2e;
color: #aabbdd; font-family: 'Courier New', monospace; font-size: 12px;
padding: 10px; resize: vertical; min-height: 90px;
outline: none; transition: border-color 0.2s;
}
#job-input:focus { border-color: #4466aa; }
#job-input::placeholder { color: #1a1a2e; }
.panel-btn {
width: 100%; margin-top: 12px;
background: transparent; border: 1px solid #334466;
color: #5577aa; font-family: 'Courier New', monospace;
font-size: 12px; letter-spacing: 2px; padding: 10px;
cursor: pointer; transition: all 0.2s;
}
.panel-btn:hover:not(:disabled) { background: #334466; color: #aabbdd; }
.panel-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.panel-btn.primary { border-color: #4466aa; color: #7799cc; }
.panel-btn.primary:hover:not(:disabled) { background: #4466aa; color: #fff; }
.panel-btn.danger { border-color: #663333; color: #995555; }
#job-status { font-size: 11px; margin-top: 8px; color: #5577aa; min-height: 16px; }
#job-error { font-size: 11px; margin-top: 4px; min-height: 16px; color: #994444; }
.invoice-box {
background: #060310; border: 1px solid #1a1a2e;
padding: 10px; margin-top: 8px; font-size: 10px; color: #334466;
word-break: break-all; max-height: 80px; overflow-y: auto;
}
.copy-row { display: flex; gap: 8px; margin-top: 6px; align-items: stretch; }
.copy-row .invoice-box { flex: 1; margin-top: 0; }
.copy-btn {
background: transparent; border: 1px solid #1a1a2e; color: #334466;
font-family: 'Courier New', monospace; font-size: 10px;
padding: 0 10px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.copy-btn:hover { border-color: #4466aa; color: #6688bb; }
.amount-tag {
display: inline-block; background: #0a0820;
border: 1px solid #334466; color: #6688bb;
font-size: 16px; font-weight: bold; letter-spacing: 2px;
padding: 6px 14px; margin-top: 8px;
}
#job-result {
background: #060310; border: 1px solid #1a1a2e;
color: #aabbdd; padding: 12px; font-size: 12px;
line-height: 1.6; margin-top: 8px;
white-space: pre-wrap; max-height: 260px; overflow-y: auto;
}
.panel-link {
display: block; text-align: center; margin-top: 20px;
font-size: 10px; letter-spacing: 1px; color: #1a1a2e;
text-decoration: none; transition: color 0.2s;
}
.panel-link:hover { color: #5577aa; }
/* ── WebGL recovery overlay ──────────────────────────────────────── */
#webgl-recovery-overlay {
display: none; position: fixed; inset: 0; z-index: 200;
background: rgba(5, 3, 12, 0.92);
justify-content: center; align-items: center;
pointer-events: none;
}
#webgl-recovery-overlay .recovery-text {
color: #5577aa; font-family: 'Courier New', monospace;
font-size: 15px; letter-spacing: 3px;
animation: ctx-blink 1.2s step-end infinite;
}
@keyframes ctx-blink {
0%, 100% { opacity: 1; }
50% { opacity: 0.2; }
}
</style>
</head>
<body>
<div id="hud">
<h1>THE WORKSHOP</h1>
<div id="fps">FPS: --</div>
<div id="active-jobs">JOBS: 0</div>
</div>
<div id="connection-status">OFFLINE</div>
<div id="event-log"></div>
<button id="open-panel-btn">⚡ SUBMIT JOB</button>
<!-- ── Input bar ──────────────────────────────────────────────────── -->
<div id="input-bar">
<input type="text" id="visitor-input" placeholder="Say something to Timmy…" autocomplete="off" autocorrect="off" spellcheck="false" />
<button id="send-btn" aria-label="Send"></button>
</div>
<!-- ── Payment panel ──────────────────────────────────────────────── -->
<div id="payment-panel">
<button id="payment-close"></button>
<h2>⚡ TIMMY — JOB SUBMISSION</h2>
<div data-step="input">
<div class="panel-label">YOUR REQUEST</div>
<textarea id="job-input" maxlength="500" placeholder="Ask Timmy anything… (max 500 chars)"></textarea>
<button class="panel-btn primary" id="job-submit-btn">CREATE JOB →</button>
<a class="panel-link" href="/api/ui" target="_blank">Open full UI ↗</a>
</div>
<div data-step="eval-invoice" style="display:none">
<div class="panel-label">EVAL FEE</div>
<div class="amount-tag" id="eval-amount">10 sats</div>
<div class="panel-label" style="margin-top:12px">LIGHTNING INVOICE</div>
<div class="copy-row">
<div class="invoice-box" id="eval-payment-request"></div>
<button class="copy-btn" onclick="_timmyCopy('eval-payment-request')">COPY</button>
</div>
<span id="eval-hash" data-hash=""></span>
<button class="panel-btn primary" id="pay-eval-btn">⚡ SIMULATE PAYMENT</button>
</div>
<div data-step="work-invoice" style="display:none">
<div class="panel-label">WORK FEE</div>
<div class="amount-tag" id="work-amount">-- sats</div>
<div class="panel-label" style="margin-top:12px">LIGHTNING INVOICE</div>
<div class="copy-row">
<div class="invoice-box" id="work-payment-request"></div>
<button class="copy-btn" onclick="_timmyCopy('work-payment-request')">COPY</button>
</div>
<span id="work-hash" data-hash=""></span>
<button class="panel-btn primary" id="pay-work-btn">⚡ SIMULATE PAYMENT</button>
</div>
<div data-step="result" style="display:none">
<div class="panel-label" id="result-label">AI RESULT</div>
<pre id="job-result"></pre>
<button class="panel-btn" id="new-job-btn" style="margin-top:16px">← NEW JOB</button>
</div>
<div id="job-status"></div>
<div id="job-error"></div>
</div>
<div id="webgl-recovery-overlay">
<span class="recovery-text">GPU context lost — recovering...</span>
</div>
<script type="module" src="./js/main.js"></script>
</body>
</html>