-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecipe.html
168 lines (148 loc) · 6.43 KB
/
recipe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE html>
<html>
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4RN7HSGW86"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-4RN7HSGW86');
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Staying Healthy - Contact Page</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" />
<link href="css/all.min.css" rel="stylesheet" />
<link href="css/templatemo-style.css" rel="stylesheet" />
<script src="data.js"></script>
</head>
<body>
<div class="container">
<!-- Top box -->
<!-- Logo & Site Name -->
<div class="placeholder">
<div class="parallax-window" data-parallax="scroll" data-image-src="img/theme/addition2.jpg">
<div class="tm-header">
<div class="header_row tm-header-inner">
<div class="col-md-6 col-12">
<img src="img/logo/logo1_notext-removebg.png" alt="Logo" class="tm-site-logo" />
<div class="tm-site-text-box">
<h1 class="tm-site-title">Staying Healthy</h1>
<h6 class="tm-site-description">Eating clean has never been easier !</h6>
</div>
</div>
<nav class="col-md-6 col-12 tm-nav">
<ul class="tm-nav-ul">
<li class="tm-nav-li"><a href="index.html" class="tm-nav-link active">Home</a></li>
<li class="tm-nav-li"><a href="search.html" class="tm-nav-link">Search</a></li>
<li class="tm-nav-li"><a href="about.html" class="tm-nav-link">About</a></li>
<li class="tm-nav-li"><a href="contact.html" class="tm-nav-link">Contact</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<main>
<header class="row tm-welcome-section">
<h2 class="col-12 text-center tm-section-title" id="title"></h2>
<p class="col-12 text-center" id="intro"></p>
</header>
<div class="tm-container-inner tm-history">
<div class="row">
<div class="col-12">
<div class="tm-history-inner">
<img id="rep_imga" alt="Image" class="img-fluid tm-history-img">
<div class="tm-history-text">
<h4 class="tm-history-title">Ingredients</h4>
<ul class="tm-gallery-description text-justify" id="ingr" ></ul>
<h4 class="tm-history-title">Method</h4>
<ul class="tm-gallery-description text-justify" id="instr" ></ul>
<h4 class="tm-history-title">Nutrition Fact (per servings: 1-2)</h4>
<ul class="tm-gallery-description text-justify" id="nutri"></ul>
</div>
</div>
</div>
</div>
</div>
<div class="row-info">
<h2 class="col-12 text-center tm-history-title">How much are the quantities listed in our instructions?</h2>
</div>
<div class="tm-container-inner tm-features">
<div class="row">
<div class="col-lg-4">
<div class="tm-feature">
<img src="img/gallery/teaspoon.jpg" alt="Image" class="img-fluid tm-gallery-img" />
<p class="tm-feature-description">A US teaspoon measures 4.9289mL, while a metric teaspoon used in the UK, Australia, and the Commonwealth, measures 5mL. They are both approximate 4.2g</p>
<a href="https://www.bakinglikeachef.com/how-many-grams-is-in-a-teaspoon/" class="tm-btn tm-btn-primary">Read More</a>
</div>
</div>
<div class="col-lg-4">
<div class="tm-feature">
<img src="img/gallery/tablespoon.jpg" alt="Image" class="img-fluid tm-gallery-img" />
<p class="tm-feature-description">A US tablespoon equals 14.7868 mL and the metric tablespoon is equal to 15 mL. They are equivalent to 12.5g and 12.7g, respectively</p>
<a href="https://www.bakinglikeachef.com/how-many-grams-is-in-a-tablespoon/" class="tm-btn tm-btn-success">Read More</a>
</div>
</div>
<div class="col-lg-4">
<div class="tm-feature">
<img src="img/gallery/cup.jpg" alt="Image" class="img-fluid tm-gallery-img" />
<p class="tm-feature-description">A US legal cup measures 240ml but the metric cup can hold up to 250ml. A cup of liquid ingredient is 240 into grams.</p>
<a href="https://healthiersteps.com/how-many-grams-in-a-cup/" class="tm-btn tm-btn-danger">Read More</a>
</div>
</div>
</div>
</div>
</main>
<script>
const queryString = window.location.search;
// Create a new instance of the URLSearchParams object using the query string.
// The URLSearchParams object provides a convenient interface to work with the query string parameters.
const urlParams = new URLSearchParams(queryString);
// Retrieve the value of the id parameter from the URL query string
const recipeId = urlParams.get("id");
// Find recipe with matching ID in data
const recipe = recipes.find((r) => r.id === parseInt(recipeId));
// Populate recipe details on page
document.getElementById("title").innerHTML = recipe.title;
document.getElementById("intro").innerHTML = recipe.intro;
recipe.ingr.forEach(function (item) {
let listItem = document.createElement("li");
listItem.innerHTML = item;
document.getElementById("ingr").appendChild(listItem);
});
recipe.instr.forEach(function (item) {
let listItem = document.createElement("li");
listItem.innerHTML = item;
document.getElementById("instr").appendChild(listItem);
});
document.getElementById("nutri").innerHTML = recipe.nutri;
document.getElementById("rep_imga").src = recipe.img;
</script>
<footer class="tm-footer text-center">
<p>Copyright © 2023 Staying Healthy</p>
</footer>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/parallax.min.js"></script>
<script>
$(document).ready(function(){
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
});
</script>
</body>
</html>