Overview
The Bİ DOLU İÇECEK application uses images for products, logos, and other visual elements. All images are stored in thepublic/images/ directory and referenced using absolute paths.
Image Directory Structure
Your project’s image structure should look like this:Adding Product Images
Prepare your image
Ensure your image meets these recommendations:
- Format: PNG, JPG, or JPEG
- Size: Maximum 1MB for fast loading
- Resolution: 800x800px recommended for products
- Background: Transparent PNG preferred for product shots
Reference in products.js
Update the product’s
image field in src/data/products.js:src/data/products.js
The path must start with
/images/ (not public/images/)Image Formats and Best Practices
Supported Formats
| Format | Use Case | Pros | Cons |
|---|---|---|---|
| PNG | Products with transparency | Lossless, supports transparency | Larger file size |
| JPG/JPEG | Photos, complex images | Smaller file size | No transparency |
| SVG | Logos, icons | Scalable, tiny file size | Not ideal for photos |
Recommended Sizes
Main Product Cards (Homepage)- Dimensions: 400x400px to 800x800px
- Format: PNG with transparent background
- Max size: 500KB
- Dimensions: 300x300px to 600x600px
- Format: PNG or JPG
- Max size: 300KB
- Dimensions: 150-250px width, 40-60px height
- Format: PNG with transparency
- Max size: 100KB
Placeholder Emojis
While images load or if they fail to load, the application shows emoji placeholders defined inimagePlaceholder.
Choosing Effective Emojis
src/data/products.js
Example Usage from Codebase
src/data/products.js
Logo Setup
The application displays a logo in the header’s left section.Adding Your Logo
Prepare logo file
Recommended specifications:
- Format: PNG with transparent background
- Dimensions: 150-250px width × 40-60px height
- File name:
logo.png - Max size: 100KB
Logo Fallback Behavior
If the logo file is missing or fails to load, the application displays the text “Bİ DOLU İÇECEK” as a fallback.
src/App.css
Retina Display Support (Optional)
For high-resolution displays, you can provide a 2x version:Image Optimization Tips
Compress Images
Use online tools or CLI tools to reduce file size:Lazy Loading
The application uses React’s built-in image optimization. Images load as users scroll.Image Loading States
TheProductImage component handles three states:
- Loading: Shows placeholder emoji with gradient
- Loaded: Displays actual image
- Error: Falls back to placeholder emoji
Naming Conventions
Good Naming Examples
Bad Naming Examples
Product Image Naming Pattern
Follow this pattern for consistency:Common Image Issues
Image Not Displaying
Problem: Image path is incorrect Solution: Check these:Image Stretched or Distorted
The CSS usesobject-fit: contain to prevent distortion:
src/App.css
Slow Loading
Problem: Image files too large Solution: Compress images before adding:Video Poster Images (Optional)
For video modals, you can provide a poster image:VideoModal.js (line 46):
src/components/VideoModal.js
Next Steps
Adding Products
Learn how to add products that use these images
Adding Videos
Set up promotional videos for your application