This feature adds support for multiple images per raffle, allowing creators to showcase physical prizes from different angles and perspectives. This is particularly useful for high-value physical items where buyers want to see detailed views.
- Added
image_urlscolumn (TEXT[]) toraffle_metadatatable - Maintains backward compatibility with existing
image_urlcolumn - Added GIN index for efficient array queries
- Added
image_urlsfield (array of strings, nullable, optional) - Keeps
image_urlfor backward compatibility
- Updated
RaffleFormDatato includeimages: File[]array - Updated
RaffleMetadatato include optionalimages?: string[]array - Maintains
imagefield for primary/legacy support
- Complete rewrite to support multiple image uploads
- Features:
- Drag & drop multiple files
- Click to upload multiple files
- Image gallery with thumbnails
- Set primary image functionality
- Remove individual images
- Visual indicators for primary image
- Hover effects for image management
- New component using Swiper library
- Features:
- Main image carousel with navigation
- Thumbnail strip for quick navigation
- Full-screen lightbox view
- Keyboard navigation (arrows, escape)
- Touch/swipe support on mobile
- Responsive design
- Image counter display
- Optimized loading
- Updated to accept
images?: string[]prop - Integrates ImageCarousel component
- Falls back to single image if no array provided
- Passes
imagesarray from metadata to RaffleDetailsCard - Maintains backward compatibility with single image
- Shows primary image with thumbnail strip
- Displays "+N" indicator for additional images
- Responsive preview of multi-image raffles
- Added
swiper: ^11.1.14for carousel functionality
- Navigate to Create Raffle page
- On the Image step:
- Drag & drop multiple images, or
- Click to select multiple files
- Manage uploaded images:
- Click "Set Primary" to change the main image
- Click X button to remove an image
- First uploaded image is primary by default
- Continue with raffle creation
- Navigate to raffle details page
- If multiple images exist:
- Main carousel shows current image
- Thumbnail strip below for navigation
- Click arrows or thumbnails to navigate
- Click any image to open lightbox
- In lightbox:
- Use arrows or keyboard to navigate
- Click thumbnails to jump to specific image
- Press ESC or click X to close
- Existing raffles with single
image_urlcontinue to work - Single images display without carousel UI
- API accepts both
image_urlandimage_urls - Frontend gracefully handles missing
imagesarray
- Lazy loading for carousel images
- Thumbnail generation for quick preview
- Progressive loading in lightbox
- Swiper's built-in optimization features
- Mobile: Stacked layout, touch-friendly controls
- Tablet: Optimized carousel size
- Desktop: Full carousel with hover effects
- Lightbox: Adapts to screen size
- Modern browsers with ES6+ support
- Touch events for mobile devices
- Keyboard navigation for accessibility
- Fallback for browsers without advanced features
- Image compression before upload
- CDN integration for faster loading
- Image zoom functionality
- Video support
- 360° view for products
- AI-powered image quality checks
- Automatic thumbnail generation
- Image reordering via drag & drop
- Test with 1, 3, 5, and 10+ images
- Test various image sizes and formats
- Test on mobile, tablet, and desktop
- Test keyboard navigation
- Test with slow network connections
- Test backward compatibility with old raffles
- Test image removal and reordering
- Limit maximum images per raffle (suggested: 10)
- Implement image size limits (suggested: 5MB per image)
- Use lazy loading for thumbnails
- Consider image compression on upload
- Use CDN for production deployments
- Validate file types on upload
- Scan for malicious content
- Limit file sizes
- Sanitize file names
- Use secure storage (Supabase/IPFS)