Skip to content

Commit 4f9631d

Browse files
whincclaude
andcommitted
feat: 优化落地页UI并实现功能卡片图片查看器
主要更新: - 新增图片查看器组件(ImageModal),支持点击放大、ESC/背景关闭 - 创建功能卡片组件(FeatureCard/FeatureGrid),优化图片显示(object-contain) - 升级导航栏为浮动玻璃态设计(fixed + backdrop-blur-md) - 优化Hero头部,添加科技感动画和SVG图标 - 现代化页脚设计,圆角按钮和卡片化布局 - 添加Tailwind动画配置(fade-in, scale-in) - 修复z-index层级问题(图片查看器z-[100]) 技术细节: - 使用React Portal实现模态框挂载 - 图片加载错误处理(显示友好提示) - 响应式设计适配移动端/桌面端 - 无障碍支持(ARIA、键盘导航) - 遵循Motion-Driven设计风格 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 84974de commit 4f9631d

43 files changed

Lines changed: 2955 additions & 228 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"enabledPlugins": {}
3+
}
Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
---
2+
name: ui-ux-pro-max
3+
description: "UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples."
4+
---
5+
6+
# UI/UX Pro Max - Design Intelligence
7+
8+
Comprehensive design guide for web and mobile applications. Contains 50+ styles, 97 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 9 technology stacks. Searchable database with priority-based recommendations.
9+
10+
## When to Apply
11+
12+
Reference these guidelines when:
13+
- Designing new UI components or pages
14+
- Choosing color palettes and typography
15+
- Reviewing code for UX issues
16+
- Building landing pages or dashboards
17+
- Implementing accessibility requirements
18+
19+
## Rule Categories by Priority
20+
21+
| Priority | Category | Impact | Domain |
22+
|----------|----------|--------|--------|
23+
| 1 | Accessibility | CRITICAL | `ux` |
24+
| 2 | Touch & Interaction | CRITICAL | `ux` |
25+
| 3 | Performance | HIGH | `ux` |
26+
| 4 | Layout & Responsive | HIGH | `ux` |
27+
| 5 | Typography & Color | MEDIUM | `typography`, `color` |
28+
| 6 | Animation | MEDIUM | `ux` |
29+
| 7 | Style Selection | MEDIUM | `style`, `product` |
30+
| 8 | Charts & Data | LOW | `chart` |
31+
32+
## Quick Reference
33+
34+
### 1. Accessibility (CRITICAL)
35+
36+
- `color-contrast` - Minimum 4.5:1 ratio for normal text
37+
- `focus-states` - Visible focus rings on interactive elements
38+
- `alt-text` - Descriptive alt text for meaningful images
39+
- `aria-labels` - aria-label for icon-only buttons
40+
- `keyboard-nav` - Tab order matches visual order
41+
- `form-labels` - Use label with for attribute
42+
43+
### 2. Touch & Interaction (CRITICAL)
44+
45+
- `touch-target-size` - Minimum 44x44px touch targets
46+
- `hover-vs-tap` - Use click/tap for primary interactions
47+
- `loading-buttons` - Disable button during async operations
48+
- `error-feedback` - Clear error messages near problem
49+
- `cursor-pointer` - Add cursor-pointer to clickable elements
50+
51+
### 3. Performance (HIGH)
52+
53+
- `image-optimization` - Use WebP, srcset, lazy loading
54+
- `reduced-motion` - Check prefers-reduced-motion
55+
- `content-jumping` - Reserve space for async content
56+
57+
### 4. Layout & Responsive (HIGH)
58+
59+
- `viewport-meta` - width=device-width initial-scale=1
60+
- `readable-font-size` - Minimum 16px body text on mobile
61+
- `horizontal-scroll` - Ensure content fits viewport width
62+
- `z-index-management` - Define z-index scale (10, 20, 30, 50)
63+
64+
### 5. Typography & Color (MEDIUM)
65+
66+
- `line-height` - Use 1.5-1.75 for body text
67+
- `line-length` - Limit to 65-75 characters per line
68+
- `font-pairing` - Match heading/body font personalities
69+
70+
### 6. Animation (MEDIUM)
71+
72+
- `duration-timing` - Use 150-300ms for micro-interactions
73+
- `transform-performance` - Use transform/opacity, not width/height
74+
- `loading-states` - Skeleton screens or spinners
75+
76+
### 7. Style Selection (MEDIUM)
77+
78+
- `style-match` - Match style to product type
79+
- `consistency` - Use same style across all pages
80+
- `no-emoji-icons` - Use SVG icons, not emojis
81+
82+
### 8. Charts & Data (LOW)
83+
84+
- `chart-type` - Match chart type to data type
85+
- `color-guidance` - Use accessible color palettes
86+
- `data-table` - Provide table alternative for accessibility
87+
88+
## How to Use
89+
90+
Search specific domains using the CLI tool below.
91+
92+
---
93+
94+
## Prerequisites
95+
96+
Check if Python is installed:
97+
98+
```bash
99+
python3 --version || python --version
100+
```
101+
102+
If Python is not installed, install it based on user's OS:
103+
104+
**macOS:**
105+
```bash
106+
brew install python3
107+
```
108+
109+
**Ubuntu/Debian:**
110+
```bash
111+
sudo apt update && sudo apt install python3
112+
```
113+
114+
**Windows:**
115+
```powershell
116+
winget install Python.Python.3.12
117+
```
118+
119+
---
120+
121+
## How to Use This Skill
122+
123+
When user requests UI/UX work (design, build, create, implement, review, fix, improve), follow this workflow:
124+
125+
### Step 1: Analyze User Requirements
126+
127+
Extract key information from user request:
128+
- **Product type**: SaaS, e-commerce, portfolio, dashboard, landing page, etc.
129+
- **Style keywords**: minimal, playful, professional, elegant, dark mode, etc.
130+
- **Industry**: healthcare, fintech, gaming, education, etc.
131+
- **Stack**: React, Vue, Next.js, or default to `html-tailwind`
132+
133+
### Step 2: Generate Design System (REQUIRED)
134+
135+
**Always start with `--design-system`** to get comprehensive recommendations with reasoning:
136+
137+
```bash
138+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "<product_type> <industry> <keywords>" --design-system [-p "Project Name"]
139+
```
140+
141+
This command:
142+
1. Searches 5 domains in parallel (product, style, color, landing, typography)
143+
2. Applies reasoning rules from `ui-reasoning.csv` to select best matches
144+
3. Returns complete design system: pattern, style, colors, typography, effects
145+
4. Includes anti-patterns to avoid
146+
147+
**Example:**
148+
```bash
149+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service" --design-system -p "Serenity Spa"
150+
```
151+
152+
### Step 3: Supplement with Detailed Searches (as needed)
153+
154+
After getting the design system, use domain searches to get additional details:
155+
156+
```bash
157+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "<keyword>" --domain <domain> [-n <max_results>]
158+
```
159+
160+
**When to use detailed searches:**
161+
162+
| Need | Domain | Example |
163+
|------|--------|---------|
164+
| More style options | `style` | `--domain style "glassmorphism dark"` |
165+
| Chart recommendations | `chart` | `--domain chart "real-time dashboard"` |
166+
| UX best practices | `ux` | `--domain ux "animation accessibility"` |
167+
| Alternative fonts | `typography` | `--domain typography "elegant luxury"` |
168+
| Landing structure | `landing` | `--domain landing "hero social-proof"` |
169+
170+
### Step 4: Stack Guidelines (Default: html-tailwind)
171+
172+
Get implementation-specific best practices. If user doesn't specify a stack, **default to `html-tailwind`**.
173+
174+
```bash
175+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "<keyword>" --stack html-tailwind
176+
```
177+
178+
Available stacks: `html-tailwind`, `react`, `nextjs`, `vue`, `svelte`, `swiftui`, `react-native`, `flutter`, `shadcn`
179+
180+
---
181+
182+
## Search Reference
183+
184+
### Available Domains
185+
186+
| Domain | Use For | Example Keywords |
187+
|--------|---------|------------------|
188+
| `product` | Product type recommendations | SaaS, e-commerce, portfolio, healthcare, beauty, service |
189+
| `style` | UI styles, colors, effects | glassmorphism, minimalism, dark mode, brutalism |
190+
| `typography` | Font pairings, Google Fonts | elegant, playful, professional, modern |
191+
| `color` | Color palettes by product type | saas, ecommerce, healthcare, beauty, fintech, service |
192+
| `landing` | Page structure, CTA strategies | hero, hero-centric, testimonial, pricing, social-proof |
193+
| `chart` | Chart types, library recommendations | trend, comparison, timeline, funnel, pie |
194+
| `ux` | Best practices, anti-patterns | animation, accessibility, z-index, loading |
195+
| `react` | React/Next.js performance | waterfall, bundle, suspense, memo, rerender, cache |
196+
| `web` | Web interface guidelines | aria, focus, keyboard, semantic, virtualize |
197+
| `prompt` | AI prompts, CSS keywords | (style name) |
198+
199+
### Available Stacks
200+
201+
| Stack | Focus |
202+
|-------|-------|
203+
| `html-tailwind` | Tailwind utilities, responsive, a11y (DEFAULT) |
204+
| `react` | State, hooks, performance, patterns |
205+
| `nextjs` | SSR, routing, images, API routes |
206+
| `vue` | Composition API, Pinia, Vue Router |
207+
| `svelte` | Runes, stores, SvelteKit |
208+
| `swiftui` | Views, State, Navigation, Animation |
209+
| `react-native` | Components, Navigation, Lists |
210+
| `flutter` | Widgets, State, Layout, Theming |
211+
| `shadcn` | shadcn/ui components, theming, forms, patterns |
212+
213+
---
214+
215+
## Example Workflow
216+
217+
**User request:** "Làm landing page cho dịch vụ chăm sóc da chuyên nghiệp"
218+
219+
### Step 1: Analyze Requirements
220+
- Product type: Beauty/Spa service
221+
- Style keywords: elegant, professional, soft
222+
- Industry: Beauty/Wellness
223+
- Stack: html-tailwind (default)
224+
225+
### Step 2: Generate Design System (REQUIRED)
226+
227+
```bash
228+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service elegant" --design-system -p "Serenity Spa"
229+
```
230+
231+
**Output:** Complete design system with pattern, style, colors, typography, effects, and anti-patterns.
232+
233+
### Step 3: Supplement with Detailed Searches (as needed)
234+
235+
```bash
236+
# Get UX guidelines for animation and accessibility
237+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "animation accessibility" --domain ux
238+
239+
# Get alternative typography options if needed
240+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "elegant luxury serif" --domain typography
241+
```
242+
243+
### Step 4: Stack Guidelines
244+
245+
```bash
246+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "layout responsive form" --stack html-tailwind
247+
```
248+
249+
**Then:** Synthesize design system + detailed searches and implement the design.
250+
251+
---
252+
253+
## Output Formats
254+
255+
The `--design-system` flag supports two output formats:
256+
257+
```bash
258+
# ASCII box (default) - best for terminal display
259+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system
260+
261+
# Markdown - best for documentation
262+
python3 .claude/skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system -f markdown
263+
```
264+
265+
---
266+
267+
## Tips for Better Results
268+
269+
1. **Be specific with keywords** - "healthcare SaaS dashboard" > "app"
270+
2. **Search multiple times** - Different keywords reveal different insights
271+
3. **Combine domains** - Style + Typography + Color = Complete design system
272+
4. **Always check UX** - Search "animation", "z-index", "accessibility" for common issues
273+
5. **Use stack flag** - Get implementation-specific best practices
274+
6. **Iterate** - If first search doesn't match, try different keywords
275+
276+
---
277+
278+
## Common Rules for Professional UI
279+
280+
These are frequently overlooked issues that make UI look unprofessional:
281+
282+
### Icons & Visual Elements
283+
284+
| Rule | Do | Don't |
285+
|------|----|----- |
286+
| **No emoji icons** | Use SVG icons (Heroicons, Lucide, Simple Icons) | Use emojis like 🎨 🚀 ⚙️ as UI icons |
287+
| **Stable hover states** | Use color/opacity transitions on hover | Use scale transforms that shift layout |
288+
| **Correct brand logos** | Research official SVG from Simple Icons | Guess or use incorrect logo paths |
289+
| **Consistent icon sizing** | Use fixed viewBox (24x24) with w-6 h-6 | Mix different icon sizes randomly |
290+
291+
### Interaction & Cursor
292+
293+
| Rule | Do | Don't |
294+
|------|----|----- |
295+
| **Cursor pointer** | Add `cursor-pointer` to all clickable/hoverable cards | Leave default cursor on interactive elements |
296+
| **Hover feedback** | Provide visual feedback (color, shadow, border) | No indication element is interactive |
297+
| **Smooth transitions** | Use `transition-colors duration-200` | Instant state changes or too slow (>500ms) |
298+
299+
### Light/Dark Mode Contrast
300+
301+
| Rule | Do | Don't |
302+
|------|----|----- |
303+
| **Glass card light mode** | Use `bg-white/80` or higher opacity | Use `bg-white/10` (too transparent) |
304+
| **Text contrast light** | Use `#0F172A` (slate-900) for text | Use `#94A3B8` (slate-400) for body text |
305+
| **Muted text light** | Use `#475569` (slate-600) minimum | Use gray-400 or lighter |
306+
| **Border visibility** | Use `border-gray-200` in light mode | Use `border-white/10` (invisible) |
307+
308+
### Layout & Spacing
309+
310+
| Rule | Do | Don't |
311+
|------|----|----- |
312+
| **Floating navbar** | Add `top-4 left-4 right-4` spacing | Stick navbar to `top-0 left-0 right-0` |
313+
| **Content padding** | Account for fixed navbar height | Let content hide behind fixed elements |
314+
| **Consistent max-width** | Use same `max-w-6xl` or `max-w-7xl` | Mix different container widths |
315+
316+
---
317+
318+
## Pre-Delivery Checklist
319+
320+
Before delivering UI code, verify these items:
321+
322+
### Visual Quality
323+
- [ ] No emojis used as icons (use SVG instead)
324+
- [ ] All icons from consistent icon set (Heroicons/Lucide)
325+
- [ ] Brand logos are correct (verified from Simple Icons)
326+
- [ ] Hover states don't cause layout shift
327+
- [ ] Use theme colors directly (bg-primary) not var() wrapper
328+
329+
### Interaction
330+
- [ ] All clickable elements have `cursor-pointer`
331+
- [ ] Hover states provide clear visual feedback
332+
- [ ] Transitions are smooth (150-300ms)
333+
- [ ] Focus states visible for keyboard navigation
334+
335+
### Light/Dark Mode
336+
- [ ] Light mode text has sufficient contrast (4.5:1 minimum)
337+
- [ ] Glass/transparent elements visible in light mode
338+
- [ ] Borders visible in both modes
339+
- [ ] Test both modes before delivery
340+
341+
### Layout
342+
- [ ] Floating elements have proper spacing from edges
343+
- [ ] No content hidden behind fixed navbars
344+
- [ ] Responsive at 375px, 768px, 1024px, 1440px
345+
- [ ] No horizontal scroll on mobile
346+
347+
### Accessibility
348+
- [ ] All images have alt text
349+
- [ ] Form inputs have labels
350+
- [ ] Color is not the only indicator
351+
- [ ] `prefers-reduced-motion` respected

0 commit comments

Comments
 (0)