# Novalon 官网重新设计实施计划 > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. **Goal:** 将 Novalon 官网从现有设计升级为深色科技风格的现代化企业网站 **Architecture:** 采用 Next.js 16 App Router + React 19 + TypeScript + Tailwind CSS v4 技术栈,基于组件化设计,实现深色科技风格的视觉系统和流畅的用户体验 **Tech Stack:** Next.js 16, React 19, TypeScript 5, Tailwind CSS v4, Framer Motion, AntV G2, shadcn/ui --- ## 前置准备 ### Task 0: 创建开发分支 **Files:** - None **Step 1: 检查当前分支状态** Run: `git status` Expected: 工作目录干净,在 main 或 develop 分支 **Step 2: 创建新的功能分支** Run: `git checkout -b feature/website-redesign` Expected: 切换到新分支 feature/website-redesign **Step 3: 推送分支到远程** Run: `git push -u origin feature/website-redesign` Expected: 分支推送到远程仓库 --- ## 阶段一:基础架构搭建 ### Task 1: 安装必要依赖 **Files:** - Modify: `package.json` **Step 1: 安装动画库** Run: `npm install framer-motion` Expected: framer-motion 安装成功 **Step 2: 安装图表库** Run: `npm install @antv/g2` Expected: @antv/g2 安装成功 **Step 3: 安装 CVA(如果尚未安装)** Run: `npm install class-variance-authority` Expected: class-variance-authority 安装成功 **Step 4: 验证安装** Run: `npm list framer-motion @antv/g2 class-variance-authority` Expected: 显示已安装的版本信息 **Step 5: 提交依赖更新** Run: ```bash git add package.json package-lock.json git commit -m "chore: add framer-motion, @antv/g2, and class-variance-authority dependencies" ``` Expected: 提交成功 --- ### Task 2: 扩展 Tailwind 配置 **Files:** - Modify: `tailwind.config.ts`(如果不存在则创建) **Step 1: 检查 Tailwind 配置文件** Run: `ls -la | grep tailwind` Expected: 显示 tailwind 配置文件 **Step 2: 读取现有配置** Read: `tailwind.config.ts` **Step 3: 扩展配置添加深色主题色彩** Modify: `tailwind.config.ts` ```typescript import type { Config } from "tailwindcss"; export default { content: [ "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", "./src/components/**/*.{js,ts,jsx,tsx,mdx}", "./src/app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: { colors: { dark: { DEFAULT: "#0A0A0A", secondary: "#1A1A1A", tertiary: "#2A2A2A", }, tech: { blue: "#00D9FF", purple: "#A855F7", cyan: "#06B6D4", }, }, fontFamily: { sans: ["Inter", "system-ui", "sans-serif"], mono: ["JetBrains Mono", "monospace"], }, animation: { "fade-in-up": "fadeInUp 0.6s ease-out", "fade-in-scale": "fadeInScale 0.6s ease-out", glow: "glow 2s ease-in-out infinite", float: "float 3s ease-in-out infinite", }, keyframes: { fadeInUp: { "0%": { opacity: "0", transform: "translateY(20px)" }, "100%": { opacity: "1", transform: "translateY(0)" }, }, fadeInScale: { "0%": { opacity: "0", transform: "scale(0.95)" }, "100%": { opacity: "1", transform: "scale(1)" }, }, glow: { "0%, 100%": { boxShadow: "0 0 20px rgba(0, 217, 255, 0.3)" }, "50%": { boxShadow: "0 0 40px rgba(0, 217, 255, 0.6)" }, }, float: { "0%, 100%": { transform: "translateY(0px)" }, "50%": { transform: "translateY(-10px)" }, }, }, }, }, plugins: [], } satisfies Config; ``` **Step 4: 验证配置语法** Run: `npx tsc --noEmit tailwind.config.ts` Expected: 无错误输出 **Step 5: 提交配置更新** Run: ```bash git add tailwind.config.ts git commit -m "feat: extend Tailwind config with dark theme and tech colors" ``` Expected: 提交成功 --- ### Task 3: 更新全局样式 **Files:** - Modify: `src/app/globals.css` **Step 1: 读取现有全局样式** Read: `src/app/globals.css` **Step 2: 添加 CSS 变量和基础样式** Modify: `src/app/globals.css` 在文件顶部添加: ```css :root { --color-dark: #0A0A0A; --color-dark-secondary: #1A1A1A; --color-dark-tertiary: #2A2A2A; --color-tech-blue: #00D9FF; --color-tech-purple: #A855F7; --color-tech-cyan: #06B6D4; --gradient-primary: linear-gradient(135deg, #00D9FF 0%, #A855F7 100%); --gradient-dark: linear-gradient(180deg, #0A0A0A 0%, #1A1A1A 100%); --gradient-glow: radial-gradient(circle, #00D9FF20 0%, transparent 70%); } * { box-sizing: border-box; padding: 0; margin: 0; } html { scroll-behavior: smooth; } body { background-color: var(--color-dark); color: #FFFFFF; font-family: 'Inter', system-ui, sans-serif; line-height: 1.6; } a { color: inherit; text-decoration: none; } button { font-family: inherit; } input, textarea { font-family: inherit; } ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: var(--color-dark-secondary); } ::-webkit-scrollbar-thumb { background: var(--color-tech-blue); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: var(--color-tech-purple); } ``` **Step 3: 验证样式文件** Run: `npm run build` Expected: 构建成功,无样式错误 **Step 4: 提交样式更新** Run: ```bash git add src/app/globals.css git commit -m "feat: add CSS variables and base styles for dark theme" ``` Expected: 提交成功 --- ### Task 4: 创建工具函数 **Files:** - Modify: `src/lib/utils.ts` **Step 1: 读取现有工具函数** Read: `src/lib/utils.ts` **Step 2: 添加新的工具函数** Modify: `src/lib/utils.ts` ```typescript import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } export function formatNumber(num: number): string { return new Intl.NumberFormat("zh-CN").format(num); } export function formatCurrency(amount: number): string { return new Intl.NumberFormat("zh-CN", { style: "currency", currency: "CNY", }).format(amount); } export function debounce unknown>( func: T, wait: number ): (...args: Parameters) => void { let timeout: NodeJS.Timeout | null = null; return (...args: Parameters) => { if (timeout) clearTimeout(timeout); timeout = setTimeout(() => func(...args), wait); }; } export function throttle unknown>( func: T, limit: number ): (...args: Parameters) => void { let inThrottle: boolean; return (...args: Parameters) => { if (!inThrottle) { func(...args); inThrottle = true; setTimeout(() => (inThrottle = false), limit); } }; } export function randomBetween(min: number, max: number): number { return Math.random() * (max - min) + min; } export function lerp(start: number, end: number, t: number): number { return start + (end - start) * t; } export function clamp(value: number, min: number, max: number): number { return Math.min(Math.max(value, min), max); } ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交工具函数** Run: ```bash git add src/lib/utils.ts git commit -m "feat: add utility functions for formatting and animation" ``` Expected: 提交成功 --- ### Task 5: 创建主题常量 **Files:** - Modify: `src/lib/constants.ts` **Step 1: 读取现有常量** Read: `src/lib/constants.ts` **Step 2: 添加主题相关常量** Modify: `src/lib/constants.ts` 在文件末尾添加: ```typescript export const THEME = { colors: { dark: { DEFAULT: "#0A0A0A", secondary: "#1A1A1A", tertiary: "#2A2A2A", }, tech: { blue: "#00D9FF", purple: "#A855F7", cyan: "#06B6D4", }, text: { primary: "#FFFFFF", secondary: "#A0A0A0", disabled: "#606060", }, }, gradients: { primary: "linear-gradient(135deg, #00D9FF 0%, #A855F7 100%)", dark: "linear-gradient(180deg, #0A0A0A 0%, #1A1A1A 100%)", glow: "radial-gradient(circle, #00D9FF20 0%, transparent 70%)", }, spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px", "3xl": "64px", }, borderRadius: { sm: "8px", md: "12px", lg: "16px", full: "9999px", }, animation: { fast: "150ms", standard: "300ms", slow: "500ms", verySlow: "1000ms", }, breakpoints: { sm: "640px", md: "768px", lg: "1024px", xl: "1280px", "2xl": "1536px", }, } as const; export const ANIMATION_VARIANTS = { fadeInUp: { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -20 }, }, fadeInScale: { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.95 }, }, slideInLeft: { initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 20 }, }, slideInRight: { initial: { opacity: 0, x: 20 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -20 }, }, } as const; ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交常量更新** Run: ```bash git add src/lib/constants.ts git commit -m "feat: add theme constants and animation variants" ``` Expected: 提交成功 --- ## 阶段二:基础UI组件开发 ### Task 6: 创建增强版按钮组件 **Files:** - Modify: `src/components/ui/button.tsx` **Step 1: 读取现有按钮组件** Read: `src/components/ui/button.tsx` **Step 2: 重写按钮组件以支持深色主题** Modify: `src/components/ui/button.tsx` ```typescript import * as React from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tech-blue focus-visible:ring-offset-2 focus-visible:ring-offset-dark disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: "bg-gradient-to-r from-tech-blue to-tech-purple text-white hover:shadow-lg hover:shadow-tech-blue/50 hover:scale-105 active:scale-95", secondary: "bg-dark-tertiary text-white border border-gray-700 hover:border-tech-blue hover:shadow-lg hover:shadow-tech-blue/20 hover:scale-105 active:scale-95", outline: "border border-tech-blue text-tech-blue hover:bg-tech-blue/10 hover:shadow-lg hover:shadow-tech-blue/20", ghost: "text-gray-300 hover:text-tech-blue hover:bg-dark-tertiary", link: "text-tech-blue underline-offset-4 hover:underline", }, size: { default: "h-10 px-6 py-2", sm: "h-8 px-4 text-xs", lg: "h-12 px-8 text-base", xl: "h-14 px-10 text-lg", icon: "h-10 w-10", }, }, defaultVariants: { variant: "default", size: "default", }, } ); export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } const Button = React.forwardRef( ({ className, variant, size, ...props }, ref) => { return ( {isMobileMenuOpen && (
{NAVIGATION.map((item) => ( setIsMobileMenuOpen(false)} > {item.label} ))}
)} ); } ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交导航栏组件** Run: ```bash git add src/components/layout/header.tsx git commit -m "feat: refactor header with dark theme and mobile menu" ``` Expected: 提交成功 --- ### Task 11: 重构页脚组件 **Files:** - Modify: `src/components/layout/footer.tsx` **Step 1: 读取现有页脚组件** Read: `src/components/layout/footer.tsx` **Step 2: 重写页脚组件以支持深色主题** Modify: `src/components/layout/footer.tsx` ```typescript import Link from "next/link"; import { COMPANY_INFO } from "@/lib/constants"; export function Footer() { const currentYear = new Date().getFullYear(); const footerLinks = { products: [ { label: "ERP系统", href: "/products/erp" }, { label: "CRM系统", href: "/products/crm" }, { label: "OA平台", href: "/products/oa" }, { label: "BI平台", href: "/products/bi" }, ], solutions: [ { label: "金融行业", href: "/solutions/finance" }, { label: "制造业", href: "/solutions/manufacturing" }, { label: "零售行业", href: "/solutions/retail" }, { label: "教育行业", href: "/solutions/education" }, ], company: [ { label: "关于我们", href: "/about" }, { label: "新闻动态", href: "/news" }, { label: "成功案例", href: "/cases" }, { label: "联系我们", href: "/contact" }, ], }; return (
{COMPANY_INFO.shortName} {COMPANY_INFO.shortName}

{COMPANY_INFO.slogan}

产品服务

    {footerLinks.products.map((link) => (
  • {link.label}
  • ))}

解决方案

    {footerLinks.solutions.map((link) => (
  • {link.label}
  • ))}

关于我们

    {footerLinks.company.map((link) => (
  • {link.label}
  • ))}

© {currentYear} {COMPANY_INFO.name}. All rights reserved.

隐私政策 服务条款
); } ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交页脚组件** Run: ```bash git add src/components/layout/footer.tsx git commit -m "feat: refactor footer with dark theme and improved layout" ``` Expected: 提交成功 --- ## 阶段四:特效组件开发 ### Task 12: 创建粒子背景组件 **Files:** - Create: `src/components/effects/particle-background.tsx` **Step 1: 创建粒子背景组件** Create: `src/components/effects/particle-background.tsx` ```typescript "use client"; import { useEffect, useRef } from "react"; import { randomBetween } from "@/lib/utils"; interface Particle { x: number; y: number; vx: number; vy: number; size: number; color: string; opacity: number; } interface ParticleBackgroundProps { particleCount?: number; colors?: string[]; minSize?: number; maxSize?: number; speed?: number; className?: string; } export function ParticleBackground({ particleCount = 50, colors = ["#00D9FF", "#A855F7", "#06B6D4"], minSize = 1, maxSize = 3, speed = 0.5, className = "", }: ParticleBackgroundProps) { const canvasRef = useRef(null); const particlesRef = useRef([]); const animationRef = useRef(); useEffect(() => { const canvas = canvasRef.current; if (!canvas) return; const ctx = canvas.getContext("2d"); if (!ctx) return; const resizeCanvas = () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; }; resizeCanvas(); window.addEventListener("resize", resizeCanvas); particlesRef.current = Array.from({ length: particleCount }, () => ({ x: randomBetween(0, canvas.width), y: randomBetween(0, canvas.height), vx: randomBetween(-speed, speed), vy: randomBetween(-speed, speed), size: randomBetween(minSize, maxSize), color: colors[Math.floor(Math.random() * colors.length)], opacity: randomBetween(0.1, 0.5), })); const animate = () => { if (!ctx || !canvas) return; ctx.clearRect(0, 0, canvas.width, canvas.height); particlesRef.current.forEach((particle) => { particle.x += particle.vx; particle.y += particle.vy; if (particle.x < 0 || particle.x > canvas.width) particle.vx *= -1; if (particle.y < 0 || particle.y > canvas.height) particle.vy *= -1; ctx.beginPath(); ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2); ctx.fillStyle = particle.color; ctx.globalAlpha = particle.opacity; ctx.fill(); }); ctx.globalAlpha = 1; animationRef.current = requestAnimationFrame(animate); }; animate(); return () => { window.removeEventListener("resize", resizeCanvas); if (animationRef.current) { cancelAnimationFrame(animationRef.current); } }; }, [particleCount, colors, minSize, maxSize, speed]); return ( ); } ``` **Step 2: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 3: 提交粒子背景组件** Run: ```bash git add src/components/effects/particle-background.tsx git commit -m "feat: create particle background component for hero section" ``` Expected: 提交成功 --- ### Task 13: 创建发光效果组件 **Files:** - Create: `src/components/effects/glow-effect.tsx` **Step 1: 创建发光效果组件** Create: `src/components/effects/glow-effect.tsx` ```typescript "use client"; import { cn } from "@/lib/utils"; interface GlowEffectProps { color?: string; size?: "sm" | "md" | "lg" | "xl"; className?: string; children?: React.ReactNode; } const sizeMap = { sm: "w-32 h-32", md: "w-48 h-48", lg: "w-64 h-64", xl: "w-96 h-96", }; export function GlowEffect({ color = "#00D9FF", size = "lg", className, children, }: GlowEffectProps) { return (
{children}
); } interface GradientOrbProps { position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; color?: string; className?: string; } const positionMap = { "top-left": "top-0 left-0", "top-right": "top-0 right-0", "bottom-left": "bottom-0 left-0", "bottom-right": "bottom-0 right-0", }; export function GradientOrb({ position = "top-right", color = "#00D9FF", className, }: GradientOrbProps) { return (
); } ``` **Step 2: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 3: 提交发光效果组件** Run: ```bash git add src/components/effects/glow-effect.tsx git commit -m "feat: create glow effect and gradient orb components" ``` Expected: 提交成功 --- ## 阶段五:首页重构 ### Task 14: 重构 Hero Section **Files:** - Modify: `src/components/sections/hero-section.tsx` **Step 1: 读取现有 Hero Section** Read: `src/components/sections/hero-section.tsx` **Step 2: 重写 Hero Section 以支持深色主题和动画** Modify: `src/components/sections/hero-section.tsx` ```typescript "use client"; import { motion } from "framer-motion"; import { Button } from "@/components/ui/button"; import { ParticleBackground } from "@/components/effects/particle-background"; import { GradientOrb } from "@/components/effects/glow-effect"; import { COMPANY_INFO } from "@/lib/constants"; import { ArrowRight, Sparkles } from "lucide-react"; export function HeroSection() { return (
专注科技创新 {COMPANY_INFO.slogan} {COMPANY_INFO.description}
向下滚动
); } ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交 Hero Section** Run: ```bash git add src/components/sections/hero-section.tsx git commit -m "feat: refactor hero section with dark theme and animations" ``` Expected: 提交成功 --- ### Task 15: 创建统计数据 Section **Files:** - Create: `src/components/sections/stats-section.tsx` **Step 1: 创建统计数据 Section** Create: `src/components/sections/stats-section.tsx` ```typescript "use client"; import { motion } from "framer-motion"; import { STATS } from "@/lib/constants"; export function StatsSection() { return (
{STATS.map((stat, index) => (
{stat.value}
{stat.label}
))}
); } ``` **Step 2: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 3: 提交统计数据 Section** Run: ```bash git add src/components/sections/stats-section.tsx git commit -m "feat: create stats section with animated counters" ``` Expected: 提交成功 --- ### Task 16: 重构产品展示 Section **Files:** - Modify: `src/components/sections/products-section.tsx` **Step 1: 读取现有产品展示 Section** Read: `src/components/sections/products-section.tsx` **Step 2: 重写产品展示 Section 以支持深色主题和卡片效果** Modify: `src/components/sections/products-section.tsx` ```typescript "use client"; import { motion } from "framer-motion"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { PRODUCTS } from "@/lib/constants"; import { ArrowRight } from "lucide-react"; export function ProductsSection() { return (

产品服务

为企业提供全方位的数字化解决方案,助力业务增长

{PRODUCTS.slice(0, 6).map((product, index) => (
{product.category}
{product.title}
{product.description}
{product.features.slice(0, 3).map((feature) => ( {feature} ))}
了解更多
))}
); } ``` **Step 3: 验证类型检查** Run: `npx tsc --noEmit` Expected: 无类型错误 **Step 4: 提交产品展示 Section** Run: ```bash git add src/components/sections/products-section.tsx git commit -m "feat: refactor products section with dark theme and card layout" ``` Expected: 提交成功 --- ## 阶段六:测试与验证 ### Task 17: 运行开发服务器测试 **Files:** - None **Step 1: 启动开发服务器** Run: `npm run dev` Expected: 开发服务器成功启动在 http://localhost:3000 **Step 2: 在浏览器中验证首页** 手动测试: - 访问 http://localhost:3000 - 验证深色主题是否正确应用 - 验证导航栏是否正常工作 - 验证 Hero Section 动画是否流畅 - 验证产品卡片悬停效果 - 验证响应式布局(移动端、平板、桌面) Expected: 所有功能正常工作 **Step 3: 停止开发服务器** 按 Ctrl+C 停止服务器 Expected: 服务器成功停止 --- ### Task 18: 运行构建测试 **Files:** - None **Step 1: 运行生产构建** Run: `npm run build` Expected: 构建成功,无错误 **Step 2: 检查构建输出** 验证构建输出中: - 页面是否正确生成 - 是否有优化建议 - 构建大小是否合理 Expected: 构建输出正常 **Step 3: 运行代码检查** Run: `npm run lint` Expected: 无 ESLint 错误 --- ### Task 19: 提交所有更改 **Files:** - None **Step 1: 检查 Git 状态** Run: `git status` Expected: 显示所有修改的文件 **Step 2: 添加所有更改** Run: `git add .` Expected: 所有更改已暂存 **Step 3: 创建提交** Run: ```bash git commit -m "feat: complete website redesign with dark tech theme - Add dark theme color system and CSS variables - Enhance UI components (Button, Card, Input, Badge) - Refactor layout components (Header, Footer) - Create effect components (ParticleBackground, GlowEffect) - Refactor sections (Hero, Stats, Products) - Add Framer Motion animations - Improve responsive design - Update Tailwind configuration" ``` Expected: 提交成功 **Step 4: 推送到远程** Run: `git push origin feature/website-redesign` Expected: 推送成功 --- ## 完成清单 - [ ] 安装必要依赖(framer-motion, @antv/g2, class-variance-authority) - [ ] 扩展 Tailwind 配置 - [ ] 更新全局样式 - [ ] 创建工具函数 - [ ] 创建主题常量 - [ ] 增强按钮组件 - [ ] 增强卡片组件 - [ ] 增强输入框组件 - [ ] 增强徽章组件 - [ ] 重构导航栏组件 - [ ] 重构页脚组件 - [ ] 创建粒子背景组件 - [ ] 创建发光效果组件 - [ ] 重构 Hero Section - [ ] 创建统计数据 Section - [ ] 重构产品展示 Section - [ ] 运行开发服务器测试 - [ ] 运行构建测试 - [ ] 提交所有更改 --- ## 注意事项 1. **每个任务都应该独立完成并提交**,便于版本控制和回滚 2. **遇到错误立即停止**,不要继续下一步 3. **保持代码风格一致**,遵循项目现有的代码规范 4. **测试每个组件**,确保在移动端和桌面端都能正常工作 5. **关注性能**,避免过度使用动画和特效 --- **计划创建者:** AI Assistant **创建日期:** 2026-02-21 **预计工期:** 2-3天(基础架构 + 核心组件 + 首页重构)