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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Hyze Code</title>
|
| 7 |
+
<link rel="icon" type="image/png" href="https://i.imgur.com/f5QyYpV.png">
|
| 8 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
|
| 9 |
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
|
| 10 |
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"></script>
|
| 11 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
|
| 12 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
| 13 |
+
<link href="https://fonts.googleapis.com/css2?family=VT323&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
| 14 |
+
<style>
|
| 15 |
+
:root {
|
| 16 |
+
--bg-primary: #151A28;
|
| 17 |
+
--bg-secondary: #1e2535;
|
| 18 |
+
--bg-tertiary: #252d3f;
|
| 19 |
+
--accent-primary: #1C4297;
|
| 20 |
+
--accent-secondary: #2d5bc4;
|
| 21 |
+
--accent-dim: #0f2a5c;
|
| 22 |
+
--text-primary: #e0f0ff;
|
| 23 |
+
--text-secondary: #8aa8c2;
|
| 24 |
+
--text-muted: #4a6075;
|
| 25 |
+
--border-color: #1C4297;
|
| 26 |
+
--border-dim: #0f2a5c;
|
| 27 |
+
--error: #ff3366;
|
| 28 |
+
--success: #00ff88;
|
| 29 |
+
--warning: #ffcc00;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
* {
|
| 33 |
+
margin: 0;
|
| 34 |
+
padding: 0;
|
| 35 |
+
box-sizing: border-box;
|
| 36 |
+
image-rendering: pixelated;
|
| 37 |
+
image-rendering: -moz-crisp-edges;
|
| 38 |
+
image-rendering: crisp-edges;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
body {
|
| 42 |
+
font-family: 'VT323', monospace;
|
| 43 |
+
background: var(--bg-primary);
|
| 44 |
+
color: var(--text-primary);
|
| 45 |
+
height: 100vh;
|
| 46 |
+
overflow: hidden;
|
| 47 |
+
font-size: 18px;
|
| 48 |
+
line-height: 1.4;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/* CRT Scanline Effect */
|
| 52 |
+
body::before {
|
| 53 |
+
content: "";
|
| 54 |
+
position: fixed;
|
| 55 |
+
top: 0;
|
| 56 |
+
left: 0;
|
| 57 |
+
width: 100%;
|
| 58 |
+
height: 100%;
|
| 59 |
+
background: repeating-linear-gradient(
|
| 60 |
+
0deg,
|
| 61 |
+
rgba(0, 0, 0, 0.15),
|
| 62 |
+
rgba(0, 0, 0, 0.15) 1px,
|
| 63 |
+
transparent 1px,
|
| 64 |
+
transparent 2px
|
| 65 |
+
);
|
| 66 |
+
pointer-events: none;
|
| 67 |
+
z-index: 9999;
|
| 68 |
+
opacity: 0.3;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
/* Screen Glow */
|
| 72 |
+
body::after {
|
| 73 |
+
content: "";
|
| 74 |
+
position: fixed;
|
| 75 |
+
top: 0;
|
| 76 |
+
left: 0;
|
| 77 |
+
width: 100%;
|
| 78 |
+
height: 100%;
|
| 79 |
+
background: radial-gradient(circle at center, rgba(28, 66, 151, 0.05) 0%, transparent 70%);
|
| 80 |
+
pointer-events: none;
|
| 81 |
+
z-index: 9998;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.terminal-container {
|
| 85 |
+
display: flex;
|
| 86 |
+
flex-direction: column;
|
| 87 |
+
height: 100vh;
|
| 88 |
+
padding: 20px;
|
| 89 |
+
gap: 10px;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/* Header */
|
| 93 |
+
.terminal-header {
|
| 94 |
+
border: 2px solid var(--border-color);
|
| 95 |
+
background: var(--bg-secondary);
|
| 96 |
+
padding: 15px 20px;
|
| 97 |
+
display: flex;
|
| 98 |
+
align-items: center;
|
| 99 |
+
justify-content: space-between;
|
| 100 |
+
box-shadow: 0 0 20px rgba(28, 66, 151, 0.3);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.logo-section {
|
| 104 |
+
display: flex;
|
| 105 |
+
align-items: center;
|
| 106 |
+
gap: 15px;
|
| 107 |
+
cursor: pointer;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.logo-ascii {
|
| 111 |
+
color: var(--accent-primary);
|
| 112 |
+
font-size: 10px;
|
| 113 |
+
line-height: 1;
|
| 114 |
+
white-space: pre;
|
| 115 |
+
font-family: 'JetBrains Mono', monospace;
|
| 116 |
+
text-shadow: 0 0 10px rgba(28, 66, 151, 0.5);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.header-status {
|
| 120 |
+
display: flex;
|
| 121 |
+
align-items: center;
|
| 122 |
+
gap: 10px;
|
| 123 |
+
color: var(--text-secondary);
|
| 124 |
+
font-size: 16px;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.status-dot {
|
| 128 |
+
width: 12px;
|
| 129 |
+
height: 12px;
|
| 130 |
+
background: var(--success);
|
| 131 |
+
box-shadow: 0 0 10px var(--success);
|
| 132 |
+
animation: blink 1s infinite;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
@keyframes blink {
|
| 136 |
+
0%, 50% { opacity: 1; }
|
| 137 |
+
51%, 100% { opacity: 0.3; }
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Main Terminal Area */
|
| 141 |
+
.terminal-main {
|
| 142 |
+
flex: 1;
|
| 143 |
+
border: 2px solid var(--border-color);
|
| 144 |
+
background: var(--bg-primary);
|
| 145 |
+
overflow: hidden;
|
| 146 |
+
display: flex;
|
| 147 |
+
flex-direction: column;
|
| 148 |
+
position: relative;
|
| 149 |
+
box-shadow: inset 0 0 30px rgba(28, 66, 151, 0.05);
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
.terminal-messages {
|
| 153 |
+
flex: 1;
|
| 154 |
+
overflow-y: auto;
|
| 155 |
+
padding: 20px;
|
| 156 |
+
display: flex;
|
| 157 |
+
flex-direction: column;
|
| 158 |
+
gap: 15px;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
/* Custom Scrollbar */
|
| 162 |
+
.terminal-messages::-webkit-scrollbar {
|
| 163 |
+
width: 12px;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.terminal-messages::-webkit-scrollbar-track {
|
| 167 |
+
background: var(--bg-secondary);
|
| 168 |
+
border-left: 2px solid var(--border-dim);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.terminal-messages::-webkit-scrollbar-thumb {
|
| 172 |
+
background: var(--accent-dim);
|
| 173 |
+
border: 2px solid var(--bg-secondary);
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.terminal-messages::-webkit-scrollbar-thumb:hover {
|
| 177 |
+
background: var(--accent-primary);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
/* Welcome Screen */
|
| 181 |
+
.welcome-screen {
|
| 182 |
+
display: flex;
|
| 183 |
+
flex-direction: column;
|
| 184 |
+
align-items: flex-start;
|
| 185 |
+
justify-content: flex-start;
|
| 186 |
+
height: 100%;
|
| 187 |
+
text-align: left;
|
| 188 |
+
gap: 20px;
|
| 189 |
+
padding: 20px;
|
| 190 |
+
animation: flicker 4s infinite;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
@keyframes flicker {
|
| 194 |
+
0%, 100% { opacity: 1; }
|
| 195 |
+
50% { opacity: 0.95; }
|
| 196 |
+
52% { opacity: 0.8; }
|
| 197 |
+
54% { opacity: 0.95; }
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
.welcome-ascii {
|
| 201 |
+
color: var(--accent-primary);
|
| 202 |
+
font-size: 12px;
|
| 203 |
+
line-height: 1.1;
|
| 204 |
+
white-space: pre;
|
| 205 |
+
text-shadow: 0 0 20px rgba(28, 66, 151, 0.5);
|
| 206 |
+
font-family: 'JetBrains Mono', monospace;
|
| 207 |
+
letter-spacing: 0;
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
.welcome-text {
|
| 211 |
+
color: var(--text-secondary);
|
| 212 |
+
font-size: 20px;
|
| 213 |
+
max-width: 600px;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.command-hints {
|
| 217 |
+
display: flex;
|
| 218 |
+
flex-wrap: wrap;
|
| 219 |
+
gap: 10px;
|
| 220 |
+
justify-content: flex-start;
|
| 221 |
+
margin-top: 20px;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.cmd-hint {
|
| 225 |
+
border: 1px solid var(--border-dim);
|
| 226 |
+
padding: 8px 16px;
|
| 227 |
+
cursor: pointer;
|
| 228 |
+
transition: all 0.2s;
|
| 229 |
+
color: var(--text-secondary);
|
| 230 |
+
font-size: 16px;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.cmd-hint:hover {
|
| 234 |
+
border-color: var(--accent-primary);
|
| 235 |
+
color: var(--accent-primary);
|
| 236 |
+
background: rgba(28, 66, 151, 0.1);
|
| 237 |
+
box-shadow: 0 0 15px rgba(28, 66, 151, 0.3);
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
/* Messages */
|
| 241 |
+
.message {
|
| 242 |
+
display: flex;
|
| 243 |
+
flex-direction: column;
|
| 244 |
+
gap: 5px;
|
| 245 |
+
animation: typeIn 0.3s ease;
|
| 246 |
+
align-items: flex-start;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
@keyframes typeIn {
|
| 250 |
+
from { opacity: 0; transform: translateX(-10px); }
|
| 251 |
+
to { opacity: 1; transform: translateX(0); }
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
.message-header {
|
| 255 |
+
display: flex;
|
| 256 |
+
align-items: center;
|
| 257 |
+
gap: 10px;
|
| 258 |
+
color: var(--accent-primary);
|
| 259 |
+
font-size: 16px;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.message.user .message-header {
|
| 263 |
+
color: var(--success);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.message-timestamp {
|
| 267 |
+
color: var(--text-muted);
|
| 268 |
+
font-size: 14px;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.message-content {
|
| 272 |
+
padding-left: 20px;
|
| 273 |
+
color: var(--text-primary);
|
| 274 |
+
line-height: 1.5;
|
| 275 |
+
white-space: pre-wrap;
|
| 276 |
+
text-align: left;
|
| 277 |
+
width: 100%;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.message-content code {
|
| 281 |
+
background: var(--bg-tertiary);
|
| 282 |
+
color: var(--accent-primary);
|
| 283 |
+
padding: 2px 6px;
|
| 284 |
+
border: 1px solid var(--border-dim);
|
| 285 |
+
font-family: 'JetBrains Mono', monospace;
|
| 286 |
+
font-size: 14px;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
.message-content pre {
|
| 290 |
+
background: var(--bg-secondary);
|
| 291 |
+
border: 1px solid var(--border-dim);
|
| 292 |
+
padding: 15px;
|
| 293 |
+
margin: 10px 0;
|
| 294 |
+
overflow-x: auto;
|
| 295 |
+
position: relative;
|
| 296 |
+
width: 100%;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
.message-content pre code {
|
| 300 |
+
background: transparent;
|
| 301 |
+
border: none;
|
| 302 |
+
padding: 0;
|
| 303 |
+
color: var(--text-primary);
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
/* Code Block Styling */
|
| 307 |
+
.code-block-container {
|
| 308 |
+
border: 2px solid var(--border-dim);
|
| 309 |
+
margin: 15px 0;
|
| 310 |
+
background: var(--bg-secondary);
|
| 311 |
+
width: 100%;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
.code-block-header {
|
| 315 |
+
background: var(--bg-tertiary);
|
| 316 |
+
padding: 10px 15px;
|
| 317 |
+
display: flex;
|
| 318 |
+
justify-content: space-between;
|
| 319 |
+
align-items: center;
|
| 320 |
+
border-bottom: 1px solid var(--border-dim);
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.code-lang {
|
| 324 |
+
color: var(--accent-primary);
|
| 325 |
+
font-size: 16px;
|
| 326 |
+
text-transform: uppercase;
|
| 327 |
+
letter-spacing: 1px;
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
.copy-btn {
|
| 331 |
+
background: transparent;
|
| 332 |
+
border: 1px solid var(--accent-primary);
|
| 333 |
+
color: var(--accent-primary);
|
| 334 |
+
padding: 5px 15px;
|
| 335 |
+
font-family: 'VT323', monospace;
|
| 336 |
+
font-size: 16px;
|
| 337 |
+
cursor: pointer;
|
| 338 |
+
transition: all 0.2s;
|
| 339 |
+
text-transform: uppercase;
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
.copy-btn:hover {
|
| 343 |
+
background: var(--accent-primary);
|
| 344 |
+
color: var(--bg-primary);
|
| 345 |
+
box-shadow: 0 0 15px rgba(28, 66, 151, 0.5);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
.copy-btn.copied {
|
| 349 |
+
background: var(--success);
|
| 350 |
+
border-color: var(--success);
|
| 351 |
+
color: var(--bg-primary);
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
/* Help Menu */
|
| 355 |
+
.help-menu {
|
| 356 |
+
border: 2px solid var(--accent-primary);
|
| 357 |
+
background: var(--bg-secondary);
|
| 358 |
+
padding: 20px;
|
| 359 |
+
margin: 10px 0;
|
| 360 |
+
max-width: 500px;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
.help-title {
|
| 364 |
+
color: var(--accent-primary);
|
| 365 |
+
font-size: 24px;
|
| 366 |
+
margin-bottom: 15px;
|
| 367 |
+
text-align: left;
|
| 368 |
+
border-bottom: 1px solid var(--border-dim);
|
| 369 |
+
padding-bottom: 10px;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
.help-item {
|
| 373 |
+
display: flex;
|
| 374 |
+
gap: 20px;
|
| 375 |
+
margin: 10px 0;
|
| 376 |
+
font-size: 16px;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.help-cmd {
|
| 380 |
+
color: var(--success);
|
| 381 |
+
min-width: 100px;
|
| 382 |
+
font-family: 'JetBrains Mono', monospace;
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
.help-desc {
|
| 386 |
+
color: var(--text-secondary);
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
/* Input Area */
|
| 390 |
+
.terminal-input-area {
|
| 391 |
+
border-top: 2px solid var(--border-color);
|
| 392 |
+
background: var(--bg-secondary);
|
| 393 |
+
padding: 15px 20px;
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
.input-wrapper {
|
| 397 |
+
display: flex;
|
| 398 |
+
align-items: flex-end;
|
| 399 |
+
gap: 10px;
|
| 400 |
+
max-width: 100%;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
.input-prompt {
|
| 404 |
+
color: var(--accent-primary);
|
| 405 |
+
font-size: 20px;
|
| 406 |
+
white-space: nowrap;
|
| 407 |
+
text-shadow: 0 0 10px rgba(28, 66, 151, 0.5);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
.terminal-input {
|
| 411 |
+
flex: 1;
|
| 412 |
+
background: transparent;
|
| 413 |
+
border: none;
|
| 414 |
+
color: var(--text-primary);
|
| 415 |
+
font-family: 'VT323', monospace;
|
| 416 |
+
font-size: 20px;
|
| 417 |
+
outline: none;
|
| 418 |
+
resize: none;
|
| 419 |
+
min-height: 30px;
|
| 420 |
+
max-height: 150px;
|
| 421 |
+
line-height: 1.4;
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
.terminal-input::placeholder {
|
| 425 |
+
color: var(--text-muted);
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
.send-btn {
|
| 429 |
+
background: transparent;
|
| 430 |
+
border: 2px solid var(--accent-primary);
|
| 431 |
+
color: var(--accent-primary);
|
| 432 |
+
width: 40px;
|
| 433 |
+
height: 40px;
|
| 434 |
+
display: flex;
|
| 435 |
+
align-items: center;
|
| 436 |
+
justify-content: center;
|
| 437 |
+
cursor: pointer;
|
| 438 |
+
font-size: 20px;
|
| 439 |
+
transition: all 0.2s;
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
.send-btn:hover:not(:disabled) {
|
| 443 |
+
background: var(--accent-primary);
|
| 444 |
+
color: var(--bg-primary);
|
| 445 |
+
box-shadow: 0 0 20px rgba(28, 66, 151, 0.5);
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
.send-btn:disabled {
|
| 449 |
+
opacity: 0.3;
|
| 450 |
+
cursor: not-allowed;
|
| 451 |
+
border-color: var(--text-muted);
|
| 452 |
+
color: var(--text-muted);
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
.input-footer {
|
| 456 |
+
text-align: left;
|
| 457 |
+
margin-top: 10px;
|
| 458 |
+
color: var(--accent-primary);
|
| 459 |
+
font-size: 14px;
|
| 460 |
+
letter-spacing: 1px;
|
| 461 |
+
font-family: 'JetBrains Mono', monospace;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
/* Typing Indicator */
|
| 465 |
+
.typing-indicator {
|
| 466 |
+
display: flex;
|
| 467 |
+
align-items: center;
|
| 468 |
+
gap: 10px;
|
| 469 |
+
color: var(--accent-primary);
|
| 470 |
+
padding: 10px 0;
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.typing-text {
|
| 474 |
+
animation: pulse 1.5s infinite;
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
@keyframes pulse {
|
| 478 |
+
0%, 100% { opacity: 0.4; }
|
| 479 |
+
50% { opacity: 1; }
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
/* Cursor Blink */
|
| 483 |
+
.cursor {
|
| 484 |
+
display: inline-block;
|
| 485 |
+
width: 10px;
|
| 486 |
+
height: 20px;
|
| 487 |
+
background: var(--accent-primary);
|
| 488 |
+
animation: cursorBlink 1s infinite;
|
| 489 |
+
vertical-align: middle;
|
| 490 |
+
margin-left: 2px;
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
@keyframes cursorBlink {
|
| 494 |
+
0%, 50% { opacity: 1; }
|
| 495 |
+
51%, 100% { opacity: 0; }
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
/* Responsive */
|
| 499 |
+
@media (max-width: 768px) {
|
| 500 |
+
body {
|
| 501 |
+
font-size: 16px;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
.logo-ascii {
|
| 505 |
+
font-size: 8px;
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
.welcome-ascii {
|
| 509 |
+
font-size: 8px;
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
.terminal-container {
|
| 513 |
+
padding: 10px;
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
/* Selection Color */
|
| 518 |
+
::selection {
|
| 519 |
+
background: var(--accent-primary);
|
| 520 |
+
color: var(--bg-primary);
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/* Scrollbar for code blocks */
|
| 524 |
+
pre::-webkit-scrollbar {
|
| 525 |
+
height: 10px;
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
pre::-webkit-scrollbar-track {
|
| 529 |
+
background: var(--bg-tertiary);
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
pre::-webkit-scrollbar-thumb {
|
| 533 |
+
background: var(--accent-dim);
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
pre::-webkit-scrollbar-thumb:hover {
|
| 537 |
+
background: var(--accent-primary);
|
| 538 |
+
}
|
| 539 |
+
</style>
|
| 540 |
+
</head>
|
| 541 |
+
<body>
|
| 542 |
+
<div class="terminal-container">
|
| 543 |
+
<header class="terminal-header">
|
| 544 |
+
<div class="logo-section" title="Double-click to reset">
|
| 545 |
+
<img src="https://i.imgur.com/f5QyYpV.png" alt="Hyze Code" class="logo-img">
|
| 546 |
+
</div>
|
| 547 |
+
<div class="header-status">
|
| 548 |
+
<span>SYSTEM:</span>
|
| 549 |
+
<div class="status-dot"></div>
|
| 550 |
+
<span>ONLINE</span>
|
| 551 |
+
</div>
|
| 552 |
+
</header>
|
| 553 |
+
|
| 554 |
+
<main class="terminal-main">
|
| 555 |
+
<div class="terminal-messages" id="messagesContainer">
|
| 556 |
+
<div class="welcome-screen" id="welcomeScreen">
|
| 557 |
+
<div class="welcome-ascii">
|
| 558 |
+
██╗ ██╗██╗ ██╗███████╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
| 559 |
+
██║ ██║╚██╗ ██╔╝╚══███╔╝██╔════╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝
|
| 560 |
+
███████║ ╚████╔╝ ███╔╝ █████╗ ██║ ██║ ██║██║ ██║█████╗
|
| 561 |
+
██╔══██║ ╚██╔╝ ███╔╝ ██╔══╝ ██║ ██║ ██║██║ ██║██╔══╝
|
| 562 |
+
██║ ██║ ██║ ███████╗███████╗ ╚██████╗╚██████╔╝██████╔╝███████╗
|
| 563 |
+
╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
| 564 |
+
</div>
|
| 565 |
+
<div class="welcome-text">
|
| 566 |
+
> Welcome to Hyze Code!<br>
|
| 567 |
+
> Powered by Hyze H1 and Kimi K2<br>
|
| 568 |
+
> TYPE /help FOR COMMANDS<br>
|
| 569 |
+
> TYPE /clear for clearing HISTORY
|
| 570 |
+
</div>
|
| 571 |
+
<div class="command-hints">
|
| 572 |
+
<div class="cmd-hint" onclick="sendSuggestion('Create HTML/CSS layout')">> CREATE_LAYOUT</div>
|
| 573 |
+
<div class="cmd-hint" onclick="sendSuggestion('Debug JavaScript code')">> DEBUG_JS</div>
|
| 574 |
+
<div class="cmd-hint" onclick="sendSuggestion('Explain Python functions')">> EXPLAIN_PY</div>
|
| 575 |
+
<div class="cmd-hint" onclick="sendSuggestion('Optimize SQL query')">> OPTIMIZE_SQL</div>
|
| 576 |
+
</div>
|
| 577 |
+
</div>
|
| 578 |
+
</div>
|
| 579 |
+
</main>
|
| 580 |
+
|
| 581 |
+
<div class="terminal-input-area">
|
| 582 |
+
<div class="input-wrapper">
|
| 583 |
+
<span class="input-prompt">></span>
|
| 584 |
+
<textarea class="terminal-input" id="messageInput" placeholder="Enter command..." rows="1" onkeydown="handleKeyDown(event)" oninput="autoResize(this)"></textarea>
|
| 585 |
+
<button class="send-btn" id="sendBtn" onclick="sendMessage()">➤</button>
|
| 586 |
+
</div>
|
| 587 |
+
<div class="input-footer">[ HYZE CODE v2.0 | SECURE CONNECTION ]</div>
|
| 588 |
+
</div>
|
| 589 |
+
</div>
|
| 590 |
+
|
| 591 |
+
<script>
|
| 592 |
+
// --- Configuration ---
|
| 593 |
+
const API_KEY = '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';
|
| 594 |
+
const MODEL = 'moonshotai/kimi-k2-instruct-0905';
|
| 595 |
+
const API_URL = 'https://api.groq.com/openai/v1/chat/completions';
|
| 596 |
+
|
| 597 |
+
// --- State ---
|
| 598 |
+
let messages = [];
|
| 599 |
+
let isGenerating = false;
|
| 600 |
+
let codeBlockCounter = 0;
|
| 601 |
+
|
| 602 |
+
// --- Initialization ---
|
| 603 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 604 |
+
loadChatHistory();
|
| 605 |
+
document.getElementById('messageInput').focus();
|
| 606 |
+
});
|
| 607 |
+
|
| 608 |
+
// --- UI Helpers ---
|
| 609 |
+
function autoResize(textarea) {
|
| 610 |
+
textarea.style.height = 'auto';
|
| 611 |
+
textarea.style.height = Math.min(textarea.scrollHeight, 150) + 'px';
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
function handleKeyDown(e) {
|
| 615 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
| 616 |
+
e.preventDefault();
|
| 617 |
+
sendMessage();
|
| 618 |
+
}
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
function sendSuggestion(text) {
|
| 622 |
+
document.getElementById('messageInput').value = text;
|
| 623 |
+
autoResize(document.getElementById('messageInput'));
|
| 624 |
+
sendMessage();
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
function getTimestamp() {
|
| 628 |
+
const now = new Date();
|
| 629 |
+
return now.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' });
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
function scrollToBottom() {
|
| 633 |
+
const container = document.getElementById('messagesContainer');
|
| 634 |
+
container.scrollTop = container.scrollHeight;
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
// --- Command Handlers ---
|
| 638 |
+
function showHelp() {
|
| 639 |
+
const container = document.getElementById('messagesContainer');
|
| 640 |
+
const helpDiv = document.createElement('div');
|
| 641 |
+
helpDiv.className = 'message system';
|
| 642 |
+
helpDiv.innerHTML = `
|
| 643 |
+
<div class="message-header" style="color: var(--warning)">
|
| 644 |
+
<span>SYSTEM</span>
|
| 645 |
+
<span class="message-timestamp">[${getTimestamp()}]</span>
|
| 646 |
+
</div>
|
| 647 |
+
<div class="message-content">
|
| 648 |
+
<div class="help-menu">
|
| 649 |
+
<div class="help-title">=== HYZE CODE COMMANDS ===</div>
|
| 650 |
+
<div class="help-item">
|
| 651 |
+
<span class="help-cmd">/clear</span>
|
| 652 |
+
<span class="help-desc">Clear all chat history and reset terminal</span>
|
| 653 |
+
</div>
|
| 654 |
+
<div class="help-item">
|
| 655 |
+
<span class="help-cmd">/help</span>
|
| 656 |
+
<span class="help-desc">Display this help menu</span>
|
| 657 |
+
</div>
|
| 658 |
+
<div class="help-item">
|
| 659 |
+
<span class="help-cmd">[message]</span>
|
| 660 |
+
<span class="help-desc">Send message to AI assistant</span>
|
| 661 |
+
</div>
|
| 662 |
+
<div style="margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--border-dim); color: var(--text-muted); text-align: left;">
|
| 663 |
+
Double-click logo to force reset
|
| 664 |
+
</div>
|
| 665 |
+
</div>
|
| 666 |
+
</div>
|
| 667 |
+
`;
|
| 668 |
+
container.appendChild(helpDiv);
|
| 669 |
+
scrollToBottom();
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
function clearChat() {
|
| 673 |
+
messages = [];
|
| 674 |
+
codeBlockCounter = 0;
|
| 675 |
+
localStorage.removeItem('hyze_code_chats');
|
| 676 |
+
|
| 677 |
+
const container = document.getElementById('messagesContainer');
|
| 678 |
+
container.innerHTML = `
|
| 679 |
+
<div class="welcome-screen" id="welcomeScreen">
|
| 680 |
+
<div class="welcome-ascii">
|
| 681 |
+
██╗ ██╗██╗ ██╗███████╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
| 682 |
+
██║ ██║╚██╗ ██╔╝╚══███╔╝██╔════╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝
|
| 683 |
+
███████║ ╚████╔╝ ███╔╝ █████╗ ██║ ██║ ██║██║ ██║█████╗
|
| 684 |
+
██╔══██║ ╚██╔╝ ███╔╝ ██╔══╝ ██║ ██║ ██║██║ ██║██╔══╝
|
| 685 |
+
██║ ██║ ██║ ███████╗███████╗ ╚██████╗╚██████╔╝██████╔╝███████╗
|
| 686 |
+
╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
| 687 |
+
</div>
|
| 688 |
+
<div class="welcome-text">
|
| 689 |
+
> TERMINAL INTERFACE INITIALIZED...<br>
|
| 690 |
+
> CONNECTED TO NEURAL NETWORK<br>
|
| 691 |
+
> TYPE /help FOR COMMANDS<br>
|
| 692 |
+
> READY FOR INPUT_
|
| 693 |
+
</div>
|
| 694 |
+
<div class="command-hints">
|
| 695 |
+
<div class="cmd-hint" onclick="sendSuggestion('Create HTML/CSS layout')">> CREATE_LAYOUT</div>
|
| 696 |
+
<div class="cmd-hint" onclick="sendSuggestion('Debug JavaScript code')">> DEBUG_JS</div>
|
| 697 |
+
<div class="cmd-hint" onclick="sendSuggestion('Explain Python functions')">> EXPLAIN_PY</div>
|
| 698 |
+
<div class="cmd-hint" onclick="sendSuggestion('Optimize SQL query')">> OPTIMIZE_SQL</div>
|
| 699 |
+
</div>
|
| 700 |
+
</div>
|
| 701 |
+
`;
|
| 702 |
+
|
| 703 |
+
// Add system message
|
| 704 |
+
const confirmDiv = document.createElement('div');
|
| 705 |
+
confirmDiv.className = 'message system';
|
| 706 |
+
confirmDiv.innerHTML = `
|
| 707 |
+
<div class="message-header" style="color: var(--success)">
|
| 708 |
+
<span>SYSTEM</span>
|
| 709 |
+
<span class="message-timestamp">[${getTimestamp()}]</span>
|
| 710 |
+
</div>
|
| 711 |
+
<div class="message-content">> TERMINAL CLEARED. HISTORY RESET.</div>
|
| 712 |
+
`;
|
| 713 |
+
container.appendChild(confirmDiv);
|
| 714 |
+
scrollToBottom();
|
| 715 |
+
}
|
| 716 |
+
|
| 717 |
+
// --- Core Chat Logic ---
|
| 718 |
+
async function sendMessage() {
|
| 719 |
+
const input = document.getElementById('messageInput');
|
| 720 |
+
const text = input.value.trim();
|
| 721 |
+
|
| 722 |
+
if (!text || isGenerating) return;
|
| 723 |
+
|
| 724 |
+
// Handle commands
|
| 725 |
+
if (text.toLowerCase() === '/clear') {
|
| 726 |
+
clearChat();
|
| 727 |
+
input.value = '';
|
| 728 |
+
input.style.height = 'auto';
|
| 729 |
+
return;
|
| 730 |
+
}
|
| 731 |
+
|
| 732 |
+
if (text.toLowerCase() === '/help') {
|
| 733 |
+
showHelp();
|
| 734 |
+
input.value = '';
|
| 735 |
+
input.style.height = 'auto';
|
| 736 |
+
return;
|
| 737 |
+
}
|
| 738 |
+
|
| 739 |
+
document.getElementById('welcomeScreen').style.display = 'none';
|
| 740 |
+
|
| 741 |
+
const timestamp = getTimestamp();
|
| 742 |
+
addMessage('user', text, timestamp);
|
| 743 |
+
messages.push({ role: 'user', content: text });
|
| 744 |
+
|
| 745 |
+
input.value = '';
|
| 746 |
+
input.style.height = 'auto';
|
| 747 |
+
showTypingIndicator();
|
| 748 |
+
|
| 749 |
+
try {
|
| 750 |
+
isGenerating = true;
|
| 751 |
+
document.getElementById('sendBtn').disabled = true;
|
| 752 |
+
|
| 753 |
+
const response = await fetch(API_URL, {
|
| 754 |
+
method: 'POST',
|
| 755 |
+
headers: {
|
| 756 |
+
'Authorization': `Bearer ${API_KEY}`,
|
| 757 |
+
'Content-Type': 'application/json'
|
| 758 |
+
},
|
| 759 |
+
body: JSON.stringify({
|
| 760 |
+
model: MODEL,
|
| 761 |
+
messages: [
|
| 762 |
+
{
|
| 763 |
+
role: 'system',
|
| 764 |
+
content: 'You are Hyze Code, a terminal-style AI coding assistant. Provide concise, technical responses. Use code blocks with language specification.'
|
| 765 |
+
},
|
| 766 |
+
...messages
|
| 767 |
+
],
|
| 768 |
+
temperature: 0.6,
|
| 769 |
+
max_tokens: 3000,
|
| 770 |
+
stream: true
|
| 771 |
+
})
|
| 772 |
+
});
|
| 773 |
+
|
| 774 |
+
if (!response.ok) throw new Error(`API Error: ${response.status}`);
|
| 775 |
+
|
| 776 |
+
removeTypingIndicator();
|
| 777 |
+
|
| 778 |
+
const messageDiv = document.createElement('div');
|
| 779 |
+
messageDiv.className = 'message assistant';
|
| 780 |
+
const msgTimestamp = getTimestamp();
|
| 781 |
+
messageDiv.innerHTML = `
|
| 782 |
+
<div class="message-header">
|
| 783 |
+
<span>HYZE_AI</span>
|
| 784 |
+
<span class="message-timestamp">[${msgTimestamp}]</span>
|
| 785 |
+
</div>
|
| 786 |
+
<div class="message-content" id="streamingContent"></div>
|
| 787 |
+
`;
|
| 788 |
+
document.getElementById('messagesContainer').appendChild(messageDiv);
|
| 789 |
+
|
| 790 |
+
const contentDiv = messageDiv.querySelector('#streamingContent');
|
| 791 |
+
const reader = response.body.getReader();
|
| 792 |
+
const decoder = new TextDecoder();
|
| 793 |
+
let fullContent = '';
|
| 794 |
+
|
| 795 |
+
while (true) {
|
| 796 |
+
const { done, value } = await reader.read();
|
| 797 |
+
if (done) break;
|
| 798 |
+
|
| 799 |
+
const chunk = decoder.decode(value);
|
| 800 |
+
const lines = chunk.split('\n');
|
| 801 |
+
|
| 802 |
+
for (const line of lines) {
|
| 803 |
+
if (line.startsWith('data: ')) {
|
| 804 |
+
const data = line.slice(6);
|
| 805 |
+
if (data === '[DONE]') continue;
|
| 806 |
+
try {
|
| 807 |
+
const parsed = JSON.parse(data);
|
| 808 |
+
const content = parsed.choices?.[0]?.delta?.content || '';
|
| 809 |
+
if (content) {
|
| 810 |
+
fullContent += content;
|
| 811 |
+
contentDiv.innerHTML = formatMessage(fullContent);
|
| 812 |
+
scrollToBottom();
|
| 813 |
+
}
|
| 814 |
+
} catch (e) {}
|
| 815 |
+
}
|
| 816 |
+
}
|
| 817 |
+
}
|
| 818 |
+
|
| 819 |
+
// Post-processing
|
| 820 |
+
contentDiv.innerHTML = formatMessage(fullContent);
|
| 821 |
+
|
| 822 |
+
// Highlight code
|
| 823 |
+
contentDiv.querySelectorAll('pre code').forEach((block) => {
|
| 824 |
+
hljs.highlightElement(block);
|
| 825 |
+
});
|
| 826 |
+
|
| 827 |
+
// Add copy buttons to code blocks
|
| 828 |
+
addCopyButtons(contentDiv);
|
| 829 |
+
|
| 830 |
+
messages.push({ role: 'assistant', content: fullContent });
|
| 831 |
+
saveChatHistory();
|
| 832 |
+
|
| 833 |
+
} catch (error) {
|
| 834 |
+
removeTypingIndicator();
|
| 835 |
+
addMessage('assistant', `ERROR: ${error.message}`, getTimestamp());
|
| 836 |
+
} finally {
|
| 837 |
+
isGenerating = false;
|
| 838 |
+
document.getElementById('sendBtn').disabled = false;
|
| 839 |
+
}
|
| 840 |
+
}
|
| 841 |
+
|
| 842 |
+
function addMessage(role, content, timestamp) {
|
| 843 |
+
const container = document.getElementById('messagesContainer');
|
| 844 |
+
const messageDiv = document.createElement('div');
|
| 845 |
+
messageDiv.className = `message ${role}`;
|
| 846 |
+
|
| 847 |
+
const sender = role === 'user' ? 'USER' : 'HYZE_AI';
|
| 848 |
+
const color = role === 'user' ? 'var(--success)' : 'var(--accent-primary)';
|
| 849 |
+
|
| 850 |
+
messageDiv.innerHTML = `
|
| 851 |
+
<div class="message-header" style="color: ${color}">
|
| 852 |
+
<span>${sender}</span>
|
| 853 |
+
<span class="message-timestamp">[${timestamp}]</span>
|
| 854 |
+
</div>
|
| 855 |
+
<div class="message-content">${formatMessage(content)}</div>
|
| 856 |
+
`;
|
| 857 |
+
|
| 858 |
+
container.appendChild(messageDiv);
|
| 859 |
+
scrollToBottom();
|
| 860 |
+
|
| 861 |
+
// Highlight and add copy buttons
|
| 862 |
+
messageDiv.querySelectorAll('pre code').forEach((block) => {
|
| 863 |
+
hljs.highlightElement(block);
|
| 864 |
+
});
|
| 865 |
+
addCopyButtons(messageDiv);
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
function showTypingIndicator() {
|
| 869 |
+
const container = document.getElementById('messagesContainer');
|
| 870 |
+
const indicator = document.createElement('div');
|
| 871 |
+
indicator.className = 'typing-indicator';
|
| 872 |
+
indicator.id = 'typingIndicator';
|
| 873 |
+
indicator.innerHTML = `
|
| 874 |
+
<span>HYZE_AI</span>
|
| 875 |
+
<span class="typing-text">PROCESSING</span>
|
| 876 |
+
<span class="cursor"></span>
|
| 877 |
+
`;
|
| 878 |
+
container.appendChild(indicator);
|
| 879 |
+
scrollToBottom();
|
| 880 |
+
}
|
| 881 |
+
|
| 882 |
+
function removeTypingIndicator() {
|
| 883 |
+
const indicator = document.getElementById('typingIndicator');
|
| 884 |
+
if (indicator) indicator.remove();
|
| 885 |
+
}
|
| 886 |
+
|
| 887 |
+
// --- Markdown & Formatting ---
|
| 888 |
+
function formatMessage(text) {
|
| 889 |
+
let safeText = text.replace(/</g, '<').replace(/>/g, '>');
|
| 890 |
+
|
| 891 |
+
// Code Blocks
|
| 892 |
+
let codeBlocks = [];
|
| 893 |
+
safeText = safeText.replace(/```(\w+)?\n([\s\S]*?)```/g, (match, lang, code) => {
|
| 894 |
+
const id = codeBlockCounter++;
|
| 895 |
+
const language = lang || 'text';
|
| 896 |
+
codeBlocks.push({id, lang: language, code: code});
|
| 897 |
+
return `<!--CODEBLOCK_${id}-->`;
|
| 898 |
+
});
|
| 899 |
+
|
| 900 |
+
// Inline Code
|
| 901 |
+
safeText = safeText.replace(/`([^`]+)`/g, '<code>$1</code>');
|
| 902 |
+
|
| 903 |
+
// Bold
|
| 904 |
+
safeText = safeText.replace(/\*\*(.*?)\*\*/g, '<strong style="color: var(--accent-primary)">$1</strong>');
|
| 905 |
+
|
| 906 |
+
// Italic
|
| 907 |
+
safeText = safeText.replace(/\*(.*?)\*/g, '<em>$1</em>');
|
| 908 |
+
|
| 909 |
+
// Lists
|
| 910 |
+
safeText = safeText.replace(/^\s*-\s+(.*$)/gim, ' ▸ $1');
|
| 911 |
+
safeText = safeText.replace(/^\s*\d+\.\s+(.*$)/gim, ' $1');
|
| 912 |
+
|
| 913 |
+
// Line Breaks
|
| 914 |
+
safeText = safeText.replace(/\n/g, '<br>');
|
| 915 |
+
|
| 916 |
+
// Restore Code Blocks
|
| 917 |
+
safeText = safeText.replace(/<!--CODEBLOCK_(\d+)-->/g, (match, id) => {
|
| 918 |
+
const block = codeBlocks.find(b => b.id == id);
|
| 919 |
+
if (!block) return match;
|
| 920 |
+
|
| 921 |
+
return `
|
| 922 |
+
<div class="code-block-container" id="code-block-${block.id}">
|
| 923 |
+
<div class="code-block-header">
|
| 924 |
+
<span class="code-lang">${block.lang.toUpperCase()}</span>
|
| 925 |
+
<button class="copy-btn" onclick="copyCode('${block.id}')">COPY</button>
|
| 926 |
+
</div>
|
| 927 |
+
<pre><code class="language-${block.lang}">${block.code.replace(/</g, '<')}</code></pre>
|
| 928 |
+
</div>
|
| 929 |
+
`;
|
| 930 |
+
});
|
| 931 |
+
|
| 932 |
+
return safeText;
|
| 933 |
+
}
|
| 934 |
+
|
| 935 |
+
function addCopyButtons(container) {
|
| 936 |
+
// Already handled in formatMessage
|
| 937 |
+
}
|
| 938 |
+
|
| 939 |
+
function copyCode(blockId) {
|
| 940 |
+
const block = document.querySelector(`#code-block-${blockId} code`);
|
| 941 |
+
if (!block) return;
|
| 942 |
+
|
| 943 |
+
const code = block.textContent;
|
| 944 |
+
navigator.clipboard.writeText(code).then(() => {
|
| 945 |
+
const btn = document.querySelector(`#code-block-${blockId} .copy-btn`);
|
| 946 |
+
const originalText = btn.textContent;
|
| 947 |
+
btn.textContent = 'COPIED!';
|
| 948 |
+
btn.classList.add('copied');
|
| 949 |
+
|
| 950 |
+
setTimeout(() => {
|
| 951 |
+
btn.textContent = originalText;
|
| 952 |
+
btn.classList.remove('copied');
|
| 953 |
+
}, 2000);
|
| 954 |
+
});
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
// --- History Management ---
|
| 958 |
+
function saveChatHistory() {
|
| 959 |
+
localStorage.setItem('hyze_code_chats', JSON.stringify(messages));
|
| 960 |
+
}
|
| 961 |
+
|
| 962 |
+
function loadChatHistory() {
|
| 963 |
+
const saved = localStorage.getItem('hyze_code_chats');
|
| 964 |
+
if (saved) {
|
| 965 |
+
try {
|
| 966 |
+
messages = JSON.parse(saved);
|
| 967 |
+
if (messages.length > 0) {
|
| 968 |
+
document.getElementById('welcomeScreen').style.display = 'none';
|
| 969 |
+
messages.forEach(msg => {
|
| 970 |
+
addMessage(msg.role, msg.content, getTimestamp());
|
| 971 |
+
});
|
| 972 |
+
}
|
| 973 |
+
} catch(e) { console.error("Failed to load history", e); }
|
| 974 |
+
}
|
| 975 |
+
}
|
| 976 |
+
|
| 977 |
+
// Clear history on double-click of logo
|
| 978 |
+
document.querySelector('.logo-section').addEventListener('dblclick', () => {
|
| 979 |
+
if (confirm('RESET TERMINAL?')) {
|
| 980 |
+
clearChat();
|
| 981 |
+
}
|
| 982 |
+
});
|
| 983 |
+
</script>
|
| 984 |
+
</body>
|
| 985 |
+
</html>
|