This repository has been archived on 2025-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
Messaging/views/index.ejs
2022-01-31 10:57:31 -05:00

131 lines
5.4 KiB
Text

<!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>
const roomName = "<%= roomName %>"
</script>
<script type="module" src="script.js"></script>
</head>
<body>
<div id="login" class="done">
<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>
<div id="rooms" class="opened">
<h1 class="medium-header" id="rooms-header">Rooms</h1>
<ul id="room-container">
<% if(Object.keys(rooms).length)
{Object.keys(rooms).forEach(room => { %>
<li>
<a
href="/<%= room %>"
class="<%= room == roomName ? 'active' : '' %>"
><%= room %></a
>
</li>
<% })} else {%>
<h1 class="medium-header" id="no-rooms">No rooms</h1>
<%} %>
</ul>
<form method="POST" action="/">
<input
id="room"
name="room"
autocomplete="off"
type="text"
placeholder="Room Name"
/>
<button class="button-primary" type="submit">New Room</button>
</form>
</div>
<div id="content">
<nav>
<button id="menu">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-list"
viewBox="0 0 16 16"
>
<path
fill-rule="evenodd"
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"
/>
</svg>
</button>
<a href="#">Home</a><a href="#">Also home</a>
<div id="change-name">
<span id="name-display"></span>
<button class="button-circle">
<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>
</nav>
<div id="messages">
</div>
<footer>
<textarea
id="message"
cols="30"
rows="3"
<%- !roomName ? "disabled placeholder='Join a room to send messages'" : 'placeholder="Enter your message"' %>
></textarea>
<button
id="send"
class="button-primary"
<%= !roomName ? "disabled" : "" %>
>
Send
</button>
</footer>
</div>
<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>