From 77164fee450c81fb12ef11e5855fb8b2ce3b547f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jul 2026 08:49:27 +0800 Subject: [PATCH] fix(nav): header publish menu + userbox card polish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unpaint multi-type 发布 wrapper, fix light-menu ink, avatar unread dot clipping, check-in REST double namespace, and user-card VIP/check-in layout. --- .../css/frontend/nav/header-menu-buttons.css | 21 ++++++++++- assets/css/frontend/nav/header-userbox.css | 37 +++++++++++++++++++ assets/css/frontend/nav/mobile-toggle.css | 22 ++++++++--- assets/js/header-userbox.js | 4 +- assets/js/messages.js | 9 ++++- header.php | 2 +- inc/helpers/aksrt-header-menu-buttons.php | 26 +++++++++++-- inc/helpers/aksrt-header-userbox.php | 31 +++++----------- inc/helpers/aksrt-identity.php | 12 +++++- 9 files changed, 126 insertions(+), 38 deletions(-) diff --git a/assets/css/frontend/nav/header-menu-buttons.css b/assets/css/frontend/nav/header-menu-buttons.css index 87e61c6b..afda8ee3 100644 --- a/assets/css/frontend/nav/header-menu-buttons.css +++ b/assets/css/frontend/nav/header-menu-buttons.css @@ -83,6 +83,12 @@ display: inline-flex; align-items: center; z-index: 20; + /* Wrapper must not inherit CTA paint (pink/primary fill + white text). */ + background: transparent !important; + color: inherit; + padding: 0; + border: 0; + box-shadow: none; } .newadd-btns .drop-newadd, @@ -133,7 +139,8 @@ align-items: center; gap: 8px; padding: 8px 14px; - color: inherit; + /* Explicit ink color — never inherit white from CTA toggle. */ + color: var(--color-ink, #222); text-decoration: none; white-space: nowrap; position: relative; @@ -151,6 +158,18 @@ color: var(--focus-color, var(--color-primary)); } +html.dark .newadd-btns__item, +body.dark-theme .newadd-btns__item, +body.theme-dark .newadd-btns__item { + color: var(--color-ink, #f8fafc); +} + +html.dark .newadd-btns__item:hover, +body.dark-theme .newadd-btns__item:hover, +body.theme-dark .newadd-btns__item:hover { + color: var(--focus-color, var(--color-primary)); +} + /* Generic hover-show (zibll parity) */ .hover-show { position: relative; diff --git a/assets/css/frontend/nav/header-userbox.css b/assets/css/frontend/nav/header-userbox.css index dfc8c7ce..0c2e6d3b 100644 --- a/assets/css/frontend/nav/header-userbox.css +++ b/assets/css/frontend/nav/header-userbox.css @@ -88,6 +88,43 @@ margin: 0 !important; } +/* Active VIP: level on line 1, smaller expiry on line 2 (no orange pill). */ +.aksrt-header-payvip .payvip-icon.aksrt-header-payvip__active, +.aksrt-header-payvip__active { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 2px; + line-height: 1.25; +} + +.aksrt-header-payvip__level { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + font-weight: 600; +} + +.aksrt-header-payvip__level > i { + margin: 0 !important; +} + +.aksrt-header-payvip__exp { + display: block; + font-size: 0.85em; + font-weight: 400; + line-height: 1.3; + opacity: 0.9; + background: none !important; + border: 0; + padding: 0; + margin: 0; + color: inherit; + box-shadow: none; +} + .aksrt-header-badges { flex-wrap: wrap; gap: 4px; diff --git a/assets/css/frontend/nav/mobile-toggle.css b/assets/css/frontend/nav/mobile-toggle.css index 79d4a1d2..134bc6c7 100644 --- a/assets/css/frontend/nav/mobile-toggle.css +++ b/assets/css/frontend/nav/mobile-toggle.css @@ -154,7 +154,8 @@ padding: 0; border: none; /* 对齐 zibll:头像无边框 */ cursor: pointer; - overflow: hidden; + /* Allow unread corner badge to paint outside the avatar circle. */ + overflow: visible; background: var(--surface-2); transition: box-shadow var(--dur-fast, 0.15s) var(--ease); } @@ -168,6 +169,7 @@ height: 100%; object-fit: cover; display: block; + border-radius: inherit; } .user-dropdown { @@ -679,13 +681,16 @@ } .nav-user__dot { position: absolute; - top: 0; - right: 0; + top: -1px; + right: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-error, #ef4444); border: 2px solid var(--surface-1, #fff); + box-sizing: content-box; + pointer-events: none; + z-index: 2; } .nav-user__guest-avatar { width: 36px; @@ -715,20 +720,27 @@ gap: 6px; flex-wrap: wrap; } +/* Beat generic `.user-dropdown a { width:100%; height:44px }` sizing. */ +.user-dropdown a.user-dropdown__msg, .user-dropdown__msg { position: absolute; top: 8px; right: 8px; - width: 34px; - height: 34px; + width: 34px !important; + height: 34px !important; + min-width: 34px; + max-width: 34px; border-radius: 50%; display: inline-flex !important; align-items: center; justify-content: center; + gap: 0 !important; padding: 0 !important; background: var(--surface-2); color: var(--color-ink-3); + box-sizing: border-box; } +.user-dropdown a.user-dropdown__msg:hover, .user-dropdown__msg:hover { background: var(--surface-3); color: var(--color-primary); diff --git a/assets/js/header-userbox.js b/assets/js/header-userbox.js index 12f20529..c3547c2d 100644 --- a/assets/js/header-userbox.js +++ b/assets/js/header-userbox.js @@ -68,7 +68,7 @@ if (!btn || btn.disabled) return; e.preventDefault(); btn.disabled = true; - fetch(restBase() + 'aksrt/v1/signin', { + fetch(restBase() + 'signin', { method: 'POST', credentials: 'same-origin', headers: { @@ -91,7 +91,7 @@ } toast((res.data && res.data.message) || '签到成功', 'success'); btn.classList.add('is-done'); - btn.innerHTML = ' 今日已签到'; + btn.innerHTML = ' 今日已签到'; }) .catch(function () { toast('网络错误', 'danger'); diff --git a/assets/js/messages.js b/assets/js/messages.js index f07554f4..cde72bf8 100644 --- a/assets/js/messages.js +++ b/assets/js/messages.js @@ -135,11 +135,18 @@ badge.style.display = nextUnread > 0 ? '' : 'none'; }); - var headerBadge = document.querySelector('.user-dropdown__badge') || document.querySelector('.aksrt-notification-badge'); + // Numeric badge inside the user dropdown only — never target the pure avatar + // .nav-user__dot.aksrt-notification-badge (no textContent on a dot indicator). + var headerBadge = document.querySelector('.user-dropdown__badge'); if (headerBadge) { headerBadge.textContent = String(nextUnread); headerBadge.style.display = nextUnread > 0 ? '' : 'none'; } + + var avatarDot = document.querySelector('.nav-user__dot'); + if (avatarDot) { + avatarDot.style.display = nextUnread > 0 ? '' : 'none'; + } } function checkEmpty() { diff --git a/header.php b/header.php index 0bf37590..415f247e 100644 --- a/header.php +++ b/header.php @@ -289,7 +289,7 @@ if (!empty($aksrt_bg_styles)) {
diff --git a/inc/helpers/aksrt-header-menu-buttons.php b/inc/helpers/aksrt-header-menu-buttons.php index e71feb2b..1659b9e9 100644 --- a/inc/helpers/aksrt-header-menu-buttons.php +++ b/inc/helpers/aksrt-header-menu-buttons.php @@ -157,18 +157,36 @@ if (!function_exists('aksrt_render_new_add_btns')) : $label = __('发布', 'aksrt'); } $label_html = aksrt_normalize_header_cta_label((string) $label, 'fas fa-pen'); - $class = trim('newadd-btns ' . $class); + // Keep CTA paint classes (e.g. btn-primary) off multi-type wrapper so the + // dropdown plate is not filled pink/primary; apply them on the toggle only. + $class_tokens = preg_split('/\s+/', trim($class), -1, PREG_SPLIT_NO_EMPTY) ?: []; + $cta_tokens = []; + $wrap_tokens = ['newadd-btns']; + foreach ($class_tokens as $token) { + if ($token === 'newadd-btns') { + continue; + } + if ($token === 'btn-primary' || $token === 'but' || $token === 'navbar-cta') { + $cta_tokens[] = $token; + continue; + } + $wrap_tokens[] = $token; + } + if (!in_array('btn-primary', $cta_tokens, true)) { + $cta_tokens[] = 'btn-primary'; + } + $cta_class = trim(implode(' ', array_unique($cta_tokens))); if (count($actions) === 1) { $a = $actions[0]; // Prefer configured label; icon already embedded after normalize. - return '' + return '' . $label_html . ''; } - $html = ''; - $html .= '' + $html = ''; + $html .= '' . $label_html . ' '; $html .= '