Procházet zdrojové kódy

✨ feat(homepage): 重构首页UI与功能,打造云存储平台风格

- 设计新的视觉风格,采用蓝紫渐变主题,增强视觉吸引力
- 重构导航栏,添加品牌标识和用户信息展示
- 实现英雄区域,突出平台核心价值主张
- 添加功能特性展示区,介绍大文件上传、文件管理等核心功能
- 增加技术架构展示,突出React、MinIO和TypeScript技术栈
- 设计文件管理功能预览区,展示核心功能和技术特性
- 优化登录/注册按钮样式,提升视觉层次感和交互体验
- 调整页脚内容,突出平台定位和技术栈信息
yourname před 4 měsíci
rodič
revize
5d547e79a8
1 změnil soubory, kde provedl 167 přidání a 49 odebrání
  1. 167 49
      src/client/home/pages/HomePage.tsx

+ 167 - 49
src/client/home/pages/HomePage.tsx

@@ -7,35 +7,47 @@ const HomePage: React.FC = () => {
   const navigate = useNavigate();
 
   return (
-    <div className="min-h-screen bg-gray-50 flex flex-col">
+    <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex flex-col">
       {/* 顶部导航 */}
-      <header className="bg-blue-600 text-white shadow-md fixed w-full z-10">
-        <div className="container mx-auto px-4 py-3 flex justify-between items-center">
-          <h1 className="text-xl font-bold">网站首页</h1>
+      <header className="bg-white shadow-sm border-b border-gray-100 fixed w-full z-10">
+        <div className="container mx-auto px-4 py-4 flex justify-between items-center">
+          <div className="flex items-center space-x-2">
+            <div className="w-8 h-8 bg-gradient-to-r from-blue-600 to-purple-600 rounded-lg flex items-center justify-center">
+              <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
+              </svg>
+            </div>
+            <h1 className="text-xl font-bold text-gray-900">云存储平台</h1>
+          </div>
+          
           {user ? (
             <div className="flex items-center space-x-4">
-              <div className="flex items-center cursor-pointer" onClick={() => navigate(`/member`)}>
-                <div className="w-8 h-8 rounded-full bg-white text-blue-600 flex items-center justify-center mr-2">
-                  <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
-                    <path fillRule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clipRule="evenodd" />
-                  </svg>
+              <button 
+                onClick={() => navigate('/admin/files')}
+                className="text-sm text-gray-600 hover:text-blue-600 transition-colors"
+              >
+                文件管理
+              </button>
+              <div className="flex items-center cursor-pointer hover:bg-gray-50 rounded-lg px-3 py-2 transition-colors" onClick={() => navigate(`/member`)}>
+                <div className="w-8 h-8 rounded-full bg-gradient-to-r from-blue-500 to-purple-500 flex items-center justify-center mr-2">
+                  <span className="text-white text-sm font-medium">{user.username.charAt(0).toUpperCase()}</span>
                 </div>
-                <span className="hidden md:inline">{user.username}</span>
+                <span className="hidden md:inline text-sm text-gray-700">{user.username}</span>
               </div>
             </div>
           ) : (
-            <div className="flex space-x-2">
+            <div className="flex space-x-3">
               <button 
                 onClick={() => navigate('/login')}
-                className="px-3 py-1 rounded text-sm bg-white text-blue-600 hover:bg-blue-50"
+                className="px-4 py-2 rounded-lg text-sm text-blue-600 hover:bg-blue-50 transition-colors"
               >
                 登录
               </button>
               <button 
                 onClick={() => navigate('/register')}
-                className="px-3 py-1 rounded text-sm bg-white text-blue-600 hover:bg-blue-50"
+                className="px-4 py-2 rounded-lg text-sm bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 transition-all shadow-sm hover:shadow-md"
               >
-                注册
+                免费注册
               </button>
             </div>
           )}
@@ -44,55 +56,161 @@ const HomePage: React.FC = () => {
       
       {/* 主内容区 */}
       <main className="flex-grow container mx-auto px-4 pt-24 pb-12">
-        <div className="bg-white rounded-lg shadow-sm p-6 md:p-8">
-          <h2 className="text-2xl font-bold text-gray-900 mb-4">欢迎使用网站模板</h2>
-          <p className="text-gray-600 mb-6">
-            这是一个通用的网站首页模板,您可以根据需要进行自定义。
-            已包含基础的登录、注册和用户中心功能。
+        {/* 英雄区域 */}
+        <div className="text-center py-12">
+          <h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6">
+            安全、高效的
+            <span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600"> 文件存储平台</span>
+          </h2>
+          <p className="text-lg text-gray-600 mb-8 max-w-2xl mx-auto">
+            基于 MinIO 构建的企业级云存储解决方案,支持大文件分片上传、断点续传、
+            文件预览与分享,为您的数据提供银行级安全保障。
           </p>
           
-          <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mt-8">
-            <div className="bg-blue-50 p-5 rounded-lg text-center">
-              <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
-                <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
-                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
-                </svg>
+          <div className="flex flex-col sm:flex-row gap-4 justify-center">
+            <button 
+              onClick={() => user ? navigate('/admin/files') : navigate('/register')}
+              className="px-8 py-3 rounded-lg bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg hover:shadow-xl"
+            >
+              {user ? '进入文件管理' : '立即开始使用'}
+            </button>
+            <button 
+              onClick={() => navigate('/admin')}
+              className="px-8 py-3 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors"
+            >
+              管理后台
+            </button>
+          </div>
+        </div>
+
+        {/* 功能特性 */}
+        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mt-16">
+          <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
+            <div className="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4">
+              <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
+              </svg>
+            </div>
+            <h3 className="font-semibold text-lg mb-2">大文件上传</h3>
+            <p className="text-gray-600 text-sm">支持分片上传,单个文件最大可达 5TB,断点续传不中断</p>
+          </div>
+          
+          <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
+            <div className="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center mb-4">
+              <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
+              </svg>
+            </div>
+            <h3 className="font-semibold text-lg mb-2">文件管理</h3>
+            <p className="text-gray-600 text-sm">完整的文件生命周期管理,支持文件预览、下载、分享和版本控制</p>
+          </div>
+          
+          <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
+            <div className="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center mb-4">
+              <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
+              </svg>
+            </div>
+            <h3 className="font-semibold text-lg mb-2">安全保障</h3>
+            <p className="text-gray-600 text-sm">端到端加密存储,多重备份机制,确保数据安全可靠</p>
+          </div>
+          
+          <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
+            <div className="w-12 h-12 bg-orange-100 rounded-lg flex items-center justify-center mb-4">
+              <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" />
+              </svg>
+            </div>
+            <h3 className="font-semibold text-lg mb-2">多端同步</h3>
+            <p className="text-gray-600 text-sm">支持Web、移动端等多平台访问,随时随地管理您的文件</p>
+          </div>
+        </div>
+
+        {/* 技术架构 */}
+        <div className="mt-16 bg-white rounded-xl p-8 shadow-sm border border-gray-100">
+          <h3 className="text-2xl font-bold text-center mb-8">技术架构</h3>
+          <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
+            <div className="text-center">
+              <div className="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
+                <span className="text-2xl font-bold text-blue-600">R</span>
               </div>
-              <h3 className="font-semibold text-lg mb-2">用户认证</h3>
-              <p className="text-gray-600 text-sm">完整的登录、注册功能,保护您的网站安全</p>
+              <h4 className="font-semibold mb-2">React 18</h4>
+              <p className="text-sm text-gray-600">现代化的前端框架,提供流畅的用户体验</p>
             </div>
-            
-            <div className="bg-green-50 p-5 rounded-lg text-center">
-              <div className="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
-                <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
-                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
-                </svg>
+            <div className="text-center">
+              <div className="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
+                <span className="text-2xl font-bold text-green-600">M</span>
+              </div>
+              <h4 className="font-semibold mb-2">MinIO</h4>
+              <p className="text-sm text-gray-600">高性能对象存储,支持S3协议的标准云存储</p>
+            </div>
+            <div className="text-center">
+              <div className="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
+                <span className="text-2xl font-bold text-purple-600">T</span>
               </div>
-              <h3 className="font-semibold text-lg mb-2">用户中心</h3>
-              <p className="text-gray-600 text-sm">用户可以查看和管理个人信息</p>
+              <h4 className="font-semibold mb-2">TypeScript</h4>
+              <p className="text-sm text-gray-600">类型安全的开发体验,提升代码质量和可维护性</p>
+            </div>
+          </div>
+        </div>
+
+        {/* 文件管理功能预览 */}
+        <div className="mt-16">
+          <div className="text-center mb-8">
+            <h3 className="text-2xl font-bold mb-4">文件管理功能一览</h3>
+            <p className="text-gray-600">完整的文件生命周期管理解决方案</p>
+          </div>
+          
+          <div className="grid grid-cols-1 md:grid-cols-2 gap-8">
+            <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100">
+              <h4 className="font-semibold text-lg mb-4 flex items-center">
+                <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 mr-2 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
+                </svg>
+                核心功能
+              </h4>
+              <ul className="space-y-2 text-sm text-gray-600">
+                <li>• 支持多种文件格式上传(图片、文档、视频、音频等)</li>
+                <li>• 大文件分片上传,支持断点续传</li>
+                <li>• 文件预览功能(图片、PDF、文本等)</li>
+                <li>• 文件搜索和分类管理</li>
+                <li>• 文件分享和权限控制</li>
+              </ul>
             </div>
             
-            <div className="bg-purple-50 p-5 rounded-lg text-center">
-              <div className="w-12 h-12 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
-                <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
-                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4" />
+            <div className="bg-white rounded-xl p-6 shadow-sm border border-gray-100">
+              <h4 className="font-semibold text-lg mb-4 flex items-center">
+                <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 mr-2 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
                 </svg>
-              </div>
-              <h3 className="font-semibold text-lg mb-2">响应式设计</h3>
-              <p className="text-gray-600 text-sm">适配各种设备屏幕,提供良好的用户体验</p>
+                技术特性
+              </h4>
+              <ul className="space-y-2 text-sm text-gray-600">
+                <li>• RESTful API 设计,支持分页查询</li>
+                <li>• 文件元数据存储(类型、大小、描述等)</li>
+                <li>• 用户关联,支持个人文件管理</li>
+                <li>• 时间戳记录,完整的操作日志</li>
+                <li>• 响应式设计,适配多端访问</li>
+              </ul>
             </div>
           </div>
         </div>
       </main>
       
       {/* 页脚 */}
-      <footer className="bg-white border-t border-gray-200 py-4">
-        <div className="container mx-auto px-4 text-center text-gray-500 text-sm">
-          网站模板 ©{new Date().getFullYear()} Created with React & Tailwind CSS
-          <div className="mt-2 space-x-4">
-            <a href="/admin" className="text-blue-600 hover:underline">管理后台</a>
-            <span className="text-gray-300">|</span>
-            <a href="/ui" className="text-blue-600 hover:underline">Api</a>
+      <footer className="bg-white border-t border-gray-100 py-8">
+        <div className="container mx-auto px-4">
+          <div className="text-center">
+            <p className="text-gray-600 mb-4">
+              基于 MinIO 的企业级云存储解决方案
+            </p>
+            <div className="flex justify-center space-x-6 text-sm">
+              <a href="/admin" className="text-blue-600 hover:text-blue-700 transition-colors">管理后台</a>
+              <a href="/ui" className="text-blue-600 hover:text-blue-700 transition-colors">API 文档</a>
+            </div>
+            <p className="text-gray-400 text-xs mt-4">
+              © {new Date().getFullYear()} 云存储平台. Built with React, TypeScript & MinIO
+            </p>
           </div>
         </div>
       </footer>