Spaces:
Running
Running
Download index.html from LonginAI/Screeps_controller: direct link, hf CLI and curl.
- Browser
- Download file 27.2 kB
-
https://huggingface.co/spaces/LonginAI/Screeps_controller/resolve/main/index.html
- Command line
-
hf download hf://spaces/LonginAI/Screeps_controller/index.html
-
curl -L -o index.html https://huggingface.co/spaces/LonginAI/Screeps_controller/resolve/main/index.html
27.2 kB
| <html lang="cs"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Screeps AI Wrapper</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --matrix-green: #00ff41; | |
| --matrix-green-dark: #00cc33; | |
| --matrix-cyan: #00ffff; | |
| --matrix-cyan-dark: #00cccc; | |
| --bg-dark: #0a0a0a; | |
| --bg-darker: #000000; | |
| --panel-bg: #111111; | |
| --border-color: #00aa00; | |
| --text-primary: #00ff41; | |
| --text-secondary: #00cc33; | |
| --hover-bg: #003300; | |
| --active-bg: #005500; | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Courier New', monospace; | |
| background-color: var(--bg-darker); | |
| color: var(--matrix-green); | |
| height: 100vh; | |
| overflow: hidden; | |
| } | |
| .app-container { | |
| display: grid; | |
| grid-template-columns: 1fr 350px; | |
| grid-template-rows: 60px 1fr 200px; | |
| height: 100vh; | |
| gap: 2px; | |
| background-color: var(--border-color); | |
| } | |
| /* Header Styles */ | |
| .header { | |
| grid-column: 1 / -1; | |
| background-color: var(--panel-bg); | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| padding: 0 20px; | |
| border-bottom: 2px solid var(--border-color); | |
| } | |
| .logo { | |
| font-size: 24px; | |
| font-weight: bold; | |
| color: var(--matrix-cyan); | |
| } | |
| .server-selector { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| } | |
| .server-dropdown { | |
| background-color: var(--bg-dark); | |
| color: var(--matrix-green); | |
| border: 1px solid var(--border-color); | |
| padding: 8px 15px; | |
| border-radius: 4px; | |
| font-family: 'Courier New', monospace; | |
| } | |
| .auth-status { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| color: var(--matrix-cyan); | |
| } | |
| /* Game View Styles */ | |
| .game-view { | |
| background-color: var(--panel-bg); | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .game-iframe { | |
| flex: 1; | |
| border: none; | |
| background-color: var(--bg-dark); | |
| } | |
| .metrics-bar { | |
| background-color: var(--bg-dark); | |
| padding: 10px 20px; | |
| display: flex; | |
| justify-content: space-around; | |
| border-top: 2px solid var(--border-color); | |
| font-size: 14px; | |
| } | |
| .metric { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| } | |
| .metric-value { | |
| font-weight: bold; | |
| color: var(--matrix-cyan); | |
| font-size: 18px; | |
| } | |
| /* Control Panel Styles */ | |
| .control-panel { | |
| grid-column: 1 / -1; | |
| background-color: var(--panel-bg); | |
| display: grid; | |
| grid-template-columns: 1fr auto; | |
| gap: 2px; | |
| background-color: var(--border-color); | |
| } | |
| .folder-tree { | |
| background-color: var(--bg-dark); | |
| padding: 15px; | |
| overflow-y: auto; | |
| min-height: 200px; | |
| } | |
| .folder-item, .file-item { | |
| padding: 8px 12px; | |
| cursor: pointer; | |
| border-radius: 4px; | |
| margin-bottom: 2px; | |
| transition: background-color 0.2s; | |
| } | |
| .folder-item:hover, .file-item:hover { | |
| background-color: var(--hover-bg); | |
| } | |
| .folder-item.active, .file-item.active { | |
| background-color: var(--active-bg); | |
| } | |
| .folder-item { | |
| font-weight: bold; | |
| } | |
| .file-item { | |
| margin-left: 20px; | |
| } | |
| .branch-selector { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| padding: 15px; | |
| background-color: var(--bg-dark); | |
| } | |
| .branch-dropdown { | |
| background-color: var(--bg-dark); | |
| color: var(--matrix-green); | |
| border: 1px solid var(--border-color); | |
| padding: 8px 15px; | |
| border-radius: 4px; | |
| font-family: 'Courier New', monospace; | |
| } | |
| .action-buttons { | |
| display: flex; | |
| gap: 10px; | |
| padding: 15px; | |
| background-color: var(--bg-dark); | |
| flex-wrap: wrap; | |
| } | |
| .btn { | |
| background-color: var(--bg-dark); | |
| color: var(--matrix-green); | |
| border: 1px solid var(--border-color); | |
| padding: 10px 20px; | |
| border-radius: 4px; | |
| font-family: 'Courier New', monospace; | |
| cursor: pointer; | |
| transition: all 0.2s; | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .btn:hover { | |
| background-color: var(--hover-bg); | |
| } | |
| .btn:active { | |
| background-color: var(--matrix-green); | |
| color: var(--bg-dark); | |
| } | |
| /* Chat Panel Styles */ | |
| .chat-panel { | |
| grid-row: 2 / span 2; | |
| background-color: var(--panel-bg); | |
| display: flex; | |
| flex-direction: column; | |
| border-left: 2px solid var(--border-color); | |
| } | |
| .chat-header { | |
| padding: 15px; | |
| background-color: var(--bg-dark); | |
| border-bottom: 2px solid var(--border-color); | |
| font-weight: bold; | |
| color: var(--matrix-cyan); | |
| } | |
| .chat-messages { | |
| flex: 1; | |
| padding: 15px; | |
| overflow-y: auto; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 10px; | |
| } | |
| .message { | |
| padding: 10px; | |
| border-radius: 4px; | |
| max-width: 90%; | |
| word-wrap: break-word; | |
| } | |
| .user-message { | |
| background-color: var(--hover-bg); | |
| align-self: flex-end; | |
| text-align: right; | |
| } | |
| .ai-message { | |
| background-color: var(--bg-dark); | |
| align-self: flex-start; | |
| } | |
| .chat-input { | |
| padding: 15px; | |
| background-color: var(--bg-dark); | |
| border-top: 2px solid var(--border-color); | |
| display: flex; | |
| gap: 10px; | |
| } | |
| .chat-input textarea { | |
| flex: 1; | |
| background-color: var(--bg-darker); | |
| color: var(--matrix-green); | |
| border: 1px solid var(--border-color); | |
| padding: 10px; | |
| border-radius: 4px; | |
| font-family: 'Courier New', monospace; | |
| resize: none; | |
| } | |
| .terminal { | |
| background-color: var(--bg-dark); | |
| padding: 15px; | |
| border-top: 2px solid var(--border-color); | |
| height: 200px; | |
| overflow-y: auto; | |
| font-family: 'Courier New', monospace; | |
| font-size: 12px; | |
| } | |
| .terminal-line { | |
| margin-bottom: 5px; | |
| word-break: break-all; | |
| } | |
| .terminal-error { | |
| color: #ff4141; | |
| } | |
| .terminal-log { | |
| color: var(--matrix-green); | |
| } | |
| .terminal-info { | |
| color: var(--matrix-cyan); | |
| } | |
| /* Login Modal */ | |
| .modal { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-color: rgba(0, 0, 0, 0.8); | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| z-index: 1000; | |
| } | |
| .modal-content { | |
| background-color: var(--panel-bg); | |
| padding: 30px; | |
| border: 2px solid var(--border-color); | |
| border-radius: 8px; | |
| width: 90%; | |
| max-width: 500px; | |
| } | |
| .modal-header { | |
| color: var(--matrix-cyan); | |
| margin-bottom: 20px; | |
| text-align: center; | |
| } | |
| .form-group { | |
| margin-bottom: 20px; | |
| } | |
| .form-group label { | |
| display: block; | |
| margin-bottom: 8px; | |
| } | |
| .form-group input, .form-group select { | |
| width: 100%; | |
| background-color: var(--bg-dark); | |
| color: var(--matrix-green); | |
| border: 1px solid var(--border-color); | |
| padding: 10px; | |
| border-radius: 4px; | |
| font-family: 'Courier New', monospace; | |
| } | |
| .checkbox-group { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| margin-bottom: 20px; | |
| } | |
| /* Mobile Responsiveness */ | |
| @media (max-width: 768px) { | |
| .app-container { | |
| grid-template-columns: 1fr; | |
| grid-template-rows: 60px 1fr 250px 200px; | |
| } | |
| .chat-panel { | |
| grid-row: 3; | |
| grid-column: 1; | |
| border-left: none; | |
| border-top: 2px solid var(--border-color); | |
| } | |
| .control-panel { | |
| grid-template-columns: 1fr; | |
| } | |
| .branch-selector { | |
| order: -1; | |
| } | |
| } | |
| /* Scrollbar styling */ | |
| ::-webkit-scrollbar { | |
| width: 8px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: var(--bg-darker); | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: var(--border-color); | |
| border-radius: 4px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: var(--matrix-green); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="app-container"> | |
| <!-- Header --> | |
| <div class="header"> | |
| <div class="logo">SCREEN AI WRAPPER</div> | |
| <div class="server-selector"> | |
| <select class="server-dropdown" id="serverSelect"> | |
| <option value="main">Main Server</option> | |
| <option value="simulation">Simulation Server</option> | |
| <option value="ptr">PTR Server</option> | |
| <option value="custom">Custom Server</option> | |
| </select> | |
| </div> | |
| <div class="auth-status"> | |
| <i class="fas fa-user"></i> | |
| <span id="authStatus">Nepřihlášen</span> | |
| </div> | |
| </div> | |
| <!-- Game View --> | |
| <div class="game-view"> | |
| <iframe class="game-iframe" id="screepsFrame" src="https://screeps.com"></iframe> | |
| <div class="metrics-bar"> | |
| <div class="metric"> | |
| <div>CPU</div> | |
| <div class="metric-value" id="cpuMetric">75%</div> | |
| </div> | |
| <div class="metric"> | |
| <div>GCL</div> | |
| <div class="metric-value" id="gclMetric">5.2</div> | |
| </div> | |
| <div class="metric"> | |
| <div>Místnosti</div> | |
| <div class="metric-value" id="roomsMetric">3/5</div> | |
| </div> | |
| <div class="metric"> | |
| <div>Creeps</div> | |
| <div class="metric-value" id="creepsMetric">12</div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Control Panel --> | |
| <div class="control-panel"> | |
| <div class="folder-tree" id="folderTree"> | |
| <div class="folder-item active">server1</div> | |
| <div class="file-item">main.js</div> | |
| <div class="file-item">creeps.js</div> | |
| <div class="file-item">structures.js</div> | |
| <div class="folder-item">branches</div> | |
| <div class="file-item">combat.js</div> | |
| <div class="file-item">economy.js</div> | |
| <div class="file-item">expansion.js</div> | |
| </div> | |
| <div class="branch-selector"> | |
| <select class="branch-dropdown" id="branchSelect"> | |
| <option value="main">main</option> | |
| <option value="combat">combat</option> | |
| <option value="economy">economy</option> | |
| <option value="expansion">expansion</option> | |
| </select> | |
| <button class="btn" id="activateBranchBtn"> | |
| <i class="fas fa-play"></i> Aktivovat | |
| </button> | |
| </div> | |
| <div class="action-buttons"> | |
| <button class="btn" id="deployBtn"> | |
| <i class="fas fa-upload"></i> Deploy | |
| </button> | |
| <button class="btn" id="optimizeBtn"> | |
| <i class="fas fa-rocket"></i> Optimize | |
| </button> | |
| <button class="btn" id="generateCodeBtn"> | |
| <i class="fas fa-code"></i> Generovat kód | |
| </button> | |
| <button class="btn" id="deleteBtn"> | |
| <i class="fas fa-trash"></i> Smazat | |
| </button> | |
| <button class="btn" id="settingsBtn"> | |
| <i class="fas fa-cog"></i> Nastavení | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Chat Panel --> | |
| <div class="chat-panel"> | |
| <div class="chat-header">AI Agent Chat</div> | |
| <div class="chat-messages" id="chatMessages"> | |
| <div class="message ai-message"> | |
| Ahoj! Jsem Screeps AI Assistant. Jak ti mohu pomoci? | |
| </div> | |
| <div class="message user-message"> | |
| Vytvoř mi kód pro harvestery | |
| </div> | |
| <div class="message ai-message"> | |
| <pre><code>// Harvestery AI code | |
| module.exports = { | |
| run: function(creep) { | |
| if(creep.store.getFreeCapacity() > 0) { | |
| var sources = creep.room.find(FIND_SOURCES); | |
| if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) { | |
| creep.moveTo(sources[0]); | |
| } | |
| } else { | |
| if(creep.transfer(Game.spawns['Spawn1'], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { | |
| creep.moveTo(Game.spawns['Spawn1']); | |
| } | |
| } | |
| } | |
| };</code></pre> | |
| </div> | |
| </div> | |
| <div class="chat-input"> | |
| <textarea id="messageInput" placeholder="Zadej příkaz pro AI agenta..."></textarea> | |
| <button class="btn" id="sendBtn"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| <div class="terminal"> | |
| <div class="terminal-line terminal-info">[INFO] Screeps AI Wrapper inicializován</div> | |
| <div class="terminal-line terminal-log">[LOG] CPU usage: 75%</div> | |
| <div class="terminal-line terminal-error">[ERROR] Nenalezen soubor main.js</div> | |
| <div class="terminal-line terminal-log">[LOG] Připojeno k serveru: main</div> | |
| <div class="terminal-line terminal-info">[INFO] Větev 'economy' aktivována</div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Login Modal --> | |
| <div class="modal" id="loginModal"> | |
| <div class="modal-content"> | |
| <h2 class="modal-header">Přihlášení do Screeps</h2> | |
| <div class="form-group"> | |
| <label for="serverType">Typ serveru:</label> | |
| <select id="serverType"> | |
| <option value="official">Official Server</option> | |
| <option value="custom">Custom Server</option> | |
| </select> | |
| </div> | |
| <div class="form-group"> | |
| <label for="username">Uživatelské jméno:</label> | |
| <input type="text" id="username" placeholder="Zadej uživatelské jméno"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="password">Heslo:</label> | |
| <input type="password" id="password" placeholder="Zadej heslo"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="steamCode">Steam kód:</label> | |
| <input type="text" id="steamCode" placeholder="Zadej 6-místný Steam kód"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="rootPath">Root cesta k serverům:</label> | |
| <input type="text" id="rootPath" placeholder="/path/to/screeps/servers"> | |
| </div> | |
| <div class="checkbox-group"> | |
| <input type="checkbox" id="rememberMe"> | |
| <label for="rememberMe">Zůstat přihlášen</label> | |
| </div> | |
| <button class="btn" id="loginBtn" style="width: 100%;"> | |
| <i class="fas fa-sign-in-alt"></i> Přihlásit se | |
| </button> | |
| </div> | |
| </div> | |
| <script> | |
| // DOM Elements | |
| const loginModal = document.getElementById('loginModal'); | |
| const authStatus = document.getElementById('authStatus'); | |
| const screepsFrame = document.getElementById('screepsFrame'); | |
| const serverSelect = document.getElementById('serverSelect'); | |
| const branchSelect = document.getElementById('branchSelect'); | |
| const chatMessages = document.getElementById('chatMessages'); | |
| const messageInput = document.getElementById('messageInput'); | |
| const folderTree = document.getElementById('folderTree'); | |
| // Sample data | |
| let selectedFileTreeItem = null; | |
| let isLoggedIn = false; | |
| let credentials = JSON.parse(localStorage.getItem('screepsCredentials')) || null; | |
| // Initialize | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Check if user has saved credentials | |
| if (credentials) { | |
| login(credentials); | |
| } else { | |
| loginModal.style.display = 'flex'; | |
| } | |
| // Event listeners | |
| document.getElementById('loginBtn').addEventListener('click', handleLogin); | |
| document.getElementById('sendBtn').addEventListener('click', sendMessage); | |
| messageInput.addEventListener('keypress', function(e) { | |
| if (e.key === 'Enter' && !e.shiftKey) { | |
| e.preventDefault(); | |
| sendMessage(); | |
| } | |
| }); | |
| serverSelect.addEventListener('change', function() { | |
| const server = this.value; | |
| if (server === 'custom') { | |
| const customUrl = prompt('Zadej URL vlastního serveru:'); | |
| if (customUrl) { | |
| screepsFrame.src = customUrl; | |
| } | |
| } else { | |
| screepsFrame.src = `https://screeps.com/${server === 'main' ? '' : server}`; | |
| } | |
| }); | |
| branchSelect.addEventListener('change', function() { | |
| // Branch selection change logic would go here | |
| }); | |
| document.getElementById('activateBranchBtn').addEventListener('click', function() { | |
| const branch = branchSelect.value; | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| // Add terminal message | |
| addTerminalMessage(`[INFO] Větev '${branch}' aktivována`, 'terminal-info'); | |
| }); | |
| // Action buttons | |
| document.getElementById('deployBtn').addEventListener('click', function() { | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| addTerminalMessage('[LOG] Deploying AI branch...', 'terminal-log'); | |
| setTimeout(() => addTerminalMessage('[INFO] Deploy success', 'terminal-info'), 1000); | |
| }); | |
| document.getElementById('optimizeBtn').addEventListener('click', function() { | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| addTerminalMessage('[LOG] Optimalizing code...', 'terminal-log'); | |
| setTimeout(() => addTerminalMessage('[INFO] Optimization complete', 'terminal-info'), 1500); | |
| }); | |
| document.getElementById('generateCodeBtn').addEventListener('click', function() { | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| addTerminalMessage('[LOG] Generating code...', 'terminal-log'); | |
| setTimeout(() => { | |
| addTerminalMessage('[INFO] Code generated successfully', 'terminal-info'); | |
| addTerminalMessage('[LOG] Creeps: 12 (Optimized)', 'terminal-log'); | |
| }, 2000); | |
| }); | |
| document.getElementById('settingsBtn').addEventListener('click', function() { | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| alert('Otevřít nastavení'); | |
| }); | |
| document.getElementById('deleteBtn').addEventListener('click', function() { | |
| this.classList.add('active'); | |
| setTimeout(() => this.classList.remove('active'), 200); | |
| if (selectedFileTreeItem) { | |
| if (confirm(`Opravdu chcete smazat ${selectedFileTreeItem.textContent}?`)) { | |
| addTerminalMessage(`[INFO] Smazán soubor/složka: ${selectedFileTreeItem.textContent}`, 'terminal-info'); | |
| selectedFileTreeItem.remove(); | |
| selectedFileTreeItem = null; | |
| } | |
| } else { | |
| alert('Nejprve vyberte soubor nebo složku ke smazání'); | |
| } | |
| }); | |
| // File tree selection | |
| folderTree.addEventListener('click', function(e) { | |
| if (e.target.classList.contains('folder-item') || e.target.classList.contains('file-item')) { | |
| // Remove previous selection | |
| const activeItems = folderTree.querySelectorAll('.active'); | |
| activeItems.forEach(item => item.classList.remove('active')); | |
| // Set new selection | |
| e.target.classList.add('active'); | |
| selectedFileTreeItem = e.target; | |
| } | |
| }); | |
| // Update metrics periodically | |
| setInterval(updateMetrics, 5000); | |
| }); | |
| // Functions | |
| function handleLogin() { | |
| const username = document.getElementById('username').value; | |
| const password = document.getElementById('password').value; | |
| const steamCode = document.getElementById('steamCode').value; | |
| const rootPath = document.getElementById('rootPath').value; | |
| const rememberMe = document.getElementById('rememberBtn').checked; | |
| if (!username || !password || !steamCode) { | |
| alert('Vyplňte všechna povinná pole'); | |
| return; | |
| } | |
| const creds = { username, password, steamCode, rootPath }; | |
| if (rememberMe) { | |
| localStorage.setItem('screepsCredentials', JSON.stringify(creds)); | |
| } | |
| login(creds); | |
| } | |
| function login(credentials) { | |
| loginModal.style.display = 'none'; | |
| isLoggedIn = true; | |
| authStatus.textContent = credentials.username; | |
| addTerminalMessage('[INFO] Přihlášení úspěšné', 'terminal-info'); | |
| // Load folder tree based on root path | |
| loadFolderTree(credentials.rootPath); | |
| } | |
| function sendMessage() { | |
| const message = messageInput.value.trim(); | |
| if (!message) return; | |
| // Add user message | |
| addMessage(message, 'user-message'); | |
| messageInput.value = ''; | |
| // Simulate AI response | |
| setTimeout(() => { | |
| const responses = [ | |
| "Analyzuji váš požadavek...", | |
| "Generuji optimalizovaný kód...", | |
| "Připravuji strategický plán...", | |
| "Kód byl aktualizován a nasazen.", | |
| "Zjišťuji metriky z hry..." | |
| ]; | |
| const randomResponse = responses[Math.floor(Math.random() * responses.length)]; | |
| addMessage(randomResponse, 'ai-message'); | |
| // Add terminal response | |
| addTerminalMessage(`[LOG] AI odpověď: ${randomResponse}`, 'terminal-log'); | |
| }, 1000); | |
| } | |
| function addMessage(text, className) { | |
| const messageDiv = document.createElement('div'); | |
| messageDiv.classList.add('message', className); | |
| messageDiv.textContent = text; | |
| chatMessages.appendChild(messageDiv); | |
| chatMessages.scrollTop = chatMessages.scrollHeight; | |
| } | |
| function addTerminalMessage(text, className) { | |
| const lineDiv = document.createElement('div'); | |
| lineDiv.classList.add('terminal-line', className); | |
| lineDiv.textContent = text; | |
| document.querySelector('.terminal').appendChild(lineDiv); | |
| document.querySelector('.terminal').scrollTop = document.querySelector('.terminal').scrollHeight; | |
| } | |
| function loadFolderTree(rootPath) { | |
| // In real implementation, this would load actual folder structure | |
| // For now, we'll just show sample structure | |
| addTerminalMessage(`[INFO] Načítám strukturu serverů z: ${rootPath}`, 'terminal-info'); | |
| } | |
| function updateMetrics() { | |
| // Simulate metric updates | |
| document.getElementById('cpuMetric').textContent = Math.floor(Math.random() * 30 + 60) + '%'; | |
| document.getElementById('gclMetric').textContent = (Math.random() * 3 + 3).toFixed(1); | |
| document.getElementById('roomsMetric').textContent = `${Math.floor(Math.random() * 3 + 2)}/5`; | |
| document.getElementById('creepsMetric').textContent = Math.floor(Math.random() * 15 + 5); | |
| } | |
| // Close modal if clicked outside content | |
| window.addEventListener('click', function(e) { | |
| if (e.target === loginModal) { | |
| loginModal.style.display = 'none'; | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |