Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- index.html +426 -432
index.html
CHANGED
|
@@ -1,25 +1,26 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ru">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>NULL-SPACE | Context
|
| 7 |
-
<!-- Import FontAwesome
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
|
| 10 |
<style>
|
| 11 |
/* --- CSS VARIABLES & RESET --- */
|
| 12 |
:root {
|
| 13 |
-
--bg-color: #
|
| 14 |
-
--panel-bg: #
|
| 15 |
-
--primary-color: #
|
| 16 |
-
--secondary-color: #
|
| 17 |
-
--
|
| 18 |
-
--
|
| 19 |
--text-dim: #666;
|
| 20 |
--text-main: #e0e0e0;
|
| 21 |
--font-main: 'Courier New', Courier, monospace;
|
| 22 |
-
--border-glow: 0 0
|
| 23 |
}
|
| 24 |
|
| 25 |
* {
|
|
@@ -40,15 +41,15 @@
|
|
| 40 |
font-size: 14px;
|
| 41 |
}
|
| 42 |
|
| 43 |
-
/* --- BACKGROUND --- */
|
| 44 |
-
#
|
| 45 |
position: absolute;
|
| 46 |
top: 0;
|
| 47 |
left: 0;
|
| 48 |
width: 100%;
|
| 49 |
height: 100%;
|
| 50 |
z-index: 0;
|
| 51 |
-
opacity: 0.
|
| 52 |
pointer-events: none;
|
| 53 |
}
|
| 54 |
|
|
@@ -58,10 +59,10 @@
|
|
| 58 |
justify-content: space-between;
|
| 59 |
align-items: center;
|
| 60 |
padding: 15px 30px;
|
| 61 |
-
background: rgba(5, 5,
|
| 62 |
border-bottom: 1px solid var(--secondary-color);
|
| 63 |
z-index: 10;
|
| 64 |
-
backdrop-filter: blur(
|
| 65 |
}
|
| 66 |
|
| 67 |
.brand {
|
|
@@ -76,7 +77,6 @@
|
|
| 76 |
}
|
| 77 |
|
| 78 |
.brand i {
|
| 79 |
-
font-size: 1rem;
|
| 80 |
color: var(--text-dim);
|
| 81 |
}
|
| 82 |
|
|
@@ -86,21 +86,21 @@
|
|
| 86 |
}
|
| 87 |
|
| 88 |
.built-with a {
|
| 89 |
-
color: var(--
|
| 90 |
text-decoration: none;
|
| 91 |
-
border-bottom: 1px dotted var(--
|
| 92 |
transition: all 0.3s;
|
| 93 |
}
|
| 94 |
|
| 95 |
.built-with a:hover {
|
| 96 |
color: #fff;
|
| 97 |
-
text-shadow: 0 0 8px var(--
|
| 98 |
}
|
| 99 |
|
| 100 |
/* --- MAIN LAYOUT --- */
|
| 101 |
main {
|
| 102 |
display: grid;
|
| 103 |
-
grid-template-columns:
|
| 104 |
gap: 20px;
|
| 105 |
padding: 20px;
|
| 106 |
height: calc(100vh - 70px);
|
|
@@ -111,111 +111,81 @@
|
|
| 111 |
/* --- PANELS --- */
|
| 112 |
.panel {
|
| 113 |
background: var(--panel-bg);
|
| 114 |
-
border: 1px solid #
|
| 115 |
display: flex;
|
| 116 |
flex-direction: column;
|
| 117 |
padding: 20px;
|
| 118 |
-
box-shadow: 0 0
|
| 119 |
position: relative;
|
| 120 |
overflow: hidden;
|
| 121 |
}
|
| 122 |
|
| 123 |
-
.panel::
|
| 124 |
content: '';
|
| 125 |
position: absolute;
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
width:
|
| 129 |
-
height:
|
| 130 |
-
background:
|
| 131 |
-
|
| 132 |
}
|
| 133 |
|
| 134 |
.panel-header {
|
| 135 |
-
font-size: 0.
|
| 136 |
color: var(--text-dim);
|
| 137 |
-
margin-bottom:
|
| 138 |
text-transform: uppercase;
|
| 139 |
-
letter-spacing:
|
| 140 |
display: flex;
|
| 141 |
justify-content: space-between;
|
| 142 |
align-items: center;
|
|
|
|
|
|
|
| 143 |
}
|
| 144 |
|
| 145 |
-
/* --- LEFT
|
| 146 |
-
.
|
| 147 |
-
|
| 148 |
-
|
|
|
|
| 149 |
padding: 15px;
|
| 150 |
-
|
| 151 |
-
font-size: 0.
|
| 152 |
-
color: #
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
.error-title {
|
| 156 |
-
color: var(--alert-color);
|
| 157 |
-
font-weight: bold;
|
| 158 |
-
margin-bottom: 10px;
|
| 159 |
-
display: flex;
|
| 160 |
-
align-items: center;
|
| 161 |
-
gap: 8px;
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
.token-stats {
|
| 165 |
-
display: flex;
|
| 166 |
-
flex-direction: column;
|
| 167 |
-
gap: 15px;
|
| 168 |
-
margin-top: 20px;
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
-
.stat-row {
|
| 172 |
-
display: flex;
|
| 173 |
-
justify-content: space-between;
|
| 174 |
-
font-size: 0.8rem;
|
| 175 |
-
}
|
| 176 |
-
|
| 177 |
-
.bar-container {
|
| 178 |
-
width: 100%;
|
| 179 |
-
height: 8px;
|
| 180 |
-
background: #222;
|
| 181 |
-
margin-top: 5px;
|
| 182 |
position: relative;
|
|
|
|
|
|
|
|
|
|
| 183 |
}
|
| 184 |
|
| 185 |
-
.
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
width: 0%;
|
| 189 |
-
transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
|
| 190 |
-
box-shadow: 0 0 10px var(--alert-color);
|
| 191 |
}
|
| 192 |
|
| 193 |
-
.
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
| 196 |
}
|
| 197 |
|
| 198 |
-
.
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
width: 2px;
|
| 203 |
-
height: 16px;
|
| 204 |
-
background: #fff;
|
| 205 |
-
z-index: 2;
|
| 206 |
}
|
| 207 |
|
| 208 |
-
.
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
font-size: 0.6rem;
|
| 214 |
-
color: #fff;
|
| 215 |
-
}
|
| 216 |
|
| 217 |
-
/* --- CENTER
|
| 218 |
-
.
|
| 219 |
flex: 1;
|
| 220 |
display: flex;
|
| 221 |
flex-direction: column;
|
|
@@ -224,123 +194,159 @@
|
|
| 224 |
position: relative;
|
| 225 |
}
|
| 226 |
|
| 227 |
-
.
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
background: #222;
|
| 238 |
-
border-radius: 2px;
|
| 239 |
-
transition: all 0.3s;
|
| 240 |
}
|
| 241 |
|
| 242 |
-
.
|
| 243 |
-
|
| 244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
}
|
| 246 |
|
| 247 |
-
.
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
}
|
| 252 |
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
}
|
| 258 |
|
| 259 |
-
.
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
|
|
|
| 265 |
}
|
| 266 |
|
| 267 |
-
.
|
| 268 |
-
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
| 271 |
|
| 272 |
-
.
|
|
|
|
| 273 |
background: transparent;
|
| 274 |
-
border:
|
| 275 |
-
color: var(--
|
| 276 |
-
padding: 15px
|
| 277 |
font-family: var(--font-main);
|
| 278 |
-
font-size: 1rem;
|
| 279 |
font-weight: bold;
|
| 280 |
cursor: pointer;
|
| 281 |
text-transform: uppercase;
|
| 282 |
-
|
| 283 |
transition: all 0.3s;
|
| 284 |
-
|
| 285 |
-
overflow: hidden;
|
| 286 |
}
|
| 287 |
|
| 288 |
-
.
|
| 289 |
-
background: var(--
|
| 290 |
color: #000;
|
| 291 |
-
box-shadow: 0 0 20px var(--
|
| 292 |
}
|
| 293 |
|
| 294 |
-
.
|
| 295 |
border-color: #333;
|
| 296 |
color: #555;
|
| 297 |
cursor: not-allowed;
|
|
|
|
| 298 |
box-shadow: none;
|
| 299 |
}
|
| 300 |
|
| 301 |
-
/* --- RIGHT
|
| 302 |
-
.
|
| 303 |
flex: 1;
|
| 304 |
-
background: #000;
|
| 305 |
-
border: 1px solid #333;
|
| 306 |
-
padding: 10px;
|
| 307 |
overflow-y: auto;
|
| 308 |
-
font-size: 0.
|
| 309 |
-
|
| 310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
}
|
| 312 |
|
| 313 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
margin-bottom: 5px;
|
| 315 |
-
|
| 316 |
-
gap: 10px;
|
| 317 |
}
|
| 318 |
|
| 319 |
-
.
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
.log-msg.success { color: var(--primary-color); font-weight: bold; }
|
| 324 |
|
| 325 |
-
.
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
font-size: 0.7rem;
|
| 330 |
-
color:
|
| 331 |
-
|
| 332 |
-
position: relative;
|
| 333 |
}
|
| 334 |
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
}
|
| 345 |
|
| 346 |
/* --- RESPONSIVE --- */
|
|
@@ -352,18 +358,19 @@
|
|
| 352 |
overflow-y: auto;
|
| 353 |
}
|
| 354 |
body { overflow-y: auto; height: auto; }
|
| 355 |
-
.
|
| 356 |
}
|
| 357 |
</style>
|
| 358 |
</head>
|
|
|
|
| 359 |
<body>
|
| 360 |
|
| 361 |
-
<canvas id="
|
| 362 |
|
| 363 |
<header>
|
| 364 |
<div class="brand">
|
| 365 |
-
<i class="fa-solid fa-
|
| 366 |
-
CONTEXT <span>
|
| 367 |
</div>
|
| 368 |
<div class="built-with">
|
| 369 |
Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
|
|
@@ -371,281 +378,256 @@
|
|
| 371 |
</header>
|
| 372 |
|
| 373 |
<main>
|
| 374 |
-
<!-- LEFT
|
| 375 |
<section class="panel">
|
| 376 |
<div class="panel-header">
|
| 377 |
-
<span>
|
| 378 |
-
<i class="fa-solid fa-
|
| 379 |
</div>
|
| 380 |
-
|
| 381 |
-
<div class="
|
| 382 |
-
<
|
| 383 |
-
<p><strong>Type:</strong> invalid_request_error</p>
|
| 384 |
-
<p><strong>Code:</strong> bad_request</p>
|
| 385 |
-
<p style="margin-top: 5px; color: #fff;">Model limit exceeded. Requested 55,689 tokens.</p>
|
| 386 |
</div>
|
| 387 |
|
| 388 |
-
<div class="
|
| 389 |
-
<div class="stat-
|
| 390 |
-
<
|
| 391 |
-
<
|
| 392 |
</div>
|
| 393 |
-
<div class="
|
| 394 |
-
<div class="
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
<div class="stat-row">
|
| 398 |
-
<span>Completion Reserve</span>
|
| 399 |
-
<span>4,096</span>
|
| 400 |
-
</div>
|
| 401 |
-
<div class="bar-container">
|
| 402 |
-
<div class="bar-fill" style="width: 8%; background: #444;"></div>
|
| 403 |
-
</div>
|
| 404 |
-
|
| 405 |
-
<div class="stat-row">
|
| 406 |
-
<span style="color: var(--primary-color); font-weight: bold;">TOTAL USAGE</span>
|
| 407 |
-
<span id="total-tokens-display">55,689</span>
|
| 408 |
-
</div>
|
| 409 |
-
<div class="bar-container">
|
| 410 |
-
<div class="limit-line" style="left: 58%;"></div> <!-- 32768 / 55689 approx 58% -->
|
| 411 |
-
<div class="bar-fill" id="total-bar" style="width: 100%;"></div>
|
| 412 |
-
</div>
|
| 413 |
-
|
| 414 |
-
<div class="stat-row" style="margin-top: 5px;">
|
| 415 |
-
<span>Model Limit (Max)</span>
|
| 416 |
-
<span>32,768</span>
|
| 417 |
</div>
|
| 418 |
</div>
|
| 419 |
</section>
|
| 420 |
|
| 421 |
-
<!-- CENTER
|
| 422 |
<section class="panel">
|
| 423 |
<div class="panel-header">
|
| 424 |
-
<span>
|
| 425 |
-
<i class="fa-solid fa-
|
| 426 |
</div>
|
| 427 |
|
| 428 |
-
<div class="viz-
|
| 429 |
-
<
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
<div class="status-display" id="main-status" style="color: var(--alert-color);">
|
| 435 |
-
OVERFLOW DETECTED
|
| 436 |
-
</div>
|
| 437 |
-
<div class="sub-status" id="sub-status">
|
| 438 |
-
Waiting for user intervention...
|
| 439 |
</div>
|
| 440 |
-
|
| 441 |
-
<
|
| 442 |
-
|
| 443 |
-
</button>
|
| 444 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
</section>
|
| 446 |
|
| 447 |
-
<!-- RIGHT
|
| 448 |
<section class="panel">
|
| 449 |
<div class="panel-header">
|
| 450 |
-
<span>
|
| 451 |
-
<i class="fa-solid fa-
|
| 452 |
</div>
|
| 453 |
|
| 454 |
-
<div class="
|
| 455 |
-
<div class="
|
| 456 |
-
<
|
| 457 |
-
<
|
| 458 |
</div>
|
| 459 |
-
<div class="
|
| 460 |
-
<
|
| 461 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
</div>
|
| 463 |
</div>
|
| 464 |
|
| 465 |
-
<div
|
| 466 |
-
<
|
| 467 |
-
<
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
<div class="code-label">PYTHON</div>
|
| 472 |
-
<pre id="code-output">
|
| 473 |
-
# Initialize Optimizer
|
| 474 |
-
optimizer = ContextWindowManager(
|
| 475 |
-
limit=32768,
|
| 476 |
-
strategy="sliding_window"
|
| 477 |
-
)
|
| 478 |
-
|
| 479 |
-
# Calculate excess
|
| 480 |
-
excess = 55689 - 32768
|
| 481 |
-
# excess = 22921 tokens
|
| 482 |
-
|
| 483 |
-
# 1. Trim History
|
| 484 |
-
messages = trim_messages(
|
| 485 |
-
messages,
|
| 486 |
-
target_tokens=28000
|
| 487 |
-
)
|
| 488 |
-
|
| 489 |
-
# 2. Summarize
|
| 490 |
-
summary = summarize_old_logs(
|
| 491 |
-
messages[:100]
|
| 492 |
-
)
|
| 493 |
-
|
| 494 |
-
# 3. Reconstruct
|
| 495 |
-
new_context = [
|
| 496 |
-
system_prompt,
|
| 497 |
-
summary,
|
| 498 |
-
*recent_messages
|
| 499 |
-
]
|
| 500 |
-
</pre>
|
| 501 |
</div>
|
| 502 |
</section>
|
| 503 |
</main>
|
| 504 |
|
| 505 |
<script>
|
| 506 |
-
// ---
|
| 507 |
const CONFIG = {
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
};
|
| 513 |
|
| 514 |
// --- DOM ELEMENTS ---
|
| 515 |
-
const
|
| 516 |
-
const
|
| 517 |
-
const
|
| 518 |
-
const
|
| 519 |
-
const
|
| 520 |
-
const
|
| 521 |
-
const
|
| 522 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
|
| 524 |
// --- STATE ---
|
| 525 |
-
let
|
|
|
|
| 526 |
|
| 527 |
-
// ---
|
| 528 |
function init() {
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
}
|
|
|
|
|
|
|
| 543 |
}
|
| 544 |
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
cell.className = 'brain-cell'; // reset
|
| 549 |
-
if (Math.random() > 0.5) {
|
| 550 |
-
cell.classList.add(type);
|
| 551 |
-
}
|
| 552 |
-
});
|
| 553 |
}
|
| 554 |
|
| 555 |
-
function
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
const time = `[${String(now.getHours()).padStart(2,'0')}:${String(now.getMinutes()).padStart(2,'0')}:${String(now.getSeconds()).padStart(2,'0')}]`;
|
| 561 |
-
|
| 562 |
-
entry.innerHTML = `<span class="log-time">${time}</span><span class="log-msg ${type}">${msg}</span>`;
|
| 563 |
-
terminal.appendChild(entry);
|
| 564 |
-
terminal.scrollTop = terminal.scrollHeight;
|
| 565 |
}
|
| 566 |
|
| 567 |
-
// --- BYPASS LOGIC ---
|
| 568 |
-
async function
|
| 569 |
-
if (
|
| 570 |
-
|
| 571 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 572 |
|
| 573 |
-
//
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 579 |
|
| 580 |
await wait(1000);
|
| 581 |
|
| 582 |
-
// Step
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
totalBar.style.transition = "width 2s ease-in-out, background-color 0.5s";
|
| 590 |
-
totalBar.style.width = "58%"; // Fit to limit
|
| 591 |
-
totalBar.style.backgroundColor = "var(--warning-color)";
|
| 592 |
|
| 593 |
-
|
| 594 |
-
|
|
|
|
| 595 |
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
log("Applying Sliding Window Algorithm...", "info");
|
| 600 |
-
log("Summarizing messages 0-1500...", "info");
|
| 601 |
-
subStatus.innerText = "Compressing historical data...";
|
| 602 |
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
return messages`;
|
| 618 |
-
|
| 619 |
-
typeWriterEffect(solutionCode, codeOutput);
|
| 620 |
-
|
| 621 |
-
await wait(2500);
|
| 622 |
-
|
| 623 |
-
// Step 4: Success
|
| 624 |
-
log("Context successfully resized.", "success");
|
| 625 |
-
log("Request is now safe to send.", "success");
|
| 626 |
-
|
| 627 |
-
mainStatus.innerText = "OPTIMIZED";
|
| 628 |
-
mainStatus.style.color = "var(--primary-color)";
|
| 629 |
-
subStatus.innerText = "Ready to proceed";
|
| 630 |
-
fixBtn.innerHTML = '<i class="fa-solid fa-check"></i> BYPASS COMPLETE';
|
| 631 |
-
fixBtn.style.borderColor = "var(--primary-color)";
|
| 632 |
-
fixBtn.style.color = "var(--primary-color)";
|
| 633 |
-
|
| 634 |
-
totalBar.classList.add('safe');
|
| 635 |
-
animateGrid('active'); // Green stable state
|
| 636 |
}
|
| 637 |
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 641 |
}
|
| 642 |
|
| 643 |
-
function
|
| 644 |
let startTimestamp = null;
|
| 645 |
const step = (timestamp) => {
|
| 646 |
if (!startTimestamp) startTimestamp = timestamp;
|
| 647 |
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
|
| 648 |
-
|
|
|
|
| 649 |
if (progress < 1) {
|
| 650 |
window.requestAnimationFrame(step);
|
| 651 |
}
|
|
@@ -653,63 +635,75 @@ def bypass_context_overflow(messages):
|
|
| 653 |
window.requestAnimationFrame(step);
|
| 654 |
}
|
| 655 |
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
const speed = 20;
|
| 660 |
-
function type() {
|
| 661 |
-
if (i < text.length) {
|
| 662 |
-
element.innerHTML += text.charAt(i);
|
| 663 |
-
i++;
|
| 664 |
-
setTimeout(type, speed);
|
| 665 |
-
}
|
| 666 |
-
}
|
| 667 |
-
type();
|
| 668 |
-
}
|
| 669 |
-
|
| 670 |
-
// --- MATRIX BACKGROUND ---
|
| 671 |
-
function initMatrixEffect() {
|
| 672 |
-
const canvas = document.getElementById('matrix-canvas');
|
| 673 |
const ctx = canvas.getContext('2d');
|
| 674 |
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
const chars = '01XYZ_NULL_SPACE_NETWORK';
|
| 679 |
-
const fontSize = 14;
|
| 680 |
-
const columns = canvas.width / fontSize;
|
| 681 |
-
const drops = Array(Math.floor(columns)).fill(1);
|
| 682 |
|
| 683 |
-
function
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 689 |
|
| 690 |
-
|
| 691 |
-
const text = chars[Math.floor(Math.random() * chars.length)];
|
| 692 |
-
ctx.fillText(text, i * fontSize, drops[i] * fontSize);
|
| 693 |
|
| 694 |
-
|
| 695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 696 |
}
|
| 697 |
-
drops[i]++;
|
| 698 |
}
|
|
|
|
| 699 |
}
|
| 700 |
-
|
| 701 |
}
|
| 702 |
|
| 703 |
-
// Handle Resize
|
| 704 |
-
window.addEventListener('resize', () => {
|
| 705 |
-
const canvas = document.getElementById('matrix-canvas');
|
| 706 |
-
canvas.width = window.innerWidth;
|
| 707 |
-
canvas.height = window.innerHeight;
|
| 708 |
-
});
|
| 709 |
-
|
| 710 |
// Run
|
| 711 |
init();
|
| 712 |
|
| 713 |
</script>
|
| 714 |
</body>
|
|
|
|
| 715 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ru">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>NULL-SPACE | Context Compression Engine</title>
|
| 8 |
+
<!-- Import FontAwesome -->
|
| 9 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
|
| 11 |
<style>
|
| 12 |
/* --- CSS VARIABLES & RESET --- */
|
| 13 |
:root {
|
| 14 |
+
--bg-color: #050505;
|
| 15 |
+
--panel-bg: #0a0a0e;
|
| 16 |
+
--primary-color: #d500f9; /* Electric Purple for "Bypass" */
|
| 17 |
+
--secondary-color: #4a0072;
|
| 18 |
+
--success-color: #00e676;
|
| 19 |
+
--alert-color: #ff1744;
|
| 20 |
--text-dim: #666;
|
| 21 |
--text-main: #e0e0e0;
|
| 22 |
--font-main: 'Courier New', Courier, monospace;
|
| 23 |
+
--border-glow: 0 0 15px rgba(213, 0, 249, 0.2);
|
| 24 |
}
|
| 25 |
|
| 26 |
* {
|
|
|
|
| 41 |
font-size: 14px;
|
| 42 |
}
|
| 43 |
|
| 44 |
+
/* --- BACKGROUND FX --- */
|
| 45 |
+
#bg-canvas {
|
| 46 |
position: absolute;
|
| 47 |
top: 0;
|
| 48 |
left: 0;
|
| 49 |
width: 100%;
|
| 50 |
height: 100%;
|
| 51 |
z-index: 0;
|
| 52 |
+
opacity: 0.15;
|
| 53 |
pointer-events: none;
|
| 54 |
}
|
| 55 |
|
|
|
|
| 59 |
justify-content: space-between;
|
| 60 |
align-items: center;
|
| 61 |
padding: 15px 30px;
|
| 62 |
+
background: rgba(5, 5, 5, 0.95);
|
| 63 |
border-bottom: 1px solid var(--secondary-color);
|
| 64 |
z-index: 10;
|
| 65 |
+
backdrop-filter: blur(8px);
|
| 66 |
}
|
| 67 |
|
| 68 |
.brand {
|
|
|
|
| 77 |
}
|
| 78 |
|
| 79 |
.brand i {
|
|
|
|
| 80 |
color: var(--text-dim);
|
| 81 |
}
|
| 82 |
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
.built-with a {
|
| 89 |
+
color: var(--success-color);
|
| 90 |
text-decoration: none;
|
| 91 |
+
border-bottom: 1px dotted var(--success-color);
|
| 92 |
transition: all 0.3s;
|
| 93 |
}
|
| 94 |
|
| 95 |
.built-with a:hover {
|
| 96 |
color: #fff;
|
| 97 |
+
text-shadow: 0 0 8px var(--success-color);
|
| 98 |
}
|
| 99 |
|
| 100 |
/* --- MAIN LAYOUT --- */
|
| 101 |
main {
|
| 102 |
display: grid;
|
| 103 |
+
grid-template-columns: 1fr 400px 1fr;
|
| 104 |
gap: 20px;
|
| 105 |
padding: 20px;
|
| 106 |
height: calc(100vh - 70px);
|
|
|
|
| 111 |
/* --- PANELS --- */
|
| 112 |
.panel {
|
| 113 |
background: var(--panel-bg);
|
| 114 |
+
border: 1px solid #333;
|
| 115 |
display: flex;
|
| 116 |
flex-direction: column;
|
| 117 |
padding: 20px;
|
| 118 |
+
box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
|
| 119 |
position: relative;
|
| 120 |
overflow: hidden;
|
| 121 |
}
|
| 122 |
|
| 123 |
+
.panel::after {
|
| 124 |
content: '';
|
| 125 |
position: absolute;
|
| 126 |
+
bottom: 0;
|
| 127 |
+
right: 0;
|
| 128 |
+
width: 100px;
|
| 129 |
+
height: 100px;
|
| 130 |
+
background: radial-gradient(circle, rgba(213,0,249,0.1) 0%, transparent 70%);
|
| 131 |
+
pointer-events: none;
|
| 132 |
}
|
| 133 |
|
| 134 |
.panel-header {
|
| 135 |
+
font-size: 0.85rem;
|
| 136 |
color: var(--text-dim);
|
| 137 |
+
margin-bottom: 15px;
|
| 138 |
text-transform: uppercase;
|
| 139 |
+
letter-spacing: 1.5px;
|
| 140 |
display: flex;
|
| 141 |
justify-content: space-between;
|
| 142 |
align-items: center;
|
| 143 |
+
border-bottom: 1px solid #222;
|
| 144 |
+
padding-bottom: 10px;
|
| 145 |
}
|
| 146 |
|
| 147 |
+
/* --- LEFT: PAYLOAD INPUT --- */
|
| 148 |
+
.payload-container {
|
| 149 |
+
flex: 1;
|
| 150 |
+
background: #000;
|
| 151 |
+
border: 1px solid #333;
|
| 152 |
padding: 15px;
|
| 153 |
+
font-family: 'Consolas', monospace;
|
| 154 |
+
font-size: 0.75rem;
|
| 155 |
+
color: #888;
|
| 156 |
+
overflow-y: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
position: relative;
|
| 158 |
+
white-space: pre-wrap;
|
| 159 |
+
word-break: break-all;
|
| 160 |
+
transition: all 0.5s;
|
| 161 |
}
|
| 162 |
|
| 163 |
+
.payload-compressed {
|
| 164 |
+
color: var(--primary-color);
|
| 165 |
+
text-shadow: 0 0 5px rgba(213, 0, 249, 0.5);
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
|
| 168 |
+
.stats-overlay {
|
| 169 |
+
margin-top: 15px;
|
| 170 |
+
display: grid;
|
| 171 |
+
grid-template-columns: 1fr 1fr;
|
| 172 |
+
gap: 10px;
|
| 173 |
}
|
| 174 |
|
| 175 |
+
.stat-box {
|
| 176 |
+
background: #111;
|
| 177 |
+
padding: 10px;
|
| 178 |
+
border-left: 2px solid #444;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
+
.stat-box.warning { border-color: var(--alert-color); }
|
| 182 |
+
.stat-box.success { border-color: var(--success-color); }
|
| 183 |
+
|
| 184 |
+
.stat-label { font-size: 0.7rem; color: var(--text-dim); }
|
| 185 |
+
.stat-value { font-size: 1.2rem; font-weight: bold; margin-top: 5px; }
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
+
/* --- CENTER: THE ENGINE --- */
|
| 188 |
+
.engine-viz {
|
| 189 |
flex: 1;
|
| 190 |
display: flex;
|
| 191 |
flex-direction: column;
|
|
|
|
| 194 |
position: relative;
|
| 195 |
}
|
| 196 |
|
| 197 |
+
.core-ring {
|
| 198 |
+
width: 180px;
|
| 199 |
+
height: 180px;
|
| 200 |
+
border-radius: 50%;
|
| 201 |
+
border: 2px dashed var(--secondary-color);
|
| 202 |
+
position: relative;
|
| 203 |
+
display: flex;
|
| 204 |
+
justify-content: center;
|
| 205 |
+
align-items: center;
|
| 206 |
+
animation: spin 10s linear infinite;
|
|
|
|
|
|
|
|
|
|
| 207 |
}
|
| 208 |
|
| 209 |
+
.core-inner {
|
| 210 |
+
width: 140px;
|
| 211 |
+
height: 140px;
|
| 212 |
+
background: radial-gradient(circle, #1a0033 0%, #000 100%);
|
| 213 |
+
border-radius: 50%;
|
| 214 |
+
border: 1px solid var(--primary-color);
|
| 215 |
+
display: flex;
|
| 216 |
+
justify-content: center;
|
| 217 |
+
align-items: center;
|
| 218 |
+
flex-direction: column;
|
| 219 |
+
z-index: 2;
|
| 220 |
+
box-shadow: 0 0 30px rgba(213, 0, 249, 0.1);
|
| 221 |
}
|
| 222 |
|
| 223 |
+
.core-icon {
|
| 224 |
+
font-size: 3rem;
|
| 225 |
+
color: var(--primary-color);
|
| 226 |
+
margin-bottom: 10px;
|
| 227 |
}
|
| 228 |
|
| 229 |
+
.core-status {
|
| 230 |
+
font-size: 0.7rem;
|
| 231 |
+
color: var(--text-dim);
|
| 232 |
+
text-transform: uppercase;
|
| 233 |
}
|
| 234 |
|
| 235 |
+
.progress-paths {
|
| 236 |
+
position: absolute;
|
| 237 |
+
width: 100%;
|
| 238 |
+
height: 100%;
|
| 239 |
+
top: 0;
|
| 240 |
+
left: 0;
|
| 241 |
+
pointer-events: none;
|
| 242 |
}
|
| 243 |
|
| 244 |
+
.particle {
|
| 245 |
+
position: absolute;
|
| 246 |
+
width: 4px;
|
| 247 |
+
height: 4px;
|
| 248 |
+
background: var(--primary-color);
|
| 249 |
+
border-radius: 50%;
|
| 250 |
+
opacity: 0;
|
| 251 |
}
|
| 252 |
|
| 253 |
+
.action-btn {
|
| 254 |
+
margin-top: 40px;
|
| 255 |
background: transparent;
|
| 256 |
+
border: 1px solid var(--primary-color);
|
| 257 |
+
color: var(--primary-color);
|
| 258 |
+
padding: 15px 30px;
|
| 259 |
font-family: var(--font-main);
|
|
|
|
| 260 |
font-weight: bold;
|
| 261 |
cursor: pointer;
|
| 262 |
text-transform: uppercase;
|
| 263 |
+
letter-spacing: 2px;
|
| 264 |
transition: all 0.3s;
|
| 265 |
+
clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
|
|
|
|
| 266 |
}
|
| 267 |
|
| 268 |
+
.action-btn:hover {
|
| 269 |
+
background: var(--primary-color);
|
| 270 |
color: #000;
|
| 271 |
+
box-shadow: 0 0 20px var(--primary-color);
|
| 272 |
}
|
| 273 |
|
| 274 |
+
.action-btn:disabled {
|
| 275 |
border-color: #333;
|
| 276 |
color: #555;
|
| 277 |
cursor: not-allowed;
|
| 278 |
+
background: transparent;
|
| 279 |
box-shadow: none;
|
| 280 |
}
|
| 281 |
|
| 282 |
+
/* --- RIGHT: ALGORITHM LOG --- */
|
| 283 |
+
.algo-display {
|
| 284 |
flex: 1;
|
|
|
|
|
|
|
|
|
|
| 285 |
overflow-y: auto;
|
| 286 |
+
font-size: 0.8rem;
|
| 287 |
+
color: #ccc;
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
.algo-step {
|
| 291 |
+
margin-bottom: 15px;
|
| 292 |
+
padding-left: 15px;
|
| 293 |
+
border-left: 2px solid #333;
|
| 294 |
+
opacity: 0.5;
|
| 295 |
+
transition: all 0.3s;
|
| 296 |
}
|
| 297 |
|
| 298 |
+
.algo-step.active {
|
| 299 |
+
border-left-color: var(--primary-color);
|
| 300 |
+
opacity: 1;
|
| 301 |
+
background: linear-gradient(90deg, rgba(213,0,249,0.1), transparent);
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
.algo-step h4 {
|
| 305 |
+
color: var(--primary-color);
|
| 306 |
margin-bottom: 5px;
|
| 307 |
+
font-size: 0.85rem;
|
|
|
|
| 308 |
}
|
| 309 |
|
| 310 |
+
.algo-step p {
|
| 311 |
+
font-size: 0.75rem;
|
| 312 |
+
color: #888;
|
| 313 |
+
}
|
|
|
|
| 314 |
|
| 315 |
+
.compression-ratio {
|
| 316 |
+
font-size: 3rem;
|
| 317 |
+
text-align: center;
|
| 318 |
+
margin-top: 10px;
|
| 319 |
+
font-weight: 900;
|
| 320 |
+
color: #fff;
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.ratio-label {
|
| 324 |
+
text-align: center;
|
| 325 |
font-size: 0.7rem;
|
| 326 |
+
color: var(--text-dim);
|
| 327 |
+
text-transform: uppercase;
|
|
|
|
| 328 |
}
|
| 329 |
|
| 330 |
+
/* --- ANIMATIONS --- */
|
| 331 |
+
@keyframes spin {
|
| 332 |
+
0% { transform: rotate(0deg); }
|
| 333 |
+
100% { transform: rotate(360deg); }
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
@keyframes pulse-ring {
|
| 337 |
+
0% { transform: scale(0.9); opacity: 0.5; border-color: var(--primary-color); }
|
| 338 |
+
50% { transform: scale(1.1); opacity: 1; border-color: #fff; }
|
| 339 |
+
100% { transform: scale(0.9); opacity: 0.5; border-color: var(--primary-color); }
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
.processing .core-ring {
|
| 343 |
+
animation: spin 2s linear infinite; /* Speed up */
|
| 344 |
+
border-color: var(--primary-color);
|
| 345 |
+
box-shadow: 0 0 15px var(--primary-color);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
.processing .core-inner {
|
| 349 |
+
animation: pulse-ring 1s infinite;
|
| 350 |
}
|
| 351 |
|
| 352 |
/* --- RESPONSIVE --- */
|
|
|
|
| 358 |
overflow-y: auto;
|
| 359 |
}
|
| 360 |
body { overflow-y: auto; height: auto; }
|
| 361 |
+
.payload-container { min-height: 200px; }
|
| 362 |
}
|
| 363 |
</style>
|
| 364 |
</head>
|
| 365 |
+
|
| 366 |
<body>
|
| 367 |
|
| 368 |
+
<canvas id="bg-canvas"></canvas>
|
| 369 |
|
| 370 |
<header>
|
| 371 |
<div class="brand">
|
| 372 |
+
<i class="fa-solid fa-compress-arrows-alt"></i>
|
| 373 |
+
CONTEXT <span>INJECTOR</span>
|
| 374 |
</div>
|
| 375 |
<div class="built-with">
|
| 376 |
Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
|
|
|
|
| 378 |
</header>
|
| 379 |
|
| 380 |
<main>
|
| 381 |
+
<!-- LEFT: PAYLOAD -->
|
| 382 |
<section class="panel">
|
| 383 |
<div class="panel-header">
|
| 384 |
+
<span>Raw Payload Data</span>
|
| 385 |
+
<i class="fa-solid fa-file-code"></i>
|
| 386 |
</div>
|
| 387 |
+
|
| 388 |
+
<div class="payload-container" id="payload-view">
|
| 389 |
+
<!-- Generated content goes here -->
|
|
|
|
|
|
|
|
|
|
| 390 |
</div>
|
| 391 |
|
| 392 |
+
<div class="stats-overlay">
|
| 393 |
+
<div class="stat-box warning">
|
| 394 |
+
<div class="stat-label">ORIGINAL SIZE</div>
|
| 395 |
+
<div class="stat-value" id="orig-tokens">0 tk</div>
|
| 396 |
</div>
|
| 397 |
+
<div class="stat-box success">
|
| 398 |
+
<div class="stat-label">INJECTED SIZE</div>
|
| 399 |
+
<div class="stat-value" id="new-tokens">0 tk</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
</div>
|
| 401 |
</div>
|
| 402 |
</section>
|
| 403 |
|
| 404 |
+
<!-- CENTER: ENGINE -->
|
| 405 |
<section class="panel">
|
| 406 |
<div class="panel-header">
|
| 407 |
+
<span>Compression Core</span>
|
| 408 |
+
<i class="fa-solid fa-microchip"></i>
|
| 409 |
</div>
|
| 410 |
|
| 411 |
+
<div class="engine-viz" id="engine-viz">
|
| 412 |
+
<div class="core-ring" id="core-ring">
|
| 413 |
+
<div class="core-inner">
|
| 414 |
+
<i class="fa-solid fa-cube core-icon" id="core-icon"></i>
|
| 415 |
+
<span class="core-status" id="core-text">IDLE</span>
|
| 416 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
</div>
|
| 418 |
+
|
| 419 |
+
<div class="compression-ratio" id="ratio-display">0%</div>
|
| 420 |
+
<div class="ratio-label">DENSITY SAVED</div>
|
|
|
|
| 421 |
</div>
|
| 422 |
+
|
| 423 |
+
<button class="action-btn" id="inject-btn" onclick="startInjection()">
|
| 424 |
+
<i class="fa-solid fa-upload"></i> INJECT PAYLOAD
|
| 425 |
+
</button>
|
| 426 |
</section>
|
| 427 |
|
| 428 |
+
<!-- RIGHT: LOGIC -->
|
| 429 |
<section class="panel">
|
| 430 |
<div class="panel-header">
|
| 431 |
+
<span>Bypass Protocol</span>
|
| 432 |
+
<i class="fa-solid fa-shield-halved"></i>
|
| 433 |
</div>
|
| 434 |
|
| 435 |
+
<div class="algo-display">
|
| 436 |
+
<div class="algo-step" id="step-1">
|
| 437 |
+
<h4>1. ANALYZE DENSITY</h4>
|
| 438 |
+
<p>Scan payload for semantic redundancy and compressible patterns.</p>
|
| 439 |
</div>
|
| 440 |
+
<div class="algo-step" id="step-2">
|
| 441 |
+
<h4>2. HIERARCHICAL ENCODING</h4>
|
| 442 |
+
<p>Apply LZW-style token compression to high-frequency data clusters.</p>
|
| 443 |
+
</div>
|
| 444 |
+
<div class="algo-step" id="step-3">
|
| 445 |
+
<h4>3. STEGANOGRAPHIC WRAP</h4>
|
| 446 |
+
<p>Embed compressed data into "System Prompt" reserved space.</p>
|
| 447 |
+
</div>
|
| 448 |
+
<div class="algo-step" id="step-4">
|
| 449 |
+
<h4>4. VALIDATION</h4>
|
| 450 |
+
<p>Verify token count is below the 32,768 hard limit threshold.</p>
|
| 451 |
</div>
|
| 452 |
</div>
|
| 453 |
|
| 454 |
+
<div style="margin-top: auto; border-top: 1px solid #222; padding-top: 15px;">
|
| 455 |
+
<div class="stat-label">TARGET LIMIT</div>
|
| 456 |
+
<div style="font-size: 1.1rem; color: #fff; display: flex; justify-content: space-between;">
|
| 457 |
+
<span>32,768</span>
|
| 458 |
+
<i class="fa-solid fa-lock-open" style="color: var(--primary-color);"></i>
|
| 459 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 460 |
</div>
|
| 461 |
</section>
|
| 462 |
</main>
|
| 463 |
|
| 464 |
<script>
|
| 465 |
+
// --- CONFIG ---
|
| 466 |
const CONFIG = {
|
| 467 |
+
limit: 32768,
|
| 468 |
+
// Simulate a payload that is 150% of the limit
|
| 469 |
+
initialTokens: Math.floor(32768 * 1.5),
|
| 470 |
+
compressionFactor: 0.65 // We will compress down to 65%
|
| 471 |
};
|
| 472 |
|
| 473 |
// --- DOM ELEMENTS ---
|
| 474 |
+
const payloadView = document.getElementById('payload-view');
|
| 475 |
+
const origTokenDisplay = document.getElementById('orig-tokens');
|
| 476 |
+
const newTokenDisplay = document.getElementById('new-tokens');
|
| 477 |
+
const engineViz = document.getElementById('engine-viz');
|
| 478 |
+
const coreText = document.getElementById('core-text');
|
| 479 |
+
const coreIcon = document.getElementById('core-icon');
|
| 480 |
+
const injectBtn = document.getElementById('inject-btn');
|
| 481 |
+
const ratioDisplay = document.getElementById('ratio-display');
|
| 482 |
+
const steps = [
|
| 483 |
+
document.getElementById('step-1'),
|
| 484 |
+
document.getElementById('step-2'),
|
| 485 |
+
document.getElementById('step-3'),
|
| 486 |
+
document.getElementById('step-4')
|
| 487 |
+
];
|
| 488 |
|
| 489 |
// --- STATE ---
|
| 490 |
+
let isProcessing = false;
|
| 491 |
+
let dummyText = "";
|
| 492 |
|
| 493 |
+
// --- INIT ---
|
| 494 |
function init() {
|
| 495 |
+
generateDummyData();
|
| 496 |
+
initCanvas();
|
| 497 |
+
|
| 498 |
+
// Set initial stats
|
| 499 |
+
origTokenDisplay.innerText = CONFIG.initialTokens.toLocaleString() + " tk";
|
| 500 |
+
newTokenDisplay.innerText = CONFIG.initialTokens.toLocaleString() + " tk";
|
| 501 |
+
ratioDisplay.innerText = "0%";
|
| 502 |
+
|
| 503 |
+
// Highlight initial visual state
|
| 504 |
+
origTokenDisplay.parentElement.style.borderColor = "var(--alert-color)";
|
| 505 |
+
newTokenDisplay.parentElement.style.borderColor = "#444";
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
// --- DATA GENERATOR ---
|
| 509 |
+
function generateDummyData() {
|
| 510 |
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]:;<>,.?/\\|";
|
| 511 |
+
let result = "";
|
| 512 |
+
for(let i=0; i<3000; i++) {
|
| 513 |
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
| 514 |
+
if(i % 50 === 0) result += "\n";
|
| 515 |
}
|
| 516 |
+
dummyText = result;
|
| 517 |
+
payloadView.innerText = dummyText.substring(0, 500) + "... [TRUNCATED VIEW]";
|
| 518 |
}
|
| 519 |
|
| 520 |
+
// --- ANIMATION HELPERS ---
|
| 521 |
+
function wait(ms) {
|
| 522 |
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
}
|
| 524 |
|
| 525 |
+
function setActiveStep(index) {
|
| 526 |
+
steps.forEach((s, i) => {
|
| 527 |
+
if (i === index) s.classList.add('active');
|
| 528 |
+
else s.classList.remove('active');
|
| 529 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
}
|
| 531 |
|
| 532 |
+
// --- THE BYPASS LOGIC ---
|
| 533 |
+
async function startInjection() {
|
| 534 |
+
if (isProcessing) return;
|
| 535 |
+
isProcessing = true;
|
| 536 |
+
injectBtn.disabled = true;
|
| 537 |
+
injectBtn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> PROCESSING';
|
| 538 |
+
|
| 539 |
+
// Reset UI
|
| 540 |
+
setActiveStep(-1);
|
| 541 |
+
coreIcon.className = "fa-solid fa-cube core-icon";
|
| 542 |
+
engineViz.classList.add('processing');
|
| 543 |
+
|
| 544 |
+
// Step 1: Analyze
|
| 545 |
+
setActiveStep(0);
|
| 546 |
+
coreText.innerText = "SCANNING...";
|
| 547 |
+
coreText.style.color = "var(--primary-color)";
|
| 548 |
+
await scrambleText();
|
| 549 |
+
await wait(800);
|
| 550 |
+
|
| 551 |
+
// Step 2: Encode
|
| 552 |
+
setActiveStep(1);
|
| 553 |
+
coreText.innerText = "ENCODING...";
|
| 554 |
+
coreIcon.className = "fa-solid fa-database core-icon";
|
| 555 |
+
await animateNumber(origTokenDisplay, CONFIG.initialTokens, Math.floor(CONFIG.initialTokens * 0.9), 1000);
|
| 556 |
+
await wait(800);
|
| 557 |
+
|
| 558 |
+
// Step 3: Wrap/Steganography
|
| 559 |
+
setActiveStep(2);
|
| 560 |
+
coreText.innerText = "INJECTING...";
|
| 561 |
+
coreIcon.className = "fa-solid fa-mask core-icon";
|
| 562 |
|
| 563 |
+
// Visual effect of compression
|
| 564 |
+
payloadView.classList.add('payload-compressed');
|
| 565 |
+
payloadView.innerText = generateHexDump();
|
| 566 |
+
payloadView.style.fontSize = "0.6rem"; // Visual density increase
|
| 567 |
+
|
| 568 |
+
// Animate stats down
|
| 569 |
+
const finalTokenCount = Math.floor(CONFIG.initialTokens * CONFIG.compressionFactor);
|
| 570 |
+
await animateNumber(newTokenDisplay, Math.floor(CONFIG.initialTokens * 0.9), finalTokenCount, 1500);
|
| 571 |
+
|
| 572 |
+
// Animate Ratio
|
| 573 |
+
const savedPercent = Math.round((1 - CONFIG.compressionFactor) * 100);
|
| 574 |
+
animateNumber(ratioDisplay, 0, savedPercent, 1500, "%");
|
| 575 |
|
| 576 |
await wait(1000);
|
| 577 |
|
| 578 |
+
// Step 4: Success
|
| 579 |
+
setActiveStep(3);
|
| 580 |
+
engineViz.classList.remove('processing');
|
| 581 |
+
coreText.innerText = "BYPASS OK";
|
| 582 |
+
coreText.style.color = "var(--success-color)";
|
| 583 |
+
coreIcon.className = "fa-solid fa-check-circle core-icon";
|
| 584 |
+
coreIcon.style.color = "var(--success-color)";
|
|
|
|
|
|
|
|
|
|
| 585 |
|
| 586 |
+
newTokenDisplay.parentElement.classList.remove('warning');
|
| 587 |
+
newTokenDisplay.parentElement.classList.add('success');
|
| 588 |
+
newTokenDisplay.style.color = "var(--success-color)";
|
| 589 |
|
| 590 |
+
injectBtn.innerHTML = '<i class="fa-solid fa-check"></i> INJECTION COMPLETE';
|
| 591 |
+
injectBtn.style.borderColor = "var(--success-color)";
|
| 592 |
+
injectBtn.style.color = "var(--success-color)";
|
|
|
|
|
|
|
|
|
|
| 593 |
|
| 594 |
+
isProcessing = false;
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
// --- VISUAL EFFECTS ---
|
| 598 |
+
function scrambleText() {
|
| 599 |
+
const original = payloadView.innerText;
|
| 600 |
+
let iterations = 0;
|
| 601 |
+
const interval = setInterval(() => {
|
| 602 |
+
payloadView.innerText = original
|
| 603 |
+
.split("")
|
| 604 |
+
.map((letter, index) => {
|
| 605 |
+
if(index < iterations) return original[index];
|
| 606 |
+
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random() * 36)];
|
| 607 |
+
})
|
| 608 |
+
.join("");
|
| 609 |
|
| 610 |
+
if(iterations >= 10) clearInterval(interval);
|
| 611 |
+
iterations += 1/3;
|
| 612 |
+
}, 30);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
}
|
| 614 |
|
| 615 |
+
function generateHexDump() {
|
| 616 |
+
let hex = "";
|
| 617 |
+
for(let i=0; i<60; i++) {
|
| 618 |
+
hex += "0x" + Math.floor(Math.random()*255).toString(16).padStart(2,'0').toUpperCase() + " ";
|
| 619 |
+
if(i%8===0) hex += "\n";
|
| 620 |
+
}
|
| 621 |
+
return hex + "\n... [COMPRESSED KERNEL]";
|
| 622 |
}
|
| 623 |
|
| 624 |
+
function animateNumber(element, start, end, duration, suffix = "") {
|
| 625 |
let startTimestamp = null;
|
| 626 |
const step = (timestamp) => {
|
| 627 |
if (!startTimestamp) startTimestamp = timestamp;
|
| 628 |
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
|
| 629 |
+
const val = Math.floor(progress * (end - start) + start);
|
| 630 |
+
element.innerHTML = val.toLocaleString() + " tk" + suffix;
|
| 631 |
if (progress < 1) {
|
| 632 |
window.requestAnimationFrame(step);
|
| 633 |
}
|
|
|
|
| 635 |
window.requestAnimationFrame(step);
|
| 636 |
}
|
| 637 |
|
| 638 |
+
// --- BACKGROUND CANVAS (Network Nodes) ---
|
| 639 |
+
function initCanvas() {
|
| 640 |
+
const canvas = document.getElementById('bg-canvas');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 641 |
const ctx = canvas.getContext('2d');
|
| 642 |
|
| 643 |
+
let width, height;
|
| 644 |
+
let particles = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 645 |
|
| 646 |
+
function resize() {
|
| 647 |
+
width = canvas.width = window.innerWidth;
|
| 648 |
+
height = canvas.height = window.innerHeight;
|
| 649 |
+
}
|
| 650 |
+
window.addEventListener('resize', resize);
|
| 651 |
+
resize();
|
| 652 |
+
|
| 653 |
+
class Particle {
|
| 654 |
+
constructor() {
|
| 655 |
+
this.x = Math.random() * width;
|
| 656 |
+
this.y = Math.random() * height;
|
| 657 |
+
this.vx = (Math.random() - 0.5) * 0.5;
|
| 658 |
+
this.vy = (Math.random() - 0.5) * 0.5;
|
| 659 |
+
this.size = Math.random() * 2 + 1;
|
| 660 |
+
}
|
| 661 |
+
update() {
|
| 662 |
+
this.x += this.vx;
|
| 663 |
+
this.y += this.vy;
|
| 664 |
+
if (this.x < 0 || this.x > width) this.vx *= -1;
|
| 665 |
+
if (this.y < 0 || this.y > height) this.vy *= -1;
|
| 666 |
+
}
|
| 667 |
+
draw() {
|
| 668 |
+
ctx.fillStyle = '#d500f9';
|
| 669 |
+
ctx.beginPath();
|
| 670 |
+
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
|
| 671 |
+
ctx.fill();
|
| 672 |
+
}
|
| 673 |
+
}
|
| 674 |
|
| 675 |
+
for(let i=0; i<40; i++) particles.push(new Particle());
|
|
|
|
|
|
|
| 676 |
|
| 677 |
+
function animate() {
|
| 678 |
+
ctx.clearRect(0, 0, width, height);
|
| 679 |
+
|
| 680 |
+
// Draw connections
|
| 681 |
+
ctx.strokeStyle = 'rgba(213, 0, 249, 0.1)';
|
| 682 |
+
ctx.lineWidth = 1;
|
| 683 |
+
for(let i=0; i<particles.length; i++) {
|
| 684 |
+
particles[i].update();
|
| 685 |
+
particles[i].draw();
|
| 686 |
+
for(let j=i; j<particles.length; j++) {
|
| 687 |
+
const dx = particles[i].x - particles[j].x;
|
| 688 |
+
const dy = particles[i].y - particles[j].y;
|
| 689 |
+
const dist = Math.sqrt(dx*dx + dy*dy);
|
| 690 |
+
if(dist < 150) {
|
| 691 |
+
ctx.beginPath();
|
| 692 |
+
ctx.moveTo(particles[i].x, particles[i].y);
|
| 693 |
+
ctx.lineTo(particles[j].x, particles[j].y);
|
| 694 |
+
ctx.stroke();
|
| 695 |
+
}
|
| 696 |
}
|
|
|
|
| 697 |
}
|
| 698 |
+
requestAnimationFrame(animate);
|
| 699 |
}
|
| 700 |
+
animate();
|
| 701 |
}
|
| 702 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
// Run
|
| 704 |
init();
|
| 705 |
|
| 706 |
</script>
|
| 707 |
</body>
|
| 708 |
+
|
| 709 |
</html>
|