Add NextSnap PWA with photo gallery viewer and continuous capture

Offline-first photo capture app for Nextcloud with:
- Camera capture with continuous mode (auto-reopens after each photo)
- File browser with fullscreen image gallery, swipe navigation, and rename
- Upload queue with background sync engine
- Admin panel for Nextcloud user management
- Service worker for offline-first caching (v13)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 04:53:13 -06:00
commit cad4118f72
55 changed files with 9038 additions and 0 deletions

340
POLISH.md Normal file
View File

@@ -0,0 +1,340 @@
# NextSnap Polish & UX Enhancements
This document describes all the polish, animations, and UX enhancements implemented in Module 14.
## Overview
NextSnap includes comprehensive polish to provide a smooth, professional user experience with:
- Smooth animations and transitions
- Enhanced accessibility features
- Micro-interactions and feedback
- Loading states and indicators
- Dark mode support
- Reduced motion support for accessibility
## Visual Enhancements
### Animations
#### Page Transitions
- **Fade-in animation** on page load (300ms)
- Subtle upward motion for content reveal
- Smooth transitions between pages
#### Button Interactions
- **Hover effect**: Lift up 2px with shadow
- **Active state**: Press down with reduced shadow
- **Ripple effect**: White ripple on click
- **3D transform**: Smooth scale transitions
#### Connectivity Indicator
- **Online**: Green with pulsing glow effect
- **Offline**: Gray with fade pulse
- **Syncing**: Yellow with continuous pulse
- Smooth color transitions between states
#### Loading States
- **Top loading bar**: Animated progress bar
- **Spinners**: Smooth rotation with easing
- **Skeleton loaders**: Shimmer effect for content loading
- **Image fade-in**: Smooth appearance on load
### Micro-Interactions
#### Form Elements
- **Focus state**: Lift up with blue shadow
- **Validation**: Real-time feedback
- **Invalid input**: Red border with shake animation
- **Valid input**: Green border confirmation
#### Cards & Items
- **Hover**: Lift up 2px with shadow
- **Queue items**: Smooth transform on hover
- **Thumbnails**: Scale and shadow on hover
- **Table rows**: Subtle scale on hover
#### Navigation
- **Active indicator**: Animated underline
- **Hover effect**: Growing underline
- **Icon bounce**: On selection
- **Smooth transitions**: 200ms easing
### Toast Notifications
- **Slide up animation**: From bottom
- **Auto-dismiss**: 2-3 seconds
- **Color coding**:
- Success: Green background
- Error: Red background
- Warning: Orange background
- Info: Dark background
- **Smooth fade-out**
### Modal Dialogs
- **Backdrop fade-in**: 200ms
- **Content slide-up**: 300ms
- **Close animation**: Reverse of open
- **Outside click**: Smooth dismiss
## Keyboard Shortcuts
Global keyboard shortcuts for power users:
| Shortcut | Action |
|----------|--------|
| `Alt + 1` | Go to Capture page |
| `Alt + 2` | Go to Queue page |
| `Alt + 3` | Go to Files/Browser page |
| `Alt + R` | Trigger sync/refresh |
| `Esc` | Close modals/exit reviewer |
| `Arrow Left/Right` | Navigate in photo reviewer |
## Accessibility Features
### Focus Management
- **Visible focus**: 2px accent color outline
- **Focus trap**: In modals
- **Keyboard navigation**: All interactive elements
- **Skip links**: For screen readers
### Reduced Motion
Respects `prefers-reduced-motion` system setting:
- Animations reduced to 10ms
- No continuous animations
- Instant transitions
- Better for motion sensitivity
### Screen Reader Support
- Semantic HTML5 elements
- ARIA labels where needed
- Alt text for images
- Meaningful link text
### Color Contrast
- WCAG AA compliant color ratios
- Dark mode with proper contrast
- Clear visual hierarchy
- Status colors are distinguishable
## Dark Mode
Automatic dark mode based on system preference:
### Light Mode
- White/light gray backgrounds
- Dark text
- Subtle shadows
- Bright accent colors
### Dark Mode
- Dark backgrounds (#1a1a2e, #16213e)
- White/light gray text
- Enhanced shadows
- Adjusted accent colors
- Reduced eye strain
Activated via `prefers-color-scheme: dark` media query.
## Performance Optimizations
### Image Loading
- **Lazy loading**: Images load as needed
- **Intersection Observer**: Efficient viewport detection
- **Fade-in**: Smooth appearance
- **Preloading**: Adjacent images in reviewer
### Animation Performance
- **CSS transforms**: Hardware accelerated
- **Will-change**: Optimized for animations
- **RequestAnimationFrame**: Smooth 60fps
- **Debouncing**: Reduces unnecessary calls
### Loading States
- **Skeleton screens**: Immediate visual feedback
- **Progressive enhancement**: Content shows before images
- **Optimistic UI**: Instant feedback, verify later
## Error Handling
### Visual Feedback
- **Shake animation**: On validation errors
- **Color indicators**: Red for errors
- **Toast notifications**: Clear error messages
- **Inline validation**: Real-time feedback
### Network Errors
- **Offline detection**: Automatic notification
- **Retry logic**: Exponential backoff
- **Queue persistence**: Never lose data
- **Connection restoration**: Automatic sync
## Mobile Optimizations
### Touch Interactions
- **Large tap targets**: Minimum 48x48px
- **Swipe gestures**: In photo reviewer
- **Pull to refresh**: Coming soon
- **Haptic feedback**: Vibration on actions
### Responsive Design
- **Mobile-first**: Optimized for small screens
- **Touch-friendly**: Large buttons and spacing
- **Safe areas**: iOS notch support
- **Viewport units**: Proper mobile sizing
### PWA Features
- **Installable**: Add to home screen
- **Offline-first**: Works without connection
- **Fast loading**: Cached app shell
- **Native feel**: Full-screen mode
## User Feedback
### Success States
- ✅ Checkmark animations
- Green color coding
- Success toasts
- Smooth transitions
### Loading States
- 🔄 Loading spinners
- Progress bars
- Skeleton screens
- Shimmer effects
### Error States
- ❌ Error icons
- Red color coding
- Shake animations
- Clear error messages
### Empty States
- 📭 Empty illustrations
- Helpful messages
- Call-to-action buttons
- Fade-in animations
## Utility Functions
The `polish.js` module provides helper functions:
```javascript
// Show toast notification
Polish.showToast(message, type, duration);
// Confirm dialog
await Polish.confirm(message, title);
// Copy to clipboard
await Polish.copyToClipboard(text);
// Loading indicator
Polish.showLoading();
Polish.hideLoading();
// Vibrate feedback
Polish.vibrate(50);
// Format helpers
Polish.formatFileSize(bytes);
Polish.formatRelativeTime(date);
// Debounce/Throttle
Polish.debounce(func, wait);
Polish.throttle(func, limit);
```
## CSS Classes
### Utility Classes
- `.skeleton` - Shimmer loading effect
- `.loading-bar` - Top progress bar
- `.clickable` - Pointer cursor + active state
- `.success-icon` - Animated checkmark
- `.badge` - Status badges with animation
### State Classes
- `.online` - Online status styling
- `.offline` - Offline status styling
- `.syncing` - Syncing status styling
- `.active` - Active navigation item
- `.disabled` - Disabled state
## Browser Support
### Modern Browsers
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
### Progressive Enhancement
- Core functionality works in all browsers
- Enhanced features for modern browsers
- Graceful degradation for older browsers
### Feature Detection
- Service Workers
- IntersectionObserver
- Clipboard API
- Vibration API
## Testing Recommendations
### Visual Testing
- [ ] Check animations in different browsers
- [ ] Test dark mode switching
- [ ] Verify hover states on all buttons
- [ ] Check loading states
- [ ] Test toast notifications
### Interaction Testing
- [ ] Test all keyboard shortcuts
- [ ] Verify touch interactions on mobile
- [ ] Check swipe gestures
- [ ] Test form validation feedback
- [ ] Verify modal interactions
### Accessibility Testing
- [ ] Screen reader navigation
- [ ] Keyboard-only navigation
- [ ] Color contrast checking
- [ ] Reduced motion testing
- [ ] Focus management
### Performance Testing
- [ ] Animation frame rate (60fps)
- [ ] Image loading speed
- [ ] Lazy loading behavior
- [ ] Memory usage
- [ ] Network performance
## Future Enhancements
Potential improvements for future versions:
- Pull-to-refresh on mobile
- Swipe-to-delete in queue
- Haptic feedback patterns
- Custom themes
- Animation preferences
- Sound effects (optional)
- Advanced gestures
- Drag-and-drop uploads
- Batch selection mode
- Context menus
## Credits
- **CSS Animations**: Custom cubic-bezier easing
- **Icons**: Native emoji for universal support
- **Typography**: System font stack for performance
- **Colors**: Material Design inspired palette
---
For implementation details, see:
- `app/static/css/style.css` - All CSS animations
- `app/static/js/polish.js` - JavaScript utilities
- `app/templates/base.html` - Base template structure