Spaces:
Running
Running
Add the subtitle; hide the loading status once PyBot is ready
Browse files- index.html +9 -5
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
-
<title>PyBot:
|
| 7 |
<style>
|
| 8 |
@font-face { font-family:"Routed Gothic"; src:url("fonts/routed-gothic.ttf") format("truetype"); }
|
| 9 |
@font-face { font-family:"Letter Gothic"; src:url("fonts/LetterGothicCode-R.ttf") format("truetype"); }
|
|
@@ -16,13 +16,14 @@
|
|
| 16 |
body { margin:0; background:var(--paper); color:var(--ink); font:18px/1.55 var(--lead); }
|
| 17 |
.page { min-height:100%; max-width:1400px; margin:0 auto; padding:clamp(16px,3vw,32px) clamp(16px,3vw,32px) 20px;
|
| 18 |
display:flex; flex-direction:column; gap:16px; }
|
| 19 |
-
header { display:flex; align-items:
|
| 20 |
h1 { font:400 clamp(28px,4.2vw,46px)/1.05 var(--lead); letter-spacing:.02em; margin:0; }
|
|
|
|
| 21 |
#status { flex:1 1 320px; max-width:520px; font:13px/1.4 var(--mono); color:var(--mute); }
|
| 22 |
#status .bar { height:4px; background:var(--off); border:1px solid var(--ink); margin-top:6px; overflow:hidden; }
|
| 23 |
#status .bar i { display:block; height:100%; width:0; background:var(--ink); transition:width .2s; }
|
| 24 |
#status .bar.busy i { width:30%; animation:slide 1.2s ease-in-out infinite; }
|
| 25 |
-
#status.done
|
| 26 |
#status.failed { color:var(--accent); }
|
| 27 |
@keyframes slide { from { transform:translateX(-100%); } to { transform:translateX(340%); } }
|
| 28 |
.grid { flex:1; display:grid; grid-template-columns:minmax(0,5fr) minmax(0,6fr); gap:16px; min-height:0; }
|
|
@@ -67,7 +68,10 @@
|
|
| 67 |
<body>
|
| 68 |
<div class="page">
|
| 69 |
<header>
|
| 70 |
-
<
|
|
|
|
|
|
|
|
|
|
| 71 |
<div id="status" role="status" aria-live="polite"><span id="status-text">Starting…</span><div class="bar busy"><i></i></div></div>
|
| 72 |
</header>
|
| 73 |
|
|
@@ -123,7 +127,7 @@ worker.onmessage = ({data: m}) => {
|
|
| 123 |
else if (m.stage === "import") setStatus(`Loading PyBot's ${TREE ? TREE.files.length : ""} Python files…`);
|
| 124 |
} else if (m.type === "ready") {
|
| 125 |
botReady = true; statusBox.classList.add("done");
|
| 126 |
-
setStatus(
|
| 127 |
if (!pending) { q.disabled = send.disabled = false; q.placeholder = "Say something to PyBot"; }
|
| 128 |
} else if (m.type === "reply") {
|
| 129 |
if (!pending || m.id !== pending.id) return;
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>PyBot: Can Python be a chatbot?</title>
|
| 7 |
<style>
|
| 8 |
@font-face { font-family:"Routed Gothic"; src:url("fonts/routed-gothic.ttf") format("truetype"); }
|
| 9 |
@font-face { font-family:"Letter Gothic"; src:url("fonts/LetterGothicCode-R.ttf") format("truetype"); }
|
|
|
|
| 16 |
body { margin:0; background:var(--paper); color:var(--ink); font:18px/1.55 var(--lead); }
|
| 17 |
.page { min-height:100%; max-width:1400px; margin:0 auto; padding:clamp(16px,3vw,32px) clamp(16px,3vw,32px) 20px;
|
| 18 |
display:flex; flex-direction:column; gap:16px; }
|
| 19 |
+
header { display:flex; align-items:flex-end; justify-content:space-between; gap:12px 24px; flex-wrap:wrap; }
|
| 20 |
h1 { font:400 clamp(28px,4.2vw,46px)/1.05 var(--lead); letter-spacing:.02em; margin:0; }
|
| 21 |
+
.sub { font:400 clamp(17px,2vw,22px)/1.3 var(--lead); color:var(--mute); margin:8px 0 0; }
|
| 22 |
#status { flex:1 1 320px; max-width:520px; font:13px/1.4 var(--mono); color:var(--mute); }
|
| 23 |
#status .bar { height:4px; background:var(--off); border:1px solid var(--ink); margin-top:6px; overflow:hidden; }
|
| 24 |
#status .bar i { display:block; height:100%; width:0; background:var(--ink); transition:width .2s; }
|
| 25 |
#status .bar.busy i { width:30%; animation:slide 1.2s ease-in-out infinite; }
|
| 26 |
+
#status.done { display:none; } /* shown only while loading, or if loading fails */
|
| 27 |
#status.failed { color:var(--accent); }
|
| 28 |
@keyframes slide { from { transform:translateX(-100%); } to { transform:translateX(340%); } }
|
| 29 |
.grid { flex:1; display:grid; grid-template-columns:minmax(0,5fr) minmax(0,6fr); gap:16px; min-height:0; }
|
|
|
|
| 68 |
<body>
|
| 69 |
<div class="page">
|
| 70 |
<header>
|
| 71 |
+
<div>
|
| 72 |
+
<h1>PyBot: Can Python be a chatbot?</h1>
|
| 73 |
+
<p class="sub">No weights, no training, just rules.</p>
|
| 74 |
+
</div>
|
| 75 |
<div id="status" role="status" aria-live="polite"><span id="status-text">Starting…</span><div class="bar busy"><i></i></div></div>
|
| 76 |
</header>
|
| 77 |
|
|
|
|
| 127 |
else if (m.stage === "import") setStatus(`Loading PyBot's ${TREE ? TREE.files.length : ""} Python files…`);
|
| 128 |
} else if (m.type === "ready") {
|
| 129 |
botReady = true; statusBox.classList.add("done");
|
| 130 |
+
setStatus("Ready");
|
| 131 |
if (!pending) { q.disabled = send.disabled = false; q.placeholder = "Say something to PyBot"; }
|
| 132 |
} else if (m.type === "reply") {
|
| 133 |
if (!pending || m.id !== pending.id) return;
|