Compare commits

...

2 Commits

Author SHA1 Message Date
820d9ee806 Add package.json 2025-06-19 19:11:39 +02:00
a829a18ba1 Add frontend 2025-06-19 19:11:01 +02:00
3 changed files with 85 additions and 0 deletions

20
ejs/footer.ejs Normal file
View File

@@ -0,0 +1,20 @@
<script>
let ws;
function connectWebSocket() {
const ws = new WebSocket((window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + window.location.pathname);
ws.onmessage = async (event) => {
if (event.data === 'update') {
location.reload();
}
};
ws.onclose = () => {
setTimeout(connectWebSocket, 5000);
};
}
connectWebSocket();
</script>

57
ejs/home.ejs Normal file
View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>XernoBomb</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
font-family: 'Poppins', sans-serif;
}
body {
background-color: #111;
color: white;
position: absolute;
width: 100%;
height: 100%;
}
.home {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
gap: 5px;
}
a {
background-color: #505050;
color: white;
padding: 10px;
font-size: 16px;
cursor: pointer;
border-radius: 5px;
text-decoration: none;
}
</style>
</head>
<body>
<div class="home">
<h1>XernoBomb</h1>
<a href="/create">Create lobby</a>
<a href="/lobbies">Search Lobbies</a>
</div>
</body>
<%- include('footer') %>
</html>

8
package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"dependencies": {
"ejs": "^3.1.10",
"express": "^5.1.0",
"fs": "^0.0.1-security",
"ws": "^8.18.2"
}
}