Skip to content

Conversation

@SaraEnderborg
Copy link

@SaraEnderborg SaraEnderborg commented Oct 11, 2025

@SaraEnderborg SaraEnderborg changed the title Netlify link My Recipe Library Oct 11, 2025
Copy link

@julialindstrand julialindstrand left a comment

Choose a reason for hiding this comment

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

Your website looks great overall, just added a suggestion for the styling but it looks like it has everything it needed and is presented in a really nice way. I really like your take on the messages, it looks fun and professional! Good job Sara! :D

I don't personally fell that comfortable with the script part yet so I don't feel entitled to have opinions and I'm not confident enough to say I would find a problem if there was one

<main>
<h1>Recipe Library</h1>

<!-- ====== FILTERS / SORT / LUCKY CONTROLS ====== -->

Choose a reason for hiding this comment

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

This is a really neat way to organize your code!

Copy link
Author

Choose a reason for hiding this comment

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

Thank you:)

@@ -0,0 +1,442 @@
/* ========== GLOBAL STYLES ========== */
* {

Choose a reason for hiding this comment

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

Really smart to set everything at zero to have a blank slate!

Copy link
Author

Choose a reason for hiding this comment

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

it is a safety net of sort.

Comment on lines +8 to +18
:root {
--page-bg: #fafafa;
--blue-main: #0018a4;
--blue-outline: #0044cc;
--mint-green: #c0f8d1;
--pink-bg: #fddddf;
--text-blue: #0033aa;
}

body {
background: var(--page-bg);

Choose a reason for hiding this comment

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

So when you use the root you "select" it with var?

style.css Outdated
font-family: "Futura", "Trebuchet MS", Arial, sans-serif;
}

.main-content {

Choose a reason for hiding this comment

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

What is main-content? I can't seem to find it in the HTML. Or is that a gather-word for everything in the main?

Copy link
Author

Choose a reason for hiding this comment

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

No, that was a leftover from previous design, i have removed it now:) good eye

/* ========== HEADINGS ========== */
h1 {
font-family: "Futura", "Trebuchet MS", Arial, sans-serif;
font-size: 64px;

Choose a reason for hiding this comment

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

In the inspector it looks like the font-size dosen't matter, what defines the size?

Comment on lines 14 to 26
const params = new URLSearchParams({
number: 30,
cuisine: 'Asian,Italian,Mexican,Middle Eastern',
diet: 'vegan,vegetarian,gluten free',
type: 'breakfast,main course,dessert',
sort: 'popularity',
addRecipeInformation: true,
instructionsRequired: true,
fillIngredients: true,
apiKey: API_KEY2
})

const URL = `https://api.spoonacular.com/recipes/complexSearch?${params.toString()}`

Choose a reason for hiding this comment

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

This is so smart! And really easy to understand 💡

<div class='card-content'>
<h3>${recipe.title}</h3>
<div class='divider'></div>
<p><strong>Cuisine:</strong>

Choose a reason for hiding this comment

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

The use of is intuitive since it might be read out loud of accessibility reasons

<p class='ingredients-header'>Ingredients:</p>
<ul>
${recipe?.extendedIngredients
.map(({ name }) => `<li>${name}</li>`)

Choose a reason for hiding this comment

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

It looked nice to have the list with dots


if (cachedData) {
try {
const { recipes, timestamp } = JSON.parse(cachedData)

Choose a reason for hiding this comment

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

What does the timestamp do?

Comment on lines +131 to +132
.map((cuisine) => cuisine.toLowerCase())
.includes(selectedCuisine.toLowerCase())

Choose a reason for hiding this comment

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

Smart to use toLowerCase if anything has a capital letter somewhere, to make sure nothings missed

@SaraEnderborg SaraEnderborg changed the title My Recipe Library My Recipe Library---https://saras-js-project-recipe-library.netlify.app/ Oct 12, 2025
@JennieDalgren JennieDalgren self-assigned this Oct 26, 2025
Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

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

Great job with this project!

You code is clean and structured and easy to follow. The site looks really well worked on and the things you have implemented you have done so very good. Thinking about the requirements, the styling and the small extras such as the animation.

Keep up the good work!

Comment on lines +14 to +24
const params = new URLSearchParams({
number: 30,
cuisine: 'Asian,Italian,Mexican,Middle Eastern',
diet: 'vegan,vegetarian,gluten free',
type: 'breakfast,main course,dessert',
sort: 'popularity',
addRecipeInformation: true,
instructionsRequired: true,
fillIngredients: true,
apiKey: API_KEY
})

Choose a reason for hiding this comment

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

Nice that you have used URLSearchParams! Super useful and clever

Comment on lines +35 to +37
<p>We couldn't find any recipes for your filter...<br>
Try changing it or click <strong>Surprise me!</strong> 🎉</p>
</div>

Choose a reason for hiding this comment

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

nice empty state msg and nudge to try the random button :)

Comment on lines +51 to +52
${recipe?.cuisines?.length ? recipe.cuisines.join(', ') : 'N/A'}
</span>

Choose a reason for hiding this comment

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

good fallback

Comment on lines +73 to +77
if (cachedData) {
try {
const { recipes, timestamp } = JSON.parse(cachedData)
const isExpired = Date.now() - timestamp > CACHE_DURATION
recipesArray = recipes

Choose a reason for hiding this comment

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

smart, nice use of a cache "timer" too

Comment on lines +92 to +97
if (res.status === 402) {
cardsContainer.innerHTML = `
<div class='empty-message'>
<h2>Daily API limit reached 🚫</h2>
<p>Please try again later.</p>
</div>`;

Choose a reason for hiding this comment

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

Comment on lines +147 to +158
const sortOnTime = () => {
const selected = sortSection.querySelector('input[name="order"]:checked')
const order = selected ? selected.value : 'desc'

const sorted = [...recipesArray].sort((a, b) => {
return order === 'asc'
? a.readyInMinutes - b.readyInMinutes
: b.readyInMinutes - a.readyInMinutes
})

showCardsContainer(sorted)
}

Choose a reason for hiding this comment

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

nice job! If you want to keep the sorting even when you change the cuisine filters you could maybe save the sorting rule in a global variable. Just something to take with you going forward.

Comment on lines +9 to +15
--page-bg: #fafafa;
--blue-main: #0018a4;
--blue-outline: #0044cc;
--mint-green: #c0f8d1;
--pink-bg: #fddddf;
--text-blue: #0033aa;
}

Choose a reason for hiding this comment

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

yay! css variables 🎨

Comment on lines +226 to +234
animation: pop-in 0.5s ease;
}

/* ========== ANIMATIONS ========== */
@keyframes pop-in {
0% {
transform: scale(0.8);
opacity: 0;
}

Choose a reason for hiding this comment

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

Wohoo! Nice animation. It's the small things that really makes it pop :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants