Welcome to Cooking for Cooked's! This website is a comprehensive recipe book where you can discover a variety of delicious recipes to try at home. From appetizers to desserts, find your next favorite dish!
- Recipe Search: Search for recipes using the search bar.
- Category Filter: Filter recipes by category.
- Featured Recipe: Highlighted featured recipe section.
- Dark Mode: Toggle between light and dark mode.
- Responsive Design: Mobile-friendly design.
- Offline Support: Service worker for offline capabilities.
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/SC136/recipe-book.git
-
Navigate to the project directory:
cd recipe-book
-
Open
index.html
in your browser to view the website.
The main HTML structure is defined in the index.html
file.
The styles for the website are defined in the styles.css
file.
The main JavaScript functionality is defined in the main.js
file.
The service worker, defined in the service-worker.js
file, is used to cache resources for offline use.
The web app manifest, defined in the manifest.json
file, provides metadata for the web application.
We welcome contributions from the community! To contribute, please follow these steps:
- Fork the repository to your own GitHub account.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear and descriptive messages.
- Push your changes to your forked repository.
- Open a pull request to the main repository with a detailed description of your changes.
Thank you for your contributions!
To add a new recipe to the site, follow these steps:
-
Update
recipes.js
:- Open the
recipes.js
file. - Add a new recipe object to the
recipes
array with the following properties:title
: The name of the recipe.image
: The path to the recipe image.description
: A brief description of the recipe.ingredients
: A list of ingredients required for the recipe.instructions
: Step-by-step instructions on how to prepare the recipe.nutrition
: Nutritional information for the recipe.category
: The category of the recipe (e.g., breakfast, dessert).
- Open the
-
Add Recipe Image:
- Place the recipe image in the
images
folder. - Ensure the image path in the
recipes.js
file matches the location of the image in theimages
folder.
- Place the recipe image in the
Example of adding a new recipe in recipes.js
:
const recipes = {
recipe1: {
title: 'Blueberry Pancakes',
image: 'images/recipe.jpg',
description: 'Fluffy pancakes loaded with fresh blueberries.',
ingredients: [
'1 cup of ingredient A',
'2 tbsp of ingredient B',
'3 pieces of ingredient C'
],
instructions: 'Mix all ingredients together and cook for 20 minutes.',
nutrition: 'Calories: 200, Protein: 10g, Fat: 5g, Carbs: 30g',
category: 'breakfast'
},
};