feat(classroom): выделить вход в онлайн-урок — акцент в сайдбаре + липкий баннер
Пункт «Онлайн-урок» в сайдбаре теперь визуально выделен (акцентная иконка), а когда урок идёт — пульсирующий бейдж «В эфире» (и точка-пульс в свёрнутом режиме). Вместо легко пропускаемой всплывашки снизу — липкий баннер сверху на любой странице с кнопкой «Войти», пока урок активен. Состояние берётся из SSE classroom_started/ended + проверки /api/classroom/my/active при загрузке (чтобы баннер появлялся и при заходе в середине урока). Для учеников. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+33
-1
@@ -67,7 +67,7 @@
|
||||
${G('learning', 'Учебный процесс', `
|
||||
${L('/classes', 'graduation-cap', 'Классы', { id: 'btn-classes', hidden: !isTch })}
|
||||
${L('/my-students', 'user-plus', 'Мои ученики', { cls: 'sb-teacher-only', hidden: !isTch })}
|
||||
${L('/classroom', 'presentation', 'Онлайн-урок')}
|
||||
${L('/classroom', 'presentation', 'Онлайн-урок', { id: 'btn-classroom', cls: 'sb-link-cr' })}
|
||||
${L('/lesson-history','archive', 'Архив уроков')}
|
||||
${L('/live-quiz', 'radio', 'Live-квиз', { cls: 'sb-teacher-only', hidden: !isTch })}
|
||||
${L('/board', 'layout-dashboard', 'Доска', { id: 'btn-board', hidden: true })}
|
||||
@@ -150,10 +150,42 @@
|
||||
/* When sidebar collapsed (icon-only mode) — hide group headers */
|
||||
.app-layout.sb-collapsed .sb-group-hdr { display: none; }
|
||||
.app-layout.sb-collapsed .sb-group-body { max-height: none !important; opacity: 1 !important; pointer-events: auto !important; }
|
||||
|
||||
/* ── Онлайн-урок: всегда заметный пункт + live-индикатор ── */
|
||||
.sb-link-cr .sb-icon { color: var(--violet, #9B5DE5); }
|
||||
.sb-link-cr:not(.active) { font-weight: 700; }
|
||||
.sb-cr-live {
|
||||
display: none; align-items: center; gap: 5px; margin-left: auto; flex-shrink: 0;
|
||||
padding: 3px 8px; border-radius: 999px;
|
||||
font-size: 0.56rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
|
||||
color: #fff; background: linear-gradient(135deg, #F15BB5, #9B5DE5);
|
||||
}
|
||||
.sb-cr-live::before {
|
||||
content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff;
|
||||
animation: sb-cr-pulse 1.15s ease-in-out infinite;
|
||||
}
|
||||
@keyframes sb-cr-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.6); } }
|
||||
.sb-link-cr.is-live { background: linear-gradient(90deg, rgba(241,91,181,.16), rgba(155,93,229,.05)); color: var(--text, #0F172A); }
|
||||
.sb-link-cr.is-live .sb-icon { color: #F15BB5; }
|
||||
.sb-link-cr.is-live .sb-cr-live { display: inline-flex; }
|
||||
.sb-link-cr.is-live::after {
|
||||
content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px;
|
||||
border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #F15BB5, #9B5DE5);
|
||||
}
|
||||
/* Свёрнутый сайдбар (только иконки): бейдж прячем, показываем точку-пульс */
|
||||
.app-layout.sb-collapsed .sb-cr-live { display: none !important; }
|
||||
.app-layout.sb-collapsed .sb-link-cr.is-live::after {
|
||||
left: auto; right: 9px; top: 8px; bottom: auto; width: 8px; height: 8px;
|
||||
border-radius: 50%; background: #F15BB5; animation: sb-cr-pulse 1.15s ease-in-out infinite;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
// Онлайн-урок: бейдж «В эфире» (скрыт; включается классом .is-live из api.js по SSE)
|
||||
const crLink = el.querySelector('#btn-classroom');
|
||||
if (crLink) crLink.insertAdjacentHTML('beforeend', '<span class="sb-cr-live">В эфире</span>');
|
||||
|
||||
// Toggle handler (global so onclick works)
|
||||
window.__lsSbToggle = function (slug) {
|
||||
const g = el.querySelector(`[data-sb-group="${slug}"]`);
|
||||
|
||||
Reference in New Issue
Block a user