Demo: [https://youtu.be/_YdYSxmbSdw]
A modern, interactive web application that combines beautiful imagery from Unsplash with time-based motivational quotes. The application creates shareable images perfect for social media, combining high-quality photographs with inspirational messages that change based on the time of day.
- Dynamic Image Search: Utilizes the Unsplash API to fetch and display high-quality images
- Time-Based Quotes: Automatically selects quotes based on the time of day (morning, afternoon, or night)
- Modern Search Interface: Features a minimalist, keyboard-shortcut-enabled search box (Ctrl+K)
- Image Sharing: Allows users to share images with overlaid quotes directly to social media
- Responsive Design: Adapts seamlessly to different screen sizes and orientations
The project consists of several key components:
-
App.js: The main React component that:
- Manages the application state
- Handles API interactions with Unsplash
- Implements the search functionality
- Controls the quote selection logic
- Manages keyboard shortcuts and user interactions
-
style.css: Contains all styling including:
- Modern, minimalist search interface
- Smooth animations and transitions
- Responsive grid layout
- Image overlay effects
- Typography and spacing
-
Quote Collections: Three separate arrays of quotes for:
- Morning motivation (before 12 PM)
- Afternoon productivity (12 PM - 6 PM)
- Evening relaxation (after 6 PM)
-
Search Interface:
- Chose a floating search bar for easy access
- Implemented Ctrl+K shortcut for power users
- Added blur overlay effect for better focus during search
-
Image Processing:
- Uses HTML Canvas for image manipulation
- Adds semi-transparent overlay for better text readability
- Implements dynamic text sizing based on image dimensions
-
Quote Selection:
- Time-based quote selection for contextual relevance
- Random selection within time category for variety
- Custom fonts for better aesthetic appeal
-
Web Share API vs WhatsApp API
- Initially considered using WhatsApp's direct API for sharing
- Chose Web Share API instead because:
- More universal solution that works across multiple platforms
- Better future-proofing as it supports any available share target
- More respectful of user choice for sharing method
- Native integration with device sharing capabilities
- No dependency on specific third-party platform
- WhatsApp API required WhatsApp Business account
-
Dynamic Images vs Static Assets
- Considered bundling high-quality images with the application
- Chose Unsplash API integration because:
- Larger variety of images
- Reduced application size
- Always fresh content for users
- Faster loading times
-
Image Processing Approach
- Debated between server-side vs client-side image processing
- Chose client-side Canvas API because:
- Lower latency for end users
- Works offline after initial image load
-
Search Interface Design
- Considered traditional header search bar
- Chose floating command palette style because:
- Modern developer-friendly interface
- Doesn't take up permanent screen space
- Follows popular design patterns (VS Code, GitHub)
- Better accessibility with keyboard shortcuts
-
Quote Management
- Considered using external API for quotes
- Chose hardcoded time-based collections because:
- Guaranteed content quality
- No additional API dependencies
- Better performance
- Carefully curated for each time of day
- Built with React.js for component-based architecture
- Uses Unsplash API for high-quality image sourcing
- Implements modern CSS features like:
- Backdrop filters
- CSS Grid
- Flexbox
- CSS Transitions
- Uses HTML5 Canvas for image manipulation
- Implements Web Share API for social sharing
- Clone the repository
- Install dependencies:
npm install - Create a Developer Account on Unsplash:
- Visit Unsplash Developers
- Click "Register as a Developer"
- Complete the registration process
- Create a New Application on Unsplash:
- Go to your Applications Dashboard
- Click "New Application"
- Accept the API Terms and Guidelines
- Get Your API Keys:
- After creation, you'll see your Access Key and Secret Key
- Copy the Access Key
- Create a
.envfile in your project root - Add your key:
REACT_APP_ACCESS_KEY=your_access_key_here
- Run the development server:
npm start