play: hide quiz HUD and map question panel in editor embed preview; lighter quiz_carry plaques

Made-with: Cursor
This commit is contained in:
2026-04-24 13:37:54 +00:00
parent 6d0a3233da
commit 7a685e73b3
2 changed files with 44 additions and 20 deletions
+43 -19
View File
@@ -709,6 +709,12 @@
const panel = document.getElementById('quiz-map-question-panel');
const textEl = document.getElementById('quiz-map-question-text');
if (!panel || !textEl || !mapData) return;
/* เอดิเตอร์ embed: อย่าวางแผงคำถามทับกลางจอ (quiz / quiz_carry ใช้กรอบทองนี้) — บังมองและรู้สึกเหมือนค้าง */
if (previewMode && editorEmbedReturn) {
panel.classList.add('is-hidden');
panel.setAttribute('aria-hidden', 'true');
return;
}
if (isQuizBattle()) {
panel.classList.add('is-hidden');
panel.setAttribute('aria-hidden', 'true');
@@ -1383,7 +1389,10 @@
playQuizTimerInterval = null;
}
const ov = document.getElementById('quiz-game-overlay');
if (ov) ov.classList.remove('is-hidden');
if (ov) {
if (previewMode && editorEmbedReturn) ov.classList.add('is-hidden');
else ov.classList.remove('is-hidden');
}
playQuizPlayerLocal = { cannotTrue: false, cannotFalse: false, eliminated: false, score: 0 };
const leg = document.getElementById('quiz-play-legend');
if (previewMode) {
@@ -1553,38 +1562,50 @@
function drawQuizCarryNeonPlaque(ctx, signX, signY, w, h, lines, lineH, padY, choiceIndex, tether) {
const neon = quizCarryNeonColorForChoice(choiceIndex);
const rr = Math.max(6, Math.min(12, Math.min(w, h) * 0.2));
const simplePreviewPlaque = previewMode && editorEmbedReturn;
function pathBoard() {
ctx.beginPath();
if (typeof ctx.roundRect === 'function') ctx.roundRect(signX, signY, w, h, rr);
else ctx.rect(signX, signY, w, h);
}
for (let g = 4; g >= 1; g--) {
ctx.strokeStyle = neon;
ctx.globalAlpha = 0.07 + g * 0.06;
ctx.lineWidth = 3 + g * 4;
pathBoard();
ctx.stroke();
if (!simplePreviewPlaque) {
for (let g = 4; g >= 1; g--) {
ctx.strokeStyle = neon;
ctx.globalAlpha = 0.07 + g * 0.06;
ctx.lineWidth = 3 + g * 4;
pathBoard();
ctx.stroke();
}
}
ctx.globalAlpha = 1;
ctx.fillStyle = 'rgba(12, 10, 20, 0.88)';
pathBoard();
ctx.fill();
ctx.strokeStyle = neon;
ctx.lineWidth = 2.5;
ctx.shadowColor = neon;
ctx.shadowBlur = 14;
pathBoard();
ctx.stroke();
ctx.shadowBlur = 8;
pathBoard();
ctx.stroke();
ctx.shadowBlur = 0;
if (simplePreviewPlaque) {
ctx.lineWidth = 2;
ctx.shadowBlur = 0;
pathBoard();
ctx.stroke();
} else {
ctx.lineWidth = 2.5;
ctx.shadowColor = neon;
ctx.shadowBlur = 14;
pathBoard();
ctx.stroke();
ctx.shadowBlur = 8;
pathBoard();
ctx.stroke();
ctx.shadowBlur = 0;
}
const attachX = signX + w / 2;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillStyle = '#f8f9ff';
ctx.shadowColor = 'rgba(0,0,0,0.55)';
ctx.shadowBlur = 3;
if (!simplePreviewPlaque) {
ctx.shadowColor = 'rgba(0,0,0,0.55)';
ctx.shadowBlur = 3;
}
const textMidY = signY + padY + lineH / 2;
for (let li = 0; li < lines.length; li++) {
ctx.fillText(lines[li], attachX, textMidY + li * lineH);
@@ -1936,7 +1957,10 @@
playQuizTimerInterval = null;
}
const ov = document.getElementById('quiz-game-overlay');
if (ov) ov.classList.remove('is-hidden');
if (ov) {
if (previewMode && editorEmbedReturn) ov.classList.add('is-hidden');
else ov.classList.remove('is-hidden');
}
const tEl = document.getElementById('quiz-game-timer');
if (tEl) tEl.textContent = '';
const leg = document.getElementById('quiz-play-legend');
+1 -1
View File
@@ -669,7 +669,7 @@
</div>
<script src="/Game/socket.io/socket.io.js"></script>
<script src="js/version.js?v=0.0166"></script>
<script src="js/play.js?v=0.081"></script>
<script src="js/play.js?v=0.082"></script>
<div class="version-tag">v —</div>
</body>
</html>