From d1dcb9dbd6ff4f4824dd82da144f7d82d0e74f67 Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期二, 15 四月 2025 16:06:25 +0800
Subject: [PATCH] 注册页面优化
---
src/components/layout/ClientLayoutContent.tsx | 258 ++++++++++++++++++++++++++++++++++++++------------
1 files changed, 194 insertions(+), 64 deletions(-)
diff --git a/src/components/layout/ClientLayoutContent.tsx b/src/components/layout/ClientLayoutContent.tsx
index 05ba845..19286e6 100644
--- a/src/components/layout/ClientLayoutContent.tsx
+++ b/src/components/layout/ClientLayoutContent.tsx
@@ -1,76 +1,206 @@
"use client";
+import { ReactNode, useState, useEffect } from 'react';
import { usePathname } from 'next/navigation';
import Navbar from './Navbar';
-import Image from 'next/image';
-export default function ClientLayoutContent({ children }: { children: React.ReactNode }) {
- // 浣跨敤瀹㈡埛绔挬瀛愭鏌ヨ矾寰�
+interface ClientLayoutContentProps {
+ children: ReactNode;
+}
+
+export default function ClientLayoutContent({ children }: ClientLayoutContentProps) {
+ const [isClient, setIsClient] = useState(false);
+ const [hasError, setHasError] = useState(false);
const pathname = usePathname();
+
+ useEffect(() => {
+ setIsClient(true);
+ }, []);
+
+ // 鍒ゆ柇褰撳墠椤甸潰
const isLoginPage = pathname === '/login';
-
- if (isLoginPage) {
- return <>{children}</>;
- }
-
- return (
- <>
- <Navbar />
- <main className="min-h-screen bg-gradient-to-b from-[var(--ai-surface)] to-white pt-16">
- {children}
- </main>
- <footer className="bg-gradient-to-br from-[var(--ai-primary)] to-[var(--ai-dark)] text-white py-10">
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
- <div className="mb-8 flex justify-center flex-col items-center">
- <div className="relative w-16 h-16 mb-3">
- <Image
- src="/images/logo.jpg"
- alt="甯峰箘鍚涙垚Logo"
- width={64}
- height={64}
- className="object-contain"
- priority
- />
- </div>
- <div className="text-xl font-bold">甯峰箘鍚涙垚</div>
- <div className="text-sm text-gray-300 mt-1">鏅鸿兘鐗╂祦瑙e喅鏂规</div>
- </div>
- <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
- <div>
- <h3 className="text-lg font-semibold mb-4 text-[#F5A800]">鍏充簬鎴戜滑</h3>
- <ul className="space-y-2">
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鍏徃浠嬬粛</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鑱旂郴鏂瑰紡</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鍔犲叆鎴戜滑</li>
- </ul>
- </div>
- <div>
- <h3 className="text-lg font-semibold mb-4 text-[#F5A800]">浜у搧鏈嶅姟</h3>
- <ul className="space-y-2">
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鏁板瓧鍛樺伐</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鏅鸿兘瀹㈡湇</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鐗╂祦瑙e喅鏂规</li>
- </ul>
- </div>
- <div>
- <h3 className="text-lg font-semibold mb-4 text-[#F5A800]">甯姪涓績</h3>
- <ul className="space-y-2">
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">浣跨敤鎸囧崡</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">甯歌闂</li>
- <li className="hover:text-[#F5A800] transition-colors cursor-pointer">鎶�鏈敮鎸�</li>
- </ul>
- </div>
- </div>
- <div className="mt-8 pt-8 border-t border-opacity-20 border-[#F5A800] text-center">
- <div className="flex items-center justify-center mb-4">
- <span className="inline-block w-2 h-2 bg-[#00A0E9] rounded-full mr-2 animate-pulse"></span>
- <span className="inline-block w-2 h-2 bg-[#5D54A4] rounded-full mx-2 animate-pulse delay-300"></span>
- <span className="inline-block w-2 h-2 bg-[#F5A800] rounded-full ml-2 animate-pulse delay-500"></span>
- </div>
- <p>漏 2024 甯峰箘鍚涙垚. All rights reserved.</p>
+ const isRegisterPage = pathname === '/register';
+ const isHomePage = pathname === '/';
+ const isAIScenePage = pathname === '/ai-scene';
+ const isAISceneChatPage = pathname.startsWith('/ai-scene/chat');
+
+ // 娣诲姞閿欒鎹曡幏
+ useEffect(() => {
+ if (hasError) {
+ console.error("娓叉煋閿欒琚崟鑾凤細鍙兘鏄疛SX缁撴瀯涓嶆纭鑷寸殑姘村悎閿欒");
+ }
+ }, [hasError]);
+
+ // 閿欒澶勭悊鍑芥暟
+ const handleError = () => {
+ setHasError(true);
+ return (
+ <div className="min-h-screen bg-[#0A1033] text-white p-8">
+ <div className="max-w-lg mx-auto mt-20 bg-red-900/30 p-6 rounded-lg border border-red-500">
+ <h2 className="text-xl font-bold text-red-400 mb-4">椤甸潰娓叉煋閿欒</h2>
+ <p className="text-white mb-4">椤甸潰浠g爜涓彲鑳藉瓨鍦↗SX缁撴瀯閿欒锛岃妫�鏌ユ爣绛鹃棴鍚堟槸鍚︽纭��</p>
+ <p className="text-gray-300 text-sm">鍏蜂綋閿欒: 鍙兘鏄痬otion.div鏍囩鏈纭棴鍚堟垨宓屽灞傜骇鏈夐棶棰�</p>
+ </div>
+ </div>
+ );
+ };
+
+ // 姝ゅ嚱鏁板彲鍦ㄧ壒娈婃儏鍐典笅鐢ㄤ簬澶勭悊杩囨浮
+ const renderContent = () => {
+ if (!isClient) {
+ // 鏈嶅姟鍣ㄧ鎴栧鎴风鍒濆娓叉煋鏃舵樉绀洪潤鎬佸唴瀹�
+ return (
+ <div className="min-h-screen bg-[#0A1033] text-white">
+ <div className="opacity-50">
+ {/* 闈欐�佸唴瀹圭増鏈紝鏃犲姩鐢� */}
+ {children}
</div>
</div>
- </footer>
+ );
+ }
+
+ // 瀹㈡埛绔覆鏌撳悗鏄剧ず瀹屾暣鍐呭
+ try {
+ return (
+ <div className="animate-fadeIn">
+ <div className="flex flex-col min-h-screen">
+ {!isLoginPage && !isRegisterPage && <Navbar />}
+ <main className={`flex-1 ${isHomePage || isAIScenePage ? '' : 'bg-gradient-to-b from-[var(--ai-surface)] to-white'} pt-0 mt-0`}>
+ {children}
+ </main>
+ {!isLoginPage && !isRegisterPage && !isAISceneChatPage && (
+ <footer className="relative z-20 bg-gradient-to-br from-[#0A1033] via-[#1E2B63] to-[#131C41] text-white py-10 overflow-hidden">
+ {/* 绉戞妧鎰熷姩鎬佽儗鏅厓绱� */}
+ <div className="absolute inset-0 overflow-hidden pointer-events-none">
+ {/* 缃戞牸搴曠汗 */}
+ <div className="absolute inset-0 opacity-5"
+ style={{
+ backgroundImage: 'radial-gradient(circle, rgba(106, 219, 255, 0.3) 1px, transparent 1px)',
+ backgroundSize: '20px 20px'
+ }}>
+ </div>
+
+ {/* 姘村钩鍏夌嚎 */}
+ <div className="absolute top-1/2 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#6ADBFF]/40 to-transparent transform -translate-y-1/2"></div>
+
+ {/* 鍨傜洿鍏夌嚎 */}
+ <div className="absolute left-1/4 top-0 bottom-0 w-[1px] bg-gradient-to-b from-transparent via-[#5E72EB]/30 to-transparent"></div>
+ <div className="absolute left-3/4 top-0 bottom-0 w-[1px] bg-gradient-to-b from-transparent via-[#FF6A88]/30 to-transparent"></div>
+
+ {/* 閲忓瓙绮掑瓙鐐� - 浣跨敤鏉′欢娓叉煋 */}
+ {isClient && (
+ <>
+ <div className="absolute top-[20%] left-[10%] w-1 h-1 rounded-full bg-[#6ADBFF]/60 animate-pulse"></div>
+ <div className="absolute top-[70%] left-[90%] w-1.5 h-1.5 rounded-full bg-[#FF6A88]/60 animate-pulse" style={{animationDelay: '1.5s'}}></div>
+ <div className="absolute top-[40%] left-[60%] w-1 h-1 rounded-full bg-[#5E72EB]/60 animate-pulse" style={{animationDelay: '0.8s'}}></div>
+ </>
+ )}
+
+ {/* 搴曢儴娉㈡氮绾� */}
+ <div className="absolute bottom-0 w-full h-8 opacity-10">
+ <svg className="w-full h-full" viewBox="0 0 1200 30" preserveAspectRatio="none">
+ <path d="M0,10 Q150,20 300,10 T600,10 T900,10 T1200,10 V30 H0 Z" fill="url(#footerGradient)"></path>
+ <defs>
+ <linearGradient id="footerGradient" x1="0%" y1="0%" x2="100%" y2="0%">
+ <stop offset="0%" stopColor="#6ADBFF" />
+ <stop offset="50%" stopColor="#5E72EB" />
+ <stop offset="100%" stopColor="#FF6A88" />
+ </linearGradient>
+ </defs>
+ </svg>
+ </div>
+ </div>
+
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
+ <div className="backdrop-blur-sm bg-white/5 rounded-lg p-6 border border-[#6ADBFF]/10 transition-transform hover:scale-[1.02] hover:shadow-[0_0_15px_rgba(106,219,255,0.2)]">
+ <h3 className="text-lg font-semibold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-[#6ADBFF] to-[#F5A800]">鍏充簬鎴戜滑</h3>
+ <ul className="space-y-3">
+ <li className="hover:text-[#6ADBFF] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#6ADBFF] rounded-full mr-2 opacity-70"></span>
+ 鍏徃浠嬬粛
+ </li>
+ <li className="hover:text-[#6ADBFF] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#6ADBFF] rounded-full mr-2 opacity-70"></span>
+ 鑱旂郴鏂瑰紡
+ </li>
+ <li className="hover:text-[#6ADBFF] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#6ADBFF] rounded-full mr-2 opacity-70"></span>
+ 鍔犲叆鎴戜滑
+ </li>
+ </ul>
+ </div>
+
+ <div className="backdrop-blur-sm bg-white/5 rounded-lg p-6 border border-[#5E72EB]/10 transition-transform hover:scale-[1.02] hover:shadow-[0_0_15px_rgba(94,114,235,0.2)]">
+ <h3 className="text-lg font-semibold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-[#5E72EB] to-[#F5A800]">浜у搧鏈嶅姟</h3>
+ <ul className="space-y-3">
+ <li className="hover:text-[#5E72EB] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#5E72EB] rounded-full mr-2 opacity-70"></span>
+ 鏁板瓧鍛樺伐
+ </li>
+ <li className="hover:text-[#5E72EB] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#5E72EB] rounded-full mr-2 opacity-70"></span>
+ 鏅鸿兘瀹㈡湇
+ </li>
+ <li className="hover:text-[#5E72EB] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#5E72EB] rounded-full mr-2 opacity-70"></span>
+ APS瑙e喅鏂规
+ </li>
+ </ul>
+ </div>
+
+ <div className="backdrop-blur-sm bg-white/5 rounded-lg p-6 border border-[#FF6A88]/10 transition-transform hover:scale-[1.02] hover:shadow-[0_0_15px_rgba(255,106,136,0.2)]">
+ <h3 className="text-lg font-semibold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-[#FF6A88] to-[#F5A800]">甯姪涓績</h3>
+ <ul className="space-y-3">
+ <li className="hover:text-[#FF6A88] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#FF6A88] rounded-full mr-2 opacity-70"></span>
+ 浣跨敤鎸囧崡
+ </li>
+ <li className="hover:text-[#FF6A88] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#FF6A88] rounded-full mr-2 opacity-70"></span>
+ 甯歌闂
+ </li>
+ <li className="hover:text-[#FF6A88] transition-colors cursor-pointer flex items-center">
+ <span className="inline-block w-1.5 h-1.5 bg-[#FF6A88] rounded-full mr-2 opacity-70"></span>
+ 鎶�鏈敮鎸�
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <div className="mt-10 pt-6 border-t border-[#6ADBFF]/10 text-center relative">
+ {/* 閲忓瓙杩炴帴鐗规晥 */}
+ <div className="absolute top-0 left-1/3 right-1/3 h-[1px]">
+ <div className="relative w-full h-full">
+ <div className="absolute inset-0 bg-gradient-to-r from-transparent via-[#6ADBFF] to-transparent"></div>
+ <div className="absolute top-0 left-1/2 h-6 w-[1px] -translate-x-1/2 -translate-y-1/2 bg-gradient-to-b from-[#6ADBFF] to-transparent opacity-70"></div>
+ </div>
+ </div>
+
+ {/* 搴曢儴鑴夊啿鎸囩ず鍣� */}
+ <div className="flex items-center justify-center mb-4">
+ <span className="inline-block w-2 h-2 bg-[#6ADBFF] rounded-full mr-3 animate-pulse"></span>
+ <span className="inline-block w-2 h-2 bg-[#5E72EB] rounded-full mx-3 animate-pulse" style={{animationDelay: '0.3s'}}></span>
+ <span className="inline-block w-2 h-2 bg-[#FF6A88] rounded-full ml-3 animate-pulse" style={{animationDelay: '0.6s'}}></span>
+ </div>
+
+ <p className="text-sm text-gray-400">漏 2025 甯峰箘鍚涙垚. All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ )}
+ </div>
+ </div>
+ );
+ } catch (error) {
+ console.error("娓叉煋閿欒:", error);
+ return handleError();
+ }
+ };
+
+ return (
+ <>
+ {hasError ? handleError() : renderContent()}
</>
);
}
\ No newline at end of file
--
Gitblit v1.9.3