feat: modernize frontend architecture with professional UI/UX design

Complete redesign of frontend interface with focus on usability, visual hierarchy, and professional appearance:

**Design System:**
- Implemented clean blue color theme (#3B82F6) with professional palette
- Created consistent spacing, shadows, and typography system
- Added reusable utility classes (page-header, section, status-badge-*)
- Removed excessive gradients and decorative effects

**Layout Architecture:**
- Redesigned main layout with 256px sidebar navigation
- Sidebar includes logo, navigation with descriptions, and user profile
- Main content area with search bar and scrollable content
- Replaced horizontal navigation with vertical sidebar pattern

**Page Redesigns:**
1. LoginPage: Split-screen design with branding (left) and clean form (right)
   - Feature highlights with icons and statistics
   - Mobile responsive design
   - Professional gradient background with subtle pattern

2. UploadPage: Added 3-step visual progress indicator
   - Better file organization with summary and status badges
   - Clear action bar with confirmation message
   - Improved file list presentation

3. ProcessingPage: Enhanced progress visualization
   - Large progress bar with percentage display
   - 4-column stats grid (Completed, Processing, Failed, Total)
   - Clean file status list with processing times

4. ResultsPage: Improved 5-column layout (2 for list, 3 for preview)
   - Added stats cards for accuracy, processing time, and text blocks
   - Better preview panel with detailed metrics
   - Export and translate action buttons

5. ExportPage: Better organization with 2-column layout
   - Visual format selection with icons (TXT, JSON, Excel, Markdown, PDF)
   - Improved form controls and option organization
   - Sticky preview sidebar showing current configuration

**Component Updates:**
- Updated Button component with proper variants
- Enhanced Card component with hover effects
- Maintained FileUpload component functionality
- Added lucide-react for modern iconography

**Technical Improvements:**
- Fixed Tailwind CSS v4 compatibility issues with @apply
- Removed decorative animations in favor of functional ones
- Improved accessibility with proper labels and ARIA attributes
- Better color contrast and readability

This redesign transforms the interface from a basic layout to a professional, enterprise-ready application with clear visual hierarchy and excellent usability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
beabigegg
2025-11-12 23:54:44 +08:00
parent 69302144f5
commit 21bc2f92f1
13 changed files with 1361 additions and 490 deletions

View File

@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { useAuthStore } from '@/store/authStore'
import { apiClient } from '@/services/api'
import { Lock, User, LayoutDashboard, AlertCircle, Loader2 } from 'lucide-react'
export default function LoginPage() {
const { t } = useTranslation()
@@ -39,57 +40,199 @@ export default function LoginPage() {
}
return (
<div className="min-h-screen bg-background flex items-center justify-center">
<div className="w-full max-w-md">
<div className="bg-card rounded-lg shadow-lg p-8 border">
<div className="text-center mb-8">
<h1 className="text-3xl font-bold text-foreground mb-2">{t('app.title')}</h1>
<p className="text-muted-foreground">{t('app.subtitle')}</p>
<div className="min-h-screen flex">
{/* Left side - Branding (hidden on mobile) */}
<div className="hidden lg:flex lg:flex-1 bg-gradient-to-br from-primary via-primary/90 to-accent relative overflow-hidden">
{/* Subtle background pattern */}
<div className="absolute inset-0 opacity-10">
<div className="absolute top-0 left-0 w-full h-full"
style={{ backgroundImage: 'radial-gradient(circle at 2px 2px, white 1px, transparent 0)', backgroundSize: '32px 32px' }}>
</div>
</div>
{/* Content */}
<div className="relative z-10 flex flex-col justify-center px-16 py-12 text-white">
{/* Logo & Title */}
<div className="mb-12">
<div className="flex items-center gap-4 mb-4">
<div className="w-14 h-14 bg-white/20 backdrop-blur-sm rounded-xl flex items-center justify-center">
<LayoutDashboard className="w-8 h-8" />
</div>
<div>
<h1 className="text-3xl font-bold">{t('app.title')}</h1>
<p className="text-white/80 text-sm mt-1">{t('app.subtitle')}</p>
</div>
</div>
</div>
<form onSubmit={handleSubmit} className="space-y-6">
<div>
<label htmlFor="username" className="block text-sm font-medium text-foreground mb-2">
{t('auth.username')}
</label>
<input
id="username"
type="text"
value={username}
onChange={(e) => setUsername(e.target.value)}
className="w-full px-3 py-2 border border-input bg-background rounded-md focus:outline-none focus:ring-2 focus:ring-ring"
required
/>
</div>
{/* Feature highlights */}
<div className="space-y-6 mb-12">
<h2 className="text-2xl font-semibold mb-6"></h2>
<div>
<label htmlFor="password" className="block text-sm font-medium text-foreground mb-2">
{t('auth.password')}
</label>
<input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="w-full px-3 py-2 border border-input bg-background rounded-md focus:outline-none focus:ring-2 focus:ring-ring"
required
/>
</div>
{error && (
<div className="p-3 bg-destructive/10 border border-destructive rounded-md text-sm text-destructive">
{error}
<div className="space-y-4">
<div className="flex items-start gap-3">
<div className="w-10 h-10 bg-white/20 backdrop-blur-sm rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5">
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
</svg>
</div>
<div>
<h3 className="font-semibold text-lg"></h3>
<p className="text-white/70 text-sm"> 10+ 99%</p>
</div>
</div>
)}
<button
type="submit"
disabled={loading}
className="w-full py-2 px-4 bg-primary text-primary-foreground rounded-md font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
{loading ? t('common.loading') : t('auth.loginButton')}
</button>
</form>
<div className="flex items-start gap-3">
<div className="w-10 h-10 bg-white/20 backdrop-blur-sm rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5">
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
</div>
<div>
<h3 className="font-semibold text-lg"></h3>
<p className="text-white/70 text-sm"></p>
</div>
</div>
<div className="flex items-start gap-3">
<div className="w-10 h-10 bg-white/20 backdrop-blur-sm rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5">
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<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>
<div>
<h3 className="font-semibold text-lg"></h3>
<p className="text-white/70 text-sm"></p>
</div>
</div>
</div>
</div>
{/* Statistics */}
<div className="grid grid-cols-3 gap-6">
<div className="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div className="text-3xl font-bold mb-1">99%</div>
<div className="text-white/70 text-sm"></div>
</div>
<div className="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div className="text-3xl font-bold mb-1">10+</div>
<div className="text-white/70 text-sm"></div>
</div>
<div className="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div className="text-3xl font-bold mb-1">1M+</div>
<div className="text-white/70 text-sm"></div>
</div>
</div>
</div>
</div>
{/* Right side - Login form */}
<div className="flex-1 flex items-center justify-center p-8 bg-background">
<div className="w-full max-w-md">
{/* Mobile logo (shown only on small screens) */}
<div className="lg:hidden text-center mb-8">
<div className="inline-flex items-center gap-3 mb-2">
<div className="w-10 h-10 bg-primary/20 rounded-lg flex items-center justify-center">
<LayoutDashboard className="w-6 h-6 text-primary" />
</div>
<h1 className="text-2xl font-bold text-foreground">{t('app.title')}</h1>
</div>
<p className="text-sm text-muted-foreground">{t('app.subtitle')}</p>
</div>
{/* Form card */}
<div className="bg-card rounded-xl border border-border p-8 shadow-lg">
<div className="mb-6">
<h2 className="text-2xl font-bold text-foreground mb-2">{t('auth.loginButton')}</h2>
<p className="text-sm text-muted-foreground"></p>
</div>
<form onSubmit={handleSubmit} className="space-y-5">
{/* Username field */}
<div className="space-y-2">
<label htmlFor="username" className="block text-sm font-medium text-foreground">
{t('auth.username')}
</label>
<div className="relative">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<User className="h-5 w-5 text-muted-foreground" />
</div>
<input
id="username"
type="text"
value={username}
onChange={(e) => setUsername(e.target.value)}
className="w-full pl-10 pr-4 py-2.5 bg-background border border-border rounded-lg
text-foreground placeholder-muted-foreground
focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary
transition-colors"
placeholder="輸入用戶名"
required
/>
</div>
</div>
{/* Password field */}
<div className="space-y-2">
<label htmlFor="password" className="block text-sm font-medium text-foreground">
{t('auth.password')}
</label>
<div className="relative">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<Lock className="h-5 w-5 text-muted-foreground" />
</div>
<input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="w-full pl-10 pr-4 py-2.5 bg-background border border-border rounded-lg
text-foreground placeholder-muted-foreground
focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary
transition-colors"
placeholder="輸入密碼"
required
/>
</div>
</div>
{/* Error message */}
{error && (
<div className="flex items-start gap-3 p-4 bg-destructive/10 border border-destructive/30 rounded-lg">
<AlertCircle className="h-5 w-5 text-destructive flex-shrink-0 mt-0.5" />
<p className="text-sm text-destructive">{error}</p>
</div>
)}
{/* Submit button */}
<button
type="submit"
disabled={loading}
className="w-full py-3 px-6 bg-primary text-white rounded-lg font-semibold
shadow-md hover:bg-primary-hover hover:shadow-lg
focus:outline-none focus:ring-2 focus:ring-primary/20 focus:ring-offset-2
disabled:opacity-50 disabled:cursor-not-allowed
transition-all duration-200
flex items-center justify-center gap-2"
>
{loading ? (
<>
<Loader2 className="w-5 h-5 animate-spin" />
<span>{t('common.loading')}</span>
</>
) : (
<span>{t('auth.loginButton')}</span>
)}
</button>
</form>
{/* Footer */}
<div className="mt-6 text-center">
<p className="text-xs text-muted-foreground">
Powered by <span className="font-semibold text-foreground">AI Technology</span>
</p>
</div>
</div>
</div>
</div>
</div>