NodeCrypt

This commit is contained in:
shuaiplus committed 2025-05-05 01:55:50 +08:00
1 parent dfa5aa22ba
commit 3eedaace2c
3 files changed
+19 -14

No files matched your search

+3 -3
View File
@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Telegram UI 聊天室框架</title>
<title>NodeCrypt</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@@ -22,7 +22,7 @@
<label for="password">Node Password <span class="optional">(optional)</span></label>
<input id="password" type="password" autocomplete="off">
</div>
<button type="submit" class="login-btn">Enter</button>
<button type="submit" class="login-btn">ENTER</button>
</form>
</div>
<!-- 聊天主界面,初始隐藏 -->
@@ -35,7 +35,7 @@
</div>
<div class="join-room">
<svg class="MuiSvgIcon-root" focusable="false" viewBox="0 0 24 24" aria-hidden="true" style="width:22px;height:22px;vertical-align:middle;margin-right:25px;margin-left: 25px;"><path d="M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3z"></path></svg>
Enter a channel
Enter a Node
</div>
<div class="rooms" id="room-list">
<!-- JS填充房间项 -->
+9 -9
View File
@@ -223,8 +223,8 @@ function loginFormHandler(modal) {
setStatus('Connecting...');
// 初始化 ChatCrypt
const callbacks = {
onServerClosed: () => setStatus('Server connection closed'),
onServerSecured: () => setStatus('Secure connection to server'),
onServerClosed: () => setStatus('Node connection closed'),
onServerSecured: () => setStatus('Secure connection to node'),
onClientSecured: (user) => handleClientSecured(idx, user),
onClientList: (list, selfId) => handleClientList(idx, list, selfId),
onClientLeft: (clientId) => handleClientLeft(idx, clientId),
@@ -252,21 +252,21 @@ function openLoginModal() {
<div class="login-modal-bg"></div>
<div class="login-modal-card">
<button class="login-modal-close" style="position:absolute;right:10px;top:10px;font-size:22px;background:none;border:none;cursor:pointer;">&times;</button>
<h1>Sign in to Chatroom</h1>
<h1>Enter a Node</h1>
<form id="login-form-modal">
<div class="input-group">
<label for="username-modal">Username</label>
<input id="username-modal" type="text" autocomplete="username" required="">
</div>
<div class="input-group">
<label for="room-modal">Room Name</label>
<label for="room-modal">Node Name</label>
<input id="room-modal" type="text" required="">
</div>
<div class="input-group">
<label for="password-modal">Room Password <span class="optional">(optional)</span></label>
<label for="password-modal">Node Password <span class="optional">(optional)</span></label>
<input id="password-modal" type="password" autocomplete="off">
</div>
<button type="submit" class="login-btn">NEXT</button>
<button type="submit" class="login-btn">ENTER</button>
</form>
</div>
`;
@@ -296,11 +296,11 @@ function openLoginModal() {
// 关闭modal
modal.remove();
document.getElementById('chat-container').style.display = '';
setStatus('正在连接...');
setStatus('Connecting...');
// 初始化 ChatCrypt
const callbacks = {
onServerClosed: () => setStatus('服务器连接关闭'),
onServerSecured: () => setStatus('与服务器安全连接已建立'),
onServerClosed: () => setStatus('Node connection closed'),
onServerSecured: () => setStatus('Secure connection to node'),
onClientSecured: (user) => handleClientSecured(idx, user),
onClientList: (list, selfId) => handleClientList(idx, list, selfId),
onClientLeft: (clientId) => handleClientLeft(idx, clientId),
+7 -2
View File
@@ -877,10 +877,15 @@ body {
border-radius: 14px;
box-shadow: 0 2px 16px rgba(60,80,100,0.13);
padding: 32px 24px 24px 24px;
min-width: 340px;
max-width: 90vw;
min-width: 200px;
width: 400px;
text-align: center;
}
.login-modal-card form {
display: flex;
flex-direction: column;
gap: 18px;
}
.login-modal-close {
position: absolute;
right: 12px;