feature/liquid-glass-ui: иконка приложения, polish UI, фикс читаемости писем

- Иконка приложения (resources/icon.png) в стиле liquid glass
- Кнопка добавления аккаунта перемещена под список аккаунтов
- Pull-to-refresh: плавающая glass-пилюля, увеличен порог тяги, фикс залипания при отпускании трекпада
- fixIframeColors: яркостный алгоритм вместо порогового — тёмный текст на тёмном фоне теперь читаем
- FolderTreeItem: убран фон у неактивных папок
- F12 открывает DevTools
- electron-builder: убран deb (требует libcrypt.so.1 отсутствующий в Fedora 42)
- package.json: добавлено поле author для сборки
- ipc.ts: добавлен unseenOnly в тип messages:list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
d.a.kolesov 2026-04-06 11:39:20 +07:00
parent 78fb30034c
commit 247dfb1670
10 changed files with 167 additions and 43 deletions

View file

@ -9,7 +9,6 @@ files:
linux:
target:
- AppImage
- deb
category: Network
icon: resources/icon.png
win:

View file

@ -2,6 +2,10 @@
"name": "aero-mail",
"version": "0.1.0",
"description": "Desktop email client built with Vue 3 + Electron",
"author": {
"name": "d.a.kolesov",
"email": "d.a.kolesov@s7.ru"
},
"main": "./out/main/index.js",
"scripts": {
"dev": "electron-vite dev",

BIN
resources/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

97
resources/icon.svg Normal file
View file

@ -0,0 +1,97 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="0.5" y2="1">
<stop offset="0%" stop-color="#1a1a2e"/>
<stop offset="100%" stop-color="#0d0d18"/>
</linearGradient>
<linearGradient id="envFill" x1="0.1" y1="0" x2="0.9" y2="1">
<stop offset="0%" stop-color="#2e2e50"/>
<stop offset="100%" stop-color="#1c1c32"/>
</linearGradient>
<linearGradient id="flapFill" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#3a3a60"/>
<stop offset="100%" stop-color="#252545"/>
</linearGradient>
<linearGradient id="shine" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.50"/>
<stop offset="100%" stop-color="#ffffff" stop-opacity="0.00"/>
</linearGradient>
<linearGradient id="badgeGrad" x1="0" y1="0" x2="0.5" y2="1">
<stop offset="0%" stop-color="#b8b0ff"/>
<stop offset="100%" stop-color="#7c6cf8"/>
</linearGradient>
<radialGradient id="glow" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#5a52d0" stop-opacity="0.40"/>
<stop offset="100%" stop-color="#5a52d0" stop-opacity="0.00"/>
</radialGradient>
<filter id="shadow" x="-10%" y="-10%" width="120%" height="120%">
<feDropShadow dx="0" dy="12" stdDeviation="24" flood-color="#000000" flood-opacity="0.70"/>
</filter>
<filter id="badgeShadow" x="-30%" y="-30%" width="160%" height="160%">
<feDropShadow dx="0" dy="6" stdDeviation="14" flood-color="#7c6cf8" flood-opacity="0.80"/>
</filter>
<clipPath id="envClip">
<rect x="152" y="312" width="720" height="420" rx="44"/>
</clipPath>
</defs>
<!-- App background -->
<rect width="1024" height="1024" rx="216" fill="url(#bg)"/>
<!-- Ambient glow behind envelope -->
<ellipse cx="512" cy="520" rx="340" ry="220" fill="url(#glow)"/>
<!-- Envelope -->
<g filter="url(#shadow)">
<!-- Body -->
<rect x="152" y="312" width="720" height="420" rx="44"
fill="url(#envFill)"
stroke="#5a5880" stroke-width="1.5"/>
<!-- Dark bottom interior -->
<rect x="152" y="490" width="720" height="242"
fill="#0a0a16" fill-opacity="0.30"
clip-path="url(#envClip)"/>
<!-- Flap -->
<polygon points="196,312 512,534 828,312"
fill="url(#flapFill)"
clip-path="url(#envClip)"/>
<!-- Flap border / crease -->
<polyline points="196,312 512,534 828,312"
fill="none" stroke="#7070a0" stroke-width="1.5" stroke-linejoin="round"/>
<!-- Bottom corner fold lines -->
<line x1="152" y1="732" x2="376" y2="528" stroke="#4a4870" stroke-width="1.2"/>
<line x1="872" y1="732" x2="648" y2="528" stroke="#4a4870" stroke-width="1.2"/>
<!-- Top specular highlight -->
<rect x="152" y="312" width="720" height="5" rx="2"
fill="url(#shine)" clip-path="url(#envClip)"/>
<!-- Left edge shimmer -->
<rect x="152" y="312" width="3" height="420" rx="1"
fill="#ffffff" fill-opacity="0.18" clip-path="url(#envClip)"/>
<!-- Envelope border outer highlight -->
<rect x="152" y="312" width="720" height="420" rx="44"
fill="none" stroke="#ffffff" stroke-opacity="0.12" stroke-width="1"/>
</g>
<!-- Badge -->
<circle cx="728" cy="296" r="54" fill="#0d0d1a" stroke="#3a3870" stroke-width="1.5"/>
<circle cx="728" cy="296" r="36" fill="url(#badgeGrad)" filter="url(#badgeShadow)"/>
<!-- Badge shine -->
<ellipse cx="722" cy="284" rx="14" ry="9"
fill="#ffffff" fill-opacity="0.50"
transform="rotate(-22 722 284)"/>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -1,4 +1,4 @@
import { app, BrowserWindow, shell, ipcMain, dialog, Menu } from 'electron'
import { app, BrowserWindow, shell, ipcMain, dialog, Menu, globalShortcut } from 'electron'
import { join } from 'node:path'
import { AccountManager } from './services/account-manager'
import { registerAccountHandlers } from './ipc/accounts.handler'
@ -9,11 +9,16 @@ import { registerOAuthHandlers } from './ipc/oauth.handler'
const accountManager = new AccountManager()
function createWindow(): BrowserWindow {
const iconPath = app.isPackaged
? join(process.resourcesPath, 'icon.png')
: join(app.getAppPath(), 'resources/icon.png')
const mainWindow = new BrowserWindow({
width: 1280,
height: 800,
minWidth: 900,
minHeight: 600,
icon: iconPath,
backgroundColor: '#1e1e1e',
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
@ -25,6 +30,10 @@ function createWindow(): BrowserWindow {
accountManager.setMainWindow(mainWindow)
globalShortcut.register('F12', () => {
mainWindow.webContents.toggleDevTools()
})
// Open external links in browser
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url)

View file

@ -157,9 +157,9 @@ onMounted(restartAutoCheck)
onUnmounted(() => { if (autoCheckTimer) clearInterval(autoCheckTimer) })
// ── Pull-to-refresh ───────────────────────────────────────
const PULL_THRESHOLD = 130 // расстояние для срабатывания
const PULL_FACTOR = 0.16 // базовая чувствительность
const PULL_RUBBER = 0.55 // rubber-band: сопротивление у порога
const PULL_THRESHOLD = 220 // расстояние для срабатывания
const PULL_FACTOR = 0.14 // базовая чувствительность
const PULL_RUBBER = 0.65 // rubber-band: сопротивление у порога
const pullY = ref(0)
const pullRefreshing = ref(false)
@ -182,11 +182,15 @@ function onWheel(event: WheelEvent): void {
if (delta < 4) return // trackpad-шум
if (event.deltaY < 0 && !pullRefreshing.value && !messagesStore.loading) {
if (pullDecayTimer) { clearTimeout(pullDecayTimer); pullDecayTimer = null }
// rubber-band: чем ближе к порогу — тем тяжелее тянуть
const resistance = 1 - (pullY.value / PULL_THRESHOLD) * PULL_RUBBER
pullY.value = Math.min(PULL_THRESHOLD, pullY.value + delta * PULL_FACTOR * resistance)
if (pullY.value >= PULL_THRESHOLD) triggerPullRefresh()
if (pullY.value >= PULL_THRESHOLD) {
triggerPullRefresh()
} else {
// Запускаем таймер возврата — если пользователь отпустит трекпад, он сработает
schedulePullDecay()
}
} else if (event.deltaY > 0 && pullY.value > 0) {
schedulePullDecay()
}
@ -795,43 +799,52 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
height: calc(var(--progress, 0) * 56px);
overflow: hidden;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.pull-indicator-wrap.releasing {
transition: height 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pull-indicator {
height: 56px;
display: flex;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
gap: 7px;
padding: 6px 14px 6px 10px;
font-size: 11.5px;
font-weight: 500;
/* цвет интерполируется от muted к accent по мере тяги */
color: color-mix(in srgb, var(--accent) calc(var(--pull-progress, 0) * 100%), var(--text-muted));
background:
linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.012) 100%),
rgba(10, 10, 18, 0.65);
backdrop-filter: blur(20px) saturate(1.5);
-webkit-backdrop-filter: blur(20px) saturate(1.5);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
letter-spacing: 0.2px;
color: color-mix(in srgb, var(--accent) calc(var(--pull-progress, 0) * 100%), var(--text-muted));
background:
linear-gradient(145deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%),
rgba(12, 12, 20, 0.72);
backdrop-filter: blur(28px) saturate(1.8);
-webkit-backdrop-filter: blur(28px) saturate(1.8);
border: 1px solid rgba(255, 255, 255, 0.10);
border-radius: 999px;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.14),
0 4px 16px rgba(0, 0, 0, 0.30);
transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Достигнут порог — accent-подсветка */
.pull-indicator.ready {
border-bottom-color: color-mix(in srgb, var(--accent) 35%, transparent);
border-color: color-mix(in srgb, var(--accent) 35%, rgba(255,255,255,0.10));
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.09),
0 2px 16px color-mix(in srgb, var(--accent) 10%, transparent);
inset 0 1px 0 rgba(255, 255, 255, 0.16),
0 4px 20px color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,0.30));
}
.pull-indicator.refreshing {
color: var(--accent);
border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent);
border-color: color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,0.10));
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.16),
0 4px 20px color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,0.30));
}
/* Обёртка иконки: вращение по прогрессу */

View file

@ -18,8 +18,9 @@ function rgbMatch(s: string): [number, number, number, number] | null {
return [+m[1], +m[2], +m[3], m[4] !== undefined ? parseFloat(m[4]) : 1]
}
function isNearWhiteRgb(r: number, g: number, b: number): boolean {
return r >= 200 && g >= 200 && b >= 200
// Воспринимаемая яркость (0–255)
function brightness(r: number, g: number, b: number): number {
return (r * 299 + g * 587 + b * 114) / 1000
}
function fixIframeColors(): void {
@ -28,30 +29,31 @@ function fixIframeColors(): void {
const view = iframeRef.value?.contentWindow
if (!doc?.body || !view) return
// Для каждого элемента: если getComputedStyle говорит что цвет текста
// близок к белому — ищем эффективный фон вверх по дереву.
// Если фон тоже светлый или прозрачный (дефолт белый) → делаем текст тёмным.
function effectiveBg(el: HTMLElement): [number, number, number] | null {
// Поднимаемся по дереву в поисках непрозрачного фона
function effectiveBgBrightness(el: HTMLElement): number | null {
let node: HTMLElement | null = el
while (node) {
const c = rgbMatch(view.getComputedStyle(node).backgroundColor)
if (c && c[3] > 0.05) return [c[0], c[1], c[2]]
if (c && c[3] > 0.05) return brightness(c[0], c[1], c[2])
node = node.parentElement
}
return null
return null // нет явного фона → тёмное стекло
}
const all = doc.body.querySelectorAll<HTMLElement>('*')
for (const el of all) {
const fg = rgbMatch(view.getComputedStyle(el).color)
if (!fg || fg[3] < 0.3) continue
if (!isNearWhiteRgb(fg[0], fg[1], fg[2])) continue
// Текст белый — проверяем эффективный фон
const bg = effectiveBg(el)
if (!bg || isNearWhiteRgb(bg[0], bg[1], bg[2])) {
// Белый на белом/прозрачном → тёмный текст
const fgBright = brightness(fg[0], fg[1], fg[2])
const bgBright = effectiveBgBrightness(el) ?? 10 // нет фона → тёмное (~10)
if (fgBright > 180 && bgBright > 180) {
// Светлый текст на светлом фоне → тёмный
el.style.setProperty('color', 'rgba(20, 20, 30, 0.88)', 'important')
} else if (fgBright < 140 && bgBright < 80) {
// Тёмный текст на тёмном/прозрачном фоне → светлый
el.style.setProperty('color', 'rgba(218, 218, 228, 0.88)', 'important')
}
}
} catch { /* sandbox или cross-origin */ }

View file

@ -38,12 +38,12 @@ function getAccountColor(index: number): string {
</span>
</button>
<div class="spacer" />
<button class="account-btn add-btn" v-tooltip="'Добавить аккаунт'" @click="emit('addAccount')">
<AppIcon name="plus" :size="16" class="add-icon" />
</button>
<div class="spacer" />
<button class="account-btn settings-btn" v-tooltip="'Настройки'" @click="router.push('/settings')">
<AppIcon name="settings" :size="15" class="settings-icon" />
</button>
@ -56,7 +56,7 @@ function getAccountColor(index: number): string {
flex-direction: column;
align-items: center;
padding: 10px 0;
gap: 2px;
gap: 6px;
height: 100%;
}

View file

@ -90,8 +90,8 @@ function toggleExpand(event: Event): void {
gap: 6px;
border-radius: 8px;
margin: 1px 6px;
border: 1px solid rgba(255, 255, 255, 0.04);
background: rgba(255, 255, 255, 0.025);
border: 1px solid transparent;
background: transparent;
position: relative;
text-align: left;
transition:

View file

@ -12,7 +12,7 @@ export interface IpcChannelMap {
'folders:list': [{ accountId: string }, FolderListResult]
'messages:list': [
{ accountId: string; folderId: string; offset: number; limit: number },
{ accountId: string; folderId: string; offset: number; limit: number; unseenOnly?: boolean },
MessageListResult
]
'messages:body': [