SHA256
Всплывающие сообщения: одна аккуратная система
- тост встаёт над нижним меню и полем ввода, а не поверх них; - значок по смыслу (галочка, восклицание, «i») вместо красного текста ошибки; - ошибки и длинные сообщения висят дольше (время на чтение), касание закрывает; - одинаковое сообщение подряд не дублируется, можно добавить кнопку («Повторить»); - ошибки, которые показывались как «успех», помечены ошибками; справочные – «i»; исправлено «Сообщение скопированно». Стили тостов перенесены из modal.css в feedback.css (общие состояния и сообщения).
This commit is contained in:
@@ -84,7 +84,94 @@
|
||||
min-width: 160px;
|
||||
}
|
||||
|
||||
/* Короткие сообщения внизу (showToast в services/channels-ux.js): над нижним меню и полем
|
||||
* ввода (bottom задаёт JS), значок по смыслу, касание закрывает. */
|
||||
.toast-host {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: calc(90px + env(safe-area-inset-bottom));
|
||||
z-index: 140;
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
gap: 8px;
|
||||
padding: 0 var(--page-gutter);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.toast {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
max-width: min(100%, 440px);
|
||||
min-height: 44px;
|
||||
padding: 10px 14px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 14px;
|
||||
background: var(--surface-raised);
|
||||
box-shadow: var(--shadow);
|
||||
color: var(--text-primary);
|
||||
font-size: var(--text-sm);
|
||||
line-height: 1.35;
|
||||
pointer-events: auto;
|
||||
cursor: default;
|
||||
opacity: 0;
|
||||
transform: translateY(8px) scale(0.98);
|
||||
transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
||||
}
|
||||
|
||||
.toast.is-visible {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.toast.is-hiding {
|
||||
opacity: 0;
|
||||
transform: translateY(4px);
|
||||
}
|
||||
|
||||
.toast__icon {
|
||||
flex: 0 0 auto;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.toast__icon svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.toast--error .toast__icon { color: var(--danger); }
|
||||
.toast--info .toast__icon { color: var(--accent); }
|
||||
|
||||
.toast__text {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.toast__action {
|
||||
flex: 0 0 auto;
|
||||
margin: -6px -6px -6px 2px;
|
||||
padding: 8px 8px;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
background: none;
|
||||
color: var(--accent);
|
||||
font: inherit;
|
||||
font-weight: var(--weight-bold);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toast__action:hover {
|
||||
background: var(--surface-selected);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.spinner { animation-duration: 1.6s; }
|
||||
.loading-state { animation: none; opacity: 1; }
|
||||
.toast { transition: none; transform: none; }
|
||||
}
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
.modal-dialog { position: absolute; left: 16px; right: 16px; bottom: 24px; display: grid; gap: 12px; box-shadow: var(--shadow); }
|
||||
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 60; }
|
||||
.modal-card { width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow-y: auto; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
|
||||
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 140; pointer-events: none; }
|
||||
.toast { max-width: min(92vw,420px); padding: 12px 16px; border-radius: 12px; color: var(--text-primary); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border-subtle); opacity: 0; transition: opacity 160ms; }
|
||||
.toast.is-visible { opacity: 1; }
|
||||
.toast.is-hiding { opacity: 0; }
|
||||
.toast.toast--error { color: var(--danger); }
|
||||
.skeleton-card { display: grid; gap: 12px; }
|
||||
.skeleton-line { height: 12px; border-radius: 6px; background: var(--surface-selected); animation: skeleton-pulse 1.2s ease-in-out infinite alternate; }
|
||||
.skeleton-line.w-40 { width: 40%; }
|
||||
@@ -24,7 +19,7 @@
|
||||
.skeleton-body { display: grid; gap: 10px; }
|
||||
.skeleton-body .skeleton-line { display: block; }
|
||||
@keyframes skeleton-pulse { to { opacity: .4; } }
|
||||
@media (prefers-reduced-motion: reduce) { .skeleton-line, .toast { animation: none; transition: none; } }
|
||||
@media (prefers-reduced-motion: reduce) { .skeleton-line { animation: none; transition: none; } }
|
||||
|
||||
@media (max-width: 599px) {
|
||||
.modal { place-items: end stretch; padding: 0; }
|
||||
|
||||
Reference in New Issue
Block a user