From 3cce29caa4d4c05de403dacb0ab80fd105d6de3e Mon Sep 17 00:00:00 2001 From: Liu Date: Fri, 13 Nov 2026 21:56:49 +0800 Subject: [PATCH] fix(doc-viewer): rebuild responsive home gallery - compose the home page from real card, field, attachment and empty widgets - place gallery cards into responsive columns on first mount and route remount - update the home layout on native window resizes and breakpoint changes - refresh navbar, docs page containers and offscreen render helpers - add gallery layout regressions for mounting, resizing, hover and icon sizing --- examples/doc-viewer/AGENTS.md | 29 +- .../doc-viewer/app/components/home-gallery.c | 2 + .../doc-viewer/app/components/home-gallery.h | 3 + .../app/components/home-gallery.tsx | 814 ++++++++++++++++ .../doc-viewer/app/components/home-grid.c | 308 ++++++ .../doc-viewer/app/components/home-grid.h | 11 + examples/doc-viewer/app/components/navbar.c | 27 +- examples/doc-viewer/app/components/navbar.css | 18 + examples/doc-viewer/app/components/navbar.tsx | 13 +- examples/doc-viewer/app/en/docs/layout.tsx | 6 +- .../doc-viewer/app/en/docs/widgets/page.tsx | 2 +- examples/doc-viewer/app/en/home/page.tsx | 11 +- examples/doc-viewer/app/global.css | 509 +++++++++- examples/doc-viewer/app/main.c | 6 +- examples/doc-viewer/app/zh-CN/docs/layout.tsx | 11 +- .../app/zh-CN/docs/widgets/page.tsx | 2 +- examples/doc-viewer/app/zh-CN/home/page.tsx | 11 +- .../doc-viewer/scripts/render-offscreen.ps1 | 38 +- src/styles/style-nova.css | 2 +- src/styles/style-nova.css.h | 15 +- tests/fixtures/test_gallery_layout.css | 88 ++ tests/integration/test_gallery_layout.c | 890 ++++++++++++++++++ tests/main.c | 2 + tests/xmake.lua | 2 + 24 files changed, 2762 insertions(+), 58 deletions(-) create mode 100644 examples/doc-viewer/app/components/home-gallery.c create mode 100644 examples/doc-viewer/app/components/home-gallery.h create mode 100644 examples/doc-viewer/app/components/home-gallery.tsx create mode 100644 examples/doc-viewer/app/components/home-grid.c create mode 100644 examples/doc-viewer/app/components/home-grid.h create mode 100644 tests/fixtures/test_gallery_layout.css create mode 100644 tests/integration/test_gallery_layout.c diff --git a/examples/doc-viewer/AGENTS.md b/examples/doc-viewer/AGENTS.md index 45bc0104..0dae3012 100644 --- a/examples/doc-viewer/AGENTS.md +++ b/examples/doc-viewer/AGENTS.md @@ -149,6 +149,33 @@ overview、handbook 等页面结构更自由,仅要求: 2. `##` 小节自由组织 3. 示例代码块须带 `title="..."` 元数据 +手写页面(Home、部件索引)另有一条硬性约定:**页面组件的根节点必须是 `div`**。 +`lcui build` 会把根元素类型作为 page 原型的父原型(例如根节点是 `` 时, +生成的 page 原型继承 `scrollarea`),但生成的 `page.c` 的 init 不会调用父原型的 init, +运行时会因为缺少部件内部数据而崩溃。需要滚动时用 +`
…
` 包裹。 + +Home 页的卡片画廊使用 `app/components/home-grid.c` 的 `home-grid` 部件:卡片是它的 +直接子节点,用 `data-column="1..4"` 指定所属列(不写则按声明顺序轮转)。可见 +`home-column` 使用 `flex: 1 1 0` 与 `min-width: 0` 自动均分画廊实际宽度,不写固定像素 +列宽;部件只按 root 宽度切换列的显示状态:窗口 ≥1400px 显示 4 列,≥1024px 隐藏第 +3 列,更窄时只保留第 1、4 列。窗口尺寸经 root 的 `afterlayout` 触发显示状态更新; +不要在 grid 的 `resize` 回调里写列样式,否则本次 updater 结束时会清掉尚未执行的 +子项样式更新。grid 在 `link` 事件中会提前标记 pending,确保预渲染页面首次挂载或 +从其它路由切回时,第一轮布局就完成列分配并使用正确宽度。新增卡片时同步调整 +`data-column`,保持各列总高度接近。 + +画廊卡片必须使用真实 `card` 部件:外层 ``,内容用 ``;有标题/描述 +的卡片用 `` + `` + ``,不要再用 +`.home-preview-title` 之类的自定义文本模拟。`home-card` / `home-card-body` 只负责 +画廊的边框、圆角和间距,不重新实现 Card 的结构。 + +TSX 里给**容器部件**(`accordion-trigger`、`accordion-content`、`input-group-text`、 +`badge` 等)写字符串子节点不会显示:编译器会把纯文本写成该部件自身的 `text` 属性, +只有 `text` 原型及其衍生的部件(`text`、`button`、`item-title`、`empty-title` 等)会 +渲染。给容器加文字必须显式写 `…`。`clip-safe` 只加在卡片 body 等内层 +容器上;加到卡片本身时它的 `margin: -4px` 会把卡片推出列边界并吞掉边框。 + ## 文档工作流 以中文文档为主,英文文档在中文文档更新完毕后再全量翻译。 @@ -314,7 +341,7 @@ xmake build doc-viewer ## 离屏渲染截图 -`examples/doc-viewer/scripts/render-offscreen.ps1` 在不打开窗口、不移动鼠标的情况下把指定路由渲染成 PNG,适合无法手动肉眼检查的验证场景(CI、agent): +`examples/doc-viewer/scripts/render-offscreen.ps1` 在不打开窗口、不移动鼠标的情况下把指定路由渲染成 PNG,适合无法手动肉眼检查的验证场景(CI、agent)。脚本用 `Start-Process -WindowStyle Hidden` 启动进程,控制台窗口也不会出现;Windows 虚拟桌面的窗口归属由系统按启动进程时所在桌面决定,进程无法选择桌面,隐藏窗口是避免影响其它桌面的唯一可靠方式。 ```powershell # 渲染单个路由 diff --git a/examples/doc-viewer/app/components/home-gallery.c b/examples/doc-viewer/app/components/home-gallery.c new file mode 100644 index 00000000..14eafc04 --- /dev/null +++ b/examples/doc-viewer/app/components/home-gallery.c @@ -0,0 +1,2 @@ +#include "home-gallery.tsx.h" +#include "home-gallery.h" diff --git a/examples/doc-viewer/app/components/home-gallery.h b/examples/doc-viewer/app/components/home-gallery.h new file mode 100644 index 00000000..8c8fca7a --- /dev/null +++ b/examples/doc-viewer/app/components/home-gallery.h @@ -0,0 +1,3 @@ +#include + +void ui_load_home_gallery_resources(void); diff --git a/examples/doc-viewer/app/components/home-gallery.tsx b/examples/doc-viewer/app/components/home-gallery.tsx new file mode 100644 index 00000000..913a02ae --- /dev/null +++ b/examples/doc-viewer/app/components/home-gallery.tsx @@ -0,0 +1,814 @@ +import { + Button, + FunctionWidget, + RouterLink, + ScrollArea, + ScrollAreaContent, + Scrollbar, + Text, +} from "@lcui/react"; + +type Locale = "zh-CN" | "en"; + +const heroDesc: Record = { + "zh-CN": "用于开发图形用户界面的 C 语言库。", + en: "The C library for building user interfaces.", +}; + +const ctaLabel: Record = { + "zh-CN": { start: "快速开始", widgets: "浏览部件" }, + en: { start: "Get started", widgets: "Browse widgets" }, +}; + +const HomeGallery: FunctionWidget = ({ locale }: { locale: Locale }) => { + const cta = ctaLabel[locale]; + + return ( +
+ + +
+
+
+ LCUI + {heroDesc[locale]} +
+ + {cta.start} + + + {cta.widgets} + +
+
+ + + + +
+ + + +
+ + + + + + + +
+
+ Badge + Secondary +
+
+ + + + + +
+
+
+ + + + + + + + + Allow accessory to connect? + + + Do you want to allow the USB accessory to + connect to this device and your data? + + + + + Don't allow + + + Allow + + + + + + + + + + + + + + Quick Actions + + + Mute Conversation + + + Mark as Read + + + Block User + + + + Delete Conversation + + + + +
+
+
+ + + + + Attachments + + Upload, review, and manage your files. + + + + + + + + selected-file.pdf + + Ready to upload + + + + + + + + + + + + design-system.zip + + Uploading - 64% + + + + + + + + + + + + market-research.pdf + + Processing document + + + + + + + + + + + + + financial-model.xlsx + + + Upload failed. Try again. + + + + + + + + + + + + + uploaded-report.pdf + + Uploaded - 1.8 MB + + + + + + + + + + + + + Savings Targets + + Active milestones for 2024 across your portfolio. + Monitor how close you are to each savings goal. + + +
+ RETIREMENT + $420,000 + +
+ 65% achieved + $273,000 +
+
+
+ REAL ESTATE + $85,000 + +
+ 32% achieved + $27,200 +
+
+ + You have not met your targets for this year. + +
+
+ + + + Claimable Balance + $1,211.29 +
+ +
+ Pending Setup + +
+
+
+ + Net Royalties + + $1,248.75 +
+
+ + Processing Fee + + -$37.46 +
+
+
+ + Total Ready to Claim + + + $1,211.29 USD + +
+
+ + Once your bank is connected, balances over $10 are + automatically eligible for monthly distribution on the + 15th of each month. + + + + + + + + Subscription & Billing + + Common questions about your account, plans, payments and + cancellations. + + + + + + What subscription plans do you offer? + + + + We offer three subscription tiers: Starter + ($9/month), Professional ($29/month), and Enterprise + ($99/month). Each plan includes increasing storage + limits, API access, priority support, and team + collaboration features. + + + + + + How does billing work? + + + + Billing occurs automatically at the start of each + billing cycle. We accept all major credit cards, + PayPal, and ACH transfers for enterprise customers. + + + + + + How do I cancel my subscription? + + + + You can cancel your subscription anytime from your + account settings. There are no cancellation fees or + penalties. + + + + + + Can I change plans later? + + + + Yes. Upgrades take effect immediately and downgrades + apply at the end of the current billing period. + + + + + + + + + + +
+ Deployment Status + +
+ Live + +
+ + Production rollout for the documentation site. + + +
+
+ + production + + 82% +
+ +
+
+ + + + + + Build & test + + Windows, Linux and macOS passed. + + + + 2m 14s + + + + + + + + Database migration + + Schema changes applied successfully. + + + + 38s + + + + + + + + Edge rollout + + Shifting traffic across regions. + + + + 82% + + +
+ + + + One region is warming up + + Traffic is still being shifted in eu-west. + + + +
+ + + + + + + + + Rollback release + + + Copy commit hash + + + + + +
+ + + + + + + Set a new milestone + + Define your financial target and we'll help you pace + your savings. + + + + Goal Name + + +
+ + Target Amount + + + + Target Date + + +
+ + +
+
+ + + +
+ Payout Threshold + +
+ + Set the minimum balance required before a payout is + triggered. + + + Preferred Currency + + + + + + + + USD — United States Dollar + + + CNY — Chinese Yuan + + + JPY — Japanese Yen + + + EUR — Euro + + + + + + + Minimum Payout Amount + $2500.00 +
+
+
+
+ $50 (MIN) + $10,000 (MAX) +
+ + + Notes + + + + + + + + + + Account Access + + Update your credentials or re-authenticate. + + + + Email Address + + + +
+ Current Password + +
+ +
+ + + + + + + Danger Zone + + Archive account and remove… + + + + + + +
+
+ + + + + +
+ +
+ Distribute Track + + Upload your first master to start reaching listeners + on Spotify, Apple Music, and more. + +
+ + + +
+
+
+ + + + + Notifications + + Choose which email and push alerts you want to receive. + + +
+ +
+ + Transaction alerts + + + Deposits, withdrawals, and transfers. + +
+
+
+ +
+ + Security alerts + + + Login attempts and account changes. + +
+
+
+ +
+ + Goal milestones + + + Updates at 25%, 50%, 75%, and 100%. + +
+
+
+ +
+ Market updates + + Daily portfolio summary and price alerts. + +
+
+ +
+
+ + + + + + + + + + Change transfer limit + + Adjust how much you can send from your balance. + + + + + + + + + + + + Scheduled transfers + + Set up a transfer to send at a later date. + + + + + + + + + + + + Recurring card payments + + Manage your repeated card transactions. + + + + + + + + + +
+
+ + + +
+ ); +}; + +HomeGallery.shouldPreRender = true; + +export default HomeGallery; diff --git a/examples/doc-viewer/app/components/home-grid.c b/examples/doc-viewer/app/components/home-grid.c new file mode 100644 index 00000000..63e22e81 --- /dev/null +++ b/examples/doc-viewer/app/components/home-grid.c @@ -0,0 +1,308 @@ +/* + * app/components/home-grid.c - Responsive gallery used by the doc-viewer home + * page. + * + * Cards are declared as direct children of . They are distributed + * over four flex columns once; narrow windows then hide the middle columns + * (window >=1400: 1-2-3-4, >=1024: 1-2-4, otherwise: 1-4). Keeping the + * assignment fixed avoids reshuffling cards when the window is resized. + * LCUI has no media queries, so the strategy lives in C. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "home-grid.h" + +#define HOME_GRID_COLUMNS 4 + +typedef struct { + bool pending; + bool distributing; + int visible_columns; + ui_widget_t *column_widgets[HOME_GRID_COLUMNS]; + ui_mutation_observer_t *observer; +} home_grid_data_t; + +static ui_widget_prototype_t *home_grid_proto; +static ui_widget_prototype_t *home_column_proto; + +static home_grid_data_t *home_grid_get_data(ui_widget_t *w) +{ + return ui_widget_get_data(w, home_grid_proto); +} + +static bool home_grid_is_column(ui_widget_t *w) +{ + return w->proto == home_column_proto; +} + +static bool home_grid_has_direct_cards(ui_widget_t *w) +{ + list_node_t *node; + + for (list_each(node, &w->children)) { + ui_widget_t *child = node->data; + + if (!home_grid_is_column(child)) { + return true; + } + } + return false; +} + +static void home_grid_ensure_columns(ui_widget_t *w, home_grid_data_t *data) +{ + int i; + + for (i = 0; i < HOME_GRID_COLUMNS; ++i) { + if (data->column_widgets[i]) { + continue; + } + data->column_widgets[i] = + ui_create_widget_with_prototype(home_column_proto); + ui_widget_append(w, data->column_widgets[i]); + /* Force the next visibility pass to initialize the column. */ + data->visible_columns = 0; + } +} + +static size_t home_grid_collect_cards(ui_widget_t *w, home_grid_data_t *data, + ui_widget_t **cards) +{ + size_t count = 0; + size_t i; + size_t j; + ui_widget_t *child; + list_node_t *node; + + for (i = 0; i < HOME_GRID_COLUMNS; ++i) { + for (j = 0; + (child = ui_widget_get_child(data->column_widgets[i], j)); + ++j) { + if (cards) { + cards[count] = child; + } + ++count; + } + } + for (list_each(node, &w->children)) { + child = node->data; + if (home_grid_is_column(child)) { + continue; + } + if (cards) { + cards[count] = child; + } + ++count; + } + return count; +} + +static int home_grid_column_of(ui_widget_t *card, size_t index) +{ + const char *value = ui_widget_get_attr(card, "data-column"); + + if (value) { + int column = atoi(value); + + if (column >= 1 && column <= HOME_GRID_COLUMNS) { + return column - 1; + } + } + return (int)(index % HOME_GRID_COLUMNS); +} + +/* Cards are spread over all four columns regardless of the current width so + * that hiding a column only affects which cards are visible, not where the + * remaining ones sit. */ +static void home_grid_apply(ui_widget_t *w, home_grid_data_t *data) +{ + size_t count; + size_t i; + ui_widget_t **cards; + + data->distributing = true; + home_grid_ensure_columns(w, data); + count = home_grid_collect_cards(w, data, NULL); + cards = count ? malloc(sizeof(*cards) * count) : NULL; + if (cards) { + home_grid_collect_cards(w, data, cards); + for (i = 0; i < count; ++i) { + ui_widget_append( + data->column_widgets[home_grid_column_of(cards[i], + i)], + cards[i]); + } + free(cards); + } + data->pending = false; + data->distributing = false; +} + +/* Window breakpoints: >=1400 -> 4 columns, >=1024 -> 3, otherwise 2. Read + * the root content width so transient widths of intermediate containers + * (scrollbar/padding resolution) cannot change the column count. */ +static int home_grid_columns_for_window(void) +{ + ui_widget_t *root = ui_root(); + float width; + + if (!root) { + return 0; + } + width = root->content_box.width; + if (width <= 0) { + return 0; + } + if (width >= 1400) { + return 4; + } + if (width >= 1024) { + return 3; + } + return 2; +} + +/* Wide screens show all four columns; medium hides the third one; narrow + * keeps only the first and the last one. Column widths are left to flexbox: + * every visible home-column has flex:1 1 0 and min-width:0, so the used grid + * width is divided equally without feeding fixed widths back into the scroll + * content's min-content size. */ +static void home_grid_update_visibility(ui_widget_t *w) +{ + home_grid_data_t *data = home_grid_get_data(w); + bool visible[HOME_GRID_COLUMNS] = { true, true, true, true }; + int columns; + int i; + + if (!data) { + return; + } + columns = home_grid_columns_for_window(); + if (columns == 0 || columns == data->visible_columns) { + return; + } + if (columns == 3) { + visible[2] = false; + } else if (columns == 2) { + visible[1] = false; + visible[2] = false; + } + data->visible_columns = columns; + for (i = 0; i < HOME_GRID_COLUMNS; ++i) { + ui_widget_t *column = data->column_widgets[i]; + + if (!column) { + continue; + } + ui_widget_set_style_string(column, "display", + visible[i] ? "flex" : "none"); + } + ui_widget_request_reflow(w); +} +static void home_grid_on_mutation(ui_mutation_list_t *records, + ui_mutation_observer_t *observer, void *arg) +{ + ui_widget_t *w = arg; + home_grid_data_t *data = home_grid_get_data(w); + list_node_t *node; + + if (!data || data->distributing) { + return; + } + for (list_each(node, records)) { + ui_mutation_record_t *record = node->data; + + if (record->type != UI_MUTATION_RECORD_TYPE_CHILD_LIST) { + continue; + } + /* Only newly appended cards need a placement pass. Cards that + * are already inside a column are not direct children. */ + if (home_grid_has_direct_cards(w)) { + data->pending = true; + ui_widget_request_update(w); + } + break; + } +} + +/* afterlayout is dispatched after the updater has cleared the current pass's + * flags. Updating column styles here keeps the request alive for the next + * pass; doing it from proto->resize during the current reflow would let + * ui_process_mutations() clear the column's pending style update unseen. */ +static void home_grid_on_root_afterlayout(ui_widget_t *w, ui_event_t *e, + void *arg) +{ + home_grid_update_visibility(e->data); +} + +static void home_grid_on_link(ui_widget_t *w, ui_event_t *e, void *arg) +{ + home_grid_data_t *data = home_grid_get_data(w); + + if (!data) { + return; + } + /* A pre-rendered page may attach a complete grid after its first + * mutation-observer pass. Schedule the placement now so the first + * layout after remount already uses columns and their real width. */ + if (home_grid_has_direct_cards(w)) { + data->pending = true; + } + ui_widget_request_reflow(w); +} + +static void home_grid_on_update(ui_widget_t *w, ui_task_type_t task) +{ + home_grid_data_t *data = home_grid_get_data(w); + + if (!data || data->distributing || task != UI_TASK_BEFORE_UPDATE) { + return; + } + if (data->pending) { + home_grid_apply(w, data); + } + home_grid_update_visibility(w); +} + +static void home_grid_on_destroy(ui_widget_t *w) +{ + home_grid_data_t *data = home_grid_get_data(w); + + if (ui_root()) { + ui_widget_off(ui_root(), "afterlayout", + home_grid_on_root_afterlayout, w); + } + if (data && data->observer) { + ui_mutation_observer_destroy(data->observer); + data->observer = NULL; + } +} + +static void home_grid_on_init(ui_widget_t *w) +{ + ui_mutation_observer_init_t options = { .child_list = true }; + home_grid_data_t *data = + ui_widget_add_data(w, home_grid_proto, sizeof(*data)); + + memset(data, 0, sizeof(*data)); + data->observer = ui_mutation_observer_create(home_grid_on_mutation, w); + ui_mutation_observer_observe(data->observer, w, options); + ui_widget_on(w, "link", home_grid_on_link, w); + ui_widget_on(ui_root(), "afterlayout", home_grid_on_root_afterlayout, + w); +} + +void ui_register_home_grid(void) +{ + home_column_proto = ui_create_widget_prototype("home-column", NULL); + home_grid_proto = ui_create_widget_prototype("home-grid", NULL); + home_grid_proto->init = home_grid_on_init; + home_grid_proto->update = home_grid_on_update; + home_grid_proto->destroy = home_grid_on_destroy; +} diff --git a/examples/doc-viewer/app/components/home-grid.h b/examples/doc-viewer/app/components/home-grid.h new file mode 100644 index 00000000..97e99e73 --- /dev/null +++ b/examples/doc-viewer/app/components/home-grid.h @@ -0,0 +1,11 @@ +/* + * app/components/home-grid.h - Public registration entry for the home page's + * responsive multi-column gallery. See home-grid.c for behavior. + */ + +#ifndef DOC_VIEWER_COMPONENTS_HOME_GRID_H +#define DOC_VIEWER_COMPONENTS_HOME_GRID_H + +void ui_register_home_grid(void); + +#endif diff --git a/examples/doc-viewer/app/components/navbar.c b/examples/doc-viewer/app/components/navbar.c index 688a80e1..a4022d54 100644 --- a/examples/doc-viewer/app/components/navbar.c +++ b/examples/doc-viewer/app/components/navbar.c @@ -215,17 +215,26 @@ static void navbar_apply_route(ui_widget_t *w, const char *path) { navbar_t *that = navbar_get(w); const wchar_t *title; + const char *last_segment; wchar_t buf[256]; navbar_sync_locale_from_path(w, path); if (path && that->base.refs.path) { ui_text_set_content(that->base.refs.path, path); } - title = route_title_for(path); - if (title && *title) { - swprintf(buf, 256, L"%ls \u00b7 LCUI", title); + last_segment = path ? strrchr(path, '/') : NULL; + if (last_segment && strcmp(last_segment, "/home") == 0) { + /* Mirror the product page titles used by documentation sites: + * the home title is the product name plus its tagline. */ + wcscpy(buf, + L"LCUI - The C library for building user interfaces"); } else { - wcscpy(buf, L"LCUI"); + title = route_title_for(path); + if (title && *title) { + swprintf(buf, 256, L"%ls \u00b7 LCUI", title); + } else { + wcscpy(buf, L"LCUI"); + } } ui_widget_set_title(ui_root(), buf); } @@ -300,9 +309,19 @@ ui_widget_t *ui_create_navbar(void) return ui_create_widget_with_prototype(navbar_proto); } +static void navbar_on_resize(ui_widget_t *w, float width, float height) +{ + if (width < 700.0f) { + ui_widget_add_class(w, "compact"); + } else { + ui_widget_remove_class(w, "compact"); + } +} + void ui_register_navbar(void) { navbar_init_prototype(); navbar_proto->init = navbar_init; navbar_proto->destroy = navbar_destroy; + navbar_proto->resize = navbar_on_resize; } diff --git a/examples/doc-viewer/app/components/navbar.css b/examples/doc-viewer/app/components/navbar.css index bb80037e..6fe80503 100644 --- a/examples/doc-viewer/app/components/navbar.css +++ b/examples/doc-viewer/app/components/navbar.css @@ -36,6 +36,24 @@ gap: 8px; } +/* Narrow windows: drop the path/version/GitHub columns so the three nav + * buttons keep their full width instead of being clipped by the column. */ +.navbar.compact { + padding: 0 8px; + gap: 8px; +} + +.navbar.compact .navbar-center, +.navbar.compact .navbar-version, +.navbar.compact .navbar-link { + display: none; +} + +.navbar.compact .navbar-left, +.navbar.compact .navbar-right { + flex: 0 0 auto; +} + .navbar-path { width: 100%; max-width: 320px; diff --git a/examples/doc-viewer/app/components/navbar.tsx b/examples/doc-viewer/app/components/navbar.tsx index 4194ef22..c392205d 100644 --- a/examples/doc-viewer/app/components/navbar.tsx +++ b/examples/doc-viewer/app/components/navbar.tsx @@ -12,7 +12,8 @@ export default function Navbar() { $ref="nav_home" onClick="navbar_on_nav_click" > - Home + Home + 首页
@@ -40,9 +43,7 @@ export default function Navbar() {