新增ui.create.toast用于弹出文字效果

This commit is contained in:
kuangthree 2024-04-20 13:01:41 +08:00
parent d5edc2b9b1
commit 5dffc03b14
3 changed files with 910 additions and 331 deletions

38
layout/default/toast.css Normal file
View File

@ -0,0 +1,38 @@
.toast-container {
position: fixed;
top: 15%;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
}
.toast {
display: none;
background-color: rgba(255, 165, 0, 0.7);
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
color: white;
font-weight: bold;
padding: 10px 20px;
text-align: center;
white-space: nowrap;
width: max-content;
animation: fadeInOut 1500ms ease-in-out forwards;
}
@keyframes fadeInOut {
0% {
opacity: 0;
}
20% {
opacity: 1;
}
80% {
opacity: 1;
}
100% {
opacity: 0;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -136,6 +136,11 @@ export class UI {
* @type {HTMLDivElement} * @type {HTMLDivElement}
*/ */
tempnowuxie; tempnowuxie;
/**
* @type {HTMLDivElement[]}
*/
toastQueue = [];
refresh(node) { refresh(node) {
void window.getComputedStyle(node, null).getPropertyValue("opacity"); void window.getComputedStyle(node, null).getPropertyValue("opacity");
} }