feat: liquid glass depth, fix artifacts, accent color picker
- AccountSwitcher: remove active-indicator bar (was causing stripe artifacts); active state now shown only via avatar glow ring - AppShell: panels get z-index layering (4→1) with depth shadows (box-shadow cast right) and backdrop-filter + saturate(1.4-1.8) for authentic glass vibrance; each panel has distinct glass weight - settings.store: add ACCENT_PRESETS (7 colors) with full palette tokens; accentId persisted to localStorage; applyAccent() sets CSS custom properties on documentElement on init and on change - SettingsView: new "Акцентный цвет" section with circular color swatches; active swatch has white ring + outer glow; imports ACCENT_PRESETS - FolderTreeItem: active indicator glow uses color-mix for dynamic accent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
69ad8af2dc
commit
dc1183b034
5 changed files with 136 additions and 33 deletions
|
|
@ -113,39 +113,50 @@ function stopResize(): void {
|
|||
.account-bar {
|
||||
width: var(--sidebar-width);
|
||||
flex-shrink: 0;
|
||||
background: rgba(255, 255, 255, 0.025);
|
||||
backdrop-filter: var(--blur-md);
|
||||
-webkit-backdrop-filter: var(--blur-md);
|
||||
position: relative;
|
||||
z-index: 4;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
backdrop-filter: blur(32px) saturate(1.8);
|
||||
-webkit-backdrop-filter: blur(32px) saturate(1.8);
|
||||
border-right: 1px solid var(--glass-border);
|
||||
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
|
||||
}
|
||||
|
||||
.folder-pane {
|
||||
flex-shrink: 0;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
backdrop-filter: var(--blur-md);
|
||||
-webkit-backdrop-filter: var(--blur-md);
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
backdrop-filter: blur(28px) saturate(1.6);
|
||||
-webkit-backdrop-filter: blur(28px) saturate(1.6);
|
||||
overflow-y: auto;
|
||||
min-width: 180px;
|
||||
max-width: 400px;
|
||||
border-right: 1px solid var(--glass-border);
|
||||
box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.06);
|
||||
}
|
||||
|
||||
.message-pane {
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background: rgba(255, 255, 255, 0.025);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
backdrop-filter: blur(20px) saturate(1.4);
|
||||
-webkit-backdrop-filter: blur(20px) saturate(1.4);
|
||||
overflow: hidden;
|
||||
min-width: 240px;
|
||||
max-width: 600px;
|
||||
border-right: 1px solid var(--glass-border);
|
||||
box-shadow: 4px 0 16px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.preview-pane {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: rgba(255, 255, 255, 0.015);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
backdrop-filter: blur(16px) saturate(1.2);
|
||||
-webkit-backdrop-filter: blur(16px) saturate(1.2);
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ function getAccountColor(index: number): string {
|
|||
>
|
||||
{{ getInitial(account.email) }}
|
||||
</span>
|
||||
<span v-if="accountsStore.activeAccountId === account.id" class="active-indicator" />
|
||||
</button>
|
||||
|
||||
<div class="spacer" />
|
||||
|
|
@ -104,16 +103,6 @@ function getAccountColor(index: number): string {
|
|||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
.active-indicator {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 3px;
|
||||
height: 18px;
|
||||
background: var(--accent);
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.add-icon {
|
||||
font-size: 20px;
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ function toggleExpand(event: Event): void {
|
|||
content: '';
|
||||
position: absolute;
|
||||
left: -4px;
|
||||
top: 20%;
|
||||
height: 60%;
|
||||
top: 15%;
|
||||
height: 70%;
|
||||
width: 3px;
|
||||
background: var(--accent);
|
||||
border-radius: 0 3px 3px 0;
|
||||
box-shadow: 0 0 8px rgba(168, 230, 0, 0.5);
|
||||
box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
|
||||
}
|
||||
|
||||
.folder-item.active .folder-name {
|
||||
|
|
|
|||
|
|
@ -17,9 +17,42 @@ export const SWIPE_ACTION_INFO: Record<SwipeAction, { icon: string; color: strin
|
|||
none: { icon: '', color: 'transparent' }
|
||||
}
|
||||
|
||||
// ─── Accent color presets ────────────────────────────────
|
||||
export type AccentPreset = {
|
||||
id: string
|
||||
label: string
|
||||
accent: string
|
||||
hover: string
|
||||
muted: string
|
||||
text: string
|
||||
}
|
||||
|
||||
export const ACCENT_PRESETS: AccentPreset[] = [
|
||||
{ id: 'lime', label: 'Лайм', accent: '#a8e600', hover: '#bdff1a', muted: 'rgba(168,230,0,0.12)', text: '#0d1a00' },
|
||||
{ id: 'blue', label: 'Синий', accent: '#38bdf8', hover: '#7dd3fc', muted: 'rgba(56,189,248,0.12)', text: '#001a2e' },
|
||||
{ id: 'violet', label: 'Фиолетовый', accent: '#a78bfa', hover: '#c4b5fd', muted: 'rgba(167,139,250,0.12)', text: '#0f0030' },
|
||||
{ id: 'pink', label: 'Розовый', accent: '#f472b6', hover: '#f9a8d4', muted: 'rgba(244,114,182,0.12)', text: '#200015' },
|
||||
{ id: 'orange', label: 'Оранжевый', accent: '#fb923c', hover: '#fdba74', muted: 'rgba(251,146,60,0.12)', text: '#1a0800' },
|
||||
{ id: 'teal', label: 'Бирюзовый', accent: '#2dd4bf', hover: '#5eead4', muted: 'rgba(45,212,191,0.12)', text: '#001a16' },
|
||||
{ id: 'red', label: 'Красный', accent: '#f87171', hover: '#fca5a5', muted: 'rgba(248,113,113,0.12)', text: '#200000' },
|
||||
]
|
||||
|
||||
function applyAccent(preset: AccentPreset): void {
|
||||
const r = document.documentElement.style
|
||||
r.setProperty('--accent', preset.accent)
|
||||
r.setProperty('--accent-hover', preset.hover)
|
||||
r.setProperty('--accent-muted', preset.muted)
|
||||
r.setProperty('--accent-text', preset.text)
|
||||
}
|
||||
|
||||
// ─── Storage ─────────────────────────────────────────────
|
||||
const STORAGE_KEY = 'vue-mail-settings'
|
||||
|
||||
function load(): { swipeLeftAction?: SwipeAction; swipeRightAction?: SwipeAction } {
|
||||
function load(): {
|
||||
swipeLeftAction?: SwipeAction
|
||||
swipeRightAction?: SwipeAction
|
||||
accentId?: string
|
||||
} {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(STORAGE_KEY) ?? '{}')
|
||||
} catch {
|
||||
|
|
@ -30,15 +63,29 @@ function load(): { swipeLeftAction?: SwipeAction; swipeRightAction?: SwipeAction
|
|||
export const useSettingsStore = defineStore('settings', () => {
|
||||
const saved = load()
|
||||
|
||||
const swipeLeftAction = ref<SwipeAction>(saved.swipeLeftAction ?? 'delete')
|
||||
const swipeLeftAction = ref<SwipeAction>(saved.swipeLeftAction ?? 'delete')
|
||||
const swipeRightAction = ref<SwipeAction>(saved.swipeRightAction ?? 'toggleRead')
|
||||
const accentId = ref<string>(saved.accentId ?? 'lime')
|
||||
|
||||
watch([swipeLeftAction, swipeRightAction], () => {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify({
|
||||
swipeLeftAction: swipeLeftAction.value,
|
||||
swipeRightAction: swipeRightAction.value
|
||||
}))
|
||||
// Apply saved accent immediately on store init
|
||||
const initPreset = ACCENT_PRESETS.find(p => p.id === accentId.value) ?? ACCENT_PRESETS[0]
|
||||
applyAccent(initPreset)
|
||||
|
||||
watch(accentId, (id) => {
|
||||
const preset = ACCENT_PRESETS.find(p => p.id === id) ?? ACCENT_PRESETS[0]
|
||||
applyAccent(preset)
|
||||
persist()
|
||||
})
|
||||
|
||||
return { swipeLeftAction, swipeRightAction }
|
||||
watch([swipeLeftAction, swipeRightAction], persist)
|
||||
|
||||
function persist(): void {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify({
|
||||
swipeLeftAction: swipeLeftAction.value,
|
||||
swipeRightAction: swipeRightAction.value,
|
||||
accentId: accentId.value,
|
||||
}))
|
||||
}
|
||||
|
||||
return { swipeLeftAction, swipeRightAction, accentId }
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useAccountsStore } from '../stores/accounts.store'
|
||||
import { useSettingsStore, SWIPE_ACTION_LABELS, type SwipeAction } from '../stores/settings.store'
|
||||
import { useSettingsStore, SWIPE_ACTION_LABELS, ACCENT_PRESETS, type SwipeAction } from '../stores/settings.store'
|
||||
|
||||
const router = useRouter()
|
||||
const accountsStore = useAccountsStore()
|
||||
|
|
@ -35,6 +35,27 @@ const swipeOptions: SwipeAction[] = ['delete', 'toggleRead', 'toggleFlag', 'none
|
|||
</p>
|
||||
</section>
|
||||
|
||||
<!-- Акцентный цвет -->
|
||||
<section>
|
||||
<h2>Акцентный цвет</h2>
|
||||
<p class="section-desc">Выберите цвет выделения интерфейса</p>
|
||||
<div class="accent-swatches">
|
||||
<button
|
||||
v-for="preset in ACCENT_PRESETS"
|
||||
:key="preset.id"
|
||||
class="accent-swatch"
|
||||
:class="{ active: settingsStore.accentId === preset.id }"
|
||||
:style="{ '--swatch-color': preset.accent }"
|
||||
:title="preset.label"
|
||||
@click="settingsStore.accentId = preset.id"
|
||||
>
|
||||
<svg v-if="settingsStore.accentId === preset.id" viewBox="0 0 16 16" width="10" height="10" fill="none">
|
||||
<polyline points="3,8 6.5,12 13,4" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Жесты -->
|
||||
<section>
|
||||
<h2>Жесты</h2>
|
||||
|
|
@ -248,4 +269,39 @@ const swipeOptions: SwipeAction[] = ['delete', 'toggleRead', 'toggleFlag', 'none
|
|||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
/* Accent swatches */
|
||||
.accent-swatches {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.accent-swatch {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 50%;
|
||||
background: var(--swatch-color);
|
||||
border: 2px solid transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.accent-swatch:hover {
|
||||
transform: scale(1.12);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.accent-swatch.active {
|
||||
border-color: rgba(255, 255, 255, 0.7);
|
||||
box-shadow:
|
||||
0 0 0 1px var(--swatch-color),
|
||||
0 4px 16px rgba(0, 0, 0, 0.5);
|
||||
transform: scale(1.08);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue