frontend-enhancer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFrontend Enhancer
前端视觉增强方案
Overview
概述
The Frontend Enhancer skill transforms Next.js applications into visually stunning, modern web experiences. It provides production-ready components, comprehensive design guidelines, curated color palettes, smooth animations, and flexible layout templates optimized for responsiveness and accessibility.
Frontend Enhancer Skill 可将Next.js应用转变为视觉惊艳、现代化的Web体验。它提供可用于生产环境的组件、全面的设计指南、精选调色板、流畅的动画效果,以及针对响应式和可访问性优化的灵活布局模板。
When to Use This Skill
适用场景
Invoke this skill when:
- Improving the visual appearance of an existing application
- Creating new UI components with modern styling
- Selecting color schemes and design themes
- Adding animations and transitions
- Building responsive layouts for different screen sizes
- Implementing hero sections, feature grids, or landing pages
- Enhancing user experience with better visual hierarchy
- Applying consistent design patterns across an application
在以下场景中调用此Skill:
- 改进现有应用的视觉外观
- 创建带有现代样式的新UI组件
- 选择配色方案和设计主题
- 添加动画与过渡效果
- 为不同屏幕尺寸构建响应式布局
- 实现英雄区、功能网格或着陆页
- 通过优化视觉层级提升用户体验
- 在应用中应用统一的设计模式
Core Capabilities
核心功能
1. Component Library
1. 组件库
Use pre-built, production-ready React components with multiple variants and states:
Button Component ():
assets/button-variants.tsx- Variants: primary, secondary, outline, ghost, danger
- Sizes: sm, md, lg
- Loading states with animated spinner
- Full TypeScript support
- Accessibility features built-in
Card Component ():
assets/card-variants.tsx- Variants: default, bordered, elevated, interactive
- Subcomponents: CardHeader, CardTitle, CardDescription, CardContent, CardFooter
- Hover effects and transitions
- Flexible padding options
Input Components ():
assets/input-variants.tsx- Text inputs with validation states
- Textarea component
- Left/right icon support
- Error and helper text display
- Label integration
- Full accessibility support
Implementation workflow:
- Copy the desired component file from to your project's components directory
assets/ - Ensure the utility function exists (see
cn)assets/utils-cn.ts - Customize colors, spacing, or variants to match your brand
- Import and use the component in your pages
使用预构建、可用于生产环境的React组件,包含多种变体和状态:
按钮组件 ():
assets/button-variants.tsx- 变体:primary、secondary、outline、ghost、danger
- 尺寸:sm、md、lg
- 带有动画加载状态的加载指示器
- 完整的TypeScript支持
- 内置可访问性功能
卡片组件 ():
assets/card-variants.tsx- 变体:default、bordered、elevated、interactive
- 子组件:CardHeader、CardTitle、CardDescription、CardContent、CardFooter
- 悬停效果与过渡动画
- 灵活的内边距选项
输入组件 ():
assets/input-variants.tsx- 带有验证状态的文本输入框
- 文本域组件
- 支持左右图标
- 错误提示与辅助文本显示
- 标签集成
- 完整的可访问性支持
实施流程:
- 将所需组件文件从复制到项目的组件目录
assets/ - 确保工具函数已存在(参考
cn)assets/utils-cn.ts - 自定义颜色、间距或变体以匹配你的品牌
- 在页面中导入并使用组件
2. Layout Templates
2. 布局模板
Use pre-designed, responsive layout patterns for common page sections:
Hero Section ():
assets/layout-hero-section.tsx- Three variants: centered, split, minimal
- Support for CTAs (primary and secondary)
- Optional background gradients
- Image/illustration support
- Built-in animations
Feature Grid ():
assets/layout-feature-grid.tsx- Configurable columns (2, 3, or 4)
- Icon integration
- Staggered animations
- Hover effects
- Fully responsive
Implementation workflow:
- Copy the layout component from to your components directory
assets/ - Customize the props and content to match your needs
- Integrate with your existing pages
- Adjust styling as needed for your brand
使用为常见页面区域预设计的响应式布局模式:
英雄区 ():
assets/layout-hero-section.tsx- 三种变体:居中、分栏、极简
- 支持CTA按钮(主按钮和次要按钮)
- 可选背景渐变效果
- 支持图片/插图
- 内置动画效果
功能网格 ():
assets/layout-feature-grid.tsx- 可配置列数(2、3或4列)
- 图标集成
- 交错动画效果
- 悬停效果
- 完全响应式
实施流程:
- 将布局组件从复制到你的组件目录
assets/ - 自定义属性和内容以满足需求
- 与现有页面集成
- 根据品牌需求调整样式
3. Design System Guidelines
3. 设计系统指南
Reference comprehensive design principles for consistent, professional interfaces:
Design Principles ():
references/design_principles.md- Visual hierarchy best practices
- Spacing and rhythm guidelines
- Typography recommendations
- Color theory and usage
- Consistency standards
- Responsiveness strategies
- Accessibility guidelines (WCAG AA/AAA)
- Common layout patterns
When to reference:
- Starting a new design
- Making decisions about visual hierarchy
- Ensuring accessibility compliance
- Establishing consistency across the app
- Reviewing design quality
How to use:
Read to understand best practices, then apply them to your specific design challenges. The document covers both theory and practical implementation.
references/design_principles.md参考全面的设计原则,打造一致、专业的界面:
设计原则 ():
references/design_principles.md- 视觉层级最佳实践
- 间距与韵律指南
- 排版建议
- 色彩理论与使用方法
- 一致性标准
- 响应式策略
- 可访问性指南(WCAG AA/AAA)
- 常见布局模式
参考时机:
- 启动新设计项目时
- 做视觉层级相关决策时
- 确保可访问性合规时
- 在应用中建立设计一致性时
- 评审设计质量时
使用方法:
阅读了解最佳实践,然后将其应用到具体的设计挑战中。该文档涵盖理论与实际实施方法。
references/design_principles.md4. Color Palettes
4. 调色板
Access professionally curated color schemes optimized for modern web applications:
Available Palettes ():
references/color_palettes.md- Corporate Blue - Professional, trustworthy (business apps, SaaS)
- Vibrant Purple - Creative, modern (creative tools, portfolios)
- Minimalist Gray - Clean, sophisticated (minimalist designs)
- Warm Sunset - Energetic, friendly (consumer apps, e-commerce)
- Ocean Fresh - Calm, professional (health, finance apps)
- Dark Mode - Modern, eye-friendly (developer tools, dashboards)
Each palette includes:
- Primary and secondary colors
- Accent colors
- Background and surface colors
- Text colors (primary and secondary)
- Semantic colors (success, warning, error)
- Border colors
Implementation options:
- Tailwind CSS: Add colors to (examples provided)
tailwind.config.js - CSS Variables: Use custom properties in global CSS (examples provided)
- Inline styles: Reference hex codes directly in components
Selection workflow:
- Review to see all available palettes
references/color_palettes.md - Consider your application's purpose and brand identity
- Choose a palette that matches your goals
- Implement using Tailwind config or CSS variables
- Adjust specific colors if needed to match your brand
获取为现代Web应用优化的专业精选配色方案:
可用调色板 ():
references/color_palettes.md- 企业蓝 - 专业、可靠(适用于商务应用、SaaS)
- 活力紫 - 创意、现代(适用于创意工具、作品集)
- 极简灰 - 简洁、精致(适用于极简设计)
- 暖日落 - 活力、友好(适用于消费类应用、电商)
- 清新海洋 - 沉稳、专业(适用于健康、金融应用)
- 深色模式 - 现代、护眼(适用于开发者工具、仪表盘)
每个调色板包含:
- 主色和辅助色
- 强调色
- 背景色与表层色
- 文本颜色(主文本和次要文本)
- 语义颜色(成功、警告、错误)
- 边框色
实施选项:
- Tailwind CSS: 将颜色添加到(提供示例)
tailwind.config.js - CSS变量: 在全局CSS中使用自定义属性(提供示例)
- 内联样式: 在组件中直接引用十六进制颜色码
选择流程:
- 查看了解所有可用调色板
references/color_palettes.md - 考虑应用的用途和品牌定位
- 选择符合目标的调色板
- 使用Tailwind配置或CSS变量实施
- 根据品牌需求调整特定颜色
5. Animations and Transitions
5. 动画与过渡效果
Add smooth, professional animations using pre-built CSS classes and keyframes:
Animation Library ():
assets/animations.css- Fade animations (fadeIn, fadeOut, fadeInUp, fadeInDown)
- Slide animations (slideInLeft, slideInRight)
- Scale animations (scaleIn, scaleOut)
- Utility animations (bounce, pulse, spin)
- Skeleton loading (shimmer effect)
- Hover effects (lift, glow, scale)
- Stagger delays for list animations
Accessibility:
All animations respect for accessibility compliance.
prefers-reduced-motionImplementation workflow:
- Copy to your global CSS file (or create a separate animations file)
assets/animations.css - Apply utility classes like ,
animate-fade-in-up, etc.hover-lift - Use stagger classes for sequential animations in lists
- Customize duration and easing if needed
Best practices:
- Keep animations subtle (200-300ms for micro-interactions)
- Use animations to guide user attention
- Avoid excessive motion that distracts
- Always test with enabled
prefers-reduced-motion
使用预构建的CSS类和关键帧添加流畅、专业的动画效果:
动画库 ():
assets/animations.css- 淡入淡出动画(fadeIn、fadeOut、fadeInUp、fadeInDown)
- 滑动动画(slideInLeft、slideInRight)
- 缩放动画(scaleIn、scaleOut)
- 工具类动画(bounce、pulse、spin)
- 骨架屏加载(微光效果)
- 悬停效果(lift、glow、scale)
- 列表动画的交错延迟
可访问性:
所有动画均支持,确保可访问性合规。
prefers-reduced-motion实施流程:
- 将复制到全局CSS文件(或创建单独的动画文件)
assets/animations.css - 应用工具类,如、
animate-fade-in-up等hover-lift - 为列表中的顺序动画使用交错类
- 根据需要调整持续时间和缓动函数
最佳实践:
- 保持动画简洁(微交互为200-300ms)
- 使用动画引导用户注意力
- 避免过度分散注意力的动画
- 始终测试启用时的效果
prefers-reduced-motion
Enhancement Workflow
增强流程
Follow this systematic approach when enhancing a frontend application:
遵循此系统化方法增强前端应用:
Step 1: Assess Current State
步骤1: 评估当前状态
- Identify areas lacking visual polish
- Note inconsistent styling patterns
- Check responsive behavior
- Review accessibility issues
- Evaluate color scheme and typography
- 识别缺乏视觉质感的区域
- 记录不一致的样式模式
- 检查响应式表现
- 评审可访问性问题
- 评估配色方案与排版
Step 2: Select Design Direction
步骤2: 选择设计方向
- Choose a color palette from
references/color_palettes.md - Review design principles in
references/design_principles.md - Decide on component variants and styles
- Plan layout improvements
- 从中选择调色板
references/color_palettes.md - 查看中的设计原则
references/design_principles.md - 确定组件变体与样式
- 规划布局改进方案
Step 3: Implement Foundation
步骤3: 搭建基础
- Set up the utility function (
cn)assets/utils-cn.ts - Configure chosen color palette (Tailwind or CSS variables)
- Add animation CSS () to global styles
assets/animations.css - Ensure consistent spacing scale
- 设置工具函数(
cn)assets/utils-cn.ts - 配置所选调色板(Tailwind或CSS变量)
- 将动画CSS()添加到全局样式
assets/animations.css - 确保一致的间距比例
Step 4: Apply Components
步骤4: 应用组件
- Replace basic elements with enhanced components from
assets/ - Implement layout templates for key pages
- Apply consistent styling across the application
- Add animations and transitions
- 用中的增强组件替换基础元素
assets/ - 为关键页面实现布局模板
- 在应用中应用一致的样式
- 添加动画与过渡效果
Step 5: Refine and Polish
步骤5: 优化与打磨
- Test responsiveness across device sizes
- Verify accessibility (keyboard navigation, contrast, screen readers)
- Ensure consistent hover/focus states
- Optimize performance (check animation performance)
- Test with
prefers-reduced-motion
- 在不同设备尺寸上测试响应式表现
- 验证可访问性(键盘导航、对比度、屏幕阅读器)
- 确保一致的悬停/聚焦状态
- 优化性能(检查动画性能)
- 测试效果
prefers-reduced-motion
Step 6: Final Review
步骤6: 最终评审
- Check visual hierarchy on all pages
- Verify color consistency
- Test all interactive states
- Validate responsive breakpoints
- Review accessibility compliance
- 检查所有页面的视觉层级
- 验证颜色一致性
- 测试所有交互状态
- 验证响应式断点
- 评审可访问性合规性
Utility Function Setup
工具函数设置
Most components require the utility function for class name merging. To set it up:
cn- Copy to your project's
assets/utils-cn.tslib/utils.ts - Install dependencies:
bash
npm install clsx tailwind-merge - Import in components:
typescript
import { cn } from '@/lib/utils';
大多数组件需要工具函数来合并类名。设置方法如下:
cn- 将复制到项目的
assets/utils-cn.tslib/utils.ts - 安装依赖:
bash
npm install clsx tailwind-merge - 在组件中导入:
typescript
import { cn } from '@/lib/utils';
Responsive Design Strategy
响应式设计策略
All components and layouts follow a mobile-first approach:
- Base styles - Optimized for mobile (320px+)
- sm breakpoint - Small tablets (640px+)
- md breakpoint - Tablets (768px+)
- lg breakpoint - Desktops (1024px+)
- xl breakpoint - Large desktops (1280px+)
Test each breakpoint to ensure proper layout and readability.
所有组件和布局遵循移动优先的方法:
- 基础样式 - 针对移动端优化(320px+)
- sm断点 - 小平板(640px+)
- md断点 - 平板(768px+)
- lg断点 - 桌面端(1024px+)
- xl断点 - 大桌面端(1280px+)
测试每个断点,确保布局和可读性正常。
Accessibility Checklist
可访问性检查清单
Ensure all enhanced interfaces meet these standards:
- Color contrast meets WCAG AA (4.5:1 for text)
- All interactive elements are keyboard accessible
- Focus indicators are visible and clear
- Semantic HTML is used (nav, main, article, etc.)
- Images have alt text
- Forms have proper labels
- Animations respect prefers-reduced-motion
- Touch targets are at least 44x44px
确保所有增强后的界面符合以下标准:
- 颜色对比度符合WCAG AA标准(文本对比度4.5:1)
- 所有交互元素支持键盘访问
- 焦点指示器清晰可见
- 使用语义化HTML(nav、main、article等)
- 图片包含替代文本
- 表单带有正确的标签
- 动画尊重prefers-reduced-motion设置
- 触摸目标至少为44x44px
Customization Guide
自定义指南
To adapt components and templates to your brand:
- Colors: Update color values in palette config or component files
- Typography: Adjust font sizes, weights, and families
- Spacing: Modify padding and margin values
- Border Radius: Change rounded corners (e.g., to
rounded-lg)rounded-xl - Shadows: Adjust shadow intensity (e.g., to
shadow-md)shadow-lg - Animations: Modify duration and easing functions
要使组件和模板适配你的品牌:
- 颜色: 更新调色板配置或组件文件中的颜色值
- 排版: 调整字体大小、字重和字体族
- 间距: 修改内边距和外边距值
- 圆角: 调整圆角大小(例如将改为
rounded-lg)rounded-xl - 阴影: 调整阴影强度(例如将改为
shadow-md)shadow-lg - 动画: 修改持续时间和缓动函数
Resources Summary
资源汇总
This skill includes:
此Skill包含以下资源:
references/
references/
- - Six professionally designed color schemes with implementation examples
color_palettes.md - - Comprehensive design guidelines covering visual hierarchy, typography, accessibility, and common patterns
design_principles.md
- - 六个专业设计的配色方案,附带实施示例
color_palettes.md - - 全面的设计指南,涵盖视觉层级、排版、可访问性和常见模式
design_principles.md
assets/
assets/
- - Modern button component with 5 variants and 3 sizes
button-variants.tsx - - Flexible card component with subcomponents
card-variants.tsx - - Input and textarea components with validation states
input-variants.tsx - - Hero section with 3 layout variants
layout-hero-section.tsx - - Responsive feature grid with configurable columns
layout-feature-grid.tsx - - Complete animation library with accessibility support
animations.css - - Utility function for class name merging
utils-cn.ts
- - 带有5种变体和3种尺寸的现代按钮组件
button-variants.tsx - - 带有子组件的灵活卡片组件
card-variants.tsx - - 带有验证状态的输入框和文本域组件
input-variants.tsx - - 带有3种布局变体的英雄区组件
layout-hero-section.tsx - - 可配置列数的响应式功能网格
layout-feature-grid.tsx - - 完整的动画库,支持可访问性
animations.css - - 用于合并类名的工具函数
utils-cn.ts
Tips for Success
成功技巧
- Start with a plan: Review design principles before making changes
- Choose one palette: Stick to a single color scheme for consistency
- Test on real devices: Emulators don't always show true responsive behavior
- Keep it simple: Modern design favors simplicity over complexity
- Prioritize accessibility: Design for all users from the start
- Iterate based on feedback: Show designs to users and refine
- Maintain consistency: Use the same patterns throughout your application
- Performance matters: Keep animations smooth (60fps) and optimize images
- 提前规划: 在进行更改前先查看设计原则
- 单一调色板: 坚持使用单一配色方案以保持一致性
- 真实设备测试: 模拟器无法完全呈现真实的响应式表现
- 保持简洁: 现代设计更倾向于简洁而非复杂
- 优先考虑可访问性: 从设计初期就为所有用户考虑
- 基于反馈迭代: 向用户展示设计并进行优化
- 保持一致性: 在整个应用中使用相同的设计模式
- 性能优先: 保持动画流畅(60fps)并优化图片
Common Use Cases
常见用例
Enhancing an Existing App
增强现有应用
- Select a color palette and implement it
- Replace basic buttons/inputs with enhanced components
- Add subtle animations to improve feedback
- Review and improve spacing consistency
- Ensure responsive behavior across devices
- 选择并实施一个调色板
- 用增强组件替换基础按钮/输入框
- 添加微妙的动画以提升反馈体验
- 评审并改进间距一致性
- 确保在不同设备上的响应式表现
Building a Landing Page
构建着陆页
- Use hero section layout as the focal point
- Add feature grid to showcase key features
- Implement consistent button styles for CTAs
- Add staggered animations for visual interest
- Test responsiveness thoroughly
- 以英雄区布局为核心
- 添加功能网格展示关键特性
- 为CTA按钮实现一致的样式
- 添加交错动画提升视觉吸引力
- 全面测试响应式表现
Creating a Dashboard
创建仪表盘
- Use card components for data sections
- Implement consistent spacing and hierarchy
- Choose a professional color palette
- Add skeleton loaders for data fetching
- Ensure touch-friendly controls on mobile
- 使用卡片组件展示数据区域
- 实现一致的间距和层级
- 选择专业的调色板
- 为数据加载添加骨架屏
- 确保移动端的触控友好控件
Redesigning Forms
重新设计表单
- Replace inputs with enhanced input components
- Add clear error and validation states
- Ensure proper label associations
- Implement loading states for submission
- Test keyboard navigation flow
- 用增强输入组件替换原有输入框
- 添加清晰的错误和验证状态
- 确保标签关联正确
- 为提交操作实现加载状态
- 测试键盘导航流程