UI: shared toast notifications in the bottom-right corner
- useToast composable and ToastContainer (mounted once in App.vue): stacked toasts with icon, close button and progress bar, hover pause, slide-in animation, aria roles, full width on phones. - Light and dark theme colour tokens; old .toast-message styles removed. - PKIConfig, VPNConfig, ServerManagement and Certificates use the shared toast through thin showMessage/showToast wrappers. - Docs: plan and summary in DOCS/Changes, README, Index. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d251ec73d0
commit
dcc3d7f2d5
12 files changed
+316
-93
No files matched your search
+153
-26
@@ -1616,42 +1616,169 @@ input[type="number"].config-input {
|
||||
appearance: textfield;
|
||||
}
|
||||
|
||||
/* Messages / Toast */
|
||||
.toast-message {
|
||||
padding: 14px 22px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
/* Toast notifications (ToastContainer.vue) */
|
||||
:root {
|
||||
--toast-success: #1a7f37;
|
||||
--toast-warning: #9a6700;
|
||||
--toast-error: #cf222e;
|
||||
--toast-info: #0969da;
|
||||
--toast-shadow: 0 8px 24px rgba(31, 35, 40, 0.14), 0 1px 3px rgba(31, 35, 40, 0.08);
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--toast-success: #3fb950;
|
||||
--toast-warning: #d29922;
|
||||
--toast-error: #f85149;
|
||||
--toast-info: #58a6ff;
|
||||
--toast-shadow: 0 8px 24px rgba(1, 4, 9, 0.6), 0 0 0 1px rgba(240, 246, 252, 0.04);
|
||||
}
|
||||
|
||||
.toast-stack {
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
z-index: 2000; /* above Bootstrap modals (1055) and backdrop (1050) */
|
||||
width: 380px;
|
||||
max-width: calc(100vw - 32px);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.toast-stack-list {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.app-toast {
|
||||
--toast-color: var(--toast-info);
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
padding: 12px 10px 14px 14px;
|
||||
overflow: hidden;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-color);
|
||||
border-left: 4px solid var(--toast-color);
|
||||
border-radius: 8px;
|
||||
box-shadow: var(--toast-shadow);
|
||||
color: var(--text-main);
|
||||
font-size: 14px;
|
||||
line-height: 1.45;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.app-toast-success { --toast-color: var(--toast-success); }
|
||||
.app-toast-warning { --toast-color: var(--toast-warning); }
|
||||
.app-toast-error { --toast-color: var(--toast-error); }
|
||||
.app-toast-info { --toast-color: var(--toast-info); }
|
||||
|
||||
.app-toast-icon {
|
||||
flex: 0 0 auto;
|
||||
margin-top: 2px;
|
||||
font-size: 16px;
|
||||
color: var(--toast-color);
|
||||
}
|
||||
|
||||
.app-toast-text {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
color: var(--text-heading);
|
||||
font-weight: 500;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.app-toast-close {
|
||||
flex: 0 0 auto;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.app-toast-close:hover,
|
||||
.app-toast-close:focus-visible {
|
||||
background: var(--bg-element-hover);
|
||||
color: var(--text-heading);
|
||||
}
|
||||
|
||||
.app-toast-progress {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 3px;
|
||||
background: var(--toast-color);
|
||||
opacity: 0.55;
|
||||
transform-origin: left center;
|
||||
animation: toast-progress linear forwards;
|
||||
}
|
||||
|
||||
.app-toast:hover .app-toast-progress {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
@keyframes toast-progress {
|
||||
from { transform: scaleX(1); }
|
||||
to { transform: scaleX(0); }
|
||||
}
|
||||
|
||||
.toast-enter-active,
|
||||
.toast-leave-active {
|
||||
transition: transform 0.28s ease, opacity 0.28s ease;
|
||||
}
|
||||
|
||||
.toast-leave-active {
|
||||
position: absolute; /* keeps its place while siblings slide into the gap */
|
||||
}
|
||||
|
||||
.toast-move {
|
||||
transition: transform 0.28s ease;
|
||||
}
|
||||
|
||||
.toast-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
transition: all 0.3s ease;
|
||||
transform: translateX(40px);
|
||||
}
|
||||
|
||||
.toast-message.show {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
.toast-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateX(20px);
|
||||
}
|
||||
|
||||
.toast-success {
|
||||
background-color: #d1fae5;
|
||||
color: #065f46;
|
||||
border-left: 4px solid #10b981;
|
||||
@media (max-width: 576px) {
|
||||
.toast-stack {
|
||||
right: 16px;
|
||||
left: 16px;
|
||||
bottom: 16px;
|
||||
width: auto;
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
.toast-warning {
|
||||
background-color: #fef3c7;
|
||||
color: #92400e;
|
||||
border-left: 4px solid #f59e0b;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.toast-enter-active,
|
||||
.toast-leave-active,
|
||||
.toast-move {
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.toast-error {
|
||||
background-color: #fee2e2;
|
||||
color: #991b1b;
|
||||
border-left: 4px solid #ef4444;
|
||||
.toast-enter-from,
|
||||
.toast-leave-to {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
|
||||
Reference in new issue
Block a user