- ${buildQuizBadgeHtml(msg, "#16a34a")}
- (${timeStr})
-
-
💰 ${quizMeta.rewardGold} 金币
-
⭐ ${quizMeta.rewardExp} 经验
+
+
${icon}
+
+
${buildQuizBadgeHtml(msg, badgeColor)}
+
+ ${summaryHtml}
+ (${timeStr})
+ ${isAnsweredResult ? `
+
+ 💰 ${quizMeta.rewardGold} 金币
+ ⭐ ${quizMeta.rewardExp} 经验
+
+ ` : ""}
`;
@@ -289,8 +556,8 @@ export function appendMessage(msg, renderBatch = null) {
div.dataset.idiomResult = "1";
div.dataset.quizRoundEndedId = String(quizMeta.endedRoundId || quizMeta.roundId || 0);
div.dataset.quizWinnerUsername = String(msg.winner_username || "");
- const parsedContent = parseBracketUsers(msg.content);
- html = `${headImg}
${clickableUser(msg.from_user, fontColor, nameClass)}:${parsedContent}`;
+ html = buildQuizResultHtml(msg, timeStr);
+ timeStrOverride = true;
} else if (isIdiomStartMessage) {
html = buildQuizStartHtml(msg, timeStr);
timeStrOverride = true;
@@ -356,17 +623,15 @@ export function appendMessage(msg, renderBatch = null) {
const isRedPacketClaimNotification = content.includes("抢到了") && content.includes("礼包");
const isBaccaratLossCoverNotification = content.includes("【你玩游戏我买单】") || content.includes("金币补偿");
const isDailySignInNotification = content.includes("完成今日签到") || content.includes("使用补签卡补签");
- const isQuizStartNotification = isIdiomStartMessage || content.includes("猜谜活动") || content.includes("猜成语时间");
- const isPlainNotification =
- content.includes("【百家乐】") ||
- content.includes("【赛马】") ||
- content.includes("神秘箱子") ||
- content.includes("【双色球") ||
- content.includes("【五子棋】") ||
- content.includes("【老虎机】") ||
- content.includes("购买了");
+ const isQuizEndNotification = content.includes("猜谜活动") && (content.includes("已超时结束") || content.includes("正确答案"));
+ const isQuizStartNotification = !isQuizEndNotification && (isIdiomStartMessage || content.includes("猜谜活动") || content.includes("猜成语时间"));
+ const systemGameCardMeta = resolveGameNotificationCardMeta(msg);
+ const isPlainNotification = content.includes("购买了");
- if (isQuizStartNotification) {
+ if (isQuizEndNotification) {
+ html = buildQuizResultHtml(msg, timeStr);
+ timeStrOverride = true;
+ } else if (isQuizStartNotification) {
div.style.cssText =
"background:linear-gradient(135deg,#fff7ed,#fffbeb);border:1px solid rgba(245,158,11,.28);border-left:4px solid #f59e0b;border-radius:12px;padding:8px 12px;margin:4px 0;box-shadow:0 10px 24px rgba(245,158,11,.14);";
html = `
@@ -385,6 +650,9 @@ export function appendMessage(msg, renderBatch = null) {
} else if (isRedPacketClaimNotification || isBaccaratLossCoverNotification || isDailySignInNotification) {
let plainAccentContent = parseBracketUsers(msg.content);
html = `
🌟 ${plainAccentContent}`;
+ } else if (systemGameCardMeta) {
+ html = buildSystemGameNotificationHtml(msg, timeStr);
+ timeStrOverride = true;
} else if (isPlainNotification) {
let parsedContent = parseBracketUsers(msg.content);
html = `${headImg}
${clickableUser(msg.from_user, fontColor, nameClass)}:${parsedContent}`;
@@ -394,6 +662,9 @@ export function appendMessage(msg, renderBatch = null) {
let sysTranContent = parseBracketUsers(msg.content);
html = `
🌟 ${sysTranContent}`;
}
+ } else if (resolveGameNotificationCardMeta(msg)) {
+ html = buildSystemGameNotificationHtml(msg, timeStr);
+ timeStrOverride = true;
} else if (msg.from_user === "系统" && msg.to_user && msg.to_user !== "大家") {
div.style.cssText =
"background:#f0fdf4;border-left:3px solid #16a34a;border-radius:4px;padding:3px 8px;margin:2px 0;";
diff --git a/resources/js/chat-room/riddle-quiz.js b/resources/js/chat-room/riddle-quiz.js
index 7b4a6e1..002dffd 100644
--- a/resources/js/chat-room/riddle-quiz.js
+++ b/resources/js/chat-room/riddle-quiz.js
@@ -140,9 +140,9 @@ function buildIdiomAnswerButton(roundId, hint, rewardGold, rewardExp, typeLabel,
btn.dataset.quizEnded = "0";
btn.textContent = "🎯 立即答题";
btn.style.cssText =
- "padding:4px 12px;background:linear-gradient(135deg,#7c3aed,#a78bfa);" +
- "color:#fff;border:none;border-radius:999px;font-size:11px;cursor:pointer;" +
- "font-weight:700;line-height:1.2;vertical-align:middle;box-shadow:0 4px 10px rgba(124,58,237,.18);";
+ "display:inline-flex;align-items:center;gap:4px;padding:2px 9px;background:linear-gradient(135deg,#7c3aed,#a78bfa);" +
+ "color:#fff;border:1px solid #7c3aed;border-radius:999px;font-size:11px;cursor:pointer;" +
+ "font-weight:700;line-height:1;vertical-align:middle;box-shadow:0 2px 6px rgba(124,58,237,.14);";
return btn;
}
@@ -211,12 +211,13 @@ export function disableIdiomAnswerButtons(roundId = 0, endedText = "本回合已
button.dataset.quizEnded = "1";
button.style.background = "linear-gradient(135deg,#94a3b8,#cbd5e1)";
button.style.color = "#f8fafc";
+ button.style.border = "1px solid #94a3b8";
button.style.cursor = "not-allowed";
button.style.boxShadow = "none";
button.style.opacity = ".92";
- button.style.padding = "4px 12px";
+ button.style.padding = "2px 9px";
button.style.fontSize = "11px";
- button.style.lineHeight = "1.2";
+ button.style.lineHeight = "1";
button.title = endedText;
button.textContent = "已结束";
syncQuizWinnerLabel(button, winnerUsername);
@@ -236,12 +237,13 @@ function syncQuizAnswerButtons(activeRoundIds) {
button.dataset.quizEnded = "0";
button.style.background = "linear-gradient(135deg,#7c3aed,#a78bfa)";
button.style.color = "#fff";
+ button.style.border = "1px solid #7c3aed";
button.style.cursor = "pointer";
- button.style.boxShadow = "0 4px 10px rgba(124,58,237,.18)";
+ button.style.boxShadow = "0 2px 6px rgba(124,58,237,.14)";
button.style.opacity = "1";
- button.style.padding = "4px 12px";
+ button.style.padding = "2px 9px";
button.style.fontSize = "11px";
- button.style.lineHeight = "1.2";
+ button.style.lineHeight = "1";
button.title = "";
button.textContent = "🎯 立即答题";
syncQuizWinnerLabel(button, "");