Forráskód Böngészése

✨ feat(homepage): 重构首页为云存储平台风格

- 修改页面整体布局,采用蓝色到紫色的渐变背景,增强视觉层次感
- 优化导航栏设计,添加品牌标识,调整登录/注册按钮样式
- 新增英雄区域,突出文件存储平台的核心价值主张
- 设计功能特性展示区,包含大文件上传、文件管理、安全保障和多端同步
- 添加技术架构展示,突出React、MinIO和TypeScript核心技术栈
- 新增文件管理功能预览区,展示核心功能和技术特性
- 更新页脚内容,突出云存储解决方案的定位

💄 style(ui): 更新组件样式和交互效果

- 移除shadcn/ui组件依赖,采用原生Tailwind样式
- 设计新的卡片组件样式,添加悬停效果和阴影过渡
- 优化按钮样式,使用渐变背景增强视觉吸引力
- 更新图标系统,使用svg图标替代lucide-react
- 调整排版层次,优化文字大小和颜色对比

🔧 chore(content): 更新页面文本内容

- 将通用网站模板改为云存储平台专属内容
- 更新描述文本,突出MinIO存储解决方案的特点
- 添加文件存储相关功能描述
- 调整CTA按钮文本,引导用户使用文件管理功能
- 更新页脚版权信息和链接
yourname 4 hónapja
szülő
commit
e28a5174db
1 módosított fájl, 186 hozzáadás és 175 törlés
  1. 186 175
      src/client/home-shadcn/pages/HomePage.tsx

+ 186 - 175
src/client/home-shadcn/pages/HomePage.tsx

@@ -1,205 +1,216 @@
 import React from 'react';
 import { useAuth } from '@/client/home-shadcn/hooks/AuthProvider';
 import { useNavigate } from 'react-router-dom';
-import { Button } from '@/client/components/ui/button';
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/client/components/ui/card';
-import { Avatar, AvatarFallback, AvatarImage } from '@/client/components/ui/avatar';
-import { Badge } from '@/client/components/ui/badge';
-import { 
-  ShieldCheck, 
-  UserCircle, 
-  Smartphone, 
-  LogIn, 
-  UserPlus,
-  ExternalLink
-} from 'lucide-react';
 
 const HomePage: React.FC = () => {
   const { user } = useAuth();
   const navigate = useNavigate();
 
   return (
-    <div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100">
+    <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex flex-col">
       {/* 顶部导航 */}
-      <header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
-        <div className="container mx-auto flex h-16 items-center justify-between">
+      <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">
-            <ShieldCheck className="h-6 w-6 text-primary" />
-            <h1 className="text-xl font-bold">网站首页</h1>
+            <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>
           
-          <div className="flex items-center space-x-4">
-            {user ? (
-              <div 
-                className="flex items-center space-x-3 cursor-pointer hover:bg-muted/50 rounded-lg px-3 py-2 transition-colors"
-                onClick={() => navigate('/member')}
+          {user ? (
+            <div className="flex items-center space-x-4">
+              <a
+                href="/admin/files"
+                className="text-sm text-gray-600 hover:text-blue-600 transition-colors"
               >
-                <Avatar className="h-8 w-8">
-                  <AvatarImage src={`https://avatar.vercel.sh/${user.username}`} />
-                  <AvatarFallback className="bg-primary text-primary-foreground">
-                    {user.username?.charAt(0).toUpperCase()}
-                  </AvatarFallback>
-                </Avatar>
-                <span className="hidden md:inline text-sm font-medium">{user.username}</span>
-              </div>
-            ) : (
-              <div className="flex items-center space-x-2">
-                <Button
-                  variant="ghost"
-                  size="sm"
-                  onClick={() => navigate('/login')}
-                  className="flex items-center space-x-1"
-                >
-                  <LogIn className="h-4 w-4" />
-                  <span>登录</span>
-                </Button>
-                <Button
-                  size="sm"
-                  onClick={() => navigate('/register')}
-                  className="flex items-center space-x-1"
-                >
-                  <UserPlus className="h-4 w-4" />
-                  <span>注册</span>
-                </Button>
+                文件管理
+              </a>
+              <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 text-sm text-gray-700">{user.username}</span>
               </div>
-            )}
-          </div>
+            </div>
+          ) : (
+            <div className="flex space-x-3">
+              <button 
+                onClick={() => navigate('/login')}
+                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-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>
+          )}
         </div>
       </header>
-
+      
       {/* 主内容区 */}
-      <main className="container mx-auto py-8">
-        <div className="mx-auto max-w-6xl space-y-8">
-          {/* 欢迎区域 */}
-          <Card className="border-0 shadow-lg">
-            <CardHeader>
-              <CardTitle className="text-3xl font-bold bg-gradient-to-r from-primary to-purple-600 bg-clip-text text-transparent">
-                欢迎使用网站模板
-              </CardTitle>
-              <CardDescription className="text-lg">
-                这是一个现代化的网站首页模板,采用 shadcn/ui 设计系统构建
-              </CardDescription>
-            </CardHeader>
-            <CardContent>
-              <p className="text-muted-foreground">
-                已集成完整的用户认证系统,包含登录、注册和用户中心功能。
-                使用 React 19 + TypeScript + shadcn/ui + Tailwind CSS 技术栈。
-              </p>
-            </CardContent>
-          </Card>
-
-          {/* 功能特性卡片 */}
-          <div className="grid gap-6 md:grid-cols-3">
-            <Card className="border-0 shadow-lg hover:shadow-xl transition-shadow">
-              <CardHeader>
-                <div className="flex items-center space-x-2">
-                  <div className="p-2 bg-blue-100 rounded-lg">
-                    <ShieldCheck className="h-6 w-6 text-blue-600" />
-                  </div>
-                  <CardTitle className="text-lg">用户认证</CardTitle>
-                </div>
-              </CardHeader>
-              <CardContent>
-                <CardDescription>
-                  完整的登录、注册功能,基于 JWT 的现代化认证系统
-                </CardDescription>
-                <Badge variant="secondary" className="mt-2">安全认证</Badge>
-              </CardContent>
-            </Card>
-
-            <Card className="border-0 shadow-lg hover:shadow-xl transition-shadow">
-              <CardHeader>
-                <div className="flex items-center space-x-2">
-                  <div className="p-2 bg-green-100 rounded-lg">
-                    <UserCircle className="h-6 w-6 text-green-600" />
-                  </div>
-                  <CardTitle className="text-lg">用户中心</CardTitle>
-                </div>
-              </CardHeader>
-              <CardContent>
-                <CardDescription>
-                  用户可以查看和管理个人信息,支持头像上传和个人资料编辑
-                </CardDescription>
-                <Badge variant="secondary" className="mt-2">个人管理</Badge>
-              </CardContent>
-            </Card>
+      <main className="flex-grow container mx-auto px-4 pt-24 pb-12">
+        {/* 英雄区域 */}
+        <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="flex flex-col sm:flex-row gap-4 justify-center">
+            <a
+              href={user ? '/admin/files' : '/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 ? '进入文件管理' : '立即开始使用'}
+            </a>
+            <a
+              href="/admin"
+              className="px-8 py-3 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors"
+            >
+              管理后台
+            </a>
+          </div>
+        </div>
 
-            <Card className="border-0 shadow-lg hover:shadow-xl transition-shadow">
-              <CardHeader>
-                <div className="flex items-center space-x-2">
-                  <div className="p-2 bg-purple-100 rounded-lg">
-                    <Smartphone className="h-6 w-6 text-purple-600" />
-                  </div>
-                  <CardTitle className="text-lg">响应式设计</CardTitle>
-                </div>
-              </CardHeader>
-              <CardContent>
-                <CardDescription>
-                  适配各种设备屏幕,采用移动端优先的设计理念
-                </CardDescription>
-                <Badge variant="secondary" className="mt-2">移动优先</Badge>
-              </CardContent>
-            </Card>
+        {/* 功能特性 */}
+        <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>
 
-          {/* 快速链接 */}
-          <Card className="border-0 shadow-lg">
-            <CardHeader>
-              <CardTitle className="flex items-center space-x-2">
-                <ExternalLink className="h-5 w-5" />
-                <span>快速访问</span>
-              </CardTitle>
-            </CardHeader>
-            <CardContent>
-              <div className="flex flex-wrap gap-4">
-                <Button
-                  variant="outline"
-                  onClick={() => window.open('/admin', '_blank')}
-                  className="flex items-center space-x-2"
-                >
-                  <span>管理后台</span>
-                  <ExternalLink className="h-4 w-4" />
-                </Button>
-                <Button
-                  variant="outline"
-                  onClick={() => window.open('/ui', '_blank')}
-                  className="flex items-center space-x-2"
-                >
-                  <span>API 文档</span>
-                  <ExternalLink className="h-4 w-4" />
-                </Button>
+        {/* 技术架构 */}
+        <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>
-            </CardContent>
-          </Card>
+              <h4 className="font-semibold mb-2">React 18</h4>
+              <p className="text-sm text-gray-600">现代化的前端框架,提供流畅的用户体验</p>
+            </div>
+            <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>
+              <h4 className="font-semibold mb-2">TypeScript</h4>
+              <p className="text-sm text-gray-600">类型安全的开发体验,提升代码质量和可维护性</p>
+            </div>
+          </div>
         </div>
-      </main>
 
+        {/* 文件管理功能预览 */}
+        <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-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>
+                技术特性
+              </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="border-t bg-background">
-        <div className="container mx-auto py-6">
-          <div className="flex flex-col items-center justify-center space-y-2">
-            <p className="text-sm text-muted-foreground">
-              网站模板 ©{new Date().getFullYear()} Created with React & shadcn/ui
+      <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 items-center space-x-4 text-sm">
-              <Button
-                variant="link"
-                size="sm"
-                onClick={() => window.open('/admin', '_blank')}
-                className="text-muted-foreground hover:text-primary"
-              >
-                管理后台
-              </Button>
-              <span className="text-muted-foreground">•</span>
-              <Button
-                variant="link"
-                size="sm"
-                onClick={() => window.open('/ui', '_blank')}
-                className="text-muted-foreground hover:text-primary"
-              >
-                API 文档
-              </Button>
+            <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>