diff --git a/frontend/classroom.html b/frontend/classroom.html index a8dcc18..6fc8f5a 100644 --- a/frontend/classroom.html +++ b/frontend/classroom.html @@ -2009,7 +2009,8 @@ /* ── Annotate-over-sim mode ───────────────────────────────────────────── */ /* Board floats above the sim panel (sim visible behind transparent canvas) */ - .cr-board-area.annotate-active .cr-sim-panel { z-index: 1; } + .cr-board-area.annotate-active .cr-sim-panel, + .cr-board-area.annotate-active .cr-tb-panel { z-index: 1; } .cr-board-area.annotate-active .cr-board-wrap { z-index: 45; background: transparent !important; @@ -2164,6 +2165,19 @@ display: none; background: transparent; cursor: not-allowed; z-index: 10; } .cr-tb-blocker.active { display: block; } + + /* Draw-over button (in tb-bar; only visible when textbook open) */ + .cr-tb-annotate-btn { + display: none; padding: 5px 10px; border-radius: 99px; + border: 1.5px solid rgba(241,91,181,0.3); background: transparent; + color: rgba(255,255,255,0.7); font-family: 'Manrope',sans-serif; + font-size: 0.72rem; font-weight: 700; cursor: pointer; + transition: all .15s; align-items: center; gap: 4px; margin-right: 4px; + } + .cr-tb-annotate-btn svg { width: 12px; height: 12px; flex-shrink: 0; } + .cr-tb-annotate-btn:hover { color: rgba(255,255,255,0.85); border-color: rgba(241,91,181,0.55); } + .cr-tb-annotate-btn.active { background: rgba(241,91,181,0.18); border-color: rgba(241,91,181,0.55); color: #F15BB5; } + .cr-tb-panel.open .cr-tb-annotate-btn.teacher-ctrl { display: flex; } @@ -2326,6 +2340,10 @@ Учебник + @@ -7107,11 +7125,11 @@ let _annotateTool = 'pencil'; // saved tool before entering annotate mode async function crToggleAnnotate() { - if (!_simActive) return; + if (!_simActive && !_tbActive) return; const isTeacher = _me && (_me.role === 'teacher' || _me.role === 'admin'); const newVal = !_annotateActive; _crApplyAnnotate(newVal); - // Only teacher broadcasts to students + // Only teacher broadcasts to students (reuse sim/annotate channel — same payload) if (isTeacher && _sessionId) { try { await LS.post(`/api/classroom/${_sessionId}/sim/annotate`, { active: newVal }); @@ -7123,10 +7141,12 @@ _annotateActive = active; const boardArea = document.getElementById('cr-board-area'); const simBtn = document.getElementById('cr-sim-annotate-btn'); + const tbBtn = document.getElementById('cr-tb-annotate-btn'); const isTeacher = _me && (_me.role === 'teacher' || _me.role === 'admin'); boardArea?.classList.toggle('annotate-active', active); if (simBtn) simBtn.classList.toggle('active', active); + if (tbBtn) tbBtn.classList.toggle('active', active); if (!_wb) return; _wb.setAnnotateMode(active); @@ -7296,6 +7316,7 @@ } function onTbClose() { + if (_annotateActive) _crApplyAnnotate(false); _tbActive = null; const panel = document.getElementById('cr-tb-panel'); const frame = document.getElementById('cr-tb-frame');