Create templates/index.html
Browse files- templates/index.html +75 -0
templates/index.html
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ja">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>Cyborg Interface: System Dominance</title>
|
| 6 |
+
<style>
|
| 7 |
+
:root { --neon: #00f3ff; --pink: #ff0055; --bg: #02050a; }
|
| 8 |
+
body { background: var(--bg); color: #c0d0d0; font-family: 'Consolas', monospace; margin: 0; display: flex; height: 100vh; overflow: hidden; }
|
| 9 |
+
#sidebar { width: 300px; background: rgba(5,10,20,0.95); border-right: 1px solid #1a3a4a; padding: 25px; }
|
| 10 |
+
#main { flex: 1; display: flex; flex-direction: column; }
|
| 11 |
+
#chat-history { flex: 1; padding: 30px; overflow-y: auto; background: linear-gradient(180deg, #02050a 0%, #05101a 100%); }
|
| 12 |
+
.msg-ai { border-left: 3px solid var(--neon); background: rgba(0,243,255,0.03); padding: 20px; margin-bottom: 20px; line-height: 1.6; }
|
| 13 |
+
.msg-user { border-right: 2px solid #444; background: rgba(255,255,255,0.02); align-self: flex-end; padding: 10px 20px; margin-bottom: 20px; }
|
| 14 |
+
#log-panel { height: 140px; background: #000; border-top: 2px solid #1a3a4a; padding: 15px; font-size: 0.8em; color: var(--neon); overflow-y: auto; }
|
| 15 |
+
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-weight: bold; margin-bottom: 10px; }
|
| 16 |
+
.tag-active { background: var(--pink); color: #fff; animation: pulse 1s infinite; }
|
| 17 |
+
.tag-idle { background: #1a3a4a; color: #555; }
|
| 18 |
+
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }
|
| 19 |
+
</style>
|
| 20 |
+
</head>
|
| 21 |
+
<body>
|
| 22 |
+
<div id="sidebar">
|
| 23 |
+
<h2 style="color:var(--neon); letter-spacing: 3px;">SYSTEM CONTROL</h2>
|
| 24 |
+
<div style="margin-bottom:30px;">
|
| 25 |
+
AI UNIT STATUS:<br>
|
| 26 |
+
<span id="ai-status" class="status-tag tag-idle">REJECTED</span>
|
| 27 |
+
</div>
|
| 28 |
+
<div style="border:1px solid #1a3a4a; padding:10px; font-size:0.7em;">
|
| 29 |
+
COMMANDER: Project-System<br>
|
| 30 |
+
AGENT: Gemma-2 (Dynamic Load)<br>
|
| 31 |
+
VRAM_POLICY: Aggressive Reject
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
<div id="main">
|
| 35 |
+
<div id="chat-history"></div>
|
| 36 |
+
<div id="log-panel" id="logs">READY. AWAITING COMMAND...</div>
|
| 37 |
+
<div style="padding:20px; display:flex; gap:10px; background:rgba(5,10,20,0.95);">
|
| 38 |
+
<input type="text" id="user-input" style="flex:1; background:#000; color:var(--neon); border:1px solid #1a3a4a; padding:12px;" placeholder="INPUT PHYSICS QUERY...">
|
| 39 |
+
<button onclick="sendMessage()" style="background:#1a3a4a; border:none; color:var(--neon); padding:0 30px; cursor:pointer;">EXEC</button>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
<script>
|
| 43 |
+
async function sendMessage() {
|
| 44 |
+
const input = document.getElementById('user-input');
|
| 45 |
+
const chat = document.getElementById('chat-history');
|
| 46 |
+
const logs = document.getElementById('log-panel');
|
| 47 |
+
const aiStatus = document.getElementById('ai-status');
|
| 48 |
+
const val = input.value; if(!val) return;
|
| 49 |
+
|
| 50 |
+
chat.innerHTML += `<div class="msg-user">${val}</div>`;
|
| 51 |
+
input.value = ""; logs.innerHTML = "";
|
| 52 |
+
|
| 53 |
+
// フェーズ1: 演算開始
|
| 54 |
+
logs.innerHTML += `<div>⚙️ [SYSTEM] 物理演算開始... AIはメモリ上に存在しません。</div>`;
|
| 55 |
+
|
| 56 |
+
const res = await fetch('/api/chat', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({message:val})});
|
| 57 |
+
|
| 58 |
+
// フェーズ2: AIロード演出(サーバーからのログ受信に合わせて)
|
| 59 |
+
aiStatus.innerText = "LOADING..."; aiStatus.className = "status-tag tag-active";
|
| 60 |
+
|
| 61 |
+
const data = await res.json();
|
| 62 |
+
for(const log of data.process_logs) {
|
| 63 |
+
logs.innerHTML += `<div>${log}</div>`;
|
| 64 |
+
if(log.includes("リジェクト")) {
|
| 65 |
+
aiStatus.innerText = "REJECTED"; aiStatus.className = "status-tag tag-idle";
|
| 66 |
+
}
|
| 67 |
+
await new Promise(r => setTimeout(r, 600));
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
chat.innerHTML += `<div class="msg-ai">${data.response.replace(/\n/g,'<br>')}</div>`;
|
| 71 |
+
chat.scrollTop = chat.scrollHeight;
|
| 72 |
+
}
|
| 73 |
+
</script>
|
| 74 |
+
</body>
|
| 75 |
+
</html>
|