Files
BetterDesk/web-nodejs/public/css/chat.css
T
UNITRONIX dd0889e3d6 Add SessionManager; update docs, i18n & CI
Introduce a SessionManager for relay-based remote sessions in the Tauri MGMT client: new SessionCommand API, start/stop/session input routing, clipboard/recording/quality controls, and notification read/dismiss state. Wire AppState with new mutexes and show main window on startup. CI: add SBOM generation (anchore) and Trivy vulnerability scan steps. Misc: change console Docker DB path, large README/CHANGELOG updates (chat E2E, unattended access/WOL, i18n expansion, CDAP/SDK docs), and many web-nodejs assets/locales/routes/views/services and server-side changes.
2026-04-05 13:42:07 +02:00

1033 lines
21 KiB
CSS

/* ============================================
BetterDesk Console — Chat 2.0 Styles
============================================ */
/* ── Layout ── */
.chat-page {
display: flex;
height: calc(100vh - var(--topnav-height, 56px));
background: var(--bg-primary, #0d1117);
overflow: hidden;
}
.chat-sidebar {
width: 320px;
min-width: 280px;
max-width: 380px;
display: flex;
flex-direction: column;
background: var(--bg-secondary, #161b22);
border-right: 1px solid var(--border-color, #30363d);
overflow: hidden;
}
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
/* ── Sidebar Header ── */
.chat-sidebar-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-sidebar-header h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: var(--text-primary, #e6edf3);
}
.chat-sidebar-actions {
display: flex;
gap: 4px;
}
.chat-sidebar-actions button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 6px;
border-radius: 6px;
transition: background 0.15s, color 0.15s;
}
.chat-sidebar-actions button:hover {
background: var(--bg-hover, #21262d);
color: var(--text-primary, #e6edf3);
}
/* ── Presence selector ── */
.chat-presence-row {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-presence-dot {
width: 10px;
height: 10px;
border-radius: 50%;
flex-shrink: 0;
}
.chat-presence-dot.presence-online { background: #3fb950; }
.chat-presence-dot.presence-away { background: #d29922; }
.chat-presence-dot.presence-busy { background: #f85149; }
.chat-presence-dot.presence-offline { background: #484f58; }
.chat-presence-row select {
flex: 1;
background: var(--bg-tertiary, #0d1117);
border: 1px solid var(--border-color, #30363d);
color: var(--text-primary, #e6edf3);
padding: 4px 8px;
border-radius: 6px;
font-size: 13px;
}
/* ── Tabs ── */
.chat-tabs {
display: flex;
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-tab {
flex: 1;
padding: 10px;
text-align: center;
font-size: 13px;
font-weight: 500;
color: var(--text-secondary, #8b949e);
background: none;
border: none;
border-bottom: 2px solid transparent;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
}
.chat-tab:hover {
color: var(--text-primary, #e6edf3);
}
.chat-tab.active {
color: var(--accent, #4f6ef7);
border-bottom-color: var(--accent, #4f6ef7);
}
/* ── Contact / Group list ── */
.chat-list {
flex: 1;
overflow-y: auto;
padding: 4px 0;
}
.chat-list-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 16px;
cursor: pointer;
transition: background 0.15s;
border-left: 3px solid transparent;
}
.chat-list-item:hover {
background: var(--bg-hover, #21262d);
}
.chat-list-item.active {
background: var(--bg-active, rgba(79, 110, 247, 0.1));
border-left-color: var(--accent, #4f6ef7);
}
.chat-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: 600;
color: #fff;
flex-shrink: 0;
position: relative;
}
.chat-avatar.group-avatar {
background: var(--bg-tertiary, #21262d);
color: var(--text-secondary, #8b949e);
}
.chat-avatar .material-icons {
font-size: 20px;
}
.chat-presence-indicator {
position: absolute;
bottom: 0;
right: 0;
width: 12px;
height: 12px;
border-radius: 50%;
border: 2px solid var(--bg-secondary, #161b22);
}
.chat-presence-indicator.online { background: #3fb950; }
.chat-presence-indicator.away { background: #d29922; }
.chat-presence-indicator.busy { background: #f85149; }
.chat-presence-indicator.offline { background: #484f58; }
.chat-list-item-body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.chat-list-item-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.chat-list-name {
font-size: 14px;
font-weight: 500;
color: var(--text-primary, #e6edf3);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.chat-list-time {
font-size: 11px;
color: var(--text-secondary, #8b949e);
flex-shrink: 0;
}
.chat-list-preview {
font-size: 12px;
color: var(--text-secondary, #8b949e);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.chat-list-members {
font-size: 12px;
color: var(--text-secondary, #8b949e);
}
.chat-role-badge {
display: inline-block;
font-size: 10px;
padding: 1px 5px;
border-radius: 4px;
margin-right: 4px;
font-weight: 600;
text-transform: uppercase;
}
.chat-role-badge.admin { background: rgba(79, 110, 247, 0.2); color: #4f6ef7; }
.chat-role-badge.operator { background: rgba(63, 185, 80, 0.2); color: #3fb950; }
.chat-unread-badge {
background: var(--accent, #4f6ef7);
color: #fff;
font-size: 11px;
font-weight: 600;
min-width: 20px;
height: 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 6px;
flex-shrink: 0;
}
.chat-list-empty {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 40px 20px;
color: var(--text-tertiary, #484f58);
text-align: center;
}
.chat-list-empty .material-icons {
font-size: 32px;
opacity: 0.5;
}
.chat-list-empty p {
margin: 0;
font-size: 13px;
}
/* ── Empty state ── */
.chat-empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-tertiary, #484f58);
gap: 12px;
}
.chat-empty-state .material-icons {
font-size: 64px;
opacity: 0.3;
}
.chat-empty-state p {
font-size: 15px;
margin: 0;
}
/* ── Conversation header ── */
.chat-conv-header {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
background: var(--bg-secondary, #161b22);
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-conv-back {
display: none;
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 4px;
border-radius: 6px;
}
.chat-conv-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 600;
color: #fff;
flex-shrink: 0;
}
.chat-conv-info {
flex: 1;
min-width: 0;
}
.chat-conv-info .chat-conv-name {
font-size: 15px;
font-weight: 600;
color: var(--text-primary, #e6edf3);
}
.chat-conv-status {
font-size: 12px;
color: var(--text-secondary, #8b949e);
}
.chat-conv-status.presence-online { color: #3fb950; }
.chat-conv-status.presence-away { color: #d29922; }
.chat-conv-status.presence-busy { color: #f85149; }
.chat-conv-actions {
display: flex;
gap: 4px;
}
.chat-conv-actions button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 6px;
border-radius: 6px;
transition: background 0.15s, color 0.15s;
}
.chat-conv-actions button:hover {
background: var(--bg-hover, #21262d);
color: var(--text-primary, #e6edf3);
}
/* ── E2E Banner ── */
.chat-e2e-banner {
display: none;
align-items: center;
gap: 8px;
padding: 8px 16px;
font-size: 12px;
color: var(--text-secondary, #8b949e);
background: var(--bg-tertiary, #0d1117);
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-e2e-banner .material-icons {
font-size: 16px;
color: #d29922;
}
.chat-e2e-banner.established .material-icons {
color: #3fb950;
}
/* ── Search Bar ── */
.chat-search-bar {
display: none;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: var(--bg-secondary, #161b22);
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-search-bar input {
flex: 1;
background: var(--bg-tertiary, #0d1117);
border: 1px solid var(--border-color, #30363d);
color: var(--text-primary, #e6edf3);
padding: 6px 10px;
border-radius: 6px;
font-size: 13px;
outline: none;
}
.chat-search-bar input:focus {
border-color: var(--accent, #4f6ef7);
}
.chat-search-bar button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 4px;
}
/* ── Search Results ── */
.chat-search-results {
display: none;
max-height: 200px;
overflow-y: auto;
background: var(--bg-secondary, #161b22);
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-search-result {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
cursor: pointer;
transition: background 0.15s;
}
.chat-search-result:hover {
background: var(--bg-hover, #21262d);
}
.chat-search-from {
font-size: 12px;
font-weight: 600;
color: var(--accent, #4f6ef7);
flex-shrink: 0;
}
.chat-search-text {
font-size: 12px;
color: var(--text-secondary, #8b949e);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}
.chat-search-time {
font-size: 11px;
color: var(--text-tertiary, #484f58);
flex-shrink: 0;
}
.chat-search-no-results {
padding: 16px;
text-align: center;
font-size: 13px;
color: var(--text-tertiary, #484f58);
}
/* ── Messages area ── */
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 16px;
scroll-behavior: smooth;
}
.chat-messages-inner {
display: flex;
flex-direction: column;
gap: 4px;
}
.chat-messages-empty {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-tertiary, #484f58);
font-size: 14px;
}
/* ── Date separator ── */
.chat-date-separator {
display: flex;
align-items: center;
justify-content: center;
padding: 16px 0 8px;
}
.chat-date-separator span {
font-size: 11px;
color: var(--text-tertiary, #484f58);
background: var(--bg-secondary, #161b22);
padding: 4px 12px;
border-radius: 10px;
}
/* ── Message bubbles ── */
.chat-msg {
display: flex;
flex-direction: column;
max-width: 70%;
animation: msgFadeIn 0.2s ease;
}
@keyframes msgFadeIn {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
.chat-msg.mine {
align-self: flex-end;
}
.chat-msg.theirs {
align-self: flex-start;
}
.chat-msg.system {
align-self: center;
flex-direction: row;
align-items: center;
gap: 6px;
max-width: 90%;
font-size: 12px;
color: var(--text-tertiary, #484f58);
padding: 4px 0;
}
.chat-msg.system .material-icons {
font-size: 14px;
}
.chat-msg-sender {
font-size: 11px;
font-weight: 600;
color: var(--accent, #4f6ef7);
padding: 0 12px 2px;
}
.chat-msg-bubble {
position: relative;
padding: 8px 12px;
border-radius: 12px;
background: var(--bg-secondary, #161b22);
border: 1px solid var(--border-color, #30363d);
word-wrap: break-word;
overflow-wrap: break-word;
}
.chat-msg.mine .chat-msg-bubble {
background: var(--accent, #4f6ef7);
border-color: transparent;
color: #fff;
border-bottom-right-radius: 4px;
}
.chat-msg.theirs .chat-msg-bubble {
border-bottom-left-radius: 4px;
}
.chat-msg-text {
font-size: 14px;
line-height: 1.4;
color: inherit;
}
.chat-msg-text a {
color: #79c0ff;
text-decoration: underline;
}
.chat-msg.mine .chat-msg-text a {
color: #d2dff8;
}
.chat-msg-meta {
display: flex;
align-items: center;
gap: 4px;
justify-content: flex-end;
margin-top: 4px;
}
.chat-msg-time {
font-size: 10px;
opacity: 0.6;
}
.chat-msg-read {
font-size: 14px !important;
opacity: 0.6;
}
.chat-msg-react-btn {
position: absolute;
top: -8px;
right: -8px;
background: var(--bg-secondary, #161b22);
border: 1px solid var(--border-color, #30363d);
border-radius: 50%;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
transition: opacity 0.15s;
}
.chat-msg:hover .chat-msg-react-btn {
opacity: 1;
}
.chat-msg-react-btn .material-icons {
font-size: 14px;
color: var(--text-secondary, #8b949e);
}
/* ── Reactions ── */
.chat-reactions {
display: flex;
flex-wrap: wrap;
gap: 4px;
padding: 4px 0 0 12px;
}
.chat-reaction {
font-size: 12px;
padding: 2px 6px;
background: var(--bg-tertiary, #0d1117);
border: 1px solid var(--border-color, #30363d);
border-radius: 10px;
cursor: pointer;
transition: background 0.15s;
}
.chat-reaction:hover {
background: var(--bg-hover, #21262d);
}
/* ── File message ── */
.chat-file-msg {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 0;
}
.chat-file-msg .material-icons {
font-size: 20px;
opacity: 0.7;
}
.chat-file-msg a {
color: var(--accent, #4f6ef7);
text-decoration: none;
font-size: 13px;
font-weight: 500;
}
.chat-file-msg a:hover {
text-decoration: underline;
}
.chat-file-size-label {
font-size: 11px;
opacity: 0.6;
}
/* ── Typing indicator ── */
.chat-typing {
display: none;
align-items: center;
gap: 8px;
padding: 4px 16px 8px;
font-size: 12px;
color: var(--text-secondary, #8b949e);
}
.chat-typing-dots {
display: flex;
gap: 3px;
}
.chat-typing-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-tertiary, #484f58);
animation: typingBounce 1.4s infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
0%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-4px); }
}
/* ── Input area ── */
.chat-input-area {
display: flex;
flex-direction: column;
border-top: 1px solid var(--border-color, #30363d);
background: var(--bg-secondary, #161b22);
}
.chat-file-preview {
display: none;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: var(--bg-tertiary, #0d1117);
border-bottom: 1px solid var(--border-color, #30363d);
}
.chat-file-preview .material-icons {
font-size: 18px;
color: var(--accent, #4f6ef7);
}
.chat-file-info {
flex: 1;
display: flex;
flex-direction: column;
}
.chat-file-info .chat-file-label {
font-size: 13px;
font-weight: 500;
color: var(--text-primary, #e6edf3);
}
.chat-file-info .chat-file-size {
font-size: 11px;
color: var(--text-secondary, #8b949e);
}
.chat-file-preview button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 4px;
}
.chat-input-row {
display: flex;
align-items: flex-end;
gap: 8px;
padding: 12px 16px;
}
.chat-input-row button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
padding: 6px;
border-radius: 6px;
flex-shrink: 0;
transition: color 0.15s;
}
.chat-input-row button:hover {
color: var(--text-primary, #e6edf3);
}
.chat-input-row textarea {
flex: 1;
background: var(--bg-tertiary, #0d1117);
border: 1px solid var(--border-color, #30363d);
color: var(--text-primary, #e6edf3);
padding: 8px 12px;
border-radius: 8px;
font-size: 14px;
font-family: inherit;
resize: none;
min-height: 38px;
max-height: 120px;
line-height: 1.4;
outline: none;
transition: border-color 0.15s;
}
.chat-input-row textarea:focus {
border-color: var(--accent, #4f6ef7);
}
.chat-input-row textarea::placeholder {
color: var(--text-tertiary, #484f58);
}
#chat-send-btn {
background: var(--accent, #4f6ef7) !important;
color: #fff !important;
border-radius: 50% !important;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s !important;
}
#chat-send-btn:hover {
background: #3d5bd9 !important;
}
/* ── Emoji Picker ── */
.chat-emoji-picker {
display: none;
flex-wrap: wrap;
position: fixed;
background: var(--bg-secondary, #161b22);
border: 1px solid var(--border-color, #30363d);
border-radius: 10px;
padding: 8px;
gap: 4px;
max-width: 240px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
z-index: 100;
}
.emoji-btn {
background: none;
border: none;
font-size: 20px;
cursor: pointer;
padding: 4px;
border-radius: 6px;
transition: background 0.15s;
line-height: 1;
}
.emoji-btn:hover {
background: var(--bg-hover, #21262d);
}
/* ── Group Modal ── */
.chat-group-modal {
display: none;
position: fixed;
inset: 0;
z-index: 200;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
}
.chat-group-modal-content {
background: var(--bg-secondary, #161b22);
border: 1px solid var(--border-color, #30363d);
border-radius: 12px;
width: 400px;
max-width: 90vw;
padding: 24px;
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.chat-group-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.chat-group-modal-header h3 {
margin: 0;
font-size: 16px;
color: var(--text-primary, #e6edf3);
}
.chat-group-modal-header button {
background: none;
border: none;
color: var(--text-secondary, #8b949e);
cursor: pointer;
}
.chat-group-form {
display: flex;
flex-direction: column;
gap: 12px;
}
.chat-group-form input {
background: var(--bg-tertiary, #0d1117);
border: 1px solid var(--border-color, #30363d);
color: var(--text-primary, #e6edf3);
padding: 8px 12px;
border-radius: 6px;
font-size: 14px;
outline: none;
}
.chat-group-form input:focus {
border-color: var(--accent, #4f6ef7);
}
.chat-member-select {
max-height: 200px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 4px;
}
.chat-member-option {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px;
border-radius: 6px;
cursor: pointer;
font-size: 13px;
color: var(--text-primary, #e6edf3);
transition: background 0.15s;
}
.chat-member-option:hover {
background: var(--bg-hover, #21262d);
}
.chat-group-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 8px;
}
.chat-group-actions button {
padding: 8px 16px;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
border: 1px solid var(--border-color, #30363d);
background: var(--bg-tertiary, #0d1117);
color: var(--text-primary, #e6edf3);
transition: background 0.15s;
}
.chat-group-actions button:hover {
background: var(--bg-hover, #21262d);
}
.chat-group-actions .btn-primary {
background: var(--accent, #4f6ef7);
border-color: transparent;
color: #fff;
}
.chat-group-actions .btn-primary:hover {
background: #3d5bd9;
}
/* ── Responsive ── */
@media (max-width: 768px) {
.chat-page {
flex-direction: column;
}
.chat-sidebar {
width: 100%;
max-width: none;
height: 100%;
}
.chat-main {
position: absolute;
inset: 0;
z-index: 10;
display: none;
}
.chat-main.active-conv {
display: flex;
}
.chat-conv-back {
display: flex !important;
}
.chat-msg {
max-width: 85%;
}
}
/* ── Light theme ── */
[data-theme="light"] .chat-sidebar { background: #f6f8fa; }
[data-theme="light"] .chat-list-item:hover { background: #e1e4e8; }
[data-theme="light"] .chat-list-item.active { background: rgba(79, 110, 247, 0.08); }
[data-theme="light"] .chat-conv-header { background: #f6f8fa; }
[data-theme="light"] .chat-msg-bubble { background: #f0f2f5; border-color: #d0d7de; }
[data-theme="light"] .chat-msg.mine .chat-msg-bubble { background: var(--accent, #4f6ef7); border-color: transparent; }
[data-theme="light"] .chat-input-area { background: #f6f8fa; }
[data-theme="light"] .chat-input-row textarea { background: #fff; border-color: #d0d7de; color: #1f2328; }
[data-theme="light"] .chat-search-bar input { background: #fff; border-color: #d0d7de; color: #1f2328; }
[data-theme="light"] .chat-group-modal-content { background: #fff; border-color: #d0d7de; }
[data-theme="light"] .chat-emoji-picker { background: #fff; border-color: #d0d7de; }
/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
.chat-msg { animation: none; }
.chat-typing-dots span { animation: none; }
}