File size: 24,298 Bytes
8059bf0 | 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 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | # Authentication Views Visual Guide
This document describes the visual design and layout of the authentication views.
## Layout Structure
Both LoginView and RegisterView use the AuthLayout component, which provides:
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββββββββββββββββββββββββββββββββββββββ β
β β β β
β β Sub2API Logo β β
β β "Subscription to API Conversion" β β
β β β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββ β
β β β β
β β [Form Content - White Card] β β
β β β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β [Footer Links] β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ
Background: Gradient (Indigo β White β Purple)
Card: White with rounded corners and shadow
Max Width: 28rem (448px)
Centered: Both horizontally and vertically
```
## LoginView Visual Design
### Default State
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β β
β π· Sub2API β
β Subscription to API Conversion Platform β
β β
β βββββββββββββββββββββββββββββββββββββββ β
β β β β
β β Welcome Back β β
β β Sign in to your account to continueβ β
β β β β
β β Username β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Enter your username β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β Password β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β’β’β’β’β’β’β’β’β’β’β’β’β’β’ β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β β Remember me β β
β β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Sign In β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β Don't have an account? Sign up β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
### Loading State
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββββββββββββ β
β β Username β β
β β ββββββββββββββββββββββββββββ β β
β β β john_doe β β β
β β ββββββββββββββββββββββββββββ β β
β β β β
β β Password β β
β β ββββββββββββββββββββββββββββ β β
β β β β’β’β’β’β’β’β’β’β’β’β’β’ β β β
β β ββββββββββββββββββββββββββββ β β
β β β β
β β β Remember me β β
β β β β
β β ββββββββββββββββββββββββββββ β β
β β β β³ Signing in... β β β Spinner
β β ββββββββββββββββββββββββββββ β β
β β (Button disabled) β β
β ββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
### Error State
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββββββββββββ β
β β Username β β
β β ββββββββββββββββββββββββββββ β β
β β β jo β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Username must be at least 3 β β Red text
β β characters β β
β β β β
β β Password β β
β β ββββββββββββββββββββββββββββ β β
β β β β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Password is required β β Red text
β β β β
β β ββββββββββββββββββββββββββββ β β
β β β β Invalid username or β β β Error banner
β β β password. Please try β β
β β β again. β β
β β ββββββββββββββββββββββββββββ β β
β β β β
β β ββββββββββββββββββββββββββββ β β
β β β Sign In β β β
β β ββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
## RegisterView Visual Design
### Default State
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β β
β π· Sub2API β
β Subscription to API Conversion Platform β
β β
β βββββββββββββββββββββββββββββββββββββββ β
β β β β
β β Create Account β β
β β Sign up to start using Sub2API β β
β β β β
β β Username β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Choose a username β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β Email β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β your.email@example.com β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β Password β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Create a strong password β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β At least 8 characters with letters β β
β β and numbers β β
β β β β
β β Confirm Password β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Confirm your password β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β Create Account β β β
β β ββββββββββββββββββββββββββββββββββ β β
β β β β
β β By signing up, you agree to our β β
β β Terms of Service and Privacy Policyβ β
β β β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β Already have an account? Sign in β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
### Validation Errors
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββββββββββββ β
β β Username β β
β β ββββββββββββββββββββββββββββ β β
β β β jane@smith β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Username can only contain β β Red text
β β letters, numbers, _, and - β β
β β β β
β β Email β β
β β ββββββββββββββββββββββββββββ β β
β β β invalid-email β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Please enter a valid email β β Red text
β β address β β
β β β β
β β Password β β
β β ββββββββββββββββββββββββββββ β β
β β β short β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Password must be at least 8 β β Red text
β β characters with letters β β
β β and numbers β β
β β β β
β β Confirm Password β β
β β ββββββββββββββββββββββββββββ β β
β β β different β β β Red border
β β ββββββββββββββββββββββββββββ β β
β β β Passwords do not match β β Red text
β β β β
β ββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
### Loading State
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββββββββββββ β
β β Username: jane_smith β β
β β Email: jane@example.com β β
β β Password: β’β’β’β’β’β’β’β’β’β’β’β’ β β
β β Confirm: β’β’β’β’β’β’β’β’β’β’β’β’ β β
β β β β
β β ββββββββββββββββββββββββββββ β β
β β β β³ Creating account... β β β Spinner
β β ββββββββββββββββββββββββββββ β β
β β (All inputs disabled) β β
β ββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
## Color Palette
### Primary Colors
- **Indigo-600**: `#4F46E5` - Primary buttons, links, brand color
- **Indigo-700**: `#4338CA` - Button hover state
- **Indigo-500**: `#6366F1` - Focus ring
### Neutral Colors
- **Gray-900**: `#111827` - Headings
- **Gray-700**: `#374151` - Labels
- **Gray-600**: `#4B5563` - Body text
- **Gray-500**: `#6B7280` - Helper text
- **Gray-300**: `#D1D5DB` - Borders
- **Gray-100**: `#F3F4F6` - Disabled backgrounds
- **White**: `#FFFFFF` - Card backgrounds
### Error Colors
- **Red-600**: `#DC2626` - Error text
- **Red-500**: `#EF4444` - Error border, focus ring
- **Red-50**: `#FEF2F2` - Error banner background
- **Red-200**: `#FECACA` - Error banner border
### Success Colors
- **Green-600**: `#16A34A` - Success text
- **Green-50**: `#F0FDF4` - Success banner background
### Background Gradient
- **From**: Indigo-100 (`#E0E7FF`)
- **Via**: White (`#FFFFFF`)
- **To**: Purple-100 (`#F3E8FF`)
## Typography
### Font Family
- **Default**: System font stack (`ui-sans-serif, system-ui, -apple-system, ...`)
### Font Sizes
- **Headings (h2)**: `1.5rem` (24px), `font-bold`
- **Body**: `0.875rem` (14px), `font-normal`
- **Labels**: `0.875rem` (14px), `font-medium`
- **Helper text**: `0.75rem` (12px), `font-normal`
- **Error text**: `0.875rem` (14px), `font-normal`
### Line Heights
- **Headings**: `1.5`
- **Body**: `1.5`
- **Helper text**: `1.25`
## Spacing
### Card Spacing
- **Padding**: `2rem` (32px) all sides
- **Gap between sections**: `1.5rem` (24px)
- **Gap between fields**: `1rem` (16px)
### Input Spacing
- **Padding**: `0.5rem 1rem` (8px 16px)
- **Label margin-bottom**: `0.25rem` (4px)
- **Error text margin-top**: `0.25rem` (4px)
### Button Spacing
- **Padding**: `0.5rem 1rem` (8px 16px)
- **Margin-top**: `1rem` (16px)
## Interactive States
### Input States
**Default:**
```css
border: 1px solid #D1D5DB (gray-300)
focus: 2px ring #6366F1 (indigo-500)
```
**Error:**
```css
border: 1px solid #EF4444 (red-500)
focus: 2px ring #EF4444 (red-500)
```
**Disabled:**
```css
background: #F3F4F6 (gray-100)
cursor: not-allowed
opacity: 0.6
```
### Button States
**Default:**
```css
background: #4F46E5 (indigo-600)
text: #FFFFFF (white)
shadow: shadow-sm
```
**Hover:**
```css
background: #4338CA (indigo-700)
transition: colors 150ms
```
**Focus:**
```css
outline: none
ring: 2px offset-2 #6366F1 (indigo-500)
```
**Disabled:**
```css
opacity: 0.5
cursor: not-allowed
```
**Loading:**
```css
opacity: 0.5
cursor: not-allowed
+ spinning icon
```
### Link States
**Default:**
```css
color: #4F46E5 (indigo-600)
font-weight: 500 (medium)
```
**Hover:**
```css
color: #6366F1 (indigo-500)
transition: colors 150ms
```
## Responsive Design
### Breakpoints
**Mobile (< 640px):**
```
- Full width container
- Padding: 1rem (16px)
- Smaller text sizes
```
**Tablet (640px - 768px):**
```
- Max width: 28rem (448px)
- Centered layout
- Standard spacing
```
**Desktop (> 768px):**
```
- Max width: 28rem (448px)
- Centered layout
- Standard spacing
```
### Mobile Optimizations
1. Touch-friendly tap targets (44px minimum)
2. Proper keyboard handling on mobile
3. Prevent zoom on input focus
4. Responsive font sizes
5. Full-width inputs
6. Adequate spacing for thumbs
## Animations
### Transitions
- Color changes: `150ms ease-in-out`
- Opacity changes: `150ms ease-in-out`
- Transform: `150ms ease-in-out`
### Loading Spinner
```css
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
animation: spin 1s linear infinite;
```
### Toast Animations
- Enter: Slide in from right + fade in
- Exit: Slide out to right + fade out
- Duration: 300ms
## Accessibility Features
### Visual Indicators
- Clear focus states (2px ring)
- Error states (red border + red text)
- Loading states (spinner + text)
- Success states (green toast)
### Color Contrast
- Text on white: > 7:1 (AAA)
- Labels on white: > 4.5:1 (AA)
- Buttons: > 4.5:1 (AA)
- Error text: > 4.5:1 (AA)
### Interactive Elements
- Minimum size: 44x44px (mobile)
- Clear hover states
- Distinct disabled states
- Keyboard accessible
### Screen Reader Support
- Proper labels on all inputs
- ARIA attributes where needed
- Error announcements
- Loading state announcements
## Icons
### Loading Spinner
```svg
<svg class="animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"/>
</svg>
```
### Error Icon
```svg
<svg class="h-5 w-5 text-red-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
</svg>
```
## Browser Compatibility
### Supported Browsers
- Chrome/Edge: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Mobile Safari: iOS 14+
- Chrome Mobile: Latest 2 versions
### CSS Features Used
- Flexbox (full support)
- CSS Grid (full support)
- CSS Transitions (full support)
- CSS Custom Properties (full support)
- Gradient backgrounds (full support)
### JavaScript Features Used
- ES2015+ syntax
- Async/await
- Optional chaining
- Nullish coalescing
- Modules
## Print Styles
(Not applicable for authentication pages - users shouldn't print login forms)
## Dark Mode Considerations
**Future Enhancement:**
- Dark mode toggle in user preferences
- System preference detection
- Persistent dark mode setting
- Adjusted color palette for dark backgrounds
```css
/* Example dark mode colors (not implemented yet) */
dark:bg-gray-900
dark:text-white
dark:border-gray-700
```
## Performance Metrics
### Target Metrics
- First Contentful Paint (FCP): < 1s
- Largest Contentful Paint (LCP): < 2.5s
- Time to Interactive (TTI): < 3s
- Cumulative Layout Shift (CLS): < 0.1
- First Input Delay (FID): < 100ms
### Optimization Strategies
- Lazy load non-critical resources
- Minimize initial bundle size
- Use efficient animations (transform, opacity)
- Optimize images (logo, icons)
- Preconnect to API domain
- Cache static assets
## Component Size
### Bundle Impact
- LoginView.vue: ~4 KB (minified)
- RegisterView.vue: ~6 KB (minified)
- AuthLayout.vue: ~1 KB (minified)
- Total: ~11 KB (excluding dependencies)
### Dependencies
- Vue 3: ~40 KB (runtime)
- Vue Router: ~15 KB
- Pinia: ~10 KB
- Total framework overhead: ~65 KB (gzipped)
## Testing Checklist
### Visual Regression Tests
- [ ] Default state (login)
- [ ] Default state (register)
- [ ] Loading state
- [ ] Error state (validation)
- [ ] Error state (API)
- [ ] Success state
- [ ] Mobile view
- [ ] Tablet view
- [ ] Desktop view
- [ ] Focus states
- [ ] Hover states
### Cross-browser Tests
- [ ] Chrome (Windows, Mac, Linux)
- [ ] Firefox (Windows, Mac, Linux)
- [ ] Safari (Mac, iOS)
- [ ] Edge (Windows)
- [ ] Chrome Mobile (Android)
- [ ] Safari Mobile (iOS)
### Accessibility Tests
- [ ] Keyboard navigation
- [ ] Screen reader (NVDA)
- [ ] Screen reader (JAWS)
- [ ] Screen reader (VoiceOver)
- [ ] Color contrast
- [ ] Focus indicators
- [ ] Error announcements
## Design Assets
### Figma/Sketch Files
(Not applicable - designed directly in code with Tailwind)
### Design Tokens
- Defined in Tailwind config
- Consistent with design system
- Reusable across all components
### Iconography
- SVG icons inline
- Heroicons (outline and solid)
- Consistent stroke width
- Accessible with proper ARIA labels
---
**Note:** This visual guide is for reference and documentation purposes. The actual implementation is in the Vue components using TailwindCSS classes.
|