修复聊天室字号偏好和游戏通知显示
This commit is contained in:
@@ -9,6 +9,8 @@ let currentRoundId = 0;
|
||||
let currentRoomId = 0;
|
||||
let currentQuizType = "idiom";
|
||||
const QUIZ_TYPES = ["idiom", "brain_teaser"];
|
||||
const QUIZ_INLINE_BUTTON_FONT_SIZE = "0.82em";
|
||||
const QUIZ_INLINE_META_FONT_SIZE = "0.78em";
|
||||
|
||||
/**
|
||||
* 兼容新旧字段,提取前端统一使用的猜谜活动回合信息。
|
||||
@@ -141,7 +143,7 @@ function buildIdiomAnswerButton(roundId, hint, rewardGold, rewardExp, typeLabel,
|
||||
btn.textContent = "🎯 立即答题";
|
||||
btn.style.cssText =
|
||||
"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;" +
|
||||
`color:#fff;border:1px solid #7c3aed;border-radius:999px;font-size:${QUIZ_INLINE_BUTTON_FONT_SIZE};cursor:pointer;` +
|
||||
"font-weight:700;line-height:1;vertical-align:middle;box-shadow:0 2px 6px rgba(124,58,237,.14);";
|
||||
|
||||
return btn;
|
||||
@@ -195,7 +197,7 @@ function syncQuizWinnerLabel(button, winnerUsername = "") {
|
||||
const winnerLabel = existingLabel || document.createElement("span");
|
||||
winnerLabel.dataset.quizWinnerLabel = String(button.dataset.quizAnswerBtn || button.dataset.idiomAnswerBtn || "0");
|
||||
winnerLabel.textContent = `答对:${winnerUsername}`;
|
||||
winnerLabel.style.cssText = "margin-left:6px;font-size:11px;line-height:1.2;color:#64748b;font-weight:700;white-space:nowrap;";
|
||||
winnerLabel.style.cssText = `margin-left:6px;font-size:${QUIZ_INLINE_META_FONT_SIZE};line-height:1.2;color:#64748b;font-weight:700;white-space:nowrap;`;
|
||||
|
||||
if (!existingLabel) {
|
||||
button.insertAdjacentElement("afterend", winnerLabel);
|
||||
@@ -216,7 +218,7 @@ export function disableIdiomAnswerButtons(roundId = 0, endedText = "本回合已
|
||||
button.style.boxShadow = "none";
|
||||
button.style.opacity = ".92";
|
||||
button.style.padding = "2px 9px";
|
||||
button.style.fontSize = "11px";
|
||||
button.style.fontSize = QUIZ_INLINE_BUTTON_FONT_SIZE;
|
||||
button.style.lineHeight = "1";
|
||||
button.title = endedText;
|
||||
button.textContent = "已结束";
|
||||
@@ -242,7 +244,7 @@ function syncQuizAnswerButtons(activeRoundIds) {
|
||||
button.style.boxShadow = "0 2px 6px rgba(124,58,237,.14)";
|
||||
button.style.opacity = "1";
|
||||
button.style.padding = "2px 9px";
|
||||
button.style.fontSize = "11px";
|
||||
button.style.fontSize = QUIZ_INLINE_BUTTON_FONT_SIZE;
|
||||
button.style.lineHeight = "1";
|
||||
button.title = "";
|
||||
button.textContent = "🎯 立即答题";
|
||||
|
||||
Reference in New Issue
Block a user