Skip to content

Latest commit

 

History

History
374 lines (308 loc) · 11.5 KB

File metadata and controls

374 lines (308 loc) · 11.5 KB

DroidMate Interactive UI - Implementation Checklist & Architecture

Quick Start

Phase 1: Assets & Setup (30 min)

  • Create droidmate-logo.svg with animated robot design
  • Create static/img/ directory if not exists
  • Copy logo to static/img/droidmate-logo.svg
  • Create templates/new/dashboard_interactive.html
  • Update templates/base_interactive.html

Phase 2: Backend Integration (20 min)

  • Update app.py route: @app.route('/') → templates/new/dashboard_interactive.html
  • Add optional: @app.route('/api/dashboard/stats') for real-time updates
  • Test homepage loads with new dashboard

Phase 3: Navigation Wiring (30 min)

  • Wire all operation cards to correct routes
  • Test drill-down navigation (hub → detail → back)
  • Verify all action links work
  • Test back buttons return to hub

Phase 4: Responsive Design (20 min)

  • Test mobile (< 640px): Logo centered, 2-col grid
  • Test tablet (640-1024px): 3-col operation grid
  • Test desktop (> 1024px): Full 5-col spread
  • Verify stats display on all sizes

Phase 5: Polish & Animation (15 min)

  • Test logo animations (pulse + spin)
  • Verify hover effects on cards
  • Check transition smoothness
  • Test keyboard navigation

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│                    DroidMate Hub                             │
│                                                               │
│              ┌──────────────────────┐                        │
│              │  Animated Logo       │                        │
│              │  (Spinning Ring)     │                        │
│              └──────────────────────┘                        │
│                       │                                       │
│      ┌────────────────┼────────────────┐                     │
│      │                │                │                     │
│      ▼                ▼                ▼                     │
│   Convert ───────► Resize         Crop (Pink)              │
│   (Indigo)          (Purple)       │                         │
│      │                │            │                         │
│      └────────────────┼────────────┘                         │
│                       │                                       │
│              ┌────────┴────────┐                             │
│              │                 │                             │
│              ▼                 ▼                             │
│          Compress          Download                          │
│          (Orange)          (Green)                           │
│                                                               │
└─────────────────────────────────────────────────────────────┘

DRILL-DOWN NAVIGATION:

Hub (Level 1)
├── Convert → [Image Conv | Doc Conv]
├── Resize → [Image Resize | Video Resize]
├── Crop → [Image Crop | Video Crop]
├── Compress → [Video Compress]
└── Download → [Video Download]

Each → Click Option → Navigate to Operation Page

File Tree

droidmate/
├── app.py
│   └── @app.route('/') 
│       ├── Serve: templates/new/dashboard_interactive.html
│       └── New endpoint: /api/dashboard/stats
│
├── templates/
│   ├── new/
│   │   ├── dashboard_interactive.html  [NEW] Main hub
│   │   └── base_interactive.html       [RENAMED from base.html]
│   └── partials/
│       └── operation_detail.html       [Optional: Reusable components]
│
├── static/
│   ├── img/
│   │   ├── droidmate-logo.svg         [NEW] Main logo
│   │   └── icon.ico                   [EXISTING]
│   ├── css/
│   │   ├── dashboard-interactive.css  [OPTIONAL] Extract inline styles
│   │   └── style.css                  [EXISTING]
│   └── js/
│       ├── dashboard.js               [NEW] Hub interactions
│       └── app.js                     [EXISTING]
│
└── config/
    └── default.yaml                   [EXISTING]

Route Mapping

Hub Navigation

GET  /                              → dashboard_interactive.html (Hub)
├── GET /convert                    → Convert operation page
│   ├── POST /convert/image         → Convert image
│   └── POST /convert/document      → Convert document
│
├── GET /resize                     → Resize operation page
│   ├── POST /resize/image          → Resize image
│   └── POST /resize/video          → Resize video
│
├── GET /crop                       → Crop operation page
│   ├── POST /crop/image            → Crop image
│   └── POST /crop/video            → Crop video
│
├── GET /compress                   → Compress operation page
│   └── POST /compress/video        → Compress video
│
└── GET /download                   → Download operation page
    └── POST /download/video        → Download video

API Routes:
GET  /api/dashboard/stats          → {files, tasks, outputs} counts

Color Scheme Reference

/* Operation Colors */
.convert     { color: #6366f1; } /* Indigo */
.resize      { color: #8b5cf6; } /* Purple */
.crop        { color: #ec4899; } /* Pink */
.compress    { color: #f97316; } /* Orange */
.download    { color: #10b981; } /* Green */

/* UI Colors */
.bg-hub      { background: linear-gradient(135deg, #111827 0%, #0f172a 100%); }
.accent      { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.hover       { box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2); }

Animation Specs

Logo Animations

/* Outer Ring: Continuous Rotation */
animation: spin-slow 20s linear infinite;
transform: rotate(360deg);

/* Inner Ring: Pulse Breath */
animation: pulse-ring 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
scale: 0.81.2
opacity: 10

/* Logo Icon: Hover Scale */
hover: transform scale(1.1);
transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);

Card Animations

/* Operation Cards: Hover Lift */
hover: {
  transform: translateY(-4px);
  shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
}

/* Detail Cards: Fade In */
animation: fadeIn 300ms ease-in-out;
opacity: 01;
transform: translateY(10px) → translateY(0);

JavaScript Functions (Client-Side)

Hub Navigation

// Navigate from hub to detail view
function navigateToDetail(operation) {
  hubView.classList.remove('active');
  detailView.classList.add('active');
  // Animation: fadeIn 300ms
}

// Navigate from detail back to hub
function navigateToHub() {
  detailView.classList.remove('active');
  hubView.classList.add('active');
  // Animation: fadeOut 200ms
}

// Handle operation selection
function selectOperation(operation) {
  const url = `/` + operation;
  window.location.href = url;
}

Stats Updates (Real-time)

// Fetch and update hub statistics every 5 seconds
function updateStats() {
  fetch('/api/dashboard/stats')
    .then(r => r.json())
    .then(data => {
      document.getElementById('file-count').textContent = data.files;
      document.getElementById('task-count').textContent = data.tasks;
      document.getElementById('output-count').textContent = data.outputs;
    });
}

setInterval(updateStats, 5000);

Testing Checklist

Visual Tests

  • Logo renders correctly with SVG
  • Logo animations smooth and visible
  • Hover states show on all cards
  • Colors match specs (Indigo, Purple, Pink, Orange, Green)
  • Text is readable on all backgrounds
  • Animations don't stutter or lag

Interaction Tests

  • Click logo → No navigation (just visual feedback)
  • Click operation card → Navigate to detail view
  • Back button → Return to hub
  • Click option in detail → Navigate to operation page
  • All links work without console errors

Responsive Tests

  • Mobile (375px): 2-col grid, stacked stats
  • Tablet (768px): 3-col grid, horizontal stats
  • Desktop (1440px): 5-col grid, full layout
  • No horizontal scroll on any size

Performance Tests

  • Page loads in < 2s
  • Animations run at 60 FPS
  • No layout shift (CLS)
  • SVG logo optimized (< 10KB)

Optional Enhancements

Tier 1 (Easy - 1-2 hours)

  • Dark/Light mode toggle
  • Keyboard shortcuts (1-5 keys for operations)
  • "Recent operations" section below hub
  • Animated counter for stats

Tier 2 (Medium - 2-4 hours)

  • File upload drag-drop in hub
  • Real-time task progress indicators
  • Operation history sidebar
  • Quick action buttons (Upload, View Files)

Tier 3 (Advanced - 4-8 hours)

  • Gesture recognition (swipe navigation)
  • 3D perspective for logo
  • Particle effects on hover
  • Custom animations per operation
  • Voice commands ("/convert image")

Troubleshooting

Logo Not Showing

1. Check file exists: ls static/img/droidmate-logo.svg
2. Check path in template: src="/static/img/droidmate-logo.svg"
3. Clear browser cache: Ctrl+Shift+R
4. Check browser console for 404 errors

Animations Stuttering

1. Check GPU acceleration: Chrome DevTools → Rendering → Paint flashing
2. Reduce animation complexity
3. Use transform + opacity (GPU friendly)
4. Avoid: left, right, top, bottom changes

Navigation Not Working

1. Check data attributes: data-operation, data-action
2. Verify JavaScript console has no errors
3. Test HTMX loaded: Check Network tab for htmx.js
4. Verify routes exist in app.py

Mobile Layout Issues

1. Check viewport meta tag present
2. Test with Chrome DevTools responsive mode
3. Verify grid responsive classes: md:, lg:
4. Check tailwind purge config includes new templates

Deployment Notes

Docker Deployment

# In Dockerfile, ensure:
COPY static/ /app/static/          # Include new SVG logo
COPY templates/ /app/templates/    # Include new templates

Termux Deployment

# Update templates directory
cp -r templates/new ~/apps/droidmate/templates/
cp static/img/droidmate-logo.svg ~/apps/droidmate/static/img/

# Restart Flask
python app.py

Development

# Flask auto-reload watches for template changes
export FLASK_ENV=development
export FLASK_DEBUG=1
python app.py

# Changes to templates auto-load (no restart needed)

Success Criteria

✅ All files created and in correct locations ✅ Dashboard loads with animated logo and 5 operation cards ✅ Clicking operations shows drill-down detail view ✅ Back button returns to hub ✅ All operation links navigate to correct pages ✅ Mobile/tablet/desktop layouts responsive ✅ Animations smooth without stutter ✅ No console errors ✅ Stats display correctly ✅ Page load time < 2 seconds


Version: 1.0 Last Updated: January 21, 2026 Status: Ready for Implementation