Skip to content

Conversation

@AgnesSj01
Copy link

No description provided.

@AgnesSj01
Copy link
Author

Added random recipe button and tidied code

… shows all recipes after clicking the random button, fixed the CSS styling, added a search function and implemented localStorage
@AgnesSj01
Copy link
Author

Changed the buttons to dropdown menus, added an API, added a button that shows all recipes after clicking the random button, fixed the CSS styling, added a search function, and implemented localStorage.

@AgnesSj01
Copy link
Author

Copy link

@LeonEkelund LeonEkelund 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, I just found a few things :)

Comment on lines +7 to +12
body {
font-family: "Montserrat", Arial, sans-serif;
margin: 0;
padding-bottom: 30px;
padding-top: 240px;
}

Choose a reason for hiding this comment

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

Maybe it would be good to add a overflow x hidden here so that you cant scroll horizontally

</head>
<body>
<header class="top-nav">
<img src="images/aprikos.jpg" alt="aprikos" class="food" />

Choose a reason for hiding this comment

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

You can see half of this image (and a bit of the searchbar) at the top when scrolling on iphone 5

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 have implemented the requirements and almost enough of the stretch goals to recieve a VG.
If you aim for that, implement a loading state when you fetch the data.

Let me know if you will add that, for now I will give you Approved with G

Comment on lines +190 to +204
const mapApiRecipe = (r) => ({
// Title with fallback
title: r.title || "Untitled",
cuisine: (r.cuisines?.[0] || "unknown").toLowerCase(),
diet: (r.diets?.[0] || "none").toLowerCase(),
popularity: Math.max(
1,
Math.min(5, Math.round((r.aggregateLikes || 0) / 100))
),
time: r.readyInMinutes || 0,
img: r.image || "https://via.placeholder.com/600x400?text=No+image",
ingredients: (r.extendedIngredients || []).map(
(i) => i.original || i.name || ""
),
});

Choose a reason for hiding this comment

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

nice function!

Comment on lines 229 to 246
const fetchRecipes = async () => {
cardsEl.innerHTML = "<p>Fetching recipes…</p>";

// 1) Try cache first
const cached = localStorage.getItem(CACHE_KEY);
if (cached) {
const saved = JSON.parse(cached);
const tooOld = Date.now() - saved.timestamp > CACHE_TIME;

// Use cached recipes and render immediately
if (!tooOld) {
cardsEl.innerHTML = "<p>Showing recipes from cache</p>";
recipes.length = 0;
recipes.push(...saved.items);
renderResult();
return; // stop here if cache is fresh
}
}

Choose a reason for hiding this comment

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

great structure, comments and implementation of function

@JennieDalgren JennieDalgren self-assigned this Oct 20, 2025
@AgnesSj01
Copy link
Author

Great job with this project!

You have implemented the requirements and almost enough of the stretch goals to recieve a VG. If you aim for that, implement a loading state when you fetch the data.

Let me know if you will add that, for now I will give you Approved with G

Hi Jennie! Thanks for the feedback! I decided to go for it and implement a loading state. :)

@AgnesSj01
Copy link
Author

AgnesSj01 commented Oct 21, 2025 via email

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.

🎊

Added a brief description of the recipe library app.
Updated the README to provide a detailed project overview, objectives, features, and technologies used.
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