Skip to content

Commit

Permalink
create: draw app/password app
Browse files Browse the repository at this point in the history
  • Loading branch information
kyvycodes committed Sep 20, 2021
1 parent cfd8dc0 commit 80ea063
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 13 deletions.
Binary file added drawing-app/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions drawing-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang-"en">
<head>
<meta charset="UTF-8">
<meta name= "viewpoint"
content="width=device-width, initial-scale=1.0">
<title>Time to draw 🖍</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<h1>Hello World</h1>
</html>
Empty file added drawing-app/script.js
Empty file.
10 changes: 10 additions & 0 deletions drawing-app/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

* {
box-sizing: border-box;
}

body {
font-family: "Poppins", sans-serif;
margin: 0;
}
Binary file added password-generator/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions password-generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang-"en">
<head>
<meta charset="UTF-8">
<meta name= "viewpoint"
content="width=device-width, initial-scale=1.0">
<title>Let's make you a password !</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<h1>Hello World</h1>
</html>
Empty file added password-generator/script.js
Empty file.
10 changes: 10 additions & 0 deletions password-generator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

* {
box-sizing: border-box;
}

body {
font-family: "Poppins", sans-serif;
margin: 0;
}
2 changes: 1 addition & 1 deletion recipe-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</header>
<div class="fav-container">
<h3> Favorite Meals</h3>
<ul class="fav-meals" id='fav-meals'>
<ul class="fav-meals" id="favorite-meals">
</ul>
</div>
<div class='meals' id='meals'>
Expand Down
27 changes: 15 additions & 12 deletions recipe-app/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const meals = document.getElementById("meals");
const favoriteContainer = document.getElementById("fav-meals");
const favoriteContainer = document.getElementById("favorite-meals");

getRandomMeal();
fetchFavMeals();
Expand All @@ -22,16 +22,14 @@ async function getRandomMealById(id) {

const respData = await resp.json();
const meal = respData.meals[0];
// console.log("by id", respData);

return meal;
}

// async function getMealsBySearch(factor) {
// const meals = await fetch(
// "https://www.themealdb.com/api/json/v1/1/search.php?s=" + factor
// );
// }
async function getMealsBySearch(factor) {
const meals = await fetch(
"https://www.themealdb.com/api/json/v1/1/search.php?s=" + factor
);
}

//reallocating from html file
function addMeal(mealData, random = false) {
Expand Down Expand Up @@ -91,20 +89,25 @@ function removeMealsLocalStorage(mealId) {
async function fetchFavMeals() {
const mealIds = getMealsLocalStorage();

// let meals = [];
for (let i = 0; i < mealIds.length; i++) {
const mealId = mealIds[i];
let meal = await getRandomMealById(mealId);
console.log("meal", meal);
meal = await getRandomMealById(mealId);

// meals.push(meal);
// console.log("meal", meal);
addMealToFavs(meal);
}
}

//reallocating from html file
// reallocating from html file
function addMealToFavs(mealData) {
const favMeal = document.createElement("li");

favMeal.innerHTML = `
<img src='${mealData.strMealThumb}' alt='${mealData.strMeal}'>
<img
src='${mealData.strMealThumb}'
alt='${mealData.strMeal}'>
<span>${mealData.strMeal}</span>
`;

Expand Down

0 comments on commit 80ea063

Please sign in to comment.