Refactor digest: storage, backup and core logic
This commit is contained in:
+13
-3
@@ -9,7 +9,10 @@
|
||||
.digest-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
|
||||
.digest-side { position: sticky; top: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
|
||||
.digest-side-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
|
||||
.digest-side-title { font-size: .85rem; font-weight: 700; white-space: nowrap; }
|
||||
.digest-side-title { font-size: .85rem; font-weight: 700; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
||||
.digest-deleted-btn { width: 28px; height: 28px; padding: 0; flex: 0 0 auto; }
|
||||
.digest-deleted-btn svg { width: 15px; height: 15px; }
|
||||
.digest-deleted-btn.active { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #dc2626; }
|
||||
.digest-side-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
|
||||
.digest-side-search .digest-search { min-width: 0; max-width: none; }
|
||||
.digest-nav { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
|
||||
@@ -20,19 +23,24 @@
|
||||
.digest-nav-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .85rem; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
|
||||
.digest-nav-title svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; color: #b45309; }
|
||||
.digest-nav-date { font-size: .72rem; color: var(--muted); white-space: nowrap; }
|
||||
.digest-nav-item.is-deleted .digest-nav-title { color: var(--muted); }
|
||||
.digest-nav-item.is-deleted .digest-nav-title svg { color: #dc2626; }
|
||||
.digest-nav-empty { padding: 22px 14px; color: var(--muted); font-size: .85rem; text-align: center; }
|
||||
|
||||
.digest-search { position: relative; flex: 1; min-width: 240px; max-width: 460px; display: flex; align-items: center; }
|
||||
.digest-search > svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
|
||||
.digest-search input { width: 100%; background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 11px 14px 11px 40px; font-size: .9rem; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
|
||||
.digest-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
|
||||
.digest-count { font-size: .75rem; font-weight: 500; color: var(--muted); margin-left: auto; white-space: nowrap; }
|
||||
.digest-count { font-size: .75rem; font-weight: 500; color: var(--muted); margin-left: auto; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
||||
.digest-list { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
|
||||
|
||||
.digest-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; scroll-margin-top: 20px; transition: box-shadow .18s, border-color .18s; }
|
||||
.digest-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.06); }
|
||||
.digest-card.pinned { border-left: 3px solid #f59e0b; background: linear-gradient(180deg, rgba(245,158,11,.055), var(--card) 180px); }
|
||||
.digest-card.digest-hidden { opacity: .62; }
|
||||
.digest-card.is-deleted { border-style: dashed; background: var(--bg); }
|
||||
.digest-card.is-deleted .digest-body { opacity: .78; }
|
||||
.digest-card.is-deleted .digest-cover { filter: grayscale(.6); }
|
||||
|
||||
.digest-card-top { padding: 24px 28px 0; display: flex; flex-direction: column; gap: 12px; }
|
||||
.digest-badges { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
@@ -40,6 +48,7 @@
|
||||
.digest-badge svg { width: 12px; height: 12px; }
|
||||
.digest-badge.scheduled { background: rgba(37,99,235,.1); color: var(--accent); }
|
||||
.digest-badge.dim { background: var(--bg); color: var(--muted); }
|
||||
.digest-badge.deleted { background: rgba(239,68,68,.12); color: #dc2626; }
|
||||
.digest-title { margin: 0; font-size: 1.35rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; word-break: break-word; }
|
||||
.digest-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
||||
.digest-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(37,99,235,.1); color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; }
|
||||
@@ -140,8 +149,9 @@
|
||||
<div class="digest-layout">
|
||||
<aside class="digest-side">
|
||||
<div class="digest-side-head">
|
||||
<span class="digest-side-title">Сообщения</span>
|
||||
<span class="digest-side-title" id="digestSideTitle">Сообщения</span>
|
||||
<span id="digestCount" class="digest-count"></span>
|
||||
<button type="button" class="icon-btn digest-deleted-btn" id="digestDeletedBtn" title="Удалённые сообщения" aria-pressed="false"><i data-lucide="trash-2"></i></button>
|
||||
</div>
|
||||
<div class="digest-side-search">
|
||||
<div class="digest-search">
|
||||
|
||||
Reference in New Issue
Block a user