-
Notifications
You must be signed in to change notification settings - Fork 33
First PR for this project #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ate filterRecipes() to filter from the full list, ensuring recipes are restored when filters are cleared. Also update infinite scroll to merge new recipes.
…o write that down
index.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool that you created your own dropdown! And html looks neat and makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
*, *::before, *::after { | ||
box-sizing: border-box; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why you used *::before and *::after? (no feedback just genuinely interested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from CSS I used in the previous business project. The design looked off without it, and I learned it was good practice for potential pseudo-elements, so I kept it. Removing it in this project distorts the recipe card’s alignment, placement, and borders on both mobile and desktop. Seems like a quick fix tho, so I am eager to learn alternative methods to address these issues.
.menu-icon.open span:nth-child(3) { | ||
transform: translateY(-9px) rotate(45deg); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really cool implementation of the nav hamburger menu!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you like it. I took Technigo's nav hamburger icon as inspiration and used on the first project, the business site. Then used that as a template for this one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some cool CSS and the file looks organised and I found it easy to read :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think that not everything needs to be inside the document.addEventListener("DOMContentLoaded") function. It might be a bit more readable if you find a way to break some functions out of there and use DOMContentLoaded when its needed. Unless there is a specific reason that I'm missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will definitely look into that!
|
||
// --- Loading State --- | ||
recipesContainer.innerHTML = "<p>Loading recipes...</p>"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting way of doing this, adding this before the recipes are fetched, its a cool and simple solution in my opinion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few comments within the code with more specifics. I think this is well made and organised and all the requirements and stretch goals are implemented so great job!
Thanks for your thoughtful comments and feedback, Christina! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like what you did with the filters and sorting options, great idea to make it less cluttered! However, I found a little bug when opening the Sort by drop down. When hovering Newest and Rating, it jumps around because of the added border. A solution is to always have a transparent border to start with (and then just change the color on hover). This way we avoid the growing width and the jumping.
Another bug I found is that your Random button doesn’t work if some filters are selected. It’s fine if you want to connect the random recipe with your filters, but make sure to display something useful if you can’t find a matching recipe.
And a third bug:
When choosing Vegetarian and Mediterranean I get like 10 identical recipes. I think it might be a bug with the infinite scrolling?
Don’t forget that we should always default to const. You can always change to let if you bump into errors. Apart from that, your JavaScript looks good and you’ve chosen descriptive function/variable names.
Some things to fix in order to be approved, but with allt this said I think you should be proud of all you have accomplished ⭐
…are any matching recipes to randomize based on selected filters
Hi Matilda, thanks for the feedback! Border “jumping around” issue dropdown menu buttons: Random button bug when some filters are selected: Duplicate recipe bug when applying filters + infinite scrolling: const as default: Please let me know if you find this works better or if there’s anything else I need to work on in order to get approved. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work sorting this out ⭐ Thanks for documenting your changes so well too 😊
Hi Christina! This PR implements the Recipe Library I did for this assignment. The project dynamically fetches recipe data from Spoonacular’s /recipes/random endpoint and displays recipe cards with filtering, sorting, random selection, infinite scrolling, and caching.
I implemented—I think—all of the requirements and some stretch goals; I describe these and more in detail in the README file.
If it looks like a lot of code, well, I’m still working to understand everything I did!
I also wish I implemented the search function, but that would have been too much for my brain to grasp right now. Maybe later in the week.