137 lines
2.4 KiB
CSS
137 lines
2.4 KiB
CSS
.toast-container {
|
|
position: fixed;
|
|
top: 20px;
|
|
right: 20px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
z-index: 114514000000000000;
|
|
}
|
|
|
|
.toast {
|
|
position: relative;
|
|
width: 300px;
|
|
padding: 15px;
|
|
border-radius: 4px;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
color: white;
|
|
overflow: hidden;
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.toast.enter {
|
|
animation: toastEnter 0.3s ease forwards;
|
|
}
|
|
|
|
.toast.exit {
|
|
animation: toastExit 0.3s ease forwards;
|
|
}
|
|
|
|
.toast.hiding {
|
|
height: 0;
|
|
padding-top: 0;
|
|
padding-bottom: 0;
|
|
margin-bottom: 0;
|
|
transition: height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
|
|
}
|
|
|
|
@keyframes toastEnter {
|
|
from {
|
|
transform: translateX(100%);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
@keyframes toastExit {
|
|
from {
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
transform: translateX(100%);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
.toast-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.toast-title {
|
|
font-weight: bold;
|
|
font-size: 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.toast-close {
|
|
background: none;
|
|
border: none;
|
|
color: white;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
opacity: 0.7;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.toast-close:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.toast-subtitle {
|
|
font-size: 14px;
|
|
opacity: 0.9;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.toast-progress {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
height: 4px;
|
|
background-color: rgba(255, 255, 255, 0.3);
|
|
width: 100%;
|
|
}
|
|
|
|
.toast-progress-bar {
|
|
height: 100%;
|
|
background-color: white;
|
|
width: 100%;
|
|
transition: width 3s linear;
|
|
}
|
|
|
|
/* 不同类型的 Toast 样式 */
|
|
.toast-success {
|
|
background-color: #4CAF50;
|
|
}
|
|
|
|
.toast-info {
|
|
background-color: #2196F3;
|
|
}
|
|
|
|
.toast-error {
|
|
background-color: #f44336;
|
|
}
|
|
|
|
.toast-warning {
|
|
background-color: #ff9800;
|
|
}
|
|
|
|
.toast-debug {
|
|
background-color: #9c27b0;
|
|
}
|
|
|
|
.toast-unknown {
|
|
background-color: #607d8b;
|
|
} |