File size: 11,780 Bytes
b190b45 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# Cursor-Inspired UI Design System π¨
**Modern Flat + Subtle Depth β’ 200ms Smooth Animations β’ Purple Accents**
Complete redesign of the crypto trading platform with a Cursor-inspired modern flat design system.
---
## π Quick Start
### 1. View the Component Showcase
```
Open: http://localhost:8000/static/cursor-ui-showcase.html
```
See all components in action with interactive examples.
### 2. Create a New Page
Copy [page-template.html](static/page-template.html) to start a new page:
```bash
cp static/page-template.html static/pages/your-page/index.html
```
The template includes:
- β
Proper HTML structure
- β
Cursor CSS imports (in correct order)
- β
Header & sidebar containers
- β
Component examples (cards, buttons, tables, alerts)
- β
Page initialization script
### 3. Update Existing Pages
Replace the `<head>` CSS imports:
```html
<!-- OLD CSS (Remove) -->
<link rel="stylesheet" href="/static/shared/css/design-system.css">
<link rel="stylesheet" href="/static/shared/css/global.css">
<link rel="stylesheet" href="/static/shared/css/components.css">
<link rel="stylesheet" href="/static/shared/css/layout.css">
<!-- NEW Cursor Design System (Add) -->
<link rel="stylesheet" href="/static/shared/css/design-system-cursor.css">
<link rel="stylesheet" href="/static/shared/css/layout-cursor.css">
<link rel="stylesheet" href="/static/shared/css/components-cursor.css">
<link rel="stylesheet" href="/static/shared/css/animations-cursor.css">
```
Change theme to dark:
```html
<html lang="en" data-theme="dark">
```
---
## π¦ What's Included
### Core CSS Files (4 files)
1. **[design-system-cursor.css](static/shared/css/design-system-cursor.css)** - Design Tokens
- Colors (deep dark theme, purple accents)
- Typography (Inter font, refined scale)
- Spacing (4px grid system)
- Shadows, animations, breakpoints
2. **[layout-cursor.css](static/shared/css/layout-cursor.css)** - Layout System
- 56px header with breadcrumb & search
- 240px sidebar (collapsible to 60px)
- Responsive mobile breakpoints
3. **[components-cursor.css](static/shared/css/components-cursor.css)** - Components
- Buttons, Cards, Forms, Tables
- Badges, Alerts, Modals, Tooltips
- Progress bars, Skeletons, Dropdowns
4. **[animations-cursor.css](static/shared/css/animations-cursor.css)** - Animations
- Fade, slide, scale animations
- Hover effects (lift, glow, scale)
- Loading states (spinners, dots)
### Layout Components (2 files)
- **[header.html](static/shared/layouts/header.html)** - Cursor-style header
- **[sidebar.html](static/shared/layouts/sidebar.html)** - Icon-first navigation
### Updated Pages (3 files)
- β
[Dashboard](static/pages/dashboard/index.html)
- β
[Market](static/pages/market/index.html)
- β
[AI Models](static/pages/models/index.html)
---
## π¨ Design Tokens
### Colors
```css
/* Backgrounds - Deep Dark */
--bg-primary: #0A0A0A;
--bg-secondary: #121212;
--surface-primary: #1E1E1E; /* Cards */
--surface-secondary: #252525; /* Elevated */
/* Text */
--text-primary: #EFEFEF; /* High contrast */
--text-secondary: #A0A0A0; /* Muted */
--text-tertiary: #666666; /* Very subtle */
/* Accent - Purple (Cursor-style) */
--accent-purple: #8B5CF6;
--accent-purple-gradient: linear-gradient(135deg, #8B5CF6, #6D28D9);
/* Semantic */
--color-success: #10B981; /* Green */
--color-warning: #F59E0B; /* Amber */
--color-danger: #EF4444; /* Red */
--color-info: #06B6D4; /* Cyan */
```
### Typography
```css
/* Font Family */
--font-primary: 'Inter', system-ui, sans-serif;
/* Sizes */
--text-xs: 11px; /* Labels */
--text-sm: 13px; /* Small text */
--text-base: 15px; /* Body (default) */
--text-lg: 17px; /* Emphasized */
--text-xl: 20px; /* H3 */
--text-2xl: 24px; /* H2 */
--text-3xl: 30px; /* H1 */
/* Weights */
--weight-normal: 400;
--weight-medium: 500;
--weight-semibold: 600;
--weight-bold: 700;
```
### Spacing (4px Grid)
```css
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px; /* Common gap */
--space-6: 24px; /* Card padding */
--space-8: 32px; /* Section spacing */
--space-16: 64px; /* Large sections */
```
### Animations
```css
/* Duration - Cursor-style (Fast & Snappy) */
--duration-normal: 200ms; /* Default */
/* Easing */
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* Material Design */
```
---
## π§© Component Examples
### Buttons
```html
<!-- Primary Button (Purple Gradient) -->
<button class="btn btn-primary">Primary Action</button>
<!-- Secondary Button (Flat) -->
<button class="btn btn-secondary">Secondary Action</button>
<!-- Ghost Button -->
<button class="btn btn-ghost">Cancel</button>
<!-- Sizes -->
<button class="btn btn-primary btn-sm">Small</button>
<button class="btn btn-primary">Default</button>
<button class="btn btn-primary btn-lg">Large</button>
<!-- Icon Button -->
<button class="btn btn-icon btn-primary">
<svg width="20" height="20">...</svg>
</button>
```
### Cards
```html
<!-- Basic Card -->
<div class="card">
<h3>Card Title</h3>
<p>Card content goes here.</p>
</div>
<!-- Card with Header -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Title</h3>
<button class="btn btn-ghost btn-sm">Action</button>
</div>
<div class="card-body">
Content...
</div>
<div class="card-footer">
<button class="btn btn-secondary">Cancel</button>
<button class="btn btn-primary">Save</button>
</div>
</div>
<!-- Stat Card -->
<div class="stat-card">
<div class="stat-icon">
<svg>...</svg>
</div>
<div class="stat-value">$12,345</div>
<div class="stat-label">Total Volume</div>
<div class="stat-change positive">β +12.5%</div>
</div>
```
### Forms
```html
<div class="input-group">
<label class="input-label">Email Address</label>
<input type="email" class="input" placeholder="[email protected]" />
<span class="input-hint">We'll never share your email.</span>
</div>
<select class="select">
<option>Choose an option</option>
<option>Option 1</option>
</select>
<textarea class="textarea" placeholder="Enter message..."></textarea>
```
### Tables
```html
<div class="table-container">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="text-right">Change</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bitcoin</td>
<td>$45,123</td>
<td class="text-right" style="color: var(--color-success);">+5.2%</td>
</tr>
</tbody>
</table>
</div>
```
### Badges
```html
<span class="badge badge-primary">Primary</span>
<span class="badge badge-success pill">Success</span>
<span class="badge badge-warning pill">Warning</span>
```
### Alerts
```html
<div class="alert alert-info">
<svg class="alert-icon" width="20" height="20">...</svg>
<div class="alert-content">
<div class="alert-title">Information</div>
<div class="alert-message">This is an informational message.</div>
</div>
</div>
```
---
## β¨ Animations
### Entrance Animations
```html
<!-- Fade In -->
<div class="animate-fade-in">Content</div>
<!-- Fade In Up -->
<div class="animate-fade-in-up">Content</div>
<!-- Stagger Children -->
<div class="stagger-fade-in">
<div>Item 1 (0ms delay)</div>
<div>Item 2 (50ms delay)</div>
<div>Item 3 (100ms delay)</div>
</div>
```
### Hover Effects
```html
<!-- Lift 2px on Hover -->
<div class="card hover-lift">Hover me</div>
<!-- Scale to 102% on Hover -->
<div class="card hover-scale">Hover me</div>
<!-- Purple Glow on Hover -->
<div class="card hover-glow">Hover me</div>
```
### Loading States
```html
<!-- Spinner -->
<div class="spinner"></div>
<div class="spinner spinner-lg"></div>
<!-- Dots Loader -->
<div class="dots-loader">
<span></span>
<span></span>
<span></span>
</div>
<!-- Skeleton -->
<div class="skeleton skeleton-text" style="width: 200px;"></div>
```
---
## π± Mobile Responsive
The design system is mobile-first:
**Breakpoints:**
- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px
**Automatic Behavior:**
- Sidebar slides in as overlay on mobile
- Header search hidden on mobile
- Cards go full-width with reduced padding
- Tables scroll horizontally
---
## π― Best Practices
### 1. Always Load CSS in Order
```html
<!-- Correct Order -->
<link rel="stylesheet" href="...design-system-cursor.css">
<link rel="stylesheet" href="...layout-cursor.css">
<link rel="stylesheet" href="...components-cursor.css">
<link rel="stylesheet" href="...animations-cursor.css">
```
### 2. Use CSS Variables
```css
/* Good β
*/
padding: var(--space-4);
color: var(--text-secondary);
/* Avoid β */
padding: 16px;
color: #A0A0A0;
```
### 3. Use Component Classes
```html
<!-- Good β
-->
<button class="btn btn-primary">Click me</button>
<!-- Avoid β -->
<button style="background: purple; padding: 10px;">Click me</button>
```
### 4. Follow 200ms Standard
All transitions should be 200ms for consistent Cursor-like feel.
---
## π Documentation
- **[Integration Guide](CURSOR_UI_INTEGRATION_GUIDE.md)** - Detailed integration instructions
- **[Component Showcase](static/cursor-ui-showcase.html)** - Visual reference
- **[Page Template](static/page-template.html)** - Quick-start template
---
## π οΈ Customization
Override CSS variables in your page-specific CSS:
```css
/* custom-page.css */
:root {
/* Change accent color */
--accent-purple: #3B82F6; /* Blue instead of purple */
/* Adjust spacing */
--space-6: 32px; /* Increase card padding */
/* Custom durations */
--duration-normal: 250ms; /* Slightly slower */
}
```
---
## β
Migration Checklist
When updating an existing page:
- [ ] Change `data-theme="light"` to `data-theme="dark"`
- [ ] Replace old CSS imports with Cursor design system
- [ ] Update favicon to purple gradient
- [ ] Replace button classes: `.btn-gradient` β `.btn .btn-primary`
- [ ] Replace card classes: `.glass-card` β `.card`
- [ ] Update form inputs: `.form-input` β `.input`
- [ ] Test mobile responsiveness (< 768px)
- [ ] Verify sidebar collapse works
- [ ] Check all animations load correctly
---
## π Quick Reference
| Element | Class | Example |
|---------|-------|---------|
| Button Primary | `.btn .btn-primary` | Purple gradient |
| Button Secondary | `.btn .btn-secondary` | Flat dark surface |
| Card | `.card` | Flat with subtle shadow |
| Stat Card | `.stat-card` | Dashboard metrics |
| Input | `.input` | Text input field |
| Badge | `.badge .badge-primary` | Label/tag |
| Alert | `.alert .alert-info` | Info message |
| Table | `.table-container .table` | Data table |
---
## π What Makes It "Cursor-Like"
1. β
**Deep dark theme** (`#0A0A0A` - true black)
2. β
**Purple accent** (#8B5CF6 - distinctive)
3. β
**200ms animations** (fast, snappy)
4. β
**Flat + subtle depth** (shadows for hierarchy)
5. β
**Generous spacing** (breathable, not cramped)
6. β
**Hover lift** (2px translateY)
7. β
**Inter typography** (clean, modern)
8. β
**Icon-first nav** (collapsible sidebar)
9. β
**Professional polish** (attention to detail)
10. β
**Minimal borders** (background colors for separation)
---
**Version:** 1.0.0
**Last Updated:** December 10, 2025
**Status:** β
Production Ready
|