feat: add toast container component and create testing page for reusable UI elements
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="toast-container position-fixed top-0 end-0 p-3">
|
||||
<div class="toast-container position-fixed bottom-0 start-50 translate-middle-x p-3">
|
||||
@for (toast of toasts(); track toast.id) {
|
||||
<div
|
||||
class="toast show align-items-center border-0 shadow-sm"
|
||||
|
||||
@@ -4,25 +4,43 @@
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
pointer-events: none;
|
||||
width: 90vw;
|
||||
max-width: 800px;
|
||||
|
||||
.toast {
|
||||
pointer-events: auto;
|
||||
min-width: 300px;
|
||||
max-width: 450px;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
border-radius: 8px;
|
||||
animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.15) !important;
|
||||
transition: all 0.2s ease-in-out;
|
||||
|
||||
&.text-bg-success {
|
||||
background-color: var(--tenant-success) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
&.text-bg-danger {
|
||||
background-color: var(--tenant-danger) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
&.text-bg-primary {
|
||||
background-color: var(--tenant-primary) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes toast-slide-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px) scale(0.95);
|
||||
transform: translateY(20px) scale(0.95);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user