From 950c9a8f5e88cc3fe934846b0596419b4795d4cd Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期四, 10 四月 2025 15:42:00 +0800
Subject: [PATCH] 新增聊天室和训练场页面
---
src/components/layout/Navbar.tsx | 156 +++++++++++++++++++++++++++++++++++----------------
1 files changed, 106 insertions(+), 50 deletions(-)
diff --git a/src/components/layout/Navbar.tsx b/src/components/layout/Navbar.tsx
index 6a9a5be..5d3885a 100644
--- a/src/components/layout/Navbar.tsx
+++ b/src/components/layout/Navbar.tsx
@@ -25,11 +25,15 @@
return (
<nav
- className={`fixed top-0 left-0 w-full z-50 transition-all duration-700 ${
+ className={`fixed top-0 z-50 transition-all duration-700 h-16 w-full lg:w-[1260px] ${
scrolled
? 'bg-gradient-to-r from-[#1E2B63]/95 to-[#0A1033]/95 backdrop-blur-md shadow-lg py-2'
: 'bg-gradient-to-r from-[#1E2B63] to-[#0A1033] py-2'
}`}
+ style={{
+ left: '50%',
+ transform: 'translateX(-50%)'
+ }}
>
{/* AI绉戞妧鎰熻儗鏅晥鏋滃眰 - 璋冩暣涓烘洿鏄庢樉浣嗕笉骞叉壈浜や簰 */}
<div className="absolute inset-0 overflow-hidden pointer-events-none">
@@ -86,11 +90,11 @@
<div className="absolute top-0 left-0 w-full h-[1.5px] bg-gradient-to-r from-transparent via-[#6ADBFF]/70 to-transparent"></div>
</div>
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative">
- <div className="flex items-center justify-between">
+ <div className="w-full px-4 md:px-6 lg:px-8 h-full mx-auto relative">
+ <div className="flex items-center justify-between h-full">
{/* Logo鍖哄煙 */}
<div className="flex-shrink-0 relative z-10 group">
- <Link href="/" className="flex items-center">
+ <a href="/" className="flex items-center">
{/* Logo涓讳綋 */}
<div className="flex items-center">
<div className="relative w-11 h-11">
@@ -120,11 +124,11 @@
</h1>
</div>
</div>
- </Link>
+ </a>
</div>
{/* 绾㈡涓殑鍔ㄦ�佺鎶�鎰熷渾鍦� - 鏇存煍鍜岀殑棰滆壊 */}
- <div className="absolute left-[230px] top-1/2 -translate-y-1/2 z-10 pointer-events-none">
+ <div className="absolute left-[120px] md:left-[180px] lg:left-[230px] top-1/2 -translate-y-1/2 z-10 pointer-events-none">
<div className="relative w-8 h-8">
{/* 澶栧湀 - 鑴夊姩鏁堟灉锛岄檷浣庝笉閫忔槑搴� */}
<div className="absolute inset-0 rounded-full border-[1.5px] border-[#6ADBFF]/50 bg-[#1E2B63]/30 animate-tech-circle-pulse"></div>
@@ -152,49 +156,86 @@
</div>
{/* 瀵艰埅鑿滃崟 - 澧炲姞z-index纭繚鍦ㄥ姩鏁堜箣涓� */}
- <div className="hidden md:flex items-center space-x-8 relative z-20">
- <Link
- href="/platform"
- className="relative px-3 py-2 text-sm font-medium"
- onMouseEnter={() => setActiveMenu('platform')}
+ <div className="hidden md:flex items-center space-x-4 lg:space-x-8 relative z-20">
+ <a
+ href="/ai-scene"
+ className="relative px-2 lg:px-3 py-2 text-sm font-medium"
+ onMouseEnter={() => setActiveMenu('ai-scene')}
onMouseLeave={() => setActiveMenu('')}
>
- <span className={`relative z-10 transition-colors duration-300 ${activeMenu === 'platform' ? 'text-[#6ADBFF]' : 'text-gray-100'}`}>鏁板瓧鍛樺伐骞冲彴</span>
+ <span className={`relative z-10 transition-colors duration-300 ${activeMenu === 'ai-scene' ? 'text-[#6ADBFF]' : 'text-gray-100'}`}>AI鍦烘櫙妯℃嫙</span>
<span className={`absolute bottom-0 left-0 h-[2px] bg-gradient-to-r from-[#6ADBFF] to-transparent
- transition-all duration-300 ${activeMenu === 'platform' ? 'w-full' : 'w-0'}`}></span>
- </Link>
+ transition-all duration-300 ${activeMenu === 'ai-scene' ? 'w-full' : 'w-0'}`}></span>
+ </a>
- <Link
- href="/chat"
- className="relative px-3 py-2 text-sm font-medium"
- onMouseEnter={() => setActiveMenu('chat')}
+ <a
+ href="/chatroom"
+ className="relative px-2 lg:px-3 py-2 text-sm font-medium"
+ onMouseEnter={() => setActiveMenu('chatroom')}
onMouseLeave={() => setActiveMenu('')}
>
- <span className={`relative z-10 transition-colors duration-300 ${activeMenu === 'chat' ? 'text-[#6ADBFF]' : 'text-gray-100'}`}>鑱婂ぉ瀹�</span>
+ <span className={`relative z-10 transition-colors duration-300 ${activeMenu === 'chatroom' ? 'text-[#6ADBFF]' : 'text-gray-100'}`}>鑱婂ぉ瀹�</span>
<span className={`absolute bottom-0 left-0 h-[2px] bg-gradient-to-r from-[#6ADBFF] to-transparent
- transition-all duration-300 ${activeMenu === 'chat' ? 'w-full' : 'w-0'}`}></span>
- </Link>
+ transition-all duration-300 ${activeMenu === 'chatroom' ? 'w-full' : 'w-0'}`}></span>
+ </a>
- <Link
+ <a
href="/training"
- className="relative px-3 py-2 text-sm font-medium"
+ className="relative px-2 lg:px-3 py-2 text-sm font-medium"
onMouseEnter={() => setActiveMenu('training')}
onMouseLeave={() => setActiveMenu('')}
>
<span className={`relative z-10 transition-colors duration-300 ${activeMenu === 'training' ? 'text-[#6ADBFF]' : 'text-gray-100'}`}>璁粌鍦�</span>
<span className={`absolute bottom-0 left-0 h-[2px] bg-gradient-to-r from-[#6ADBFF] to-transparent
transition-all duration-300 ${activeMenu === 'training' ? 'w-full' : 'w-0'}`}></span>
- </Link>
+ </a>
{/* 鐧诲綍鎸夐挳 */}
- <div className="relative group ml-6">
- <button className="relative bg-gradient-to-r from-[#5E72EB] to-[#FF9190] px-7 py-2
- rounded-full text-white font-medium overflow-hidden shadow-[0_2px_10px_rgba(94,114,235,0.3)]
- hover:shadow-[0_5px_15px_rgba(94,114,235,0.5)] transition-shadow duration-300">
- <span className="relative z-10">鐧诲綍</span>
- <div className="absolute inset-0 bg-gradient-to-r from-[#FF9190] to-[#5E72EB] opacity-0
- group-hover:opacity-100 transition-opacity duration-500"></div>
- </button>
+ <div className="relative group">
+ <a href="/login" className="relative overflow-hidden flex items-center justify-center px-4 lg:px-7 py-2 rounded-full border border-[#6ADBFF]/40 bg-gradient-to-r from-[#131C41] to-[#1E2B63] hover:border-[#6ADBFF]/70 transition-all duration-300 group quantum-button">
+ <span className="relative z-10 text-white group-hover:text-[#6ADBFF] transition-colors duration-300 quantum-pulse">鐧诲綍</span>
+
+ {/* 閲忓瓙鍏夌嚎鏁堟灉 */}
+ <div className="absolute inset-0 overflow-hidden">
+ {/* 搴曞眰杈夊厜鏁堟灉 */}
+ <div className="absolute inset-0 opacity-0 group-hover:opacity-30 transition-opacity duration-500 bg-gradient-to-r from-[#6ADBFF]/20 to-[#6ADBFF]/40"></div>
+
+ {/* 閲忓瓙鎵弿绾� */}
+ <div className="absolute top-[45%] -left-10 h-[1px] w-[120%] bg-gradient-to-r from-transparent via-[#6ADBFF] to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 quantum-scan-line"></div>
+
+ {/* 閲忓瓙鏁版嵁娴� */}
+ <div className="absolute top-0 h-full w-full">
+ <div className="absolute left-[50%] top-0 bottom-0 w-[1px] bg-gradient-to-b from-transparent via-[#6ADBFF]/30 to-transparent transform scale-y-0 group-hover:scale-y-100 transition-transform duration-700 ease-out"></div>
+ </div>
+
+ {/* 閲忓瓙杈圭紭鏁堟灉 */}
+ <div className="absolute bottom-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#6ADBFF] to-transparent transform scale-x-0 group-hover:scale-x-100 transition-transform duration-700 ease-out"></div>
+ </div>
+ </a>
+ </div>
+
+ {/* 娉ㄥ唽鎸夐挳 */}
+ <div className="relative group -ml-2">
+ <a href="/register" className="relative overflow-hidden flex items-center justify-center px-4 lg:px-7 py-2 rounded-full border border-[#FF6A88]/40 bg-gradient-to-r from-[#131C41] via-[#1E2B63] to-[#2A1B48] hover:border-[#FF6A88]/70 transition-all duration-300 group quantum-button">
+ <span className="relative z-10 text-white group-hover:text-[#FF6A88] transition-colors duration-300 quantum-pulse">娉ㄥ唽</span>
+
+ {/* 閲忓瓙鍏夌嚎鏁堟灉 */}
+ <div className="absolute inset-0 overflow-hidden">
+ {/* 搴曞眰杈夊厜鏁堟灉 */}
+ <div className="absolute inset-0 opacity-0 group-hover:opacity-30 transition-opacity duration-500 bg-gradient-to-r from-[#FF6A88]/20 to-[#FF6A88]/40"></div>
+
+ {/* 閲忓瓙鎵弿绾� */}
+ <div className="absolute top-[45%] -left-10 h-[1px] w-[120%] bg-gradient-to-r from-transparent via-[#FF6A88] to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 quantum-scan-line"></div>
+
+ {/* 閲忓瓙鏁版嵁娴� */}
+ <div className="absolute top-0 h-full w-full">
+ <div className="absolute left-[50%] top-0 bottom-0 w-[1px] bg-gradient-to-b from-transparent via-[#FF6A88]/30 to-transparent transform scale-y-0 group-hover:scale-y-100 transition-transform duration-700 ease-out"></div>
+ </div>
+
+ {/* 閲忓瓙杈圭紭鏁堟灉 */}
+ <div className="absolute bottom-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#FF6A88] to-transparent transform scale-x-0 group-hover:scale-x-100 transition-transform duration-700 ease-out"></div>
+ </div>
+ </a>
</div>
</div>
@@ -202,7 +243,7 @@
<div className="md:hidden relative z-20">
<button
onClick={() => setIsMenuOpen(!isMenuOpen)}
- className="relative w-10 h-10 flex items-center justify-center focus:outline-none"
+ className="relative w-10 h-10 flex items-center justify-center focus:outline-none cursor-pointer"
aria-label="Toggle navigation menu"
>
<div className="relative">
@@ -226,35 +267,50 @@
>
<div className="p-3 space-y-1 bg-gradient-to-b from-[#1E2B63] to-[#0A1033]
border-t border-[#6ADBFF]/10">
- <Link
- href="/platform"
+ <a
+ href="/ai-scene"
className="block px-4 py-3 text-white border-l-2 border-transparent hover:border-[#6ADBFF]
- hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200"
+ hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200 cursor-pointer"
>
- 鏁板瓧鍛樺伐骞冲彴
- </Link>
+ AI鍦烘櫙妯℃嫙
+ </a>
- <Link
- href="/chat"
+ <a
+ href="/chatroom"
className="block px-4 py-3 text-white border-l-2 border-transparent hover:border-[#6ADBFF]
- hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200"
+ hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200 cursor-pointer"
>
鑱婂ぉ瀹�
- </Link>
+ </a>
- <Link
+ <a
href="/training"
className="block px-4 py-3 text-white border-l-2 border-transparent hover:border-[#6ADBFF]
- hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200"
+ hover:bg-[#3B4888]/20 rounded-r-md transition-all duration-200 cursor-pointer"
>
璁粌鍦�
- </Link>
+ </a>
- <div className="pt-3 pb-1">
- <button className="w-full bg-gradient-to-r from-[#5E72EB] to-[#FF9190]
- text-white font-medium px-6 py-2 rounded-md">
- 鐧诲綍
- </button>
+ <div className="flex space-x-2 px-4 py-3">
+ <Link href="/login" className="relative overflow-hidden flex items-center justify-center w-full px-6 py-2 rounded-full border border-[#6ADBFF]/40 bg-gradient-to-r from-[#131C41] to-[#1E2B63] text-white font-medium group cursor-pointer">
+ <span className="relative z-10 text-white group-hover:text-[#6ADBFF] transition-colors duration-300">鐧诲綍</span>
+
+ {/* 绠�鍖栫増閲忓瓙鏁堟灉 - 閫傚悎绉诲姩绔� */}
+ <div className="absolute inset-0 overflow-hidden">
+ <div className="absolute inset-0 opacity-0 group-hover:opacity-30 transition-opacity duration-500 bg-gradient-to-r from-[#6ADBFF]/20 to-[#6ADBFF]/40"></div>
+ <div className="absolute bottom-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-[#6ADBFF] to-transparent transform scale-x-0 group-hover:scale-x-100 transition-transform duration-700 ease-out"></div>
+ </div>
+ </Link>
+
+ <Link href="/register" className="relative overflow-hidden flex items-center justify-center w-full px-6 py-2 rounded-full border border-[#FF6A88]/40 bg-gradient-to-r from-[#131C41] via-[#1E2B63] to-[#2A1B48] text-white font-medium group cursor-pointer">
+ <span className="relative z-10 text-white group-hover:text-[#FF6A88] transition-colors duration-300">娉ㄥ唽</span>
+
+ {/* 绠�鍖栫増閲忓瓙鏁堟灉 - 閫傚悎绉诲姩绔� */}
+ <div className="absolute inset-0 overflow-hidden">
+ <div className="absolute inset-0 opacity-0 group-hover:opacity-30 transition-opacity duration-500 bg-gradient-to-r from-[#FF6A88]/20 to-[#FF6A88]/40"></div>
+ <div className="absolute bottom-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-[#FF6A88] to-transparent transform scale-x-0 group-hover:scale-x-100 transition-transform duration-700 ease-out"></div>
+ </div>
+ </Link>
</div>
</div>
</div>
--
Gitblit v1.9.3