From 5e97f6d6d8b669a79b515fd5735358207dfbd76c Mon Sep 17 00:00:00 2001 From: mac Date: Fri, 24 Jul 2026 17:39:40 +0800 Subject: [PATCH] =?UTF-8?q?v2.1.5=20=E2=80=94=20=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=82=B9=E5=87=BB=E5=A4=B4=E5=83=8F=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 11 +++++++++++ static/style.css | 35 +++++++++++++++++++++++++++++++++++ templates/index.html | 10 ++++++---- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/static/app.js b/static/app.js index 2f0d32b..0112b59 100644 --- a/static/app.js +++ b/static/app.js @@ -469,6 +469,17 @@ if (card) card.classList.add('active'); }; + /* 头像菜单 */ + window.toggleUserMenu = function(e) { + e.stopPropagation(); + var dd = document.getElementById('user-dropdown'); + if (dd) dd.style.display = dd.style.display === 'none' ? 'block' : 'none'; + }; + document.addEventListener('click', function() { + var dd = document.getElementById('user-dropdown'); + if (dd) dd.style.display = 'none'; + }); + /* ================================================================ Load & Auto Save Checkin ================================================================ */ diff --git a/static/style.css b/static/style.css index 80b625c..a23f869 100644 --- a/static/style.css +++ b/static/style.css @@ -71,6 +71,41 @@ body { gap: 8px; padding: 24px 12px 16px; position: relative; + cursor: pointer; +} + +.sidebar-user .user-avatar { + transition: transform 0.15s; +} +.sidebar-user:hover .user-avatar { transform: scale(1.05); } + +.user-dropdown { + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + background: var(--card); + border: 1px solid var(--border); + border-radius: var(--radius-sm); + box-shadow: var(--shadow-hover); + z-index: 100; + min-width: 120px; + padding: 4px; +} +.user-dropdown-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + font-size: 13px; + color: var(--text-dim); + text-decoration: none; + border-radius: 6px; + transition: all 0.15s; +} +.user-dropdown-item:hover { + background: var(--danger-light); + color: var(--danger); } .sidebar-user .user-name { diff --git a/templates/index.html b/templates/index.html index 5bd7ef6..0ab021e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -40,12 +40,14 @@