forked from Tzikas/PromiseMeDinner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
66 lines (41 loc) · 1.39 KB
/
script.js
File metadata and controls
66 lines (41 loc) · 1.39 KB
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
const steak = [
'season steak generously with salt, pepper and garlic powder',
'place in ziplock bag',
'cook in sous vide at 120 F for 1-2 hours',
'remove from bag and pat dry',
'heat pan with grapeseed oil and a quarter stick of butter',
'cook steak for 30-60 seconds per side using a spoon to baste with butter',
'rest for 10 mintutes',
'enjoy'
]
const brusselSprouts = [
'wash burussel srouts',
'cut off base and chop in half',
'toss in bowl with olive oil, balsamic vinger and salt',
'preheat oven to 500 F',
'coat baking sheet with olive oil',
'place in flat side down',
'cook for 20 minutes',
'place back in bowl and add salt and pepper',
'enjoy'
]
const mashPotatoes = [
'boil water',
'tear open bag of of instant potato mix and pour into bowl',
'pour in water',
'mix',
'enjoy'
]
function makeFood(steps, id){
for(const step of steps){
//This function adds food to the list ==> addFood('take steak from fridge', #steak)
addFood(step,id)
}
//Adds image to the table div
document.querySelector('#table').innerHTML += (`<img src="images/${id.replace('#','')}.jpg" />`)
//Use once all food is made
//document.body.innerHTML += `<button onclick="new Audio('dinnerIsServed.mp3').play()">Dinner is Served!</button>`
}
makeFood(steak, '#steak')
makeFood(mashPotatoes, '#mashPotatoes')
makeFood(brusselSprouts, '#brusselSprouts')