A modern, responsive web application for discovering delicious recipes by searching for ingredients. Built with vanilla HTML, CSS, and JavaScript, this app fetches recipe data from TheMealDB API and displays it in an elegant, user-friendly interface.
- ๐ Ingredient Search: Search for recipes by entering any ingredient
- โก Real-time Results: Instant recipe suggestions as you type
- ๐ฑ Responsive Design: Optimized for desktop, tablet, and mobile devices
- ๐ผ๏ธ Equal Square Images: Beautiful, consistent image grid layout
- ๐ Detailed Recipes: Click any recipe to view full instructions and ingredients
- ๐ฅ Video Links: Direct links to cooking videos on YouTube
- โจ๏ธ Keyboard Support: Press Enter to search
- ๐ Auto-load Content: Displays chicken recipes on page load
Simply open index.html in your web browser to start using the app!
food-recipe-website/
โ
โโโ index.html # Main HTML structure
โโโ style.css # Styling and responsive design
โโโ script.js # JavaScript functionality and API calls
โโโ README.md # Project documentation
- HTML5: Semantic markup and structure
- CSS3: Modern styling with Flexbox, Grid, and animations
- JavaScript ES6+: Async/await, DOM manipulation, and API integration
- TheMealDB API: Free recipe database API
- Google Fonts: Poppins font family for modern typography
- Clean, modern card-based layout
- Smooth hover animations and transitions
- Professional color scheme with orange accents (#ff5722)
- Beautiful shadows and rounded corners
- Modal popup for detailed recipe view
- Desktop (1200px+): 4 cards per row
- Tablet (768px-1199px): 3 cards per row
- Mobile (480px-767px): 2 cards per row
- Small Mobile (<480px): 1 card per row
- Search Functionality: Enter an ingredient in the search box
- API Integration: Fetches data from TheMealDB API
- Dynamic Display: Creates recipe cards with images and titles
- Modal Details: Click any recipe to view full details in a popup
- Error Handling: Gracefully handles API errors and empty results
This project uses TheMealDB API:
- Search by Ingredient:
https://www.themealdb.com/api/json/v1/1/filter.php?i={ingredient} - Get Recipe Details:
https://www.themealdb.com/api/json/v1/1/lookup.php?i={meal_id}
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection (for API calls and Google Fonts)
- Clone or download this repository
- Open
index.htmlin your web browser - Start searching for recipes!
# Clone the repository
git clone https://github.com/yourusername/food-recipe-website.git
# Navigate to the project directory
cd food-recipe-website
# Open in browser
# Simply double-click index.html or use a local serverTry searching for these popular ingredients:
chicken- Chicken-based recipesbeef- Beef dishespasta- Pasta recipesrice- Rice-based mealstomato- Tomato recipescheese- Cheese-based dishes
- Enter: Perform search
- Escape: Close recipe modal (when implemented)
getMealsByIngredient(ingredient)- Fetches recipes by ingredientgetMealDetails(mealID)- Gets detailed recipe informationdisplayMeals(meals)- Renders recipe cards in the gridshowMealDetailsPopup(meal)- Displays recipe details in modal
- Search button click
- Enter key press
- Recipe card click
- Modal close button
- Flexbox Layout: Responsive grid system
- CSS Custom Properties: Consistent color scheme
- Smooth Animations: Hover effects and transitions
- Mobile-First Design: Progressive enhancement
- Object-fit Cover: Perfect square images
.meal-item- Recipe card styling.meal-img img- Square image formatting.modal-container- Popup overlay.recipe-btn- Call-to-action buttons
- Advanced Filters: Filter by cuisine type, cooking time, difficulty
- Favorites System: Save favorite recipes locally
- Shopping List: Generate ingredient lists
- Nutritional Info: Display calorie and nutrition data
- Recipe Sharing: Share recipes via social media
- Dark Mode: Toggle between light and dark themes
- Offline Support: Cache recipes for offline viewing
- Some recipes may not have video links
- API rate limiting may occur with excessive requests
- Images load from external sources (TheMealDB)
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- TheMealDB: For providing the free recipe API
- Google Fonts: For the beautiful Poppins font family
- Unsplash/TheMealDB: For high-quality food images
If you have any questions or issues:
- Create an issue in this repository
- Check the browser console for error messages
- Ensure you have a stable internet connection
Made by Sam Orth
Enjoy cooking and discovering new recipes! ๐ณ๐จโ๐ณ๐ฉโ๐ณ