From 6caf2460101657e11321e966f7daa7b6f86d2bb7 Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Mon, 16 Feb 2026 10:57:50 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=B0=83=E6=95=B4=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/globals.css | 49 +++++++++++++++++++++++++++++++++++++++++++++---- app/page.jsx | 34 ++++++++++++++++++---------------- 2 files changed, 63 insertions(+), 20 deletions(-) diff --git a/app/globals.css b/app/globals.css index 6469ab4..ca7cb9d 100644 --- a/app/globals.css +++ b/app/globals.css @@ -181,7 +181,17 @@ body { @media (max-width: 640px) { /* Default: Search hidden, Trigger visible */ .navbar-add-fund { - display: none; + display: flex; + width: 0 !important; + min-width: 0 !important; + flex: 0 0 0 !important; + opacity: 0; + overflow: hidden; + padding: 0 !important; + margin: 0 !important; + border: none; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + pointer-events: none; } .mobile-search-btn { @@ -189,20 +199,51 @@ body { } /* When search focused/active */ + .brand { + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 1; + transform: translateX(0); + width: auto; + white-space: nowrap; + } + .brand.search-focused-sibling { - display: none !important; + width: 0 !important; + opacity: 0; + overflow: hidden; + padding: 0 !important; + margin: 0 !important; + transform: translateX(-20px); + pointer-events: none; + } + + .actions { + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 1; + transform: translateX(0); + width: auto; + white-space: nowrap; } .actions.search-focused-sibling { - display: none !important; + width: 0 !important; + opacity: 0; + overflow: hidden; + padding: 0 !important; + margin: 0 !important; + transform: translateX(20px); + pointer-events: none; } .navbar-add-fund.search-focused { display: flex !important; max-width: 100% !important; width: 100% !important; - flex: 1; + flex: 1 !important; margin-top: 0 !important; + opacity: 1; + pointer-events: auto; + overflow: visible !important; } } diff --git a/app/page.jsx b/app/page.jsx index 0b31c93..b1553bc 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -10,7 +10,6 @@ import timezone from 'dayjs/plugin/timezone'; import Announcement from "./components/Announcement"; import { DatePicker, DonateTabs, NumericInput, Stat } from "./components/Common"; import { ChevronIcon, CloseIcon, CloudIcon, DragIcon, ExitIcon, EyeIcon, EyeOffIcon, GridIcon, ListIcon, LoginIcon, LogoutIcon, MailIcon, PinIcon, PinOffIcon, PlusIcon, RefreshIcon, SettingsIcon, SortIcon, StarIcon, TrashIcon, UpdateIcon, UserIcon } from "./components/Icons"; -import githubImg from "./assets/github.svg"; import weChatGroupImg from "./assets/weChatGroup.png"; import { supabase, isSupabaseConfigured } from './lib/supabase'; import { fetchFundData, fetchLatestRelease, fetchShanghaiIndexDate, fetchSmartFundNetValue, searchFunds, submitFeedback } from './api/fund'; @@ -3109,6 +3108,7 @@ export default function HomePage() { setSearchTerm(''); setSelectedFunds([]); setShowDropdown(false); + setIsSearchFocused(false); if (failures.length > 0) { setAddFailures(failures); setAddResultOpen(true); @@ -3747,7 +3747,7 @@ export default function HomePage() { initial={{ opacity: 0, width: 0, marginLeft: 0 }} animate={{ opacity: 1, width: 'auto', marginLeft: 8 }} exit={{ opacity: 0, width: 0, marginLeft: 0 }} - style={{ display: 'flex', alignItems: 'center', overflow: 'hidden' }} + style={{ display: 'flex', alignItems: 'center', overflow: 'hidden', height: 24 }} title="正在同步到云端..." >
0) ? 'search-focused' : ''}`} role="region" aria-label="添加基金">
+ {selectedFunds.length > 0 && ( +
+ {selectedFunds.map(fund => ( +
+ {fund.NAME} + +
+ ))} +
+ )}
- {selectedFunds.length > 0 && ( -
- {selectedFunds.map(fund => ( -
- {fund.NAME} - -
- ))} -
- )} setIsSearchFocused(false)} + onBlur={() => { + // 延迟关闭,以允许点击搜索结果 + setTimeout(() => setIsSearchFocused(false), 200); + }} />
{isSearching &&
} @@ -3883,7 +3886,6 @@ export default function HomePage() {
)} - 项目Github地址 window.open("https://github.com/hzm0321/real-time-fund")} /> {isMobile && (