Skip to content

Latest commit

Β 

History

History
395 lines (314 loc) Β· 10.2 KB

File metadata and controls

395 lines (314 loc) Β· 10.2 KB

Visual Implementation Guide

Connection Status Indicators

🟒 CONNECTED State

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            ● (green) β”‚  ← Minimal green dot indicator
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Location: Fixed top-right corner
  • Animation: Pulse effect
  • Behavior: Always visible when connected

⚠️ RECONNECTING State

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ⚠ Connection lost. Reconnecting... (attempt 3/10)  [Dismiss] β”‚
β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 30%                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     ^                                           ^        ^
     Icon                                     Progress  Button
  • Background: Yellow/amber gradient (#f59e0b β†’ #d97706)
  • Features:
    • Animated progress bar (shimmer effect)
    • Dismiss button to hide banner
    • Shows attempt count (X/10)
  • Input: Disabled during reconnection
  • Messages: Remain visible

πŸ”΄ OFFLINE State

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ⚠ You're offline. Messages will be sent when you reconnect    β”‚
β”‚                                                    [Try Again]  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Background: Red/rose gradient (#f43f5e β†’ #e11d48)
  • Features:
    • Try Again button to retry connection
    • Clear offline indicator
  • Input: Enabled (messages queued locally)
  • Messages: Remain visible

πŸ”΅ SYNCING State

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ⟳ Syncing messages...                      β”‚
β”‚   (spinner animation)                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Background: Blue gradient (#3b82f6 β†’ #1d4ed8)
  • Features:
    • Animated spinner
    • Auto-dismisses when complete
  • Behavior: Temporary state during sync

Message Animations

πŸ“¨ Incoming Message

Animation Timeline:
0ms:   opacity: 0, y: 20px, scale: 0.95
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                 β”‚ ← Below, small, invisible
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

200ms: opacity: 1, y: 0, scale: 1
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Hello World!    β”‚ ← In position, full size, visible
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Duration: 200ms
  • Easing: cubic-bezier(0.25, 0.1, 0.25, 1.0)
  • Effect: Fade in from bottom with scale

πŸ“€ Sending Message

Animation Timeline:
0ms:   opacity: 0.7, x: 10px
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                 β”‚ ← Slightly right, semi-transparent
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

150ms: opacity: 1, x: 0
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Sending...    β—‹ β”‚ ← In position, fully visible
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Duration: 150ms
  • Easing: ease-out
  • Effect: Slide in from right with fade

βœ… Message Confirmed

Animation Timeline:
Checkmark pulses:
0ms:   scale: 1.0    βœ“
200ms: scale: 1.3    βœ“ (larger)
400ms: scale: 1.0    βœ“
  • Duration: 400ms
  • Effect: Checkmark scales up and back

πŸ—‘οΈ Message Deleted

Animation Timeline:
0ms:   opacity: 1, height: 60px
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Message here    β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

200ms: opacity: 0, height: 0
      ─ (collapsed)
  • Duration: 200ms
  • Easing: ease-in-out
  • Effect: Collapse and fade

Presence Animations

πŸ‘€ User Online

Status Dot:
0ms:   scale: 0
       β—‹ (invisible)

300ms: scale: 1 (spring)
       ● (green, bouncy entrance)

Name Entry:
0ms:   opacity: 0, x: -20px
       ────────

300ms: opacity: 1, x: 0
       Alice

πŸ‘₯ User Offline

Status Dot Color:
0ms:   green (#22c55e)
       ●

500ms: gray (#71717a)
       ●

Then after 5 seconds:
       opacity: 1 β†’ 0
       x: 0 β†’ -20px (fade left)

⌨️ Typing Indicator

Three dots bouncing with stagger:

●  β—‹  β—‹     ← Dot 1 up
β—‹  ●  β—‹     ← Dot 2 up
β—‹  β—‹  ●     ← Dot 3 up
●  β—‹  β—‹     ← Repeat

Stagger: 100ms between each dot
Cycle: 600ms per complete bounce

UI Transitions

πŸ—” Modal Open

Backdrop:
0ms:   opacity: 0 (invisible)
150ms: opacity: 0.5 (semi-transparent dark overlay)

Modal Content:
0ms:   opacity: 0, scale: 0.95 (small, invisible)
       β”Œβ”€β”€β”€β”€β”€β”
       β”‚  β–‘  β”‚
       β””β”€β”€β”€β”€β”€β”˜

200ms: opacity: 1, scale: 1 (full size, visible)
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚  Modal    β”‚
       β”‚  Content  β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Backdrop: 150ms fade
  • Modal: 200ms scale with expo-out easing

πŸ“„ Page Transitions

Exit Animation:

0ms:   opacity: 1, x: 0
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   Page    β”‚ ← Visible, in place
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

150ms: opacity: 0, x: -20px
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€
       β”‚   Pa      ← Faded, moved left
       └────────

Enter Animation:

0ms:   opacity: 0, x: 20px
              ────────┐
              Page    β”‚ ← Invisible, right
              β”€β”€β”€β”€β”€β”€β”€β”€β”˜

200ms: opacity: 1, x: 0
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   Page    β”‚ ← Visible, in place
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Hover Effects

πŸ”˜ Button Hover

Normal:     scale(1.0)
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚  Button  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Hover:      scale(1.02)
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Button   β”‚ ← Slightly larger
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Active:     scale(0.98)
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚ Button β”‚ ← Pressed down
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Duration: 100ms

πŸ“‡ Card Hover

Normal:     y: 0, shadow-md
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Card    β”‚
            β”‚  Content  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            ___shadow___

Hover:      y: -2px, shadow-lg
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Card    β”‚ ← Lifted
            β”‚  Content  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            ____shadow____
  • Duration: 150ms

πŸ”— Link Hover

Normal:     color: blue, opacity: 1
            Link Text

Hover:      color: dark-blue, opacity: 0.8
            Link Text ← Darker, slightly transparent
  • Duration: 100ms

Utility Classes Quick Reference

Fade

  • .fade-in - Fade in
  • .fade-out - Fade out

Slide

  • .slide-in-left - From left
  • .slide-in-right - From right
  • .slide-in-top - From top
  • .slide-in-bottom - From bottom

Scale & Bounce

  • .scale-in - Scale in
  • .bounce-in - Bounce in
  • .shake - Shake animation

Loading

  • .spinner - Rotating spinner
  • .pulse-loading - Pulsing
  • .skeleton - Skeleton loader

Hover

  • .hover-scale - Button scale
  • .card-hover - Card lift
  • .link-hover - Link transition

Responsive Behavior

Mobile (<768px)

  • Connection banners stack vertically
  • Buttons below content
  • Reduced padding and font sizes
  • Touch-optimized hit areas

Tablet (768px - 1024px)

  • Full banner layout
  • Adjusted spacing
  • Optimized for touch

Desktop (>1024px)

  • Full-featured layout
  • Hover effects enabled
  • Optimal spacing and typography

Accessibility

Reduced Motion

@media (prefers-reduced-motion: reduce) {
  /* All animations: 0.01ms (instant) */
}

Users with "Reduce Motion" enabled see:

  • Instant state changes (no animations)
  • Immediate transitions
  • Full functionality maintained

Browser Support Matrix

Browser Animations Hover Gradients Notes
Chrome βœ… Full βœ… Full βœ… Full Recommended
Firefox βœ… Full βœ… Full βœ… Full Recommended
Safari βœ… Full βœ… Full βœ… Full Recommended
Edge βœ… Full βœ… Full βœ… Full Recommended
iOS Safari βœ… Full ⚠️ Touch βœ… Full Touch events
Chrome Mobile βœ… Full ⚠️ Touch βœ… Full Touch events
IE11 ⚠️ Basic ⚠️ Basic ⚠️ Basic Degraded

Legend:

  • βœ… Full support with all features
  • ⚠️ Partial support or degraded
  • ❌ Not supported

Performance Tips

  1. GPU Acceleration: All animations use transform and opacity
  2. No Layout Shifts: Avoid animating width, height, margin
  3. Limit Concurrent: Don't animate too many elements at once
  4. Profile: Use Chrome DevTools Performance tab
  5. Test Mobile: Verify 60fps on lower-end devices

Visual Guide Version: 1.0.0
Last Updated: December 13, 2024
Status: Complete