-
Notifications
You must be signed in to change notification settings - Fork 60
Maja E - Recipe Library #68
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
JennieDalgren
left a comment
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.
Good job with this project!
You code is clean and easy to follow. I'm a bit confused over the way you're fetching from the API. Refactor that into the way we teach in the education. Other than that, you have met the requirements. When that is fixed I can approve this project.
I can see that some code is generated by AI, that is totally fine as long as you understand what is going on and can explain it. Remember that it is important to understand the basic javascript concepts and programming fundamentals to be able to utilise the power of AI as a code buddy in a good and safe way.
data.js
Outdated
| const xhttp = new XMLHttpRequest(); | ||
| xhttp.open("GET", "https://api.spoonacular.com/recipes/random?apiKey=24c0ad763b794214b472e5a5e70fac09&number=20&includeNutrition=false", false); | ||
| xhttp.send(); |
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.
what is this XMLHttpRequest for?
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 creates an object that fetches data from the server. It requests for data in the background and updates the page without reloading it for the client. It’s an older way to make HTTP requests that I thought was a bit easier to understand and use in the beginning, and for this smaller project.
script.js
Outdated
| const card = document.createElement('article'); | ||
| card.className = 'recipe-card'; | ||
| card.tabIndex = 0; // Makes card focusable for accessibility | ||
| card.style.cursor = 'pointer'; // Shows pointer on hover |
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 should be controlled in the css file, just as the rest of the .recipe-card styling
JennieDalgren
left a comment
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.
✅
https://maja-recipelibrary.netlify.app/