улучшение: кастомный скролл письма и glass color picker

MessageBody:
- инжектируем ::-webkit-scrollbar CSS в оба варианта iframe-документа
  (html и plaintext) — тонкий 4px скролл rgba(255,255,255,0.13),
  соответствует общему scrollbar приложения

SettingsView — color picker:
- color-input-wrap: blur(16px) saturate(1.5), inset-highlight, hover elevation
- color-preview: 28px с border и box-shadow, scale при hover
- добавлена двухстрочная подпись (label + hex) и chevron-иконка
- quick-picks: обёрнут в glass-карточку со своим border/shadow
- quick-dot: inset-highlight сверху, двойной ring при active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
vodyanoysh 2026-03-31 22:23:34 +07:00
parent aba4b7fd60
commit 7f52ab3e27
2 changed files with 109 additions and 30 deletions

View file

@ -53,6 +53,15 @@ const processedHtml = computed(() => {
padding: 4px 14px;
color: rgba(255,255,255,0.45);
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
background: rgba(255,255,255,0.13);
border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255,255,255,0.26);
}
</style>
</head>
<body>${html}</body>
@ -84,6 +93,15 @@ const plainTextHtml = computed(() => {
word-wrap: break-word;
}
a { color: #a8e600; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
background: rgba(255,255,255,0.13);
border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255,255,255,0.26);
}
</style>
</head>
<body>${escaped}</body>

View file

@ -45,7 +45,14 @@ const swipeOptions: { value: SwipeAction; label: string }[] = (
<div class="color-picker-row">
<label class="color-input-wrap" title="Выбрать цвет">
<span class="color-preview" :style="{ background: settingsStore.accentColor }" />
<span class="color-hex">{{ settingsStore.accentColor.toUpperCase() }}</span>
<span class="color-label">
<span class="color-label-text">Акцентный цвет</span>
<span class="color-hex">{{ settingsStore.accentColor.toUpperCase() }}</span>
</span>
<svg class="color-chevron" viewBox="0 0 16 16" width="14" height="14" fill="none"
stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
<polyline points="4,6 8,10 12,6" />
</svg>
<input
type="color"
:value="settingsStore.accentColor"
@ -284,46 +291,82 @@ const swipeOptions: { value: SwipeAction; label: string }[] = (
/* Color picker */
.color-picker-row {
display: flex;
align-items: center;
gap: 14px;
flex-wrap: wrap;
flex-direction: column;
gap: 10px;
}
/* Основная кнопка выбора цвета */
.color-input-wrap {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 14px;
border-radius: var(--radius-md);
background: var(--glass-bg);
backdrop-filter: var(--blur-sm);
-webkit-backdrop-filter: var(--blur-sm);
border: 1px solid var(--glass-border-strong);
box-shadow: var(--glass-specular);
gap: 12px;
padding: 10px 16px;
border-radius: var(--radius-lg);
background: rgba(255, 255, 255, 0.06);
backdrop-filter: blur(16px) saturate(1.5);
-webkit-backdrop-filter: blur(16px) saturate(1.5);
border: 1px solid rgba(255, 255, 255, 0.11);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.09),
0 2px 10px rgba(0, 0, 0, 0.2);
cursor: pointer;
position: relative;
transition: background var(--transition-fast);
transition:
background var(--transition-fast),
border-color var(--transition-fast),
box-shadow var(--transition-fast);
}
.color-input-wrap:hover {
background: var(--glass-bg-hover);
background: rgba(255, 255, 255, 0.09);
border-color: rgba(255, 255, 255, 0.17);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.12),
0 3px 14px rgba(0, 0, 0, 0.25);
}
.color-preview {
width: 24px;
height: 24px;
width: 28px;
height: 28px;
border-radius: 50%;
flex-shrink: 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
transition: box-shadow var(--transition-fast);
border: 1.5px solid rgba(255, 255, 255, 0.2);
box-shadow:
0 2px 10px rgba(0,0,0,0.4),
0 0 0 1px rgba(0,0,0,0.2);
transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.color-input-wrap:hover .color-preview {
transform: scale(1.08);
}
.color-label {
display: flex;
flex-direction: column;
gap: 1px;
flex: 1;
}
.color-label-text {
font-size: 11px;
font-weight: 500;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.color-hex {
font-family: var(--font-mono);
font-size: 12px;
color: var(--text-secondary);
font-size: 13px;
font-weight: 600;
color: var(--text-primary);
letter-spacing: 0.5px;
}
.color-chevron {
color: var(--text-muted);
flex-shrink: 0;
}
.color-native {
position: absolute;
inset: 0;
@ -337,28 +380,46 @@ const swipeOptions: { value: SwipeAction; label: string }[] = (
border-radius: inherit;
}
/* Быстрый выбор цвета */
.quick-picks {
display: flex;
gap: 8px;
gap: 6px;
align-items: center;
padding: 10px 14px;
border-radius: var(--radius-lg);
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.07);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
flex-wrap: wrap;
}
.quick-dot {
width: 22px;
height: 22px;
width: 24px;
height: 24px;
border-radius: 50%;
background: var(--dot-color);
border: 2px solid transparent;
border: 1.5px solid rgba(255, 255, 255, 0.0);
cursor: pointer;
transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
box-shadow: 0 2px 6px rgba(0,0,0,0.4);
transition:
transform var(--transition-fast),
box-shadow var(--transition-fast),
border-color var(--transition-fast);
box-shadow:
0 2px 8px rgba(0,0,0,0.45),
inset 0 1px 0 rgba(255,255,255,0.25);
}
.quick-dot:hover {
transform: scale(1.15);
transform: scale(1.18);
box-shadow:
0 4px 14px rgba(0,0,0,0.5),
inset 0 1px 0 rgba(255,255,255,0.3);
}
.quick-dot.active {
border-color: rgba(255,255,255,0.75);
box-shadow: 0 0 0 1px var(--dot-color), 0 3px 10px rgba(0,0,0,0.5);
transform: scale(1.1);
border-color: rgba(255,255,255,0.80);
transform: scale(1.12);
box-shadow:
0 0 0 2px var(--dot-color),
0 4px 14px rgba(0,0,0,0.5),
inset 0 1px 0 rgba(255,255,255,0.3);
}
</style>