统一猜谜答对通知配色

This commit is contained in:
pllx
2026-04-29 15:50:58 +08:00
parent 02ed8ea319
commit ee56792beb
+9 -9
View File
@@ -482,19 +482,19 @@ function buildQuizResultHtml(msg, timeStr) {
const winnerUsername = String(msg.winner_username || "").trim();
const answerText = escapeHtml(resolveQuizResultAnswerText(msg));
const isAnsweredResult = winnerUsername !== "";
const accentColor = isAnsweredResult ? "#16a34a" : "#d97706";
const accentColor = isAnsweredResult ? "#7c3aed" : "#d97706";
const accentBackground = isAnsweredResult
? "linear-gradient(135deg,#f0fdf4,#ecfccb)"
? "linear-gradient(135deg,#f5f3ff,#faf5ff)"
: "linear-gradient(135deg,#fff7ed,#fffbeb)";
const accentBorder = isAnsweredResult ? "rgba(22,163,74,.18)" : "rgba(217,119,6,.18)";
const textColor = isAnsweredResult ? "#166534" : "#9a3412";
const accentBorder = isAnsweredResult ? "rgba(124,58,237,.16)" : "rgba(217,119,6,.18)";
const textColor = isAnsweredResult ? "#312e81" : "#9a3412";
const icon = isAnsweredResult ? "🎉" : "⏳";
const iconBackground = isAnsweredResult
? "linear-gradient(135deg,#16a34a,#4ade80)"
? "linear-gradient(135deg,#7c3aed,#a78bfa)"
: "linear-gradient(135deg,#f59e0b,#f97316)";
const badgeColor = isAnsweredResult ? "#16a34a" : "#d97706";
const badgeColor = isAnsweredResult ? "#7c3aed" : "#d97706";
const summaryHtml = isAnsweredResult
? `${clickableUser(winnerUsername, "#15803d")}】率先答对「${answerText}`
? `${clickableUser(winnerUsername, "#6d28d9")}】率先答对「${answerText}`
: `第 #${quizMeta.endedRoundId || quizMeta.roundId || 0} 题已超时结束,正确答案:${answerText}`;
return `
@@ -508,8 +508,8 @@ function buildQuizResultHtml(msg, timeStr) {
</div>
${isAnsweredResult ? `
<div style="display:flex;align-items:center;gap:5px;flex-wrap:wrap;color:${textColor};font-size:10px;flex-shrink:0;margin-left:auto;">
<span style="padding:1px 6px;border-radius:999px;background:#ffffff;box-shadow:inset 0 0 0 1px ${isAnsweredResult ? "rgba(22,163,74,.12)" : "rgba(217,119,6,.12)"};white-space:nowrap;">💰 ${quizMeta.rewardGold} 金币</span>
<span style="padding:1px 6px;border-radius:999px;background:#ffffff;box-shadow:inset 0 0 0 1px ${isAnsweredResult ? "rgba(22,163,74,.12)" : "rgba(217,119,6,.12)"};white-space:nowrap;">⭐ ${quizMeta.rewardExp} 经验</span>
<span style="padding:1px 6px;border-radius:999px;background:#ffffff;box-shadow:inset 0 0 0 1px ${isAnsweredResult ? "rgba(124,58,237,.10)" : "rgba(217,119,6,.12)"};white-space:nowrap;">💰 ${quizMeta.rewardGold} 金币</span>
<span style="padding:1px 6px;border-radius:999px;background:#ffffff;box-shadow:inset 0 0 0 1px ${isAnsweredResult ? "rgba(124,58,237,.10)" : "rgba(217,119,6,.12)"};white-space:nowrap;">⭐ ${quizMeta.rewardExp} 经验</span>
</div>
` : ""}
</div>