diff --git a/www/html/Game/public/js/play.js b/www/html/Game/public/js/play.js index e628368..341cd8e 100644 --- a/www/html/Game/public/js/play.js +++ b/www/html/Game/public/js/play.js @@ -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'); diff --git a/www/html/Game/public/play.html b/www/html/Game/public/play.html index c88e5cf..ef599cc 100644 --- a/www/html/Game/public/play.html +++ b/www/html/Game/public/play.html @@ -669,7 +669,7 @@ - +