diff --git a/static/style.css b/static/style.css index eae27dd..a507dfb 100644 --- a/static/style.css +++ b/static/style.css @@ -96,6 +96,34 @@ h3 { margin: 0; font-size: 17px; } border: 1px solid var(--border); color: #334155; } .class-tab.active { border-color: transparent; background: var(--primary); color: #fff; } +.class-panel { margin-bottom: 14px; } +.class-panel .status-row { margin-top: 14px; } + +.admin-tabs { + display: flex; gap: 6px; align-items: center; overflow-x: auto; + padding: 7px; margin: 0 0 16px; background: rgba(255,255,255,.94); + border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 5px 16px rgba(15,23,42,.05); +} +.admin-tab { + flex: 1 0 auto; min-width: 118px; height: 40px; border-radius: 10px; + background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; + white-space: nowrap; transition: color .15s, background-color .15s, transform .15s; +} +.admin-tab:hover:not(:disabled) { background: #eef2f7; color: var(--text); transform: none; } +.admin-tab.active { background: var(--primary); color: #fff; } +.admin-tab.active:hover:not(:disabled) { background: var(--primary-dark); color: #fff; } +.tab-panel { margin-bottom: 0; } +.statistics { margin: 0 0 20px; } +.create-group-line { margin-bottom: 24px; } +.groups-head { margin-top: 4px; } +.import-label { + display: inline-flex; align-items: center; height: 38px; padding: 0 14px; + border: 0; border-radius: 8px; background: #eef2f7; color: var(--text); + font-size: 14px; font-weight: 500; line-height: 1; cursor: pointer; transition: .15s; +} +.import-label:hover { background: #e2e8f0; } +.settings-divider { height: 1px; margin: 26px 0 22px; background: var(--border); } +.settings-password-line { margin-top: 14px; } .grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 16px; @@ -153,4 +181,10 @@ h3 { margin: 0; font-size: 17px; } .brand span { display: none; } .group-card { padding: 13px; } .member-actions button { padding: 0 6px; } + .admin-tabs { gap: 5px; padding: 6px; margin-bottom: 13px; } + .admin-tab { min-width: 96px; height: 38px; font-size: 13px; } + .class-panel, .import-label, .create-group-line { margin-bottom: 14px; } + .form-line { flex-direction: column; align-items: stretch; } + .form-line button, .form-line span { width: 100%; text-align: center; } + .form-line span { height: auto; color: var(--muted); font-size: 13px; } } diff --git a/static/teacher.html b/static/teacher.html index f64d6e5..2454831 100644 --- a/static/teacher.html +++ b/static/teacher.html @@ -31,19 +31,49 @@ diff --git a/static/teacher.js b/static/teacher.js index e1f3f2f..41f0e59 100644 --- a/static/teacher.js +++ b/static/teacher.js @@ -1,5 +1,6 @@ const state = { classes: [], snapshot: null, activeClass: '', username: '' }; const el = id => document.getElementById(id); +const adminTabs = ['groups', 'ungrouped', 'settings']; function renderUnauthenticated() { el('loginArea').classList.remove('hidden'); @@ -7,6 +8,16 @@ function renderUnauthenticated() { el('teacherToolbar').classList.add('hidden'); } +function switchAdminTab(tabName) { + if (!adminTabs.includes(tabName)) tabName = 'groups'; + document.querySelectorAll('.admin-tab').forEach(button => { + const active = button.dataset.tab === tabName; + button.classList.toggle('active', active); + button.setAttribute('aria-selected', String(active)); + el(`${button.dataset.tab}Panel`).classList.toggle('hidden', !active); + }); +} + function renderState() { el('loginArea').classList.add('hidden'); el('mainArea').classList.remove('hidden'); @@ -19,6 +30,10 @@ function renderState() { renderUngrouped(); } +document.querySelectorAll('.admin-tab').forEach(button => { + button.addEventListener('click', () => switchAdminTab(button.dataset.tab)); +}); + function renderClassTabs() { el('classTabs').innerHTML = state.classes.map(item => `