Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added public/.DS_Store
Binary file not shown.
Binary file added public/Day-216_Quick_image_finder/.DS_Store
Binary file not shown.
189 changes: 189 additions & 0 deletions public/Day-216_Quick_image_finder/exported-assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Quick Image Finder 🔍

A responsive web application that allows users to search for high-quality images using the Unsplash API. Enter a keyword, get instant results, and navigate through multiple images with ease.

## Features

✨ **Simple Search Interface** - Clean and intuitive design for easy image searching
🖼️ **High-Quality Images** - Access millions of professional photos from Unsplash
⬅️➡️ **Easy Navigation** - Browse through results with Previous/Next buttons or arrow keys
📱 **Responsive Design** - Works perfectly on desktop, tablet, and mobile devices
🎨 **Modern UI** - Beautiful gradient design with smooth animations
🔄 **Load More** - Fetch additional results without losing your place

## Technologies Used

- **HTML5** - Structure and content
- **CSS3** - Styling with gradients, animations, and responsive design
- **JavaScript (ES6+)** - API integration and interactivity
- **Unsplash API** - Free high-quality image database

## Getting Started

### Prerequisites

- A modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection
- A free Unsplash API key

### Step 1: Get Your Free Unsplash API Key

1. Go to [Unsplash Developers](https://unsplash.com/developers)
2. Click **"Register as a Developer"** (or log in if you already have an account)
3. Click **"New Application"**
4. Accept the API guidelines
5. Fill in the application details:
- **Application name**: Quick Image Finder (or any name you prefer)
- **Description**: A web app for searching images
6. Click **"Create application"**
7. Copy your **Access Key** from the application page

**Note**: The free tier allows 50 requests per hour, which is perfect for this demo project.

### Step 2: Set Up the Project

1. Download all three files:
- `index.html`
- `style.css`
- `script.js`

2. Place all files in the same folder/directory

3. Open `script.js` in a text editor

4. Find this line at the top:
```javascript
const API_KEY = 'YOUR_UNSPLASH_ACCESS_KEY';
```

5. Replace `'YOUR_UNSPLASH_ACCESS_KEY'` with your actual API key:
```javascript
const API_KEY = 'your-actual-api-key-here';
```

6. Save the file

### Step 3: Run the Application

1. Double-click on `index.html` to open it in your default browser
- OR right-click → Open with → Choose your browser

2. Enter a search term (e.g., "mountains", "technology", "nature")

3. Press the **Search** button or hit Enter

4. Navigate through results using:
- **Previous/Next buttons**
- **Arrow keys** on your keyboard
- **Load More Results** button for additional images

## Project Structure

```
quick-image-finder/
├── index.html # Main HTML structure
├── style.css # All styling and animations
├── script.js # JavaScript logic and API integration
└── README.md # This file
```

## How It Works

1. **User Input**: User enters a search keyword in the form
2. **API Request**: The app sends a request to Unsplash API with the search query
3. **Data Processing**: Response data is stored and the first image is displayed
4. **Navigation**: Users can browse through the 10 results per page
5. **Load More**: Clicking "Load More Results" fetches the next page of images

## API Integration Details

The app uses Unsplash's Search Photos endpoint:

```
https://api.unsplash.com/search/photos?query={searchTerm}&page={pageNumber}&per_page=10
```

**Parameters:**
- `query`: The search keyword
- `page`: Page number for pagination
- `per_page`: Number of results per page (set to 10)
- `client_id`: Your API key for authentication

## Customization Ideas

Want to enhance this project? Here are some ideas:

- Add filter options (orientation, color, etc.)
- Implement download functionality
- Add image favorites/bookmarking
- Create image gallery view
- Add dark mode toggle
- Implement infinite scroll
- Show more image metadata

## Troubleshooting

**Problem**: "Please add your Unsplash API key" error
- **Solution**: Make sure you've replaced `YOUR_UNSPLASH_ACCESS_KEY` in `script.js` with your actual key

**Problem**: "Failed to fetch images" error
- **Solution**: Check your internet connection and verify your API key is correct

**Problem**: No images found
- **Solution**: Try a different search term or more general keywords

**Problem**: Images not loading
- **Solution**: Check browser console for errors (F12) and ensure all files are in the same directory

## API Rate Limits

- **Free tier**: 50 requests per hour
- **Recommended**: Apply for production access if you need higher limits
- The app handles errors gracefully if you exceed rate limits

## Contributing to Open Source

This project is perfect for:
- Learning API integration
- Practicing JavaScript async/await
- Understanding DOM manipulation
- Building portfolio projects

Feel free to:
- Fork this project
- Add new features
- Fix bugs
- Improve the UI/UX
- Add documentation

## License

This project is open source and available for educational purposes.

**Important**: When using Unsplash images, you must:
- Give credit to photographers
- Follow Unsplash's API guidelines
- Not abuse the API

## Resources

- [Unsplash API Documentation](https://unsplash.com/documentation)
- [Unsplash API Guidelines](https://help.unsplash.com/en/articles/2511245-unsplash-api-guidelines)
- [JavaScript Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)

## Author

Created as a learning project for web development students.

## Acknowledgments

- **Unsplash** for providing free API access
- **Unsplash photographers** for amazing images
- Web development community for tutorials and support

---

**Happy coding! 🚀**

If you have any questions or run into issues, check the browser console (F12) for detailed error messages.
64 changes: 64 additions & 0 deletions public/Day-216_Quick_image_finder/exported-assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quick Image Finder</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<header>
<h1>🔍 Quick Image Finder</h1>
<p class="subtitle">Search for high-quality images instantly</p>
</header>

<div class="search-section">
<form id="search-form">
<input
type="text"
id="search-input"
placeholder="Search for images (e.g., mountains, nature, technology)"
required
>
<button type="submit" id="search-btn">Search</button>
</form>
</div>

<div id="results-section" class="results-section hidden">
<div class="result-info">
<p id="result-text"></p>
<div class="navigation-buttons">
<button id="prev-btn" class="nav-btn" disabled>← Previous</button>
<span id="image-counter">1 / 10</span>
<button id="next-btn" class="nav-btn">Next →</button>
</div>
</div>

<div class="image-container">
<img id="result-image" src="" alt="Search Result">
<div class="image-details">
<p id="photographer-name"></p>
<a id="image-link" href="" target="_blank">View on Unsplash</a>
</div>
</div>

<button id="show-more-btn">Load More Results</button>
</div>

<div id="loading" class="loading hidden">
<div class="spinner"></div>
<p>Searching for images...</p>
</div>

<div id="error-message" class="error-message hidden"></div>

<footer>
<p>Powered by <a href="https://unsplash.com" target="_blank">Unsplash API</a></p>
<p class="api-note">⚠️ Please add your Unsplash API key in script.js to use this app</p>
</footer>
</div>

<script src="script.js"></script>
</body>
</html>
Loading