Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 41 additions & 36 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -1,69 +1,74 @@
<!doctype html>
<html lang="en">
<head>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Box Game</title>
<link rel="shortcut icon" href="icon.png" type="image" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
</head>

<body>

<!-- ===== LOBBY SCREEN ===== -->
<div id="nameScreen">
<div class="nameBox" id="lobbyBox">
<h2>Box Game</h2>
<p>Jump, collect hearts, beat your friends.</p>
<div class="nameBox" id="lobbyBox">
<h2>Box Game</h2>
<p>Jump, collect hearts, beat your friends.</p>

<label class="field-label">Your Name</label>
<input type="text" id="nameInput" placeholder="Enter your name…" maxlength="15" autofocus />
<label class="field-label">Your Name</label>
<input type="text" id="nameInput" placeholder="Enter your name…" maxlength="15" autofocus />

<div class="divider"><span>choose a room</span></div>
<div class="divider"><span>choose a room</span></div>

<!-- Create Room -->
<button id="createRoomBtn" class="btn-primary">✦ Create Private Room</button>
<!-- Create Room -->
<button id="createRoomBtn" class="btn-primary">✦ Create Private Room</button>

<!-- Join Room -->
<div class="join-row">
<input type="text" id="roomCodeInput" placeholder="Room code…" maxlength="5" />
<button id="joinRoomBtn" class="btn-secondary">Join</button>
</div>
<!-- Join Room -->
<div class="join-row">
<input type="text" id="roomCodeInput" placeholder="Room code…" maxlength="5" />
<button id="joinRoomBtn" class="btn-secondary">Join</button>
</div>

<p id="lobbyError" class="error-msg"></p>
</div>
<p id="lobbyError" class="error-msg"></p>
</div>
</div>

<!-- ===== IN-GAME HUD ===== -->
<div id="hud" style="display:none;">
<button id="menuBtn" title="Options">☰</button>
<div id="roomBadge"></div>
<button id="menuBtn" title="Options">☰</button>
<div id="roomBadge"></div>
</div>

<!-- ===== OPTIONS MODAL (in-game) ===== -->
<div id="optionsModal" style="display:none;">
<div class="modal-box">
<h3>Options</h3>
<div class="modal-box">
<h3>Options</h3>

<label class="field-label">Change Name</label>
<input type="text" id="newNameInput" placeholder="New name…" maxlength="15" />
<button id="saveNameBtn" class="btn-primary">Save Name</button>
<label class="field-label">Change Name</label>
<input type="text" id="newNameInput" placeholder="New name…" maxlength="15" />
<button id="saveNameBtn" class="btn-primary">Save Name</button>

<div class="divider"></div>
<div id="roomInfo"></div>
<div class="divider"></div>
<div id="roomInfo"></div>

<button id="copyCodeBtn" class="btn-secondary" style="margin-top:8px;">Copy Room Code</button>
<button id="closeModalBtn" class="btn-ghost" style="margin-top:8px;">Close</button>
</div>
<button id="copyCodeBtn" class="btn-secondary" style="margin-top:8px;">Copy Room Code</button>
<button id="closeModalBtn" class="btn-ghost" style="margin-top:8px;">Close</button>
</div>
</div>

<canvas id="gameCanvas"></canvas>

<script
src="https://cdn.socket.io/4.8.3/socket.io.min.js"
integrity="sha384-kzavj5fiMwLKzzD1f8S7TeoVIEi7uKHvbTA3ueZkrzYq75pNQUiUi6Dy98Q3fxb0"
crossorigin="anonymous"
></script>
<script src="https://cdn.socket.io/4.8.3/socket.io.min.js"
integrity="sha384-kzavj5fiMwLKzzD1f8S7TeoVIEi7uKHvbTA3ueZkrzYq75pNQUiUi6Dy98Q3fxb0"
crossorigin="anonymous"></script>
<!-- ⬇ Change this URL when deploying to Vercel (point to your VM's gateway) -->
<script>
window.GATEWAY_URL = "http://localhost:8080";
</script>
<script src="index.js"></script>
<script src="game.js"></script>
</body>
</body>

</html>
Loading