缩短弹窗通知显示时间

This commit is contained in:
pllx
2026-05-05 22:03:18 +08:00
parent 645fe2a830
commit 41522393de
9 changed files with 14 additions and 13 deletions
@@ -1023,7 +1023,7 @@ class AdminCommandController extends Controller
'message' => "<b>{$admin->username}</b>{$positionName})向你发放了 <b>{$amount}</b> 枚金币!", 'message' => "<b>{$admin->username}</b>{$positionName})向你发放了 <b>{$amount}</b> 枚金币!",
'icon' => '💰', 'icon' => '💰',
'color' => '#f59e0b', 'color' => '#f59e0b',
'duration' => 8000, 'duration' => 3000,
], ],
]; ];
$this->chatState->pushMessage($roomId, $msg); $this->chatState->pushMessage($roomId, $msg);
+2 -2
View File
@@ -506,7 +506,7 @@ class ChatController extends Controller
'message' => strip_tags($pureContent), 'message' => strip_tags($pureContent),
'icon' => '👋', 'icon' => '👋',
'color' => '#e11d48', 'color' => '#e11d48',
'duration' => 8000, 'duration' => 3000,
]; ];
} }
@@ -1425,7 +1425,7 @@ class ChatController extends Controller
'message' => '<b>'.ChatContentSanitizer::htmlText($sender->username)."</b> 向你赠送了 <b>{$amount}</b> 枚金币!", 'message' => '<b>'.ChatContentSanitizer::htmlText($sender->username)."</b> 向你赠送了 <b>{$amount}</b> 枚金币!",
'icon' => '💰', 'icon' => '💰',
'color' => '#f59e0b', 'color' => '#f59e0b',
'duration' => 8000, 'duration' => 3000,
], ],
]; ];
+1 -1
View File
@@ -428,7 +428,7 @@ class AchievementService
'message' => "{$definition['icon']} {$definition['name']}", 'message' => "{$definition['icon']} {$definition['name']}",
'icon' => '🏅', 'icon' => '🏅',
'color' => '#ca8a04', 'color' => '#ca8a04',
'duration' => 8000, 'duration' => 3000,
], ],
'sent_at' => now()->toDateTimeString(), 'sent_at' => now()->toDateTimeString(),
]; ];
+1 -1
View File
@@ -122,7 +122,7 @@ class GameBetBroadcastService
'message' => $toastMessage, 'message' => $toastMessage,
'icon' => $toastIcon, 'icon' => $toastIcon,
'color' => $toastColor, 'color' => $toastColor,
'duration' => 8000, 'duration' => 3000,
]; ];
if ($toastActorUsername !== null) { if ($toastActorUsername !== null) {
+1 -1
View File
@@ -472,7 +472,7 @@ export function bindChatEvents() {
message: t.message || "", message: t.message || "",
icon: t.icon || "💬", icon: t.icon || "💬",
color: t.color || "#336699", color: t.color || "#336699",
duration: t.duration ?? 8000, duration: t.duration ?? 3000,
}); });
} }
}); });
+1 -1
View File
@@ -525,7 +525,7 @@ function handleClaimResponse(response, data, button) {
message: `恭喜您抢到了礼包 ${data.amount} ${typeLabel}`, message: `恭喜您抢到了礼包 ${data.amount} ${typeLabel}`,
icon: "🧧", icon: "🧧",
color: redPacketType === "exp" ? "#7c3aed" : "#dc2626", color: redPacketType === "exp" ? "#7c3aed" : "#dc2626",
duration: 8000, duration: 3000,
}); });
closeRedPacketModal(); closeRedPacketModal();
+1 -1
View File
@@ -461,7 +461,7 @@ function handleRiddleGameAnswered(e) {
message: `<b>${winnerUsername}</b> 答对了「${answer}」,获得 ${rewardGold}💰 + ${rewardExp}⭐!`, message: `<b>${winnerUsername}</b> 答对了「${answer}」,获得 ${rewardGold}💰 + ${rewardExp}⭐!`,
icon: "🎉", icon: "🎉",
color: "#16a34a", color: "#16a34a",
duration: 6000, duration: 3000,
}); });
} }
+1 -1
View File
@@ -80,7 +80,7 @@ function createChatToast(container) {
message, message,
icon = "💬", icon = "💬",
color = "#336699", color = "#336699",
duration = 6000, duration = 3000,
action = null, action = null,
}) { }) {
const card = document.createElement("div"); const card = document.createElement("div");
@@ -7,7 +7,7 @@
- message: 卡片内容(支持 HTML - message: 卡片内容(支持 HTML
- icon: 左侧 Emoji 图标(可选,默认 💬) - icon: 左侧 Emoji 图标(可选,默认 💬)
- color: 强调色 HEX(可选,默认 #336699 - color: 强调色 HEX(可选,默认 #336699
- duration: 自动消失毫秒数(可选,默认 60000 = 不自动消失) - duration: 自动消失毫秒数(可选,默认 30000 = 不自动消失)
- action: { label, onClick } 可选操作按钮 - action: { label, onClick } 可选操作按钮
使用示例: 使用示例:
@@ -43,13 +43,14 @@
right: 12px !important; right: 12px !important;
bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
left: 12px !important; left: 12px !important;
align-items: stretch; align-items: flex-end;
} }
#chat-toast-container .chat-toast-card { #chat-toast-container .chat-toast-card {
width: 100% !important; width: fit-content !important;
min-width: 0 !important; min-width: 0 !important;
max-width: none !important; max-width: min(320px, calc(100vw - 24px)) !important;
overflow-wrap: anywhere;
} }
} }
</style> </style>