From 3e6af7863d0c260d7eaa533bb979c2dfb6b5dd5f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Aug 2026 12:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B7=B2=E7=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/frontend/header-userbox.css | 124 ++++++++++++++++++ .../header/aksrt-header-menu-search.php | 4 +- inc/helpers/header/aksrt-header-navbar.php | 48 +++---- src/Admin/Schema/SchemaPageDisplay.php | 2 - src/WidgetSystem/FrontendRenderer.php | 2 +- src/WidgetSystem/Renderers/UserRenderer.php | 2 +- .../page-display-contract.test.cjs | 34 ++++- 7 files changed, 178 insertions(+), 38 deletions(-) diff --git a/assets/css/frontend/header-userbox.css b/assets/css/frontend/header-userbox.css index 938d4c0d..b3a686e4 100644 --- a/assets/css/frontend/header-userbox.css +++ b/assets/css/frontend/header-userbox.css @@ -5,6 +5,130 @@ * owns AKSRT-specific account content such as check-in, wallet and VIP rows. */ +/* The desktop action cluster owns one horizontal alignment context. */ +.navbar-top .aksrt-navbar-actions { + display: flex; + align-items: center; + gap: 10px; + min-height: 50px; + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +.navbar-top .aksrt-navbar-actions > *, +.navbar-top .aksrt-navbar-account, +.navbar-top .aksrt-navbar-account > li { + display: inline-flex; + align-items: center; + flex: 0 0 auto; +} + +.navbar-top .aksrt-navbar-account { + gap: 4px; + min-height: 50px; + margin: 0; +} + +.navbar-top .aksrt-navbar-account.navbar-text { + float: none; +} + +.navbar-top .aksrt-navbar-actions .navbar-cta { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 4px; + min-height: 29px; + margin: 0; + padding: .3em 1em !important; + border-radius: var(--radius-btn, 4px); + font-size: .8em; + line-height: 1.44; +} + +.navbar-top .aksrt-navbar-actions .navbar-cta.radius { + border-radius: 50px; +} + +.navbar-top .aksrt-nav-icon, +.navbar-top .aksrt-nav-avatar { + display: inline-flex !important; + align-items: center; + justify-content: center; + width: 34px; + height: 34px; + padding: 0 !important; + overflow: visible !important; + border: 0 !important; + border-radius: 0; + background: transparent !important; + box-shadow: none !important; +} + +.navbar-top .aksrt-nav-icon .icon { + width: 1.2em; + height: 1.2em; +} + +.navbar-top .aksrt-nav-avatar { + margin-top: 0; +} + +.navbar-top .aksrt-nav-avatar .avatar { + display: block; + width: 29px; + height: 29px; + border-radius: 50%; + object-fit: cover; +} + +.navbar-top .aksrt-navbar-actions .toggle-radius { + flex: 0 0 29px; + margin: 0; + vertical-align: middle; +} + +.navbar-top .aksrt-navbar-language { + margin: 0; +} + +/* The full search surface must sit above a fixed header (z-index: 999). */ +.navbar-search { + z-index: 1001; + height: 100%; + overflow: hidden; +} + +.navbar-search > .container { + position: relative; + height: 100%; + max-height: 100%; + padding-bottom: 76px; + overflow-y: auto; +} + +.navbar-search .search-close-box { + position: fixed; + right: max(30px, calc((100vw - var(--container, 1200px)) / 2 + 30px)); + bottom: 24px; + z-index: 2; + width: auto; + max-width: none; + margin: 0; +} + +.navbar-search .search-close-box > .but { + float: none; +} + +@media (max-width: 767.98px) { + .navbar-search .search-close-box { + right: 15px; + bottom: calc(15px + env(safe-area-inset-bottom, 0px)); + } +} + .aksrt-header-userbox { width: 260px; color: var(--color-ink-2); diff --git a/inc/helpers/header/aksrt-header-menu-search.php b/inc/helpers/header/aksrt-header-menu-search.php index 658d41ff..5bc26c74 100644 --- a/inc/helpers/header/aksrt-header-menu-search.php +++ b/inc/helpers/header/aksrt-header-menu-search.php @@ -103,9 +103,9 @@ if (!function_exists('aksrt_footer_navbar_search')) : echo ''; } endif; diff --git a/inc/helpers/header/aksrt-header-navbar.php b/inc/helpers/header/aksrt-header-navbar.php index eb96b295..0f550efc 100644 --- a/inc/helpers/header/aksrt-header-navbar.php +++ b/inc/helpers/header/aksrt-header-navbar.php @@ -197,14 +197,10 @@ if (!function_exists('aksrt_header_user_box_html')) : } if (!empty($ctx['can_publish'])) { - $pub_text = (string) ($ctx['settings']['nav_user_newposts_btn_text'] ?? ''); - if ($pub_text === '') { - $pub_text = __('发布内容', 'aksrt'); - } $pub_url = (string) $ctx['publish_url']; $href .= ''; $href .= '
'; - $href .= '
' . esc_html($pub_text) . '
'; + $href .= '
' . esc_html__('发布内容', 'aksrt') . '
'; } $href .= ''; @@ -289,29 +285,23 @@ if (!function_exists('aksrt_menu_button')) : function aksrt_menu_button(array $ctx): void { $layout = (string) ($ctx['layout'] ?? '1'); $user_id = (int) ($ctx['user_id'] ?? 0); - $button = ''; + $actions = ''; // Publish and membership actions. if (function_exists('aksrt_render_header_menu_buttons')) { - $action_buttons = aksrt_render_header_menu_buttons(); - if ($action_buttons !== '') { - $button .= ''; - } + $actions = aksrt_render_header_menu_buttons(); } // Theme toggle. - $radius_but = ''; + $utility_buttons = ''; if (in_array('pc_nav', (array) ($ctx['theme_positions'] ?? []), true)) { - $radius_but .= ''; - $radius_but .= ''; - $radius_but .= ''; + $utility_buttons .= ''; + $utility_buttons .= ''; } if (function_exists('aksrt_get_translate_language_btn')) { - $radius_but .= aksrt_get_translate_language_btn('ml10 pull-right'); - } - if ($radius_but !== '') { - $button .= ''; + $utility_buttons .= aksrt_get_translate_language_btn('aksrt-navbar-language'); } // User + search. @@ -320,7 +310,7 @@ if (!function_exists('aksrt_menu_button')) : if ('2' === $layout) { if ($user_id > 0) { $avatar = aksrt_get_avatar_html($user_id, 36, ['class' => 'avatar']); - $sign_but = '
  • ' . $avatar . '