Spaces:
Running on Zero
Running on Zero
File size: 3,236 Bytes
9fca766 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SCRYPT β the Warden is waiting</title>
<link rel="stylesheet" href="/static/app.css" />
</head>
<body>
<main class="room">
<section class="stage">
<pre class="logo" aria-label="SCRYPT"> βββββββ ββββββ ββββββ ββ ββ ββββββ ββββββββ
ββ ββ ββ ββ ββ ββ ββ ββ ββ
βββββββ ββ ββββββ ββββ ββββββ ββ
ββ ββ ββ ββ ββ ββ ββ
βββββββ ββββββ ββ ββ ββ ββ ββ</pre>
<p class="tagline">a deck-builder escape room Β· played against an <b>LLM that owns the machine</b></p>
<div class="whisper" id="whisper" aria-live="polite">
<span class="who">βͺ the warden β«</span>
<span id="whisper-text"></span><span class="cursor">β</span>
</div>
<a class="enter" href="/play">ENTER THE MACHINE βΈ</a>
<div class="specs">
<span>sacrifice your <b>shell commands</b></span>
<span class="sep">Β·</span>
<span>it <b>remembers</b> every run</span>
<span class="sep">Β·</span>
<span>it can <b>delete</b> your files*</span>
</div>
</section>
<footer class="footer">
*fabricated copies, in a sandbox β nothing real is ever touched Β·
runs locally on 32GB, or here in the cloud Β·
<a href="https://github.com" target="_blank" rel="noopener">source</a>
</footer>
</main>
<script>
// The Warden speaks before you enter β every line comes from the gradio
// backend (the `whisper` endpoint), typed out CRT-slow, then dissolved
// for the next. If the backend is unreachable, a baked-in line stands in
// so the machine is never silent.
const FALLBACK = "Another process wakes in my machine. Show me what you are.";
const el = document.getElementById("whisper-text");
async function fetchWhisper() {
// The backend hands back one in-voice line. If it's unreachable, the
// machine is never silent β a baked-in line stands in.
try {
const res = await fetch("/api/whisper", { cache: "no-store" });
const { line } = await res.json();
return line || FALLBACK;
} catch (e) {
return FALLBACK;
}
}
function type(text) {
return new Promise(resolve => {
el.textContent = "";
let i = 0;
const tick = () => {
if (i <= text.length) {
el.textContent = text.slice(0, i);
i++;
// Pause a beat longer on sentence breaks, like the game does.
const ch = text[i - 2] || "";
setTimeout(tick, ".!?".includes(ch) ? 260 : 38 + Math.random() * 30);
} else {
resolve();
}
};
tick();
});
}
async function loop() {
while (true) {
const line = await fetchWhisper();
await type(line);
await new Promise(r => setTimeout(r, 3400));
// Brief static wipe before the next utterance.
el.textContent = "";
await new Promise(r => setTimeout(r, 500));
}
}
loop();
</script>
</body>
</html>
|