feature/liquid-glass-ui: glass MessageHeader + action кнопки
- Усилен glass на панели: bg rgba(10,10,18,0.68), blur(32px) saturate(2.0), stronger specular inset 0 1px 0 rgba(255,255,255,0.14) - header-details: opacity 0.055→0.06, border 0.07→0.11, добавлен backdrop-filter blur(16px) на контейнер деталей - Добавлены action-кнопки: Флаг (toggleFlag), Прочитано (toggleRead), Удалить (deleteOne) — стиль glass pill с active/hover/danger состояниями - Убраны badge-элементы, флаг теперь через action-btn.flag-active - Выровнены отступы: padding 22/26→20/22 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2ce5003e52
commit
ffe1ad76ca
1 changed files with 129 additions and 50 deletions
|
|
@ -3,11 +3,34 @@ import { computed, ref, onMounted, onUnmounted } from 'vue'
|
|||
import type { MessageEnvelope, Address } from '@shared/types/message'
|
||||
import { formatFullDate } from '../../utils/date'
|
||||
import AppIcon from '../AppIcon.vue'
|
||||
import { useMessagesStore } from '../../stores/messages.store'
|
||||
import { useFoldersStore } from '../../stores/folders.store'
|
||||
import { useAccountsStore } from '../../stores/accounts.store'
|
||||
|
||||
const props = defineProps<{
|
||||
message: MessageEnvelope
|
||||
}>()
|
||||
|
||||
const messagesStore = useMessagesStore()
|
||||
const foldersStore = useFoldersStore()
|
||||
const accountsStore = useAccountsStore()
|
||||
|
||||
const isUnread = computed(() => !props.message.flags.seen)
|
||||
const isFlagged = computed(() => props.message.flags.flagged)
|
||||
|
||||
async function handleToggleFlag(): Promise<void> {
|
||||
await messagesStore.toggleFlag(props.message.id)
|
||||
}
|
||||
|
||||
async function handleToggleRead(): Promise<void> {
|
||||
await messagesStore.toggleRead(props.message.id)
|
||||
}
|
||||
|
||||
async function handleDelete(): Promise<void> {
|
||||
if (!accountsStore.activeAccountId || !foldersStore.activeFolderId) return
|
||||
await messagesStore.deleteOne(props.message.id)
|
||||
}
|
||||
|
||||
const dateDisplay = computed(() => formatFullDate(props.message.date))
|
||||
|
||||
// ── Contact popup ──────────────────────────────────────────
|
||||
|
|
@ -157,33 +180,61 @@ onUnmounted(() => {
|
|||
</div>
|
||||
</Transition>
|
||||
|
||||
<div class="header-badges">
|
||||
<span v-if="message.flags.flagged" class="badge flagged">
|
||||
<AppIcon name="flag" :size="11" /> Отмечено
|
||||
</span>
|
||||
<!-- Строка действий -->
|
||||
<div class="action-bar">
|
||||
<button
|
||||
class="action-btn"
|
||||
:class="{ active: isFlagged, 'flag-active': isFlagged }"
|
||||
v-tooltip="isFlagged ? 'Снять флажок' : 'Поставить флажок'"
|
||||
@click="handleToggleFlag"
|
||||
>
|
||||
<AppIcon name="flag" :size="13" />
|
||||
<span>{{ isFlagged ? 'Отмечено' : 'Флажок' }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="action-btn"
|
||||
:class="{ active: isUnread }"
|
||||
v-tooltip="isUnread ? 'Отметить прочитанным' : 'Отметить непрочитанным'"
|
||||
@click="handleToggleRead"
|
||||
>
|
||||
<AppIcon name="envelope" :size="13" />
|
||||
<span>{{ isUnread ? 'Прочитано' : 'Непрочитано' }}</span>
|
||||
</button>
|
||||
|
||||
<div class="action-spacer" />
|
||||
|
||||
<button
|
||||
class="action-btn danger"
|
||||
v-tooltip="'Удалить письмо'"
|
||||
@click="handleDelete"
|
||||
>
|
||||
<AppIcon name="trash" :size="13" />
|
||||
<span>Удалить</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.message-header {
|
||||
padding: 22px 26px 18px;
|
||||
padding: 20px 22px 16px;
|
||||
flex-shrink: 0;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.014) 100%),
|
||||
rgba(10, 10, 18, 0.55);
|
||||
backdrop-filter: blur(32px) saturate(1.8);
|
||||
-webkit-backdrop-filter: blur(32px) saturate(1.8);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.016) 100%),
|
||||
rgba(10, 10, 18, 0.68);
|
||||
backdrop-filter: blur(32px) saturate(2.0);
|
||||
-webkit-backdrop-filter: blur(32px) saturate(2.0);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.09);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.12),
|
||||
0 4px 22px rgba(0, 0, 0, 0.20);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.14),
|
||||
0 6px 28px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.subject {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 14px;
|
||||
line-height: 1.4;
|
||||
color: var(--text-primary);
|
||||
overflow-wrap: anywhere;
|
||||
|
|
@ -194,13 +245,15 @@ onUnmounted(() => {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
border: 1px solid rgba(255, 255, 255, 0.07);
|
||||
background: rgba(255, 255, 255, 0.055);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||
0 2px 8px rgba(0, 0, 0, 0.12);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.10),
|
||||
0 4px 16px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.header-row {
|
||||
|
|
@ -208,8 +261,8 @@ onUnmounted(() => {
|
|||
gap: 0;
|
||||
font-size: 12px;
|
||||
align-items: baseline;
|
||||
padding: 6px 12px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
padding: 7px 14px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.055);
|
||||
}
|
||||
|
||||
.header-row:last-child {
|
||||
|
|
@ -218,12 +271,12 @@ onUnmounted(() => {
|
|||
|
||||
.label {
|
||||
color: var(--text-muted);
|
||||
min-width: 52px;
|
||||
min-width: 56px;
|
||||
flex-shrink: 0;
|
||||
font-size: 10.5px;
|
||||
font-weight: 500;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
letter-spacing: 0.6px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
|
|
@ -374,55 +427,81 @@ onUnmounted(() => {
|
|||
transform: translateY(-3px) scale(0.97);
|
||||
}
|
||||
|
||||
/* ── Бейджи ──────────────────────────────────────────────── */
|
||||
.header-badges {
|
||||
/* ── Action bar ──────────────────────────────────────────── */
|
||||
.action-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 14px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.badge {
|
||||
.action-spacer { flex: 1; }
|
||||
|
||||
.action-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
padding: 4px 10px;
|
||||
gap: 6px;
|
||||
padding: 6px 12px;
|
||||
border-radius: var(--radius-full);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.10);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.1),
|
||||
0 2px 6px rgba(0, 0, 0, 0.2);
|
||||
transition: background var(--transition-fast), box-shadow var(--transition-fast);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.10),
|
||||
0 2px 6px rgba(0, 0, 0, 0.18);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background var(--transition-fast),
|
||||
border-color var(--transition-fast),
|
||||
color var(--transition-fast),
|
||||
box-shadow var(--transition-fast),
|
||||
transform var(--transition-fast);
|
||||
}
|
||||
|
||||
.badge:hover {
|
||||
.action-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.11);
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
color: var(--text-primary);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.13),
|
||||
0 3px 10px rgba(0, 0, 0, 0.25);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.14),
|
||||
0 4px 12px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.badge.flagged {
|
||||
.action-btn:active {
|
||||
transform: translateY(1px);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.action-btn.active {
|
||||
background: rgba(255, 255, 255, 0.09);
|
||||
border-color: rgba(255, 255, 255, 0.16);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-btn.flag-active {
|
||||
color: var(--warning);
|
||||
background: rgba(229, 160, 0, 0.1);
|
||||
border-color: rgba(229, 160, 0, 0.28);
|
||||
background: rgba(240, 165, 0, 0.12);
|
||||
border-color: rgba(240, 165, 0, 0.30);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 200, 50, 0.12),
|
||||
0 2px 8px rgba(180, 120, 0, 0.2),
|
||||
0 0 14px rgba(229, 160, 0, 0.08);
|
||||
inset 0 1px 0 rgba(255, 200, 60, 0.15),
|
||||
0 2px 10px rgba(200, 130, 0, 0.20);
|
||||
}
|
||||
|
||||
.badge.flagged:hover {
|
||||
background: rgba(229, 160, 0, 0.16);
|
||||
.action-btn.flag-active:hover {
|
||||
background: rgba(240, 165, 0, 0.18);
|
||||
border-color: rgba(240, 165, 0, 0.42);
|
||||
}
|
||||
|
||||
.action-btn.danger:hover {
|
||||
color: var(--danger);
|
||||
background: rgba(255, 60, 60, 0.12);
|
||||
border-color: rgba(255, 60, 60, 0.28);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 200, 50, 0.18),
|
||||
0 3px 12px rgba(180, 120, 0, 0.3),
|
||||
0 0 18px rgba(229, 160, 0, 0.12);
|
||||
inset 0 1px 0 rgba(255, 100, 100, 0.12),
|
||||
0 4px 12px rgba(180, 30, 30, 0.22);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue