|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>MatrixGame 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; |
|
|
} |
|
|
|
|
|
.container { |
|
|
width: 90%; |
|
|
max-width: 1200px; |
|
|
margin: 20px auto; |
|
|
} |
|
|
|
|
|
h1 { |
|
|
color: #4CAF50; |
|
|
text-align: center; |
|
|
} |
|
|
|
|
|
.game-area { |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
align-items: center; |
|
|
margin: 20px 0; |
|
|
} |
|
|
|
|
|
#game-canvas { |
|
|
border: 2px solid #4CAF50; |
|
|
background-color: #000; |
|
|
width: 640px; |
|
|
height: 360px; |
|
|
object-fit: contain; |
|
|
} |
|
|
|
|
|
.controls { |
|
|
display: flex; |
|
|
justify-content: space-between; |
|
|
width: 640px; |
|
|
margin-top: 10px; |
|
|
} |
|
|
|
|
|
.control-panel { |
|
|
background-color: #1E1E1E; |
|
|
padding: 15px; |
|
|
border-radius: 5px; |
|
|
margin-top: 20px; |
|
|
width: 640px; |
|
|
} |
|
|
|
|
|
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 { |
|
|
margin-top: 20px; |
|
|
padding: 10px; |
|
|
background-color: #1E1E1E; |
|
|
border-radius: 5px; |
|
|
font-family: monospace; |
|
|
height: 150px; |
|
|
overflow-y: auto; |
|
|
width: 640px; |
|
|
} |
|
|
|
|
|
.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; |
|
|
} |
|
|
|
|
|
#mouse-tracking-area { |
|
|
position: relative; |
|
|
width: 640px; |
|
|
height: 360px; |
|
|
} |
|
|
|
|
|
#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; |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body> |
|
|
<div class="container"> |
|
|
<h1>MatrixGame WebSocket Client</h1> |
|
|
|
|
|
<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> |
|
|
|
|
|
<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> |
|
|
<select id="scene-select" disabled> |
|
|
<option value="forest">Forest</option> |
|
|
<option value="desert">Desert</option> |
|
|
<option value="beach">Beach</option> |
|
|
<option value="hills">Hills</option> |
|
|
<option value="river">River</option> |
|
|
<option value="icy">Icy</option> |
|
|
<option value="mushroom">Mushroom</option> |
|
|
<option value="plain">Plain</option> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="control-panel"> |
|
|
<h3>Keyboard Controls</h3> |
|
|
<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"> |
|
|
W = Forward, S = Back, A = Left, D = Right<br> |
|
|
Space = Jump, Shift = Attack<br> |
|
|
Mouse = Look around |
|
|
</p> |
|
|
</div> |
|
|
|
|
|
<div class="connection-info" id="connection-log"> |
|
|
<div class="log-entry">Waiting to connect...</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<script src="./assets/client.js"></script> |
|
|
</body> |
|
|
</html> |