Spaces:
Running
Running
Update index.html
Browse files- index.html +445 -560
index.html
CHANGED
|
@@ -1,566 +1,451 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 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-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 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 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
"aiqtech/flxgif": "Image Gen",
|
| 352 |
-
"aiqtech/imaginpaint": "Image Edit"
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
};
|
| 356 |
-
|
| 357 |
-
const newProjects = [
|
| 358 |
-
"fantos/Panorama",
|
| 359 |
-
"ginigen/Multi-LoRAgen",
|
| 360 |
-
"ginigen/canvas-studio",
|
| 361 |
-
"ginipick/Fashion-Stylegen",
|
| 362 |
-
"ginipick/Time-Stream",
|
| 363 |
-
"ginipick/AccuVision-Diffusion",
|
| 364 |
-
"fantos/Magic-Drawings",
|
| 365 |
-
"ginigen/Lumina-Image-PLUS",
|
| 366 |
-
"fantaxy/fantasy-novel",
|
| 367 |
-
"fantaxy/eros",
|
| 368 |
-
"fantaxy/adult-novel",
|
| 369 |
-
"fantaxy/kungfu-novel",
|
| 370 |
-
"fantaxy/love-novel",
|
| 371 |
-
"VIDraft/mouse-webgen",
|
| 372 |
-
"immunobiotech/MUSIC-Jukebox",
|
| 373 |
-
"seawolf2357/Flowise-AI",
|
| 374 |
-
"ginigen/Flux-LayerDiffuse",
|
| 375 |
-
"VIDraft/Portrait-Animation",
|
| 376 |
-
"VIDraft/Deepseek-Multimodal",
|
| 377 |
-
"VIDraft/BLIP2",
|
| 378 |
-
"ginigen/text3d-r1",
|
| 379 |
-
"immunobiotech/drug-discovery",
|
| 380 |
-
"openfree/VisionOCR-Chat",
|
| 381 |
-
"immunobiotech/MICHELIN",
|
| 382 |
-
"immunobiotech/MICHELIN-korea",
|
| 383 |
-
"immunobiotech/MICHELIN-japan",
|
| 384 |
-
"immunobiotech/MICHELIN-china",
|
| 385 |
-
"VIDraft/money-radar-korea",
|
| 386 |
-
"VIDraft/money-radar",
|
| 387 |
-
"ginipick/PharmAI-Korea",
|
| 388 |
-
"ginigen/MagicFace-V3",
|
| 389 |
-
"aiqcamp/MindMap",
|
| 390 |
-
"ginigen/3D-LLAMA",
|
| 391 |
-
"openfree/VectorFlow",
|
| 392 |
-
"openfree/webtoon-gen",
|
| 393 |
-
"VIDraft/topic-prediction",
|
| 394 |
-
"VIDraft/PapersImpact",
|
| 395 |
-
"VIDraft/EveryRAG",
|
| 396 |
-
"VIDraft/korea-president-DJ",
|
| 397 |
-
"VIDraft/korea-president-PARK",
|
| 398 |
-
"openfree/image-to-vector",
|
| 399 |
-
"ginipick/QR-Canvas-plus",
|
| 400 |
-
"openfree/MagicFace-V3",
|
| 401 |
-
"ginipick/DeepSeekR1-LIVE",
|
| 402 |
-
"ginigen/ColPali-multi",
|
| 403 |
-
"ginigen/Janus-Pro-7B",
|
| 404 |
-
"ginigen/Animagine",
|
| 405 |
-
"openfree/PDF-RAG",
|
| 406 |
-
"fantos/Ranking-Tracker",
|
| 407 |
-
"aiqcamp/Multilingual-Images",
|
| 408 |
-
"aiqcamp/Gemini2-Flash-Thinking",
|
| 409 |
-
"openfree/pepe",
|
| 410 |
-
"openfree/korea-president-yoon",
|
| 411 |
-
"openfree/CryptoVision",
|
| 412 |
-
"fantos/VoiceClone",
|
| 413 |
-
"seawolf2357/ocrlatex",
|
| 414 |
-
"seawolf2357/img2vid",
|
| 415 |
-
"seawolf2357/sd-prompt-gen",
|
| 416 |
-
"openfree/tarotcard",
|
| 417 |
-
"aiqcamp/Polaroid",
|
| 418 |
-
"ginigen/cartoon",
|
| 419 |
-
"ginigen/Book-Cover"
|
| 420 |
-
];
|
| 421 |
-
|
| 422 |
-
const bestProjects = [
|
| 423 |
-
"openfree/VisionOCR-Chat",
|
| 424 |
-
"ginigen/3D-LLAMA",
|
| 425 |
-
"fantos/Ranking-Tracker",
|
| 426 |
-
"openfree/trending-board",
|
| 427 |
-
"openfree/Korean-Leaderboard",
|
| 428 |
-
"fantos/Panorama",
|
| 429 |
-
"ginigen/Multi-LoRAgen",
|
| 430 |
-
"ginigen/canvas-studio",
|
| 431 |
-
"fantaxy/adult-novel",
|
| 432 |
-
"VIDraft/mouse-webgen",
|
| 433 |
-
"ginigen/text3d-r1",
|
| 434 |
-
"immunobiotech/MICHELIN-korea",
|
| 435 |
-
"VIDraft/money-radar-korea",
|
| 436 |
-
"ginipick/PharmAI-Korea",
|
| 437 |
-
"VIDraft/PapersImpact",
|
| 438 |
-
"aiqcamp/MindMap",
|
| 439 |
-
"VIDraft/EveryRAG",
|
| 440 |
-
"openfree/MagicFace-V3",
|
| 441 |
-
"ginigen/Animagine",
|
| 442 |
-
"openfree/PDF-RAG",
|
| 443 |
-
"aiqcamp/Multilingual-Images",
|
| 444 |
-
"aiqcamp/Gemini2-Flash-Thinking",
|
| 445 |
-
"openfree/CryptoVision",
|
| 446 |
-
"fantos/VoiceClone",
|
| 447 |
-
"seawolf2357/ocrlatex",
|
| 448 |
-
"ginigen/cartoon",
|
| 449 |
-
"ginigen/Book-Cover",
|
| 450 |
-
"aiqcamp/fash",
|
| 451 |
-
"seawolf2357/REALVISXL-V5",
|
| 452 |
-
"aiqcamp/AudioLlama",
|
| 453 |
-
"ginigen/FLUXllama-Multilingual",
|
| 454 |
-
"ginipick/FitGen"
|
| 455 |
-
];
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
// 4. URL 변환 함수
|
| 459 |
-
function transformUrl(url) {
|
| 460 |
-
const prefix = "https://huggingface.co/spaces/";
|
| 461 |
-
if (url.startsWith(prefix)) {
|
| 462 |
-
const rest = url.substring(prefix.length);
|
| 463 |
-
return "https://" + rest.replace("/", "-") + ".hf.space";
|
| 464 |
-
}
|
| 465 |
-
return url;
|
| 466 |
-
}
|
| 467 |
-
|
| 468 |
-
// 5. 프로젝트 배열 생성
|
| 469 |
-
const keys = Object.keys(projectList);
|
| 470 |
-
const projects = keys.map(key => {
|
| 471 |
-
const primaryCategory = customCategories[key] || "Image Gen";
|
| 472 |
-
let categories = [primaryCategory];
|
| 473 |
-
|
| 474 |
-
if (newProjects.includes(key)) categories.push("NEW");
|
| 475 |
-
if (bestProjects.includes(key)) categories.push("BEST");
|
| 476 |
-
|
| 477 |
-
return {
|
| 478 |
-
name: primaryCategory + "/" + key.split("/")[1],
|
| 479 |
-
url: transformUrl(projectList[key]),
|
| 480 |
-
categories: categories
|
| 481 |
-
};
|
| 482 |
-
});
|
| 483 |
-
|
| 484 |
-
// 6. 카테고리별 그룹화
|
| 485 |
-
const grouped = {};
|
| 486 |
-
projects.forEach(proj => {
|
| 487 |
-
proj.categories.forEach(cat => {
|
| 488 |
-
if (!grouped[cat]) grouped[cat] = [];
|
| 489 |
-
grouped[cat].push(proj);
|
| 490 |
-
});
|
| 491 |
-
});
|
| 492 |
-
|
| 493 |
-
// 7. 필터 버튼 생성
|
| 494 |
-
const fixedGroups = ["NEW", "BEST", "Text", "Image Gen", "Image Edit", "Audio", "Video", "Productivity", "Utility", "Vision"];
|
| 495 |
-
const filterGroupDiv = document.getElementById("filter-group");
|
| 496 |
-
|
| 497 |
-
const allButton = document.createElement("button");
|
| 498 |
-
allButton.className = "toggle-button active";
|
| 499 |
-
allButton.setAttribute("data-filter", "all");
|
| 500 |
-
allButton.textContent = "All";
|
| 501 |
-
filterGroupDiv.appendChild(allButton);
|
| 502 |
-
|
| 503 |
-
fixedGroups.forEach(category => {
|
| 504 |
-
const btn = document.createElement("button");
|
| 505 |
-
btn.className = "toggle-button";
|
| 506 |
-
btn.setAttribute("data-filter", category);
|
| 507 |
-
btn.textContent = category;
|
| 508 |
-
filterGroupDiv.appendChild(btn);
|
| 509 |
-
});
|
| 510 |
-
|
| 511 |
-
// 8. 사이드바 갱신 함수
|
| 512 |
-
function updateSidebar(filter) {
|
| 513 |
-
const sidebar = document.getElementById("sidebar");
|
| 514 |
-
sidebar.innerHTML = "";
|
| 515 |
-
let items = (filter === "all")
|
| 516 |
-
? projects
|
| 517 |
-
: projects.filter(p => p.categories.includes(filter));
|
| 518 |
-
|
| 519 |
-
const ul = document.createElement("ul");
|
| 520 |
-
items.forEach(item => {
|
| 521 |
-
const li = document.createElement("li");
|
| 522 |
-
|
| 523 |
-
// 이름 표시
|
| 524 |
-
const nameSpan = document.createElement("span");
|
| 525 |
-
nameSpan.textContent = item.name;
|
| 526 |
-
li.appendChild(nameSpan);
|
| 527 |
-
|
| 528 |
-
// "링크 클릭" 버튼
|
| 529 |
-
const linkButton = document.createElement("button");
|
| 530 |
-
linkButton.textContent = "링크 클릭";
|
| 531 |
-
linkButton.addEventListener("click", (event) => {
|
| 532 |
-
event.stopPropagation(); // li 클릭 이벤트와 구분
|
| 533 |
-
window.open(item.url, "_blank"); // 새 탭(창) 열기
|
| 534 |
-
});
|
| 535 |
-
li.appendChild(linkButton);
|
| 536 |
-
|
| 537 |
-
// li 자체 클릭하면 iframe 변경
|
| 538 |
-
li.addEventListener("click", () => {
|
| 539 |
-
document.getElementById("embed-frame").src = item.url;
|
| 540 |
-
});
|
| 541 |
-
|
| 542 |
-
ul.appendChild(li);
|
| 543 |
-
});
|
| 544 |
-
sidebar.appendChild(ul);
|
| 545 |
-
|
| 546 |
-
if (items.length > 0) {
|
| 547 |
-
document.getElementById("embed-frame").src = items[0].url;
|
| 548 |
-
} else {
|
| 549 |
-
document.getElementById("embed-frame").src = "";
|
| 550 |
-
}
|
| 551 |
-
}
|
| 552 |
-
|
| 553 |
-
// 9. 버튼 클릭 이벤트
|
| 554 |
-
document.querySelectorAll(".toggle-button").forEach(button => {
|
| 555 |
-
button.addEventListener("click", function() {
|
| 556 |
-
document.querySelectorAll(".toggle-button").forEach(b => b.classList.remove("active"));
|
| 557 |
-
this.classList.add("active");
|
| 558 |
-
updateSidebar(this.getAttribute("data-filter"));
|
| 559 |
-
});
|
| 560 |
-
});
|
| 561 |
-
|
| 562 |
-
// 10. 페이지 로드 시 All 필터
|
| 563 |
-
updateSidebar("all");
|
| 564 |
-
</script>
|
| 565 |
</body>
|
| 566 |
-
</html>
|
|
|
|
| 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>Perceptron Passive Radar</title>
|
| 7 |
+
<style>
|
| 8 |
+
* {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
box-sizing: border-box;
|
| 12 |
+
font-family: monospace;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
body {
|
| 16 |
+
background: #001;
|
| 17 |
+
color: #0f8;
|
| 18 |
+
min-height: 100vh;
|
| 19 |
+
overflow: hidden;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
.main-container {
|
| 23 |
+
display: grid;
|
| 24 |
+
grid-template-columns: 1fr 400px;
|
| 25 |
+
gap: 10px;
|
| 26 |
+
padding: 10px;
|
| 27 |
+
height: 100vh;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.radar-container {
|
| 31 |
+
position: relative;
|
| 32 |
+
border: 2px solid #0f8;
|
| 33 |
+
border-radius: 50%;
|
| 34 |
+
background: radial-gradient(circle, rgba(0,255,136,0.05) 0%, rgba(0,0,0,0.9) 100%);
|
| 35 |
+
overflow: hidden;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.sweep-line {
|
| 39 |
+
position: absolute;
|
| 40 |
+
top: 50%;
|
| 41 |
+
left: 50%;
|
| 42 |
+
width: 50%;
|
| 43 |
+
height: 2px;
|
| 44 |
+
background: linear-gradient(90deg, #0f8, transparent);
|
| 45 |
+
transform-origin: left;
|
| 46 |
+
animation: radar-sweep 4s linear infinite;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.grid-overlay {
|
| 50 |
+
position: absolute;
|
| 51 |
+
width: 100%;
|
| 52 |
+
height: 100%;
|
| 53 |
+
background:
|
| 54 |
+
linear-gradient(#0f81 1px, transparent 1px),
|
| 55 |
+
linear-gradient(90deg, #0f81 1px, transparent 1px);
|
| 56 |
+
background-size: 50px 50px;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
@keyframes radar-sweep {
|
| 60 |
+
from { transform: rotate(0deg); }
|
| 61 |
+
to { transform: rotate(360deg); }
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.control-panel {
|
| 65 |
+
display: flex;
|
| 66 |
+
flex-direction: column;
|
| 67 |
+
gap: 10px;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.panel {
|
| 71 |
+
background: rgba(0,255,136,0.1);
|
| 72 |
+
border: 1px solid #0f8;
|
| 73 |
+
padding: 10px;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.perceptron-layer {
|
| 77 |
+
display: flex;
|
| 78 |
+
justify-content: space-between;
|
| 79 |
+
align-items: center;
|
| 80 |
+
height: 200px;
|
| 81 |
+
margin: 10px 0;
|
| 82 |
+
position: relative;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.layer {
|
| 86 |
+
display: flex;
|
| 87 |
+
flex-direction: column;
|
| 88 |
+
gap: 4px;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.neuron {
|
| 92 |
+
width: 12px;
|
| 93 |
+
height: 12px;
|
| 94 |
+
background: #0f8;
|
| 95 |
+
border-radius: 50%;
|
| 96 |
+
position: relative;
|
| 97 |
+
opacity: 0.3;
|
| 98 |
+
transition: all 0.2s;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.neuron.active {
|
| 102 |
+
opacity: 1;
|
| 103 |
+
box-shadow: 0 0 10px #0f8;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.connections {
|
| 107 |
+
position: absolute;
|
| 108 |
+
width: 100%;
|
| 109 |
+
height: 100%;
|
| 110 |
+
pointer-events: none;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.spectrum {
|
| 114 |
+
height: 120px;
|
| 115 |
+
display: flex;
|
| 116 |
+
align-items: flex-end;
|
| 117 |
+
gap: 2px;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.bar {
|
| 121 |
+
flex: 1;
|
| 122 |
+
background: #0f8;
|
| 123 |
+
transition: height 0.1s;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.signal {
|
| 127 |
+
position: absolute;
|
| 128 |
+
width: 8px;
|
| 129 |
+
height: 8px;
|
| 130 |
+
background: #0f8;
|
| 131 |
+
border-radius: 50%;
|
| 132 |
+
transform: translate(-50%, -50%);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.signal-echo {
|
| 136 |
+
position: absolute;
|
| 137 |
+
border: 1px solid #0f8;
|
| 138 |
+
border-radius: 50%;
|
| 139 |
+
transform: translate(-50%, -50%);
|
| 140 |
+
animation: echo 2s ease-out forwards;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
@keyframes echo {
|
| 144 |
+
0% {
|
| 145 |
+
width: 8px;
|
| 146 |
+
height: 8px;
|
| 147 |
+
opacity: 1;
|
| 148 |
+
}
|
| 149 |
+
100% {
|
| 150 |
+
width: 60px;
|
| 151 |
+
height: 60px;
|
| 152 |
+
opacity: 0;
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
button {
|
| 157 |
+
background: transparent;
|
| 158 |
+
border: 1px solid #0f8;
|
| 159 |
+
color: #0f8;
|
| 160 |
+
padding: 8px;
|
| 161 |
+
cursor: pointer;
|
| 162 |
+
transition: 0.3s;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
button:hover {
|
| 166 |
+
background: #0f8;
|
| 167 |
+
color: #001;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.stats {
|
| 171 |
+
font-size: 12px;
|
| 172 |
+
line-height: 1.5;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
canvas {
|
| 176 |
+
margin-top: 10px;
|
| 177 |
+
border: 1px solid #0f8;
|
| 178 |
+
}
|
| 179 |
+
</style>
|
| 180 |
</head>
|
| 181 |
<body>
|
| 182 |
+
<div class="main-container">
|
| 183 |
+
<div class="radar-container">
|
| 184 |
+
<div class="grid-overlay"></div>
|
| 185 |
+
<div class="sweep-line"></div>
|
| 186 |
+
<div id="signals"></div>
|
| 187 |
+
</div>
|
| 188 |
+
|
| 189 |
+
<div class="control-panel">
|
| 190 |
+
<div class="panel">
|
| 191 |
+
<h3>Perceptron Network</h3>
|
| 192 |
+
<div class="perceptron-layer">
|
| 193 |
+
<canvas id="networkCanvas"></canvas>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="stats" id="networkStats">
|
| 196 |
+
Accuracy: 0%<br>
|
| 197 |
+
Detections: 0<br>
|
| 198 |
+
Signal Strength: 0
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
<div class="panel">
|
| 203 |
+
<h3>Frequency Analysis</h3>
|
| 204 |
+
<div class="spectrum" id="spectrum"></div>
|
| 205 |
+
</div>
|
| 206 |
+
|
| 207 |
+
<div class="panel">
|
| 208 |
+
<button onclick="startRadar()">Start Detection</button>
|
| 209 |
+
<button onclick="stopRadar()">Stop</button>
|
| 210 |
+
<button onclick="trainPerceptrons()">Train Network</button>
|
| 211 |
+
<button onclick="toggleLearning()">Toggle Learning</button>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
</div>
|
| 215 |
+
|
| 216 |
+
<script>
|
| 217 |
+
class Perceptron {
|
| 218 |
+
constructor(inputs) {
|
| 219 |
+
this.weights = new Array(inputs).fill(0).map(() => Math.random() * 2 - 1);
|
| 220 |
+
this.bias = Math.random() * 2 - 1;
|
| 221 |
+
this.learningRate = 0.1;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
activate(sum) {
|
| 225 |
+
return sum > 0 ? 1 : 0;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
predict(inputs) {
|
| 229 |
+
const sum = inputs.reduce((sum, input, i) => sum + input * this.weights[i], 0) + this.bias;
|
| 230 |
+
return this.activate(sum);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
train(inputs, target) {
|
| 234 |
+
const prediction = this.predict(inputs);
|
| 235 |
+
const error = target - prediction;
|
| 236 |
+
|
| 237 |
+
for(let i = 0; i < this.weights.length; i++) {
|
| 238 |
+
this.weights[i] += error * inputs[i] * this.learningRate;
|
| 239 |
+
}
|
| 240 |
+
this.bias += error * this.learningRate;
|
| 241 |
+
|
| 242 |
+
return Math.abs(error);
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
class PerceptronNetwork {
|
| 247 |
+
constructor(inputSize, hiddenSize, outputSize) {
|
| 248 |
+
this.inputLayer = new Array(hiddenSize)
|
| 249 |
+
.fill(0)
|
| 250 |
+
.map(() => new Perceptron(inputSize));
|
| 251 |
+
|
| 252 |
+
this.outputLayer = new Array(outputSize)
|
| 253 |
+
.fill(0)
|
| 254 |
+
.map(() => new Perceptron(hiddenSize));
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
predict(inputs) {
|
| 258 |
+
const hiddenOutputs = this.inputLayer.map(p => p.predict(inputs));
|
| 259 |
+
return this.outputLayer.map(p => p.predict(hiddenOutputs));
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
train(inputs, targets) {
|
| 263 |
+
const hiddenOutputs = this.inputLayer.map(p => p.predict(inputs));
|
| 264 |
+
const finalOutputs = this.outputLayer.map(p => p.predict(hiddenOutputs));
|
| 265 |
+
|
| 266 |
+
let error = 0;
|
| 267 |
+
this.outputLayer.forEach((p, i) => {
|
| 268 |
+
error += p.train(hiddenOutputs, targets[i]);
|
| 269 |
+
});
|
| 270 |
+
this.inputLayer.forEach(p => {
|
| 271 |
+
error += p.train(inputs, 1);
|
| 272 |
+
});
|
| 273 |
+
|
| 274 |
+
return error / (this.inputLayer.length + this.outputLayer.length);
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
// Initialize system
|
| 279 |
+
const INPUT_SIZE = 32;
|
| 280 |
+
const HIDDEN_SIZE = 16;
|
| 281 |
+
const OUTPUT_SIZE = 4;
|
| 282 |
+
|
| 283 |
+
let isRunning = false;
|
| 284 |
+
let isLearning = false;
|
| 285 |
+
let network = new PerceptronNetwork(INPUT_SIZE, HIDDEN_SIZE, OUTPUT_SIZE);
|
| 286 |
+
let audioContext, analyser, dataArray;
|
| 287 |
+
|
| 288 |
+
// Setup UI
|
| 289 |
+
const spectrum = document.getElementById('spectrum');
|
| 290 |
+
for(let i = 0; i < INPUT_SIZE; i++) {
|
| 291 |
+
const bar = document.createElement('div');
|
| 292 |
+
bar.className = 'bar';
|
| 293 |
+
spectrum.appendChild(bar);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
// Setup canvas
|
| 297 |
+
const canvas = document.getElementById('networkCanvas');
|
| 298 |
+
canvas.width = 350;
|
| 299 |
+
canvas.height = 180;
|
| 300 |
+
const ctx = canvas.getContext('2d');
|
| 301 |
+
|
| 302 |
+
function drawNetwork(inputs, hiddenOutputs, finalOutputs) {
|
| 303 |
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 304 |
+
ctx.strokeStyle = '#0f8';
|
| 305 |
+
ctx.lineWidth = 0.5;
|
| 306 |
+
|
| 307 |
+
const drawLayer = (nodes, x, active) => {
|
| 308 |
+
const spacing = canvas.height / (nodes.length + 1);
|
| 309 |
+
return nodes.map((value, i) => {
|
| 310 |
+
const y = spacing * (i + 1);
|
| 311 |
+
ctx.beginPath();
|
| 312 |
+
ctx.arc(x, y, 4, 0, Math.PI * 2);
|
| 313 |
+
ctx.fillStyle = `rgba(0,255,136,${active ? value : 0.3})`;
|
| 314 |
+
ctx.fill();
|
| 315 |
+
return {x, y};
|
| 316 |
+
});
|
| 317 |
+
};
|
| 318 |
+
|
| 319 |
+
const inputNodes = drawLayer(inputs, 30, true);
|
| 320 |
+
const hiddenNodes = drawLayer(hiddenOutputs, canvas.width/2, true);
|
| 321 |
+
const outputNodes = drawLayer(finalOutputs, canvas.width - 30, true);
|
| 322 |
+
|
| 323 |
+
// Draw connections
|
| 324 |
+
ctx.beginPath();
|
| 325 |
+
inputNodes.forEach(input => {
|
| 326 |
+
hiddenNodes.forEach(hidden => {
|
| 327 |
+
ctx.moveTo(input.x, input.y);
|
| 328 |
+
ctx.lineTo(hidden.x, hidden.y);
|
| 329 |
+
});
|
| 330 |
+
});
|
| 331 |
+
hiddenNodes.forEach(hidden => {
|
| 332 |
+
outputNodes.forEach(output => {
|
| 333 |
+
ctx.moveTo(hidden.x, hidden.y);
|
| 334 |
+
ctx.lineTo(output.x, output.y);
|
| 335 |
+
});
|
| 336 |
+
});
|
| 337 |
+
ctx.stroke();
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
async function startRadar() {
|
| 341 |
+
try {
|
| 342 |
+
if(!audioContext) {
|
| 343 |
+
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
| 344 |
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
| 345 |
+
const source = audioContext.createMediaStreamSource(stream);
|
| 346 |
+
analyser = audioContext.createAnalyser();
|
| 347 |
+
analyser.fftSize = 64;
|
| 348 |
+
source.connect(analyser);
|
| 349 |
+
dataArray = new Uint8Array(analyser.frequencyBinCount);
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
isRunning = true;
|
| 353 |
+
updateRadar();
|
| 354 |
+
} catch(err) {
|
| 355 |
+
console.error('Error accessing microphone:', err);
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
function stopRadar() {
|
| 360 |
+
isRunning = false;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
function updateRadar() {
|
| 364 |
+
if(!isRunning) return;
|
| 365 |
+
|
| 366 |
+
analyser.getByteFrequencyData(dataArray);
|
| 367 |
+
|
| 368 |
+
// Update spectrum
|
| 369 |
+
const bars = spectrum.children;
|
| 370 |
+
for(let i = 0; i < bars.length; i++) {
|
| 371 |
+
const height = (dataArray[i] / 255) * 120;
|
| 372 |
+
bars[i].style.height = height + 'px';
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
// Normalize input data
|
| 376 |
+
const inputs = Array.from(dataArray).map(x => x / 255);
|
| 377 |
+
|
| 378 |
+
// Get network predictions
|
| 379 |
+
const hiddenOutputs = network.inputLayer.map(p => p.predict(inputs));
|
| 380 |
+
const outputs = network.outputLayer.map(p => p.predict(hiddenOutputs));
|
| 381 |
+
|
| 382 |
+
// Draw network state
|
| 383 |
+
drawNetwork(inputs, hiddenOutputs, outputs);
|
| 384 |
+
|
| 385 |
+
// Create signals for strong predictions
|
| 386 |
+
outputs.forEach((output, i) => {
|
| 387 |
+
if(output > 0.7) {
|
| 388 |
+
createSignal(i);
|
| 389 |
+
}
|
| 390 |
+
});
|
| 391 |
+
|
| 392 |
+
// Update stats
|
| 393 |
+
const avgOutput = outputs.reduce((a,b) => a+b) / outputs.length;
|
| 394 |
+
document.getElementById('networkStats').innerHTML =
|
| 395 |
+
`Accuracy: ${Math.round(avgOutput * 100)}%<br>` +
|
| 396 |
+
`Detections: ${outputs.filter(x => x > 0.7).length}<br>` +
|
| 397 |
+
`Signal Strength: ${Math.round(inputs.reduce((a,b) => a+b) / inputs.length * 100)}`;
|
| 398 |
+
|
| 399 |
+
if(isLearning) {
|
| 400 |
+
const target = Array(OUTPUT_SIZE).fill(0);
|
| 401 |
+
target[Math.floor(Math.random() * OUTPUT_SIZE)] = 1;
|
| 402 |
+
network.train(inputs, target);
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
requestAnimationFrame(updateRadar);
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
function createSignal(type) {
|
| 409 |
+
const radar = document.querySelector('.radar-container');
|
| 410 |
+
const angle = Math.random() * Math.PI * 2;
|
| 411 |
+
const distance = Math.random() * (radar.offsetWidth / 3);
|
| 412 |
+
|
| 413 |
+
const x = Math.cos(angle) * distance + radar.offsetWidth / 2;
|
| 414 |
+
const y = Math.sin(angle) * distance + radar.offsetHeight / 2;
|
| 415 |
+
|
| 416 |
+
const signal = document.createElement('div');
|
| 417 |
+
signal.className = 'signal';
|
| 418 |
+
signal.style.left = x + 'px';
|
| 419 |
+
signal.style.top = y + 'px';
|
| 420 |
+
radar.appendChild(signal);
|
| 421 |
+
|
| 422 |
+
const echo = document.createElement('div');
|
| 423 |
+
echo.className = 'signal-echo';
|
| 424 |
+
echo.style.left = x + 'px';
|
| 425 |
+
echo.style.top = y + 'px';
|
| 426 |
+
radar.appendChild(echo);
|
| 427 |
+
|
| 428 |
+
setTimeout(() => {
|
| 429 |
+
signal.remove();
|
| 430 |
+
echo.remove();
|
| 431 |
+
}, 2000);
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
function trainPerceptrons() {
|
| 435 |
+
let error = 0;
|
| 436 |
+
for(let i = 0; i < 100; i++) {
|
| 437 |
+
const inputs = Array(INPUT_SIZE).fill(0).map(() => Math.random());
|
| 438 |
+
const targets = Array(OUTPUT_SIZE).fill(0);
|
| 439 |
+
targets[Math.floor(Math.random() * OUTPUT_SIZE)] = 1;
|
| 440 |
+
error += network.train(inputs, targets);
|
| 441 |
+
}
|
| 442 |
+
document.getElementById('networkStats').innerHTML =
|
| 443 |
+
`Training complete<br>Error: ${Math.round(error * 100) / 100}<br>Network ready`;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
function toggleLearning() {
|
| 447 |
+
isLearning = !isLearning;
|
| 448 |
+
}
|
| 449 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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