134 lines
6 KiB
Text
134 lines
6 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" />
|
|
<link rel="icon" type="image/svg+xml" href="/icon.svg" sizes="any" />
|
|
<title>Messaging</title>
|
|
<link rel="stylesheet" href="style.css" />
|
|
<link rel="icon" href="/favicon.ico" type="image/gif">
|
|
<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="/" id="room-form" novalidate>
|
|
<div class="input-group">
|
|
<input placeholder="Room Name" type="text" name="room" id="room" class="input-field" maxlength="10" />
|
|
<button class="input-item" type="submit" id="room-button">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
|
|
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
|
|
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</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>
|
|
<span id="roomName"></span>
|
|
<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="1"
|
|
<%- !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>
|