main
jerl 2023-05-13 05:01:22 -07:00
parent fd6092947f
commit 55fdc45073
2 changed files with 80 additions and 79 deletions

View File

@ -83,9 +83,7 @@ async function loadKeys(keys) {
async function loadMessages() { async function loadMessages() {
window.socket.emit( window.socket.emit(
"get_history", "get_history",
window.earliestMessage { before: window.earliestMessage, thread: window.currentThreadId }
? { before: window.earliestMessage, thread: window.currentThreadId }
: { thread: window.currentThreadId }
); );
} }

View File

@ -1,79 +1,82 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vybe</title> <title>vybe</title>
<style> <style>
* { * {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
sans-serif; sans-serif;
} }
body { body, button, input {
background: #171719; background: #020202;
color: #d8d8d8; color: #eaeaea;
} }
.hidden { button {
display: none; border-color: #767676;
} }
#msginput { .hidden {
margin-top: 15px; display: none;
} }
.message { #msginput {
margin-bottom: 5px; margin-top: 15px;
} }
#loadmore { .message {
margin-bottom: 10px; margin-bottom: 5px;
} }
.channel { #loadmore {
font-weight: normal; margin-bottom: 10px;
} }
</style> .channel {
</head> font-weight: normal;
<body> }
<div id="register" class="hidden"> </style>
<h1>welcome to vybe</h1> </head>
<h3>this site is in beta</h3> <body>
<p> <div id="register" class="hidden">
to get started, you'll need to set up an account. we use public key <h1>welcome to vybe</h1>
cryptography for security, rather than passwords. in this early beta <h3>a communication network (beta)</h3>
version your keys are stored in your browser storage only. <p>
</p> to get started, you'll need an account. we use public key
<form id="registerform"> cryptography for security, rather than passwords. for now
<label for="name">name/username</label> your keys are stored in your browser storage only.
<input type="text" id="name" /> </p>
<button id="submit" type="submit">generate keys & register</button> <form id="registerform">
</form> <label for="name">name/username: </label>
</div> <input type="text" id="name" />
<div id="chat" class="hidden"> <button id="submit" type="submit">generate keys & register</button>
<h1>vybe</h1> </form>
<h3 class="thread"> </div>
current thread: <strong id="threadname">meow</strong> <div id="chat" class="hidden">
<button id="change">change thread</button> <h1>vybe</h1>
</h3> <h3 class="thread">
<h3>messages will appear below as they are sent</h3> current thread: <strong id="threadname">meow</strong>
<button id="loadmore">load more messages</button> <button id="change">change thread</button>
<div id="messages"></div> </h3>
<form id="msginput"> <h3>messages will appear below as they are sent</h3>
<input type="text" placeholder="write a message..." id="msg" /> <button id="loadmore">load more messages</button>
<button type="submit" class="hidden" id="sendmsg"></button> <div id="messages"></div>
</form> <form id="msginput">
</div> <input type="text" placeholder="write a message..." id="msg" />
<div id="threads" class="hidden"> <button type="submit" class="hidden" id="sendmsg"></button>
<h1>threads</h1> </form>
<h3>create thread</h3> </div>
<form id="createthread"> <div id="threads" class="hidden">
<label for="newthreadname">thread name</label> <h1>threads</h1>
<input type="text" id="newthreadname" /> <h3>create thread</h3>
<button id="submitthread" type="submit">create</button> <form id="createthread">
</form> <label for="newthreadname">thread name</label>
<h3>choose existing thread</h3> <input type="text" id="newthreadname" />
<div id="threadlist">loading...</div> <button id="submitthread" type="submit">create</button>
</div> </form>
<script src="/openpgp.min.js"></script> <h3>choose existing thread</h3>
<script src="/chat.js"></script> <div id="threadlist">loading...</div>
<script src="/socket.io.min.v4.6.1.js"></script> </div>
</body> <script src="/openpgp.min.js"></script>
<script src="/chat.js"></script>
<script src="/socket.io.min.v4.6.1.js"></script>
</body>
</html> </html>