Reaperxxxx commited on
Commit
70e5671
·
verified ·
1 Parent(s): be57c67

Update public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +37 -25
public/index.html CHANGED
@@ -148,26 +148,27 @@ header{
148
  .cmd-block{
149
  background:var(--bg);border:1px solid var(--border);border-radius:var(--r);
150
  font-family:var(--mono);font-size:12px;overflow:hidden;animation:fadein .2s ease;
151
- max-width:100%;
152
  }
153
  .cmd-block.error-block{border-color:rgba(239,68,68,.4);}
154
  .cmd-head{
155
- display:flex;align-items:center;gap:8px;
156
- padding:8px 12px;background:var(--bg2);border-bottom:1px solid var(--border);
 
157
  }
158
  .cmd-head.err-head{background:rgba(239,68,68,.06);}
159
- .cmd-prompt{color:var(--green);font-weight:600;flex-shrink:0;}
160
  .cmd-prompt.err{color:var(--red);}
161
- .cmd-txt{color:var(--text2);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;}
162
  .cmd-badge{
163
  padding:2px 7px;border-radius:4px;font-size:10px;font-weight:600;
164
  background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.3);color:var(--green);
165
- flex-shrink:0;
166
  }
167
  .cmd-badge.running{background:rgba(245,158,11,.12);border-color:rgba(245,158,11,.3);color:var(--yellow);}
168
  .cmd-badge.err-badge{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.3);color:var(--red);}
169
  .cmd-out{
170
- padding:8px 12px;color:var(--text3);max-height:120px;overflow-y:auto;
171
  line-height:1.6;white-space:pre-wrap;word-break:break-all;font-size:11px;
172
  }
173
  .cmd-out.err-out{color:var(--red);}
@@ -430,7 +431,7 @@ header{
430
  <!-- HEADER -->
431
  <header>
432
  <div class="logo">
433
- <span class="logo-ice">❄️</span>
434
  Cryo<span>Dev</span>
435
  </div>
436
  <div class="h-spacer"></div>
@@ -454,7 +455,7 @@ header{
454
  <div class="chat-side">
455
  <div class="msgs" id="msgs">
456
  <div class="welcome" id="welcome">
457
- <div class="w-icon">❄️</div>
458
  <div class="w-title">Cryo Dev</div>
459
  <div class="w-sub">AI-powered code editor. Ask me to create, edit, or explain code — or search the web.</div>
460
  <div class="tips">
@@ -481,7 +482,7 @@ header{
481
  <!-- INPUT AREA -->
482
  <div class="input-area">
483
  <div class="ctx-row">
484
- <div class="ctx-badge">📄 <span id="ctxFile">No file</span></div>
485
  <div class="ctx-actions">
486
  <button class="ctx-icon-btn" onclick="openSheet('tasksSheet')" id="taskCountBtn">Tasks</button>
487
  <button class="ctx-icon-btn" onclick="openSheet('versionsSheet')" id="versionsBtn" style="display:none">Versions</button>
@@ -522,26 +523,25 @@ header{
522
 
523
  </div>
524
 
525
- <!-- BOTTOM NAV (mobile only) -->
526
  <div class="bottom-nav">
527
  <button class="nav-btn active" onclick="closeAllSheets()" id="navChat">
528
- <span class="nav-icon">💬</span>
529
  <span class="nav-label">Chat</span>
530
  </button>
531
  <button class="nav-btn" onclick="openSheet('filesSheet')" id="navFiles">
532
- <span class="nav-icon">📁</span>
533
  <span class="nav-label">Files</span>
534
  </button>
535
  <button class="nav-btn" onclick="openSheet('tasksSheet')" id="navTasks">
536
- <span class="nav-icon"></span>
537
  <span class="nav-label">Tasks</span>
538
  </button>
539
  <button class="nav-btn" onclick="openSheet('codeSheet')" id="navCode">
540
- <span class="nav-icon">{ }</span>
541
  <span class="nav-label">Code</span>
542
  </button>
543
  <button class="nav-btn" onclick="openSheet('histSheet')" id="navHist">
544
- <span class="nav-icon">⌨️</span>
545
  <span class="nav-label">History</span>
546
  </button>
547
  </div>
@@ -588,8 +588,8 @@ header{
588
  </div>
589
  <div class="sheet-body">
590
  <div class="code-acts">
591
- <button class="btn-act" onclick="copyCode()"> Copy</button>
592
- <a class="btn-act" id="dlBtn"> Download</a>
593
  </div>
594
  <div class="code-viewer" id="codeViewer">No file open</div>
595
  </div>
@@ -674,7 +674,7 @@ async function loadTree() {
674
 
675
  function renderItems(items, depth = 0) {
676
  return items.map(it => {
677
- const icon = it.type === "dir" ? "📁" : fileIcon(it.name);
678
  const active = curFile === it.path ? "active" : "";
679
  const size = it.size ? fmtSize(it.size) : "";
680
  return `
@@ -694,7 +694,12 @@ function renderItems(items, depth = 0) {
694
 
695
  function fileIcon(n) {
696
  const e = n.split(".").pop().toLowerCase();
697
- return {js:"🟨",ts:"🔷",py:"🐍",sh:"⚙️",json:"📋",html:"🌐",css:"🎨",md:"📝",txt:"📄",env:"🔑"}[e] || "📄";
 
 
 
 
 
698
  }
699
  function fmtSize(b) {
700
  if (b < 1024) return b + "B";
@@ -718,7 +723,10 @@ function renderTasks(tasks) {
718
 
719
  const html = tasks.length ? tasks.map(t => `
720
  <div class="task-item">
721
- <span class="task-check">${t.done ? "✅" : "⬜"}</span>
 
 
 
722
  <span class="task-text ${t.done ? "done" : ""}">${esc(t.task)}</span>
723
  </div>`).join("") : '<div style="color:var(--text3);font-size:13px">No tasks yet</div>';
724
 
@@ -975,7 +983,7 @@ function handleEvent(ev) {
975
  el.id = "ws-block";
976
  el.innerHTML = `
977
  <div class="ws-head">
978
- <span>🔍</span>
979
  <span class="ws-query">Searching: ${esc(ev.query)}</span>
980
  </div>
981
  <div class="ws-citations" id="ws-citations"><div style="color:var(--text3);font-size:12px;padding:4px 0">Fetching results...</div></div>`;
@@ -1009,8 +1017,12 @@ function handleEvent(ev) {
1009
 
1010
  const el = document.createElement("div");
1011
  el.className = "file-banner";
 
1012
  el.innerHTML = `
1013
- <span class="fb-icon">${ev.type === "file_created" ? "✨" : "✏️"}</span>
 
 
 
1014
  <div class="fb-info">
1015
  <div class="fb-name">${esc(ev.filename)}</div>
1016
  <div class="fb-desc">${esc(ev.description || "")}</div>
@@ -1033,7 +1045,7 @@ function handleEvent(ev) {
1033
  const el = document.createElement("div");
1034
  el.className = "pending-banner";
1035
  el.innerHTML = `
1036
- <div class="pb-title"> ${tasks.length} task${tasks.length > 1 ? "s" : ""} pending</div>
1037
  <ul class="pb-list">${tasks.map(t => `<li>${esc(t.task)}</li>`).join("")}</ul>
1038
  <button class="resume-btn" onclick="resumeTasks()">Resume pending tasks →</button>`;
1039
  msgs.appendChild(el);
@@ -1074,7 +1086,7 @@ function appendAI(text) {
1074
  const el = document.createElement("div");
1075
  el.className = "msg msg-ai";
1076
  const fmt = esc(text).replace(/`([^`]+)`/g, "<code>$1</code>");
1077
- el.innerHTML = `<div class="msg-label">❄️ Cryo</div><div class="bubble">${fmt}</div>`;
1078
  msgs.appendChild(el);
1079
  scrollBot();
1080
  }
 
148
  .cmd-block{
149
  background:var(--bg);border:1px solid var(--border);border-radius:var(--r);
150
  font-family:var(--mono);font-size:12px;overflow:hidden;animation:fadein .2s ease;
151
+ max-width:100%;width:100%;
152
  }
153
  .cmd-block.error-block{border-color:rgba(239,68,68,.4);}
154
  .cmd-head{
155
+ display:flex;align-items:flex-start;gap:8px;
156
+ padding:9px 12px;background:var(--bg2);border-bottom:1px solid var(--border);
157
+ min-height:38px;
158
  }
159
  .cmd-head.err-head{background:rgba(239,68,68,.06);}
160
+ .cmd-prompt{color:var(--green);font-weight:600;flex-shrink:0;padding-top:1px;}
161
  .cmd-prompt.err{color:var(--red);}
162
+ .cmd-txt{color:var(--text2);flex:1;white-space:pre-wrap;word-break:break-all;font-size:12px;line-height:1.5;}
163
  .cmd-badge{
164
  padding:2px 7px;border-radius:4px;font-size:10px;font-weight:600;
165
  background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.3);color:var(--green);
166
+ flex-shrink:0;margin-top:1px;
167
  }
168
  .cmd-badge.running{background:rgba(245,158,11,.12);border-color:rgba(245,158,11,.3);color:var(--yellow);}
169
  .cmd-badge.err-badge{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.3);color:var(--red);}
170
  .cmd-out{
171
+ padding:8px 12px;color:var(--text3);max-height:160px;overflow-y:auto;
172
  line-height:1.6;white-space:pre-wrap;word-break:break-all;font-size:11px;
173
  }
174
  .cmd-out.err-out{color:var(--red);}
 
431
  <!-- HEADER -->
432
  <header>
433
  <div class="logo">
434
+ <span class="logo-ice"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color:#7dd3fc"><line x1="12" y1="2" x2="12" y2="22"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/><line x1="19.07" y1="4.93" x2="4.93" y2="19.07"/><circle cx="12" cy="12" r="2" fill="#7dd3fc" stroke="none"/></svg></span>
435
  Cryo<span>Dev</span>
436
  </div>
437
  <div class="h-spacer"></div>
 
455
  <div class="chat-side">
456
  <div class="msgs" id="msgs">
457
  <div class="welcome" id="welcome">
458
+ <div class="w-icon"><svg width="56" height="56" viewBox="0 0 24 24" fill="none" stroke="#7dd3fc" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="2" x2="12" y2="22"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/><line x1="19.07" y1="4.93" x2="4.93" y2="19.07"/><circle cx="12" cy="12" r="2.5" fill="#7dd3fc" stroke="none"/><circle cx="12" cy="2" r="1.5" fill="#7dd3fc" stroke="none"/><circle cx="12" cy="22" r="1.5" fill="#7dd3fc" stroke="none"/><circle cx="2" cy="12" r="1.5" fill="#7dd3fc" stroke="none"/><circle cx="22" cy="12" r="1.5" fill="#7dd3fc" stroke="none"/></svg></div>
459
  <div class="w-title">Cryo Dev</div>
460
  <div class="w-sub">AI-powered code editor. Ask me to create, edit, or explain code — or search the web.</div>
461
  <div class="tips">
 
482
  <!-- INPUT AREA -->
483
  <div class="input-area">
484
  <div class="ctx-row">
485
+ <div class="ctx-badge"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink:0"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg> <span id="ctxFile">No file</span></div>
486
  <div class="ctx-actions">
487
  <button class="ctx-icon-btn" onclick="openSheet('tasksSheet')" id="taskCountBtn">Tasks</button>
488
  <button class="ctx-icon-btn" onclick="openSheet('versionsSheet')" id="versionsBtn" style="display:none">Versions</button>
 
523
 
524
  </div>
525
 
 
526
  <div class="bottom-nav">
527
  <button class="nav-btn active" onclick="closeAllSheets()" id="navChat">
528
+ <span class="nav-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg></span>
529
  <span class="nav-label">Chat</span>
530
  </button>
531
  <button class="nav-btn" onclick="openSheet('filesSheet')" id="navFiles">
532
+ <span class="nav-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg></span>
533
  <span class="nav-label">Files</span>
534
  </button>
535
  <button class="nav-btn" onclick="openSheet('tasksSheet')" id="navTasks">
536
+ <span class="nav-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 11 12 14 22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg></span>
537
  <span class="nav-label">Tasks</span>
538
  </button>
539
  <button class="nav-btn" onclick="openSheet('codeSheet')" id="navCode">
540
+ <span class="nav-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg></span>
541
  <span class="nav-label">Code</span>
542
  </button>
543
  <button class="nav-btn" onclick="openSheet('histSheet')" id="navHist">
544
+ <span class="nav-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg></span>
545
  <span class="nav-label">History</span>
546
  </button>
547
  </div>
 
588
  </div>
589
  <div class="sheet-body">
590
  <div class="code-acts">
591
+ <button class="btn-act" onclick="copyCode()"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg> Copy</button>
592
+ <a class="btn-act" id="dlBtn"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg> Download</a>
593
  </div>
594
  <div class="code-viewer" id="codeViewer">No file open</div>
595
  </div>
 
674
 
675
  function renderItems(items, depth = 0) {
676
  return items.map(it => {
677
+ const icon = it.type === "dir" ? dirIcon() : fileIcon(it.name);
678
  const active = curFile === it.path ? "active" : "";
679
  const size = it.size ? fmtSize(it.size) : "";
680
  return `
 
694
 
695
  function fileIcon(n) {
696
  const e = n.split(".").pop().toLowerCase();
697
+ const color = {js:"#f7df1e",ts:"#3178c6",py:"#3572a5",sh:"#89e051",json:"#cbcb41",html:"#e34c26",css:"#563d7c",md:"#083fa1",txt:"#888",env:"#f59e0b"}[e] || "#888";
698
+ return `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`;
699
+ }
700
+
701
+ function dirIcon() {
702
+ return `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>`;
703
  }
704
  function fmtSize(b) {
705
  if (b < 1024) return b + "B";
 
723
 
724
  const html = tasks.length ? tasks.map(t => `
725
  <div class="task-item">
726
+ <span class="task-check">${t.done
727
+ ? `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`
728
+ : `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>`
729
+ }</span>
730
  <span class="task-text ${t.done ? "done" : ""}">${esc(t.task)}</span>
731
  </div>`).join("") : '<div style="color:var(--text3);font-size:13px">No tasks yet</div>';
732
 
 
983
  el.id = "ws-block";
984
  el.innerHTML = `
985
  <div class="ws-head">
986
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
987
  <span class="ws-query">Searching: ${esc(ev.query)}</span>
988
  </div>
989
  <div class="ws-citations" id="ws-citations"><div style="color:var(--text3);font-size:12px;padding:4px 0">Fetching results...</div></div>`;
 
1017
 
1018
  const el = document.createElement("div");
1019
  el.className = "file-banner";
1020
+ const isCreate = ev.type === "file_created";
1021
  el.innerHTML = `
1022
+ <span class="fb-icon">${isCreate
1023
+ ? `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="12" y1="18" x2="12" y2="12"/><line x1="9" y1="15" x2="15" y2="15"/></svg>`
1024
+ : `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`
1025
+ }</span>
1026
  <div class="fb-info">
1027
  <div class="fb-name">${esc(ev.filename)}</div>
1028
  <div class="fb-desc">${esc(ev.description || "")}</div>
 
1045
  const el = document.createElement("div");
1046
  el.className = "pending-banner";
1047
  el.innerHTML = `
1048
+ <div class="pb-title"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display:inline;vertical-align:middle;margin-right:4px"><rect x="3" y="3" width="18" height="18" rx="2"/></svg> ${tasks.length} task${tasks.length > 1 ? "s" : ""} pending</div>
1049
  <ul class="pb-list">${tasks.map(t => `<li>${esc(t.task)}</li>`).join("")}</ul>
1050
  <button class="resume-btn" onclick="resumeTasks()">Resume pending tasks →</button>`;
1051
  msgs.appendChild(el);
 
1086
  const el = document.createElement("div");
1087
  el.className = "msg msg-ai";
1088
  const fmt = esc(text).replace(/`([^`]+)`/g, "<code>$1</code>");
1089
+ el.innerHTML = `<div class="msg-label"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="#7dd3fc" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display:inline;vertical-align:middle;margin-right:3px"><line x1="12" y1="2" x2="12" y2="22"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/><line x1="19.07" y1="4.93" x2="4.93" y2="19.07"/></svg> Cryo</div><div class="bubble">${fmt}</div>`;
1090
  msgs.appendChild(el);
1091
  scrollBot();
1092
  }