Implement community forum integration in CommunityPage; update BottomNav to conditionally display community tab based on screen size. Add new audio processing function for combined PEQ magnitude calculation in peqAudio.

This commit is contained in:
yangy
2026-05-12 15:13:20 +08:00
parent 2b1c69460f
commit c639c77383
4 changed files with 68 additions and 26 deletions
+23 -1
View File
@@ -2,6 +2,7 @@
BOTTOM NAV — Luxsin X9 Controller (Mobile)
Design: iOS/Android App-style bottom tab bar
5 tabs — labels from locales/bottomNav, language = deviceState.language (同系统页)
- 社区:仅桌面宽屏(lg ≥1024px)显示,手机等小屏隐藏
- Active tab: cyan icon + top indicator bar
- Inactive: muted icon + label
============================================================ */
@@ -30,6 +31,8 @@ interface NavItem {
labelKey: keyof BottomNavLocale;
}
const FORUM_URL = "https://forum.zidoo.tv/index.php";
const NAV_ITEMS: NavItem[] = [
{ path: "/community", icon: MessageSquare, labelKey: "community" },
{ path: "/eq", icon: Sliders, labelKey: "hpEq" },
@@ -51,6 +54,12 @@ export default function BottomNav() {
return (pack.bottomNav ?? localeZh.bottomNav) as BottomNavLocale;
}, [deviceState?.language]);
/** 社区入口仅在桌面级视口显示(与 useIsLgUp / Tailwind lg 一致) */
const visibleNavItems = useMemo(
() => NAV_ITEMS.filter((item) => item.path !== "/community" || isLgUp),
[isLgUp],
);
return (
<nav
className="fixed bottom-0 left-0 right-0 z-50 lg:left-1/2 lg:right-auto lg:w-[min(1180px,calc(100vw-3rem))] lg:-translate-x-1/2"
@@ -64,7 +73,7 @@ export default function BottomNav() {
}}
>
<div className="flex items-stretch justify-around">
{NAV_ITEMS.map((item) => {
{visibleNavItems.map((item) => {
const isActive =
item.path === "/ai"
? location === "/ai" || (isLgUp && aiDrawerOpen)
@@ -122,6 +131,19 @@ export default function BottomNav() {
</div>
);
if (item.path === "/community") {
return (
<button
key={item.path}
type="button"
className="cursor-pointer border-0 bg-transparent p-0 text-inherit outline-none focus-visible:ring-2 focus-visible:ring-[#00FFF6]/40 focus-visible:ring-offset-2 focus-visible:ring-offset-[rgba(10,10,12,0.96)]"
onClick={() => window.open(FORUM_URL, "_blank", "noopener,noreferrer")}
>
{inner}
</button>
);
}
if (item.path === "/ai") {
if (!isLgUp) {
return (