Julian Bilcke
wip
cd845ad
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matrix-Game V2 Client</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #121212;
color: #e0e0e0;
display: flex;
flex-direction: column;
align-items: center;
user-select: none; /* Disable text selection */
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-x: hidden;
}
.container {
width: 100%;
max-width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.game-area {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-height: 85vh;
margin: 0;
position: relative;
}
#mouse-tracking-area {
position: relative;
width: 100%;
height: auto;
cursor: pointer; /* Show cursor as pointer to encourage clicks */
display: flex;
justify-content: center;
align-items: center;
max-height: 85vh;
}
#game-canvas {
width: 100%;
height: auto;
max-height: 85vh;
object-fit: contain;
background-color: #000;
pointer-events: none; /* Prevent drag on the image */
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
}
.controls {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 1200px;
padding: 10px;
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
bottom: 0;
z-index: 10;
box-sizing: border-box;
}
.panels-container {
display: flex;
width: 100%;
max-width: 1200px;
margin: 10px auto;
gap: 10px;
}
.panel {
flex: 1;
background-color: #1E1E1E;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
transition: height 0.3s ease;
}
.panel-header {
background-color: #272727;
padding: 10px 15px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
}
.panel-title {
font-weight: bold;
color: #4CAF50;
}
.toggle-button {
background: none;
border: none;
color: #e0e0e0;
font-size: 18px;
cursor: pointer;
}
.toggle-button:focus {
outline: none;
}
.panel-content {
padding: 15px;
max-height: 300px;
overflow-y: auto;
transition: all 0.3s ease;
}
.collapsed .panel-content {
max-height: 0;
padding-top: 0;
padding-bottom: 0;
overflow: hidden;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
border-radius: 5px;
cursor: pointer;
margin: 5px;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
button:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
select {
padding: 10px;
border-radius: 5px;
background-color: #2A2A2A;
color: #e0e0e0;
border: 1px solid #4CAF50;
}
.status {
margin-top: 10px;
color: #4CAF50;
}
.key-indicators {
display: flex;
justify-content: center;
margin-top: 15px;
}
.key {
width: 40px;
height: 40px;
margin: 0 5px;
background-color: #2A2A2A;
border: 1px solid #444;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
transition: background-color 0.2s;
}
.key.active {
background-color: #4CAF50;
color: white;
}
.key-row {
display: flex;
justify-content: center;
margin: 5px 0;
}
.spacebar {
width: 150px;
}
.connection-info {
font-family: monospace;
height: 100%;
overflow-y: auto;
}
.log-entry {
margin: 5px 0;
padding: 3px;
border-bottom: 1px solid #333;
}
.fps-counter {
position: absolute;
top: 10px;
right: 10px;
background-color: rgba(0,0,0,0.5);
color: #4CAF50;
padding: 5px;
border-radius: 3px;
font-family: monospace;
z-index: 20;
}
#mouse-position {
position: absolute;
top: 10px;
left: 10px;
background-color: rgba(0,0,0,0.5);
color: #4CAF50;
padding: 5px;
border-radius: 3px;
font-family: monospace;
z-index: 20;
}
@media (max-width: 768px) {
.panels-container {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="container">
<div class="game-area">
<div id="mouse-tracking-area">
<img id="game-canvas" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" alt="Game Frame">
<div id="mouse-position">Mouse: 0.00, 0.00</div>
<div class="fps-counter" id="fps-counter">FPS: 0</div>
<div id="session-progress" style="position: absolute; top: 50px; left: 10px; background-color: rgba(0,0,0,0.8); color: #4CAF50; padding: 10px; border-radius: 5px; font-family: monospace; z-index: 20; display: none;">
<div>Session Progress: <span id="progress-bar" style="display: inline-block; width: 200px; height: 10px; background-color: #333; border-radius: 5px; margin-left: 10px; position: relative;">
<div id="progress-fill" style="height: 100%; background-color: #4CAF50; border-radius: 5px; width: 0%; transition: width 0.3s;"></div>
</span></div>
<div style="margin-top: 5px;">Frame: <span id="current-frame">0</span>/<span id="max-frames">0</span></div>
<div>Time: <span id="elapsed-time">0:00</span> / <span id="session-duration">0:00</span></div>
<div>Remaining: <span id="remaining-time">0:00</span></div>
</div>
</div>
<div class="controls">
<button id="connect-btn">Connect</button>
<button id="start-stream-btn" disabled>Start Stream</button>
<button id="stop-stream-btn" disabled>Stop Stream</button>
<button id="reset-session-btn" disabled style="background-color: #FF5722;">Reset Session</button>
<select id="scene-select" disabled>
<option value="universal">Universal Mode</option>
<option value="gta_drive">GTA Drive Mode</option>
<option value="temple_run">Temple Run Mode</option>
<option value="forest">Forest (Demo)</option>
<option value="desert">Desert (Demo)</option>
<option value="beach">Beach (Demo)</option>
<option value="hills">Hills (Demo)</option>
<option value="river">River (Demo)</option>
<option value="icy">Icy (Demo)</option>
<option value="mushroom">Mushroom (Demo)</option>
<option value="plain">Plain (Demo)</option>
</select>
</div>
</div>
<div class="panels-container">
<!-- Controls Panel -->
<div class="panel" id="controls-panel">
<div class="panel-header" onclick="togglePanel('controls-panel')">
<div class="panel-title">Keyboard Controls</div>
<button class="toggle-button"></button>
</div>
<div class="panel-content">
<div class="key-indicators">
<div class="key-row">
<div id="key-w" class="key">W</div>
</div>
<div class="key-row">
<div id="key-a" class="key">A</div>
<div id="key-s" class="key">S</div>
<div id="key-d" class="key">D</div>
</div>
<div class="key-row">
<div id="key-space" class="key spacebar">SPACE</div>
</div>
<div class="key-row">
<div id="key-shift" class="key">SHIFT</div>
</div>
</div>
<p class="status">
<strong>Movement:</strong> W/↑ = Forward, S/↓ = Back, A/← = Left, D/→ = Right<br>
<strong>Actions:</strong> Space = Jump, Shift = Attack/Action<br>
<strong>Camera:</strong> Click game view to capture mouse (ESC to release)<br>
<strong>Modes:</strong> Universal (full control), GTA Drive (driving), Temple Run (runner)<br>
<strong>Requirements:</strong> NVIDIA GPU with 24GB+ VRAM required for model inference
</p>
</div>
</div>
<!-- Connection Log Panel -->
<div class="panel" id="log-panel">
<div class="panel-header" onclick="togglePanel('log-panel')">
<div class="panel-title">Connection Log</div>
<button class="toggle-button"></button>
</div>
<div class="panel-content">
<div class="connection-info" id="connection-log">
<div class="log-entry">Waiting to connect...</div>
</div>
</div>
</div>
</div>
</div>
<script src="./assets/client.js"></script>
</body>
</html>