From 3a9dcdbc7a9764033c366d4868626cc60604d364 Mon Sep 17 00:00:00 2001 From: lintsinghua Date: Thu, 18 Dec 2025 20:47:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=89=8D=E7=AB=AF):=20=E5=A2=9E=E5=BC=BAU?= =?UTF-8?q?I=E7=BB=84=E4=BB=B6=E8=A7=86=E8=A7=89=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E5=92=8C=E4=BA=A4=E4=BA=92=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor(认证): 支持记住我功能并优化token存储逻辑 style(字体): 更新字体配置增加CJK回退支持 perf(全局样式): 添加新动画效果和视觉增强样式 fix(AlertDialog): 修复portal容器定位问题 --- frontend/src/assets/styles/globals.css | 207 +++++++-- frontend/src/components/layout/Sidebar.tsx | 185 +++++--- frontend/src/components/ui/alert-dialog.tsx | 20 +- .../AgentAudit/components/AgentTreeNode.tsx | 168 +++---- .../pages/AgentAudit/components/Header.tsx | 92 ++-- .../pages/AgentAudit/components/LogEntry.tsx | 151 ++++--- .../AgentAudit/components/SplashScreen.tsx | 419 ++++++++++++++---- .../AgentAudit/components/StatsPanel.tsx | 292 +++++++----- frontend/src/pages/AgentAudit/index.tsx | 204 +++++---- frontend/src/pages/Login.tsx | 2 +- frontend/src/shared/api/serverClient.ts | 6 +- frontend/src/shared/context/AuthContext.tsx | 20 +- frontend/tailwind.config.js | 4 +- 13 files changed, 1180 insertions(+), 590 deletions(-) diff --git a/frontend/src/assets/styles/globals.css b/frontend/src/assets/styles/globals.css index 58a1b22..66e3256 100644 --- a/frontend/src/assets/styles/globals.css +++ b/frontend/src/assets/styles/globals.css @@ -5,11 +5,20 @@ @font-face { font-family: 'ArkPixel'; src: url('/fonts/ark-pixel-12px-monospaced-zh_cn.ttf.woff2') format('woff2'); - font-weight: normal; + font-weight: 100 900; font-style: normal; font-display: swap; } +/* CJK fallback font with consistent weight */ +@font-face { + font-family: 'CJK Fallback'; + src: local('PingFang SC'), local('Microsoft YaHei'), local('Noto Sans SC'), local('Hiragino Sans GB'); + font-weight: 100 900; + font-style: normal; + unicode-range: U+4E00-9FFF, U+3400-4DBF, U+F900-FAFF, U+FE30-FE4F; +} + /* DeepAudit Design System v3.1 Theme System with CSS Variables @@ -729,51 +738,53 @@ to { opacity: 1; transform: translateY(0); } } + @keyframes shimmer { + 0% { transform: translateX(-100%); } + 100% { transform: translateX(100%); } + } + + @keyframes float { + 0%, 100% { + transform: translateY(0) translateX(0); + opacity: 0.3; + } + 25% { + transform: translateY(-20px) translateX(10px); + opacity: 0.6; + } + 50% { + transform: translateY(-40px) translateX(-5px); + opacity: 0.3; + } + 75% { + transform: translateY(-20px) translateX(-10px); + opacity: 0.5; + } + } + + @keyframes grid-pulse { + 0%, 100% { opacity: 0.03; } + 50% { opacity: 0.05; } + } + + @keyframes glow-pulse { + 0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 44, 0.2); } + 50% { box-shadow: 0 0 30px rgba(255, 107, 44, 0.4); } + } + + @keyframes border-glow { + 0%, 100% { border-color: rgba(255, 107, 44, 0.3); } + 50% { border-color: rgba(255, 107, 44, 0.6); } + } + .animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; } .animate-blink { animation: blink 1s step-end infinite; } .animate-fade-slide-in { animation: fadeSlideIn 0.3s ease-out forwards; } - - /* ============ Corner Decorations ============ */ - .corner-decoration { - position: absolute; - font-size: 11px; - font-family: monospace; - z-index: 30; - color: var(--cyber-text-muted); - letter-spacing: 0.1em; - } - - .corner-tl { top: 0.75rem; left: 0.75rem; } - .corner-tr { top: 0.75rem; right: 0.75rem; text-align: right; } - .corner-bl { bottom: 0.75rem; left: 0.75rem; } - .corner-br { bottom: 0.75rem; right: 0.75rem; text-align: right; } - - /* ============ HUD Elements ============ */ - .hud-border { - position: relative; - } - - .hud-border::before, - .hud-border::after { - content: ''; - position: absolute; - width: 10px; - height: 10px; - } - - .hud-border::before { - top: 0; - left: 0; - border-top: 2px solid var(--cyber-border-accent); - border-left: 2px solid var(--cyber-border-accent); - } - - .hud-border::after { - bottom: 0; - right: 0; - border-bottom: 2px solid var(--cyber-border-accent); - border-right: 2px solid var(--cyber-border-accent); - } + .animate-shimmer { animation: shimmer 2s ease-in-out infinite; } + .animate-float { animation: float 10s ease-in-out infinite; } + .animate-grid-pulse { animation: grid-pulse 4s ease-in-out infinite; } + .animate-glow-pulse { animation: glow-pulse 2s ease-in-out infinite; } + .animate-border-glow { animation: border-glow 2s ease-in-out infinite; } /* ============ Data Display ============ */ .data-value { @@ -917,4 +928,114 @@ border-top: 1px solid var(--cyber-border); background: var(--cyber-bg-elevated); } + + /* ============ Enhanced Visual Effects ============ */ + + /* Scanline overlay effect */ + .scanline-overlay { + background-image: repeating-linear-gradient( + 0deg, + transparent, + transparent 2px, + rgba(0, 0, 0, 0.03) 2px, + rgba(0, 0, 0, 0.03) 4px + ); + pointer-events: none; + } + + /* Text glow effects */ + .text-glow-primary { + text-shadow: 0 0 10px rgba(255, 107, 44, 0.5), 0 0 20px rgba(255, 107, 44, 0.3); + } + + .text-glow-success { + text-shadow: 0 0 10px rgba(52, 211, 153, 0.5), 0 0 20px rgba(52, 211, 153, 0.3); + } + + .text-glow-cyan { + text-shadow: 0 0 10px rgba(6, 182, 212, 0.5), 0 0 20px rgba(6, 182, 212, 0.3); + } + + /* Glass morphism effect */ + .glass { + background: rgba(255, 255, 255, 0.05); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.1); + } + + .dark .glass { + background: rgba(0, 0, 0, 0.3); + border: 1px solid rgba(255, 255, 255, 0.05); + } + + /* Gradient borders */ + .gradient-border { + position: relative; + } + + .gradient-border::before { + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + padding: 1px; + background: linear-gradient(135deg, rgba(255, 107, 44, 0.5), transparent, rgba(255, 107, 44, 0.5)); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + pointer-events: none; + } + + /* Hover lift effect */ + .hover-lift { + transition: transform 0.3s ease, box-shadow 0.3s ease; + } + + .hover-lift:hover { + transform: translateY(-2px); + box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); + } + + /* Border left accent with gradient */ + .border-l-3 { + border-left-width: 3px; + } + + /* Smooth transitions for interactive elements */ + .interactive { + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); + } + + /* Focus ring enhancement */ + .focus-ring:focus-visible { + outline: none; + box-shadow: 0 0 0 2px var(--cyber-bg), 0 0 0 4px hsl(var(--primary) / 0.5); + } + + /* Subtle background patterns */ + .pattern-dots { + background-image: radial-gradient(circle, var(--cyber-border) 1px, transparent 1px); + background-size: 20px 20px; + } + + /* Animated underline */ + .animated-underline { + position: relative; + } + + .animated-underline::after { + content: ''; + position: absolute; + bottom: -2px; + left: 0; + width: 0; + height: 2px; + background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary) / 0.5)); + transition: width 0.3s ease; + } + + .animated-underline:hover::after { + width: 100%; + } } diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index 335fab8..f650443 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -1,6 +1,6 @@ /** * Sidebar Component - * Cyberpunk Terminal Aesthetic + * Premium Terminal Aesthetic with Enhanced Visual Design */ import { useState } from "react"; @@ -23,21 +23,22 @@ import { Shield, MessageSquare, Bot, + ExternalLink, } from "lucide-react"; import routes from "@/app/routes"; import { version } from "../../../package.json"; -// Icon mapping for routes +// Icon mapping for routes with consistent sizing const routeIcons: Record = { - "/": , - "/dashboard": , - "/projects": , - "/instant-analysis": , - "/audit-tasks": , - "/audit-rules": , - "/prompts": , - "/admin": , - "/recycle-bin": , + "/": , + "/dashboard": , + "/projects": , + "/instant-analysis": , + "/audit-tasks": , + "/audit-rules": , + "/prompts": , + "/admin": , + "/recycle-bin": , }; interface SidebarProps { @@ -89,65 +90,77 @@ export default function Sidebar({ collapsed, setCollapsed }: SidebarProps) { }} >
+ {/* Subtle gradient background */} +
+ {/* Subtle grid background */}
- {/* Logo Section */} + {/* Right edge glow */} +
+ + {/* Logo Section with enhanced styling */}
+ {/* Bottom accent line */} +
+ setMobileOpen(false)} > - {/* Logo Icon */} + {/* Logo Icon with enhanced styling */}
DeepAudit
{/* Glow effect */} -
+
- {/* Logo Text */} + {/* Logo Text with enhanced styling */}
DEEP AUDIT
+
+ Security Agent +
- {/* Collapse button */} + {/* Collapse button with enhanced styling */}
- {/* Navigation */} -