From 7e15b5489308042e9b2d07ed2491bbac70799b9c Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Fri, 22 May 2026 18:16:27 +0200 Subject: [PATCH] css changes --- .../backend/public/assets/css/app.css | 211 ++++++++++++++++-- .../backend/public/assets/js/app.js | 6 +- .../crash_reporter/backend/views/layout.php | 41 +++- 3 files changed, 230 insertions(+), 28 deletions(-) diff --git a/examples/crash_reporter/backend/public/assets/css/app.css b/examples/crash_reporter/backend/public/assets/css/app.css index e6d5579..229ab3a 100644 --- a/examples/crash_reporter/backend/public/assets/css/app.css +++ b/examples/crash_reporter/backend/public/assets/css/app.css @@ -27,38 +27,209 @@ a:hover { text-decoration: underline; } transition: width .2s ease; overflow: hidden; position: relative; + flex-shrink: 0; } -.nav-pane.open, .nav-pane:hover { width: 220px; } +.nav-pane.open, +.nav-pane:hover { width: 72px; } .nav-handle { position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 4px; - cursor: ew-resize; - background: var(--border); + top: 8px; + left: 50%; + transform: translateX(-50%); + width: 40px; + height: 40px; + padding: 0; + border: none; + border-radius: 10px; + cursor: pointer; + background: transparent; + color: var(--muted); + display: flex; + align-items: center; + justify-content: center; + transition: background .15s ease, color .15s ease; } -.nav-pane ul { list-style: none; margin: 48px 0 0; padding: 0 12px; } -.nav-pane li { margin: 8px 0; } -.nav-pane a { - display: block; - padding: 10px 12px; - border-radius: 8px; +.nav-handle:hover, +.nav-handle:focus-visible { + background: rgba(61, 139, 253, .15); color: var(--text); - white-space: nowrap; + outline: none; } -.nav-pane a.active, .nav-pane a:hover { - background: rgba(61, 139, 253, .2); +.nav-list { + list-style: none; + margin: 56px 0 0; + padding: 0 8px; +} +.nav-list li { margin: 6px 0; } +.nav-link { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + margin: 0 auto; + padding: 0; + border-radius: 10px; + color: var(--muted); text-decoration: none; + transition: background .15s ease, color .15s ease; +} +.nav-link.active, +.nav-link:hover { + background: rgba(61, 139, 253, .22); + color: var(--accent); + text-decoration: none; +} +.nav-label { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} +.nav-icon { + display: block; + flex-shrink: 0; + position: relative; + box-sizing: border-box; +} +/* Hamburger (nav handle) */ +.nav-icon--menu { + width: 18px; + height: 2px; + background: currentColor; + border-radius: 1px; + box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; +} +/* House */ +.nav-icon--home { + width: 18px; + height: 16px; +} +.nav-icon--home::before { + content: ""; + position: absolute; + left: 50%; + top: 0; + transform: translateX(-50%); + border-left: 9px solid transparent; + border-right: 9px solid transparent; + border-bottom: 7px solid currentColor; +} +.nav-icon--home::after { + content: ""; + position: absolute; + left: 3px; + bottom: 0; + width: 12px; + height: 9px; + border: 2px solid currentColor; + border-top: none; + border-radius: 0 0 2px 2px; + box-sizing: border-box; +} +/* Stacked reports */ +.nav-icon--reports { + width: 16px; + height: 18px; + border: 2px solid currentColor; + border-radius: 3px; +} +.nav-icon--reports::before, +.nav-icon--reports::after { + content: ""; + position: absolute; + left: 3px; + right: 3px; + height: 2px; + background: currentColor; + border-radius: 1px; +} +.nav-icon--reports::before { top: 5px; } +.nav-icon--reports::after { top: 10px; width: 70%; } +/* User */ +.nav-icon--user { + width: 18px; + height: 18px; +} +.nav-icon--user::before { + content: ""; + position: absolute; + top: 1px; + left: 50%; + transform: translateX(-50%); + width: 8px; + height: 8px; + border: 2px solid currentColor; + border-radius: 50%; + box-sizing: border-box; +} +.nav-icon--user::after { + content: ""; + position: absolute; + left: 2px; + right: 2px; + bottom: 0; + height: 7px; + border: 2px solid currentColor; + border-top: none; + border-radius: 8px 8px 3px 3px; + box-sizing: border-box; +} +/* Logout — door + arrow */ +.nav-icon--logout { + width: 18px; + height: 16px; +} +.nav-icon--logout::before { + content: ""; + position: absolute; + left: 0; + top: 1px; + width: 10px; + height: 14px; + border: 2px solid currentColor; + border-right: none; + border-radius: 2px 0 0 2px; + box-sizing: border-box; +} +.nav-icon--logout::after { + content: ""; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + width: 0; + height: 0; + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + border-left: 7px solid currentColor; } .nav-user { position: absolute; - bottom: 12px; - left: 12px; - right: 12px; - font-size: 12px; + bottom: 10px; + left: 0; + right: 0; + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; color: var(--muted); } +.nav-user-name { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + color: var(--muted); +} +.nav-link--logout { color: var(--muted); } +.nav-link--logout:hover { color: var(--danger); background: rgba(248, 113, 113, .12); } .main-pane { flex: 1; padding: 24px 28px; } .bottom-bar { height: 40px; diff --git a/examples/crash_reporter/backend/public/assets/js/app.js b/examples/crash_reporter/backend/public/assets/js/app.js index e9ea966..96cab61 100644 --- a/examples/crash_reporter/backend/public/assets/js/app.js +++ b/examples/crash_reporter/backend/public/assets/js/app.js @@ -2,5 +2,9 @@ document.addEventListener('DOMContentLoaded', () => { const nav = document.getElementById('nav-pane'); const handle = document.getElementById('nav-handle'); if (!nav || !handle) return; - handle.addEventListener('click', () => nav.classList.toggle('open')); + handle.addEventListener('click', () => { + const open = nav.classList.toggle('open'); + handle.setAttribute('aria-expanded', open ? 'true' : 'false'); + }); + handle.setAttribute('aria-expanded', nav.classList.contains('open') ? 'true' : 'false'); }); diff --git a/examples/crash_reporter/backend/views/layout.php b/examples/crash_reporter/backend/views/layout.php index 940e5be..2e7443b 100644 --- a/examples/crash_reporter/backend/views/layout.php +++ b/examples/crash_reporter/backend/views/layout.php @@ -24,15 +24,42 @@
-