This commit is contained in:
parent
d1a68c635c
commit
a4bb3cfcca
7 changed files with 556 additions and 364 deletions
|
|
@ -23,6 +23,7 @@ const state = {
|
|||
voicePresencePollId: null,
|
||||
chatWs: null,
|
||||
lastMessageId: null,
|
||||
onlineUsers: new Set(),
|
||||
};
|
||||
|
||||
const el = {
|
||||
|
|
@ -141,6 +142,14 @@ function formatDate(isoString) {
|
|||
}
|
||||
|
||||
let audioCtx = null;
|
||||
|
||||
// Global interaction listener to unlock AudioContext (autoplay policy)
|
||||
window.addEventListener('click', () => {
|
||||
if (audioCtx && audioCtx.state === 'suspended') {
|
||||
audioCtx.resume();
|
||||
}
|
||||
}, { once: true });
|
||||
|
||||
function playSound(type) {
|
||||
try {
|
||||
if (!audioCtx) audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
||||
|
|
@ -274,9 +283,16 @@ function renderChannels() {
|
|||
function renderDMs() {
|
||||
el.dmList.innerHTML = "";
|
||||
for (const dm of state.dmConversations) {
|
||||
const isOnline = state.onlineUsers.has(dm.user_id);
|
||||
const row = document.createElement("button");
|
||||
row.className = `channel-row ${state.selectedDmUserId === dm.user_id ? "active" : ""}`;
|
||||
row.innerHTML = `<i data-lucide="message-circle"></i> <span>${escapeHtml(dm.display_name)}</span>`;
|
||||
row.innerHTML = `
|
||||
<div class="avatar-wrapper">
|
||||
<i data-lucide="message-circle"></i>
|
||||
<div class="status-dot ${isOnline ? "online" : ""}"></div>
|
||||
</div>
|
||||
<span>${escapeHtml(dm.display_name)}</span>
|
||||
`;
|
||||
row.onclick = async () => {
|
||||
state.selectedDmUserId = dm.user_id;
|
||||
state.selectedDmDisplayName = dm.display_name;
|
||||
|
|
@ -329,11 +345,7 @@ function renderMessages(messages) {
|
|||
}
|
||||
|
||||
if (messages.length > 0) {
|
||||
const latest = messages[0];
|
||||
if (state.lastMessageId && latest.id !== state.lastMessageId && latest.author_user_id !== state.me?.id) {
|
||||
playSound(state.selectedDmUserId ? 'dm' : 'message');
|
||||
}
|
||||
state.lastMessageId = latest.id;
|
||||
state.lastMessageId = messages[0].id;
|
||||
}
|
||||
|
||||
el.messageList.scrollTop = el.messageList.scrollHeight;
|
||||
|
|
@ -342,10 +354,14 @@ function renderMessages(messages) {
|
|||
function renderMembers() {
|
||||
el.memberList.innerHTML = "";
|
||||
for (const m of state.members) {
|
||||
const isOnline = state.onlineUsers.has(m.id);
|
||||
const row = document.createElement("div");
|
||||
row.className = "member-row";
|
||||
row.innerHTML = `
|
||||
<div class="member-avatar">${shortName(m.display_name)}</div>
|
||||
<div class="member-avatar">
|
||||
${shortName(m.display_name)}
|
||||
<div class="status-dot ${isOnline ? "online" : ""}"></div>
|
||||
</div>
|
||||
<div class="member-name">${escapeHtml(m.display_name)}</div>
|
||||
`;
|
||||
row.style.cursor = "pointer";
|
||||
|
|
@ -476,21 +492,31 @@ function initChatWs() {
|
|||
|
||||
ws.onmessage = (event) => {
|
||||
const msg = JSON.parse(event.data);
|
||||
const authorId = msg.message?.author_user_id;
|
||||
const isFromMe = authorId && state.me && authorId === state.me.id;
|
||||
|
||||
if (msg.type === "message_created") {
|
||||
if (!isFromMe) playSound('message');
|
||||
if (state.selectedTextChannelId === msg.channel_id) {
|
||||
// Optimization: we could just push the message, but refresh for now
|
||||
api(`/channels/${state.selectedTextChannelId}/messages?limit=100`).then(renderMessages);
|
||||
} else {
|
||||
// Even if not active, play sound
|
||||
playSound('message');
|
||||
}
|
||||
} else if (msg.type === "dm_created") {
|
||||
if (!isFromMe) playSound('dm');
|
||||
if (state.selectedDmUserId === msg.other_user_id) {
|
||||
api(`/dms/${state.selectedDmUserId}/messages?limit=100`).then(renderMessages);
|
||||
} else {
|
||||
playSound('dm');
|
||||
loadDMConversations().then(renderDMs);
|
||||
} else {
|
||||
loadDMConversations().then(renderDMs);
|
||||
}
|
||||
} else if (msg.type === "user_presence") {
|
||||
if (msg.online) {
|
||||
state.onlineUsers.add(msg.user_id);
|
||||
} else {
|
||||
state.onlineUsers.delete(msg.user_id);
|
||||
}
|
||||
renderMembers();
|
||||
renderDMs();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -918,6 +944,11 @@ async function init() {
|
|||
await loadGuilds();
|
||||
await loadDMConversations();
|
||||
|
||||
try {
|
||||
const online = await api("/presence");
|
||||
state.onlineUsers = new Set(online);
|
||||
} catch (err) { console.warn("presence sync failed", err); }
|
||||
|
||||
if (state.guilds.length > 0) {
|
||||
const lastGuildId = localStorage.getItem(LAST_GUILD_STORAGE_KEY);
|
||||
const guild = state.guilds.find((g) => g.id === lastGuildId) || state.guilds[0];
|
||||
|
|
|
|||
|
|
@ -7,22 +7,24 @@
|
|||
--bg-modifier-selected: rgba(78, 80, 88, 0.6);
|
||||
--bg-modifier-hover: rgba(78, 80, 88, 0.3);
|
||||
--bg-input: #383a40;
|
||||
|
||||
|
||||
--text-normal: #dbdee1;
|
||||
--text-muted: #949ba4;
|
||||
--text-strong: #f2f3f5;
|
||||
--text-link: #00a8fc;
|
||||
|
||||
|
||||
--brand: #5865f2;
|
||||
--brand-hover: #4752c4;
|
||||
--green: #23a559;
|
||||
--danger: #f23f43;
|
||||
--yellow: #f0b232;
|
||||
|
||||
|
||||
--font-main: "gg sans", "Inter", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
|
|
@ -34,15 +36,46 @@ body {
|
|||
}
|
||||
|
||||
/* Scrollbars */
|
||||
::-webkit-scrollbar { width: 8px; height: 8px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
|
||||
::-webkit-scrollbar-thumb:hover { background: #242529; }
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
button { border: 0; cursor: pointer; transition: all 150ms ease; background: none; color: inherit; font: inherit; padding: 0; }
|
||||
input, select { border: 0; outline: none; background: var(--bg-input); color: var(--text-normal); font: inherit; }
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.hidden { display: none !important; }
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #242529;
|
||||
}
|
||||
|
||||
button {
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
transition: all 150ms ease;
|
||||
background: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
border: 0;
|
||||
outline: none;
|
||||
background: var(--bg-input);
|
||||
color: var(--text-normal);
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Auth Screen */
|
||||
.auth-screen {
|
||||
|
|
@ -52,14 +85,16 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
background-image: url("https://discord.com/assets/f9a15998e94589d343f7.png");
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.auth-card {
|
||||
width: min(480px, 92vw);
|
||||
background: var(--bg-sidebar);
|
||||
border-radius: 8px;
|
||||
padding: 32px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.brand-large {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
|
@ -72,8 +107,17 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 800;
|
||||
margin: 0 auto 20px;
|
||||
}
|
||||
.auth-card h1 { margin: 0 0 8px; color: var(--text-strong); }
|
||||
.auth-card p { margin: 0 0 24px; color: var(--text-muted); }
|
||||
|
||||
.auth-card h1 {
|
||||
margin: 0 0 8px;
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.auth-card p {
|
||||
margin: 0 0 24px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
#login-btn {
|
||||
width: 100%;
|
||||
background: var(--brand);
|
||||
|
|
@ -83,7 +127,10 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
#login-btn:hover { background: var(--brand-hover); }
|
||||
|
||||
#login-btn:hover {
|
||||
background: var(--brand-hover);
|
||||
}
|
||||
|
||||
/* Main Layout */
|
||||
.shell {
|
||||
|
|
@ -104,7 +151,11 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.server-rail::-webkit-scrollbar { display: none; }
|
||||
|
||||
.server-rail::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.guild-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -112,7 +163,8 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.brand, .guild-pill {
|
||||
.brand,
|
||||
.guild-pill {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
|
|
@ -124,8 +176,16 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
background: var(--bg-sidebar);
|
||||
}
|
||||
|
||||
.brand { background: var(--brand); color: #fff; border-radius: 16px; margin-bottom: 2px; }
|
||||
.brand:hover { border-radius: 16px; }
|
||||
.brand {
|
||||
background: var(--brand);
|
||||
color: #fff;
|
||||
border-radius: 16px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.brand:hover {
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.separator {
|
||||
width: 32px;
|
||||
|
|
@ -135,7 +195,8 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.guild-pill:hover, .guild-pill.active {
|
||||
.guild-pill:hover,
|
||||
.guild-pill.active {
|
||||
border-radius: 16px;
|
||||
background: var(--brand);
|
||||
color: #fff;
|
||||
|
|
@ -151,11 +212,23 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
border-radius: 0 4px 4px 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.guild-pill:hover::before { height: 20px; }
|
||||
.guild-pill.active::before { height: 40px; }
|
||||
|
||||
.action-pill { color: var(--green); }
|
||||
.action-pill:hover { background: var(--green); color: #fff; }
|
||||
.guild-pill:hover::before {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.guild-pill.active::before {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.action-pill {
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.action-pill:hover {
|
||||
background: var(--green);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Channel Sidebar */
|
||||
.channel-sidebar {
|
||||
|
|
@ -171,11 +244,15 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid var(--bg-darker);
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.1s;
|
||||
}
|
||||
.sidebar-header:hover { background: var(--bg-modifier-hover); }
|
||||
|
||||
.sidebar-header:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
}
|
||||
|
||||
.sidebar-header h2 {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
|
|
@ -185,11 +262,13 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.sidebar-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.header-action-btn {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
@ -198,18 +277,27 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
place-items: center;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.header-action-btn:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.header-action-btn i {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.sidebar-scroll { flex: 1; overflow-y: auto; padding-top: 12px; }
|
||||
.sidebar-scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding-top: 12px;
|
||||
}
|
||||
|
||||
.sidebar-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.sidebar-group { margin-bottom: 20px; }
|
||||
.group-title {
|
||||
padding: 0 8px 0 2px;
|
||||
display: flex;
|
||||
|
|
@ -221,9 +309,21 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
letter-spacing: 0.24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.group-title:hover { color: var(--text-normal); }
|
||||
.group-toggle { width: 12px; height: 12px; margin-right: 2px; }
|
||||
.group-title span { flex: 1; }
|
||||
|
||||
.group-title:hover {
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.group-toggle {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.group-title span {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
|
@ -233,13 +333,24 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.add-btn:hover {
|
||||
opacity: 1;
|
||||
background: var(--bg-modifier-hover);
|
||||
}
|
||||
.add-btn i { width: 16px; height: 16px; }
|
||||
|
||||
.channel-list { padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
|
||||
.add-btn i {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.channel-list {
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.channel-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -249,12 +360,28 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 500;
|
||||
gap: 6px;
|
||||
}
|
||||
.channel-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
|
||||
.channel-row.active { background: var(--bg-modifier-selected); color: var(--text-strong); }
|
||||
.channel-row i { width: 20px; height: 20px; opacity: 0.6; }
|
||||
|
||||
.channel-row:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.channel-row.active {
|
||||
background: var(--bg-modifier-selected);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.channel-row i {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Sidebar Footer */
|
||||
.sidebar-footer { background: var(--bg-secondary); padding: 0; }
|
||||
.sidebar-footer {
|
||||
background: var(--bg-secondary);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.user-panel {
|
||||
padding: 8px;
|
||||
|
|
@ -263,9 +390,15 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
gap: 8px;
|
||||
height: 52px;
|
||||
}
|
||||
.user-panel:hover { background: var(--bg-modifier-hover); }
|
||||
|
||||
.avatar-wrapper { position: relative; }
|
||||
.user-panel:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
|
@ -277,6 +410,7 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
|
|
@ -286,9 +420,16 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
border-radius: 50%;
|
||||
border: 3px solid var(--bg-secondary);
|
||||
}
|
||||
.status-dot.online { background: var(--green); }
|
||||
|
||||
.user-info { flex: 1; min-width: 0; }
|
||||
.status-dot.online {
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
.user-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.display-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
|
|
@ -297,9 +438,17 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-status { font-size: 12px; color: var(--text-muted); }
|
||||
|
||||
.user-actions { display: flex; gap: 2px; }
|
||||
.user-status {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.user-actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.user-actions button {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
|
@ -308,21 +457,57 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
place-items: center;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.user-actions button:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
|
||||
.user-actions i { width: 20px; height: 20px; }
|
||||
|
||||
.user-actions button:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.user-actions i {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
/* Voice Connection */
|
||||
.voice-connection {
|
||||
padding: 8px;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
.vc-info { display: flex; align-items: center; gap: 8px; }
|
||||
.vc-icon { color: var(--green); width: 20px; }
|
||||
.vc-text { flex: 1; display: flex; flex-direction: column; }
|
||||
.vc-status { color: var(--green); font-size: 14px; font-weight: 700; }
|
||||
.vc-name { color: var(--text-muted); font-size: 12px; }
|
||||
.vc-actions { display: flex; gap: 4px; }
|
||||
|
||||
.vc-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vc-icon {
|
||||
color: var(--green);
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.vc-text {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.vc-status {
|
||||
color: var(--green);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.vc-name {
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.vc-actions {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.vc-actions button {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
|
@ -331,7 +516,11 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
.vc-actions button:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
|
||||
|
||||
.vc-actions button:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
/* Chat Pane */
|
||||
.chat-pane {
|
||||
|
|
@ -347,11 +536,21 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.2);
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header-icon {
|
||||
color: var(--text-muted);
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
.chat-header h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: var(--text-strong);
|
||||
}
|
||||
.header-icon { color: var(--text-muted); width: 24px; }
|
||||
.chat-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-strong); }
|
||||
|
||||
.message-list {
|
||||
flex: 1;
|
||||
|
|
@ -365,7 +564,10 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
gap: 16px;
|
||||
margin-top: 1.0625rem;
|
||||
}
|
||||
.msg:hover { background: rgba(0,0,0,0.05); }
|
||||
|
||||
.msg:hover {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.msg-avatar {
|
||||
width: 40px;
|
||||
|
|
@ -379,36 +581,77 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 600;
|
||||
}
|
||||
|
||||
.msg-content { flex: 1; min-width: 0; }
|
||||
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
|
||||
.msg-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.msg-header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.msg-author {
|
||||
font-weight: 600;
|
||||
color: var(--text-strong);
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.msg-author:hover { text-decoration: underline; }
|
||||
.msg-time { font-size: 12px; color: var(--text-muted); }
|
||||
.msg-body { color: var(--text-normal); line-height: 1.375rem; white-space: pre-wrap; word-wrap: break-word; }
|
||||
|
||||
.msg-grouped { margin-top: 0; padding-top: 0; padding-bottom: 0; }
|
||||
.msg-grouped .msg-avatar, .msg-grouped .msg-header { display: none; }
|
||||
.msg-grouped .msg-content { padding-left: 56px; }
|
||||
.msg-author:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.msg-time {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.msg-body {
|
||||
color: var(--text-normal);
|
||||
line-height: 1.375rem;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.msg-grouped {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.msg-grouped .msg-avatar,
|
||||
.msg-grouped .msg-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.msg-grouped .msg-content {
|
||||
padding-left: 56px;
|
||||
}
|
||||
|
||||
/* Chat Input */
|
||||
.chat-input-wrapper { padding: 0 16px 24px; }
|
||||
.chat-input-wrapper {
|
||||
padding: 0 16px 24px;
|
||||
}
|
||||
|
||||
.message-form {
|
||||
background: var(--bg-input);
|
||||
border-radius: 8px;
|
||||
padding: 11px 16px;
|
||||
}
|
||||
|
||||
.message-form input {
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
color: var(--text-normal);
|
||||
font-size: 16px;
|
||||
}
|
||||
.message-form input::placeholder { color: var(--text-muted); }
|
||||
|
||||
.message-form input::placeholder {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Member List */
|
||||
.utility-sidebar {
|
||||
|
|
@ -416,7 +659,13 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.member-list-wrapper { flex: 1; overflow-y: auto; padding: 12px 8px; }
|
||||
|
||||
.member-list-wrapper {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.member-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -426,7 +675,12 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
.member-row:hover { background: var(--bg-modifier-hover); color: var(--text-normal); }
|
||||
|
||||
.member-row:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.member-avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
|
@ -439,23 +693,67 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.member-name {
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Presence Badges */
|
||||
.avatar-wrapper {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
right: -2px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--bg-sidebar);
|
||||
background: #747f8d;
|
||||
/* Gray for offline */
|
||||
}
|
||||
|
||||
.status-badge.online {
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
.member-avatar,
|
||||
.msg-avatar {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--bg-sidebar);
|
||||
background: #747f8d;
|
||||
}
|
||||
|
||||
.status-dot.online {
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
/* Modals */
|
||||
.modal-container {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.85);
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.85);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.modal {
|
||||
background: var(--bg-sidebar);
|
||||
width: min(440px, 95vw);
|
||||
|
|
@ -463,8 +761,17 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
padding: 24px;
|
||||
color: var(--text-normal);
|
||||
}
|
||||
.modal h2 { margin: 0 0 16px; text-align: center; color: var(--text-strong); }
|
||||
.form-item { margin-bottom: 20px; }
|
||||
|
||||
.modal h2 {
|
||||
margin: 0 0 16px;
|
||||
text-align: center;
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form-item label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
|
|
@ -472,6 +779,7 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
color: var(--text-muted);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form-item input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
|
|
@ -485,8 +793,17 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
justify-content: flex-end;
|
||||
gap: 16px;
|
||||
}
|
||||
.cancel-btn { padding: 10px 20px; color: var(--text-strong); font-weight: 500; }
|
||||
.cancel-btn:hover { text-decoration: underline; }
|
||||
|
||||
.cancel-btn {
|
||||
padding: 10px 20px;
|
||||
color: var(--text-strong);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background: var(--brand);
|
||||
color: #fff;
|
||||
|
|
@ -494,12 +811,28 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
border-radius: 3px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.submit-btn:hover { background: var(--brand-hover); }
|
||||
|
||||
.submit-btn:hover {
|
||||
background: var(--brand-hover);
|
||||
}
|
||||
|
||||
/* Radio Group for Channel Type */
|
||||
.radio-group { display: flex; flex-direction: column; gap: 8px; }
|
||||
.radio-item { cursor: pointer; position: relative; }
|
||||
.radio-item input { position: absolute; opacity: 0; }
|
||||
.radio-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.radio-item {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.radio-item input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.radio-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -509,21 +842,45 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
border-radius: 4px;
|
||||
transition: all 0.1s;
|
||||
}
|
||||
.radio-item input:checked + .radio-box { background: var(--bg-modifier-selected); color: var(--text-strong); }
|
||||
.radio-box i { width: 24px; height: 24px; color: var(--text-muted); }
|
||||
.radio-text { display: flex; flex-direction: column; }
|
||||
.radio-text strong { font-size: 16px; }
|
||||
.radio-text span { font-size: 12px; color: var(--text-muted); }
|
||||
|
||||
.radio-item input:checked+.radio-box {
|
||||
background: var(--bg-modifier-selected);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.radio-box i {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.radio-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.radio-text strong {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.radio-text span {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Mobile Overlay */
|
||||
.overlay {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 90;
|
||||
opacity: 1;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.overlay.hidden {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
|
|
@ -541,39 +898,50 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
background: transparent;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.mobile-toggle-btn:hover {
|
||||
background: var(--bg-modifier-hover);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.shell { grid-template-columns: 72px 240px 1fr; }
|
||||
.shell {
|
||||
grid-template-columns: 72px 240px 1fr;
|
||||
}
|
||||
|
||||
.utility-sidebar {
|
||||
position: fixed;
|
||||
top: 0; bottom: 0; right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 240px;
|
||||
z-index: 100;
|
||||
box-shadow: -2px 0 10px rgba(0,0,0,0.5);
|
||||
box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.utility-sidebar.active {
|
||||
transform: translateX(0);
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.chat-header .mobile-toggle-btn { display: flex; }
|
||||
|
||||
.chat-header .mobile-toggle-btn {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.shell {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
|
||||
/* Hide sidebars by default on mobile */
|
||||
.server-rail, .channel-sidebar {
|
||||
.server-rail,
|
||||
.channel-sidebar {
|
||||
position: fixed;
|
||||
top: 0; bottom: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
|
@ -583,25 +951,28 @@ input, select { border: 0; outline: none; background: var(--bg-input); color: va
|
|||
width: 72px;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
|
||||
.channel-sidebar {
|
||||
left: 72px;
|
||||
width: 240px;
|
||||
transform: translateX(-312px); /* 72 + 240 */
|
||||
box-shadow: 2px 0 10px rgba(0,0,0,0.5);
|
||||
transform: translateX(-312px);
|
||||
/* 72 + 240 */
|
||||
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
/* When menu is active */
|
||||
.shell.menu-open .server-rail {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.shell.menu-open .channel-sidebar {
|
||||
transform: translateX(0);
|
||||
display: flex; /* Override display: none from previous rule */
|
||||
display: flex;
|
||||
/* Override display: none from previous rule */
|
||||
}
|
||||
|
||||
/* Adjust chat header for mobile */
|
||||
.chat-header {
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
249
static/vendor/deepfilternet3/index.esm.js
vendored
249
static/vendor/deepfilternet3/index.esm.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
static/vendor/deepfilternet3/v2/pkg/df_bg.wasm
vendored
BIN
static/vendor/deepfilternet3/v2/pkg/df_bg.wasm
vendored
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue