Working
This commit is contained in:
parent
d8146c3723
commit
abdffe2e7a
7 changed files with 1184 additions and 51 deletions
43
views/index.ejs
Normal file
43
views/index.ejs
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script type="module" src="script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav><a href="#">Home</a><a href="#">Also home</a></nav>
|
||||
<!-- <% if("<%= roomName %>") {} else -->
|
||||
<div id="main-content">
|
||||
<div id="room-container">
|
||||
<span>Joinable rooms:</span>
|
||||
<ul>
|
||||
<% Object.keys(rooms).forEach(room => { %>
|
||||
<li><a href="/<%= room %>"><%= room %></a></li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
</div>
|
||||
<form action="/room" method="POST">
|
||||
<label for="room"></label>
|
||||
<input
|
||||
id="room"
|
||||
name="room"
|
||||
type="text"
|
||||
placeholder="Room Name"
|
||||
/>
|
||||
<button class="button-primary" type="submit">New Room</button>
|
||||
</form>
|
||||
</div>
|
||||
<footer>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href="https://github.com/Henry-Hiles"
|
||||
>My Github</a
|
||||
>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
64
views/room.ejs
Normal file
64
views/room.ejs
Normal file
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Messaging - Chatting</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script>
|
||||
const roomName = "<%= roomName %>"
|
||||
</script>
|
||||
<script type="module" src="script.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="login">
|
||||
<h1 class="large-header">Login</h1>
|
||||
<div>
|
||||
<input type="text" placeholder="Username" />
|
||||
<button class="button-circle" id="name">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
class="bi bi-pencil"
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<path
|
||||
d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<nav><a href="#">Home</a><a href="#">Also home</a></nav>
|
||||
|
||||
<div id="messages">
|
||||
<div class="message message-right"></div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<textarea
|
||||
id="message"
|
||||
placeholder="Enter your message here"
|
||||
cols="30"
|
||||
rows="3"
|
||||
></textarea>
|
||||
<button id="send" class="button-primary">Send</button>
|
||||
</footer>
|
||||
|
||||
<template>
|
||||
<div class="message">
|
||||
<div class="message-content">
|
||||
<span class="message-text"></span>
|
||||
|
||||
<span class="message-info"
|
||||
><span class="message-user"></span>
|
||||
<span class="message-timestamp"></span
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</body>
|
||||
</html>
|
Reference in a new issue