From 8dc4ddac668f271bf71d31159684ad1b1e486f37 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Thu, 13 Nov 2025 17:45:09 +0800 Subject: [PATCH] update ui --- src/views/Community/components/HeroPanel.js | 36 ++++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/views/Community/components/HeroPanel.js b/src/views/Community/components/HeroPanel.js index 3b00a153..9daad7fd 100644 --- a/src/views/Community/components/HeroPanel.js +++ b/src/views/Community/components/HeroPanel.js @@ -63,7 +63,7 @@ const fetchIndexKline = async (indexCode) => { }; /** - * 获取热门概念数据(用于词云图) + * 获取热门概念数据(用于流动动画) */ const fetchPopularConcepts = async () => { try { @@ -74,7 +74,7 @@ const fetchPopularConcepts = async () => { }, body: JSON.stringify({ query: '', - size: 18, // 只获取前18个概念 + size: 80, // 获取前80个概念 page: 1, sort_by: 'change_pct' }) @@ -455,25 +455,29 @@ const ConceptFlowAnimation = () => { ); } - // 将概念分成3行 - const rows = [ - concepts.slice(0, 6), - concepts.slice(6, 12), - concepts.slice(12, 18) - ]; + // 将 80 个概念均匀分成 5 行(每行 16 个) + const rowCount = 5; + const conceptsPerRow = Math.ceil(concepts.length / rowCount); + const rows = []; + + for (let i = 0; i < rowCount; i++) { + const start = i * conceptsPerRow; + const end = Math.min(start + conceptsPerRow, concepts.length); + rows.push(concepts.slice(start, end)); + } return ( - + {rows.map((row, rowIndex) => { - // 每行不同的速度:第一行20秒,第二行25秒,第三行30秒 - const duration = 25 + rowIndex * 5; + // 每行不同的速度:第一行30秒,第二行35秒,依次递增 + const duration = 30 + rowIndex * 5; return ( { return ( { }} onClick={() => handleConceptClick(concept.name)} _hover={{ - transform: 'scale(1.15)', + transform: 'scale(1.1)', bg: 'whiteAlpha.300', boxShadow: `0 0 20px ${color}80`, zIndex: 100