修复:主界面下拉出现两个重复的回到页面顶部按钮。注释了NavBar.tsx中的按钮,保留并修改了scrollToTop.tsx中的按钮样式。

This commit is contained in:
2026-01-13 20:32:13 +08:00
parent f1e8437d31
commit 6b7a057cb4
2 changed files with 3 additions and 3 deletions

View File

@@ -464,7 +464,7 @@ export default function Navbar() {
</motion.nav> </motion.nav>
{/* 返回顶部按钮 */} {/* 返回顶部按钮 */}
<AnimatePresence> {/* <AnimatePresence>
{showScrollTop && ( {showScrollTop && (
<motion.button <motion.button
initial={{ opacity: 0, scale: 0.8, y: 20 }} initial={{ opacity: 0, scale: 0.8, y: 20 }}
@@ -485,7 +485,7 @@ export default function Navbar() {
</motion.div> </motion.div>
</motion.button> </motion.button>
)} )}
</AnimatePresence> </AnimatePresence> */}
</> </>
); );
} }

View File

@@ -41,7 +41,7 @@ export default function ScrollToTop() {
exit={{ opacity: 0, scale: 0.8, y: 20 }} exit={{ opacity: 0, scale: 0.8, y: 20 }}
transition={{ duration: 0.2, ease: 'easeOut' }} transition={{ duration: 0.2, ease: 'easeOut' }}
onClick={scrollToTop} onClick={scrollToTop}
className="fixed bottom-6 right-6 w-12 h-12 bg-gradient-to-br from-orange-500 to-orange-600 hover:from-orange-600 hover:to-orange-700 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 flex items-center justify-center z-40 group" className="fixed bottom-6 right-6 w-12 h-12 bg-gradient-to-br from-orange-400/70 to-amber-300/70 hover:from-orange-600/70 hover:to-orange-700/70 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 flex items-center justify-center z-40 group"
whileHover={{ scale: 1.1, y: -2 }} whileHover={{ scale: 1.1, y: -2 }}
whileTap={{ scale: 0.9 }} whileTap={{ scale: 0.9 }}
> >