Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f7a557a
add skeleton for HTML
gabriellaberko Sep 19, 2025
2d1eef0
add content to the cards
gabriellaberko Sep 19, 2025
47cf6b9
add gridlayout to cards and set card image size
gabriellaberko Sep 19, 2025
c8929fd
add font styling
gabriellaberko Sep 19, 2025
ec578cb
add hover effect on cards
gabriellaberko Sep 19, 2025
ebeba59
add background color
gabriellaberko Sep 19, 2025
c1a0a65
add html code and styling for filter and sort buttons + media query f…
gabriellaberko Sep 22, 2025
38133dd
add another filter input
gabriellaberko Sep 23, 2025
aeb718a
add event listener to the filter and sorting buttons and toggle the c…
gabriellaberko Sep 23, 2025
81612e1
capture the clicked button's text and create a function for printing …
gabriellaberko Sep 23, 2025
91b1cba
change back to one filter input
gabriellaberko Sep 23, 2025
a343261
refactor function and update from logging to console to add message t…
gabriellaberko Sep 24, 2025
a6f62e1
separate function for sort and filter buttons and fix issue with butt…
gabriellaberko Sep 24, 2025
583be14
clean code
gabriellaberko Sep 24, 2025
a1921ed
change min-wdith in media query for wide screens
gabriellaberko Sep 24, 2025
94ae331
add outline on buttons
gabriellaberko Sep 25, 2025
f8993e9
Add functions for creating elements for recipe cards and to add recip…
gabriellaberko Sep 29, 2025
898e236
add a function for creating a card for each recipe
gabriellaberko Sep 29, 2025
c83abed
clear comments and remove unused variable
gabriellaberko Sep 29, 2025
0c05aba
add method to add every ingredient in each recipe to the recipe card
gabriellaberko Sep 29, 2025
2091f78
styling ingredient list
gabriellaberko Sep 30, 2025
5147d24
refactor the function for creating recipe cards
gabriellaberko Sep 30, 2025
4e2a5fb
add function for sorting the cards based on popularity score
gabriellaberko Sep 30, 2025
e75d5c8
add a button for randomizing a recipe
gabriellaberko Oct 1, 2025
30de569
add function for randomizing a recipe and add event listener to the r…
gabriellaberko Oct 1, 2025
f94de2d
add function to show filtered cards based of active filters
gabriellaberko Oct 1, 2025
811d6d2
refactor function for filtering cards to handle multiple active filte…
gabriellaberko Oct 1, 2025
cb2e64c
add error message when the array passed in showRecipeCards is undefin…
gabriellaberko Oct 1, 2025
740a3c4
remove intentional spelling error in recipes array
gabriellaberko Oct 1, 2025
fd2b772
add heart icon to each card in showRecipeCards and add click listener…
gabriellaberko Oct 3, 2025
2a4a1d9
add function for storing liked recipes in a new array
gabriellaberko Oct 3, 2025
714182d
add button for favorite recipes
gabriellaberko Oct 3, 2025
c472c88
include state of heart icon in showRecipeCards to be able to save sta…
gabriellaberko Oct 3, 2025
aa2eea6
add a function for fetching data from API
gabriellaberko Oct 6, 2025
cc9b3d6
modify showRecipeCards to reference data from API
gabriellaberko Oct 6, 2025
ac7dfc2
add functionality to save data from fetch to local storage and displa…
gabriellaberko Oct 6, 2025
70d5f2a
correct typo
gabriellaberko Oct 6, 2025
2a52929
refactor fetch function and add a global variable for all recipes reg…
gabriellaberko Oct 6, 2025
a57eabc
add empty array value for storedRecipes and update filterCardsOnKitch…
gabriellaberko Oct 6, 2025
0cb1f03
change the reference from recipes to allRecipes in all functions
gabriellaberko Oct 7, 2025
4fe9d18
change sorting cards based on popularity to sort on cooking time
gabriellaberko Oct 7, 2025
a64ae9e
add a search input
gabriellaberko Oct 7, 2025
094859a
changing instructions to instruction steps and correct type in filter…
gabriellaberko Oct 7, 2025
4011633
add more filter button choices and adjust media query for wide screen
gabriellaberko Oct 7, 2025
fa6b6df
add event listener to search button and function for filtering based …
gabriellaberko Oct 7, 2025
c587147
add modal overlay and modal popup + recipe card button
gabriellaberko Oct 7, 2025
e3d4be3
add more recipe data to cards and hide some of the divs
gabriellaberko Oct 7, 2025
9868e8e
add event listener to card buttons, add a modal in HTML and add a fun…
gabriellaberko Oct 7, 2025
339695e
add function for displaying the clicked card's content in the modal p…
gabriellaberko Oct 7, 2025
441aa69
modify styling for modal
gabriellaberko Oct 7, 2025
924fa7a
add styling to card buttons
gabriellaberko Oct 7, 2025
316aadf
add favoriteRecipes to local storage
gabriellaberko Oct 7, 2025
a6dce24
fix bugs for favorite recipe functionality and keeping favorites in l…
gabriellaberko Oct 8, 2025
2e45517
add some new styling to the random button
gabriellaberko Oct 8, 2025
97d1c05
refactor fetch function and add a fetch loading state where a message…
gabriellaberko Oct 8, 2025
0b8aa59
change card button styling
gabriellaberko Oct 8, 2025
a422201
clean code + add some margin to modal cross icon
gabriellaberko Oct 10, 2025
1e47060
add active state toggle on favorite button
gabriellaberko Oct 10, 2025
6ef4401
fix for top container in media query
gabriellaberko Oct 10, 2025
dfdcec5
add link to Netlify in readme file
gabriellaberko Oct 10, 2025
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# js-project-recipe-library
Link to Netlify: https://js-recipe-library.netlify.app/
7 changes: 7 additions & 0 deletions cross-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Recipe Library</title>
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="top-container">
<input
class="search-button"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally get the choice of the name but maybe for further clarity "search-input" could be another option for it, since it's "not really" a button:)

id="search-button"
type="search"
placeholder="🔍 Search...">
<button
class="favorite-button btn"
id="favorite-button">
My favorite recipes
<i
class="fas fa-heart"
id="favorite-button-heart">
</i>
</button>
</div>
<h1 class="title">Recipe Library</h1>
<div class="controls-container">
<div class="filter-container">
<h2>Filter on kitchen</h2>
<div class="filter-buttons-container">
<button
class="btn active"
id="filter-all-button">
All
</button>
<button class="btn">African</button>
<button class="btn">American</button>
<button class="btn">Asian</button>
<button class="btn">Italian</button>
<button class="btn">Mediterranean</button>
<button class="btn">Mexican</button>
<button class="btn">Indian</button>
</div>
</div>
<div class="sort-random-container">
<div class="sort-container">
<h2>Sort on cooking time</h2>
<div class="sort-buttons-container">
<button class="btn">Descending</button>
<button class="btn">Ascending</button>
</div>
</div>
<div class="random-container">
<h2>Can't decide?</h2>
<div class="random-button-container">
<button
class="btn"
id="random-button">
Get me a random recipe!
</button>
</div>
</div>
</div>
</div>
<div
class="modal-overlay hidden"
id="modal-overlay">
<img
Comment on lines +66 to +69

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the modal, take a look at the html element <dialog>
I'm not so used to it myself but it is pretty cool!
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog

class="cross-icon"
id="cross-icon"
src="./cross-white.svg"
alt="cross icon">
<div
class="modal"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool use of "modal", also in js. I have not seen this before:)

id="modal-popup">
<div
class="modal-content"
id="modal-content">
</div>
</div>
</div>
<div
class="card-container"
id="card-container">
</div>
<script src="./script.js"></script>
</body>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good and easy-to-understand structure in your HTML, really nice :) Maybe you could use more semantic tags like “main” and “section” to make it even more accessible.

</html>
Loading