-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
97 lines (84 loc) · 2.99 KB
/
script.js
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
const hamburgerMenu = document.querySelector('.hamburger-icon')
const popupWindow = document.querySelector('.popup-menu')
const closePopupWindow = document.querySelector('.close-menu')
const toggleMenu = false
hamburgerMenu.addEventListener('click', () => {
if (toggleMenu === false) {
popupWindow.style.visibility = 'visible'
}
})
closePopupWindow.addEventListener('click', () => {
if (toggleMenu === false) {
popupWindow.style.visibility = 'hidden'
}
})
const navMenuButton = document.querySelector('.popup-menu')
navMenuButton.addEventListener('click', () => {
if (toggleMenu === false) {
popupWindow.style.visibility = 'hidden'
}
})
const roasterInfo1 = [
{
name: 'Brandywine',
screenshot: 'img/featured-roaster-1.webp',
location: 'Wilmington, DE',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
},
{
name: 'Birdrock',
screenshot: 'img/featured-roaster-6.jpg',
location: 'San-Diego, CA',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
},
{
name: 'Cat & Cloud',
screenshot: 'img/featured-roaster-2.jpg',
location: 'Santa Ana, CA',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
}
]
document.querySelector('.featured-roasters-column-1').innerHTML = roasterInfo1.map((data) =>
`<div class="featured-roaster">
<div class="featured-roaster-img-div">
<img class="featured-roaster-img" src="${data.screenshot}" alt="Roaster Logo">
</div>
<div class="featured-roaster-info">
<h4 class="featured-roaster-name">${data.name}</h4>
<p class="featured-roaster-location">${data.location}</p>
<div class="roaster-seperator"></div>
<p>${data.description}</p>
</div>
</div>`).join('')
const roasterInfo2 = [
{
name: 'Blue Bottle',
screenshot: 'img/featured-roaster-3.jpg',
location: 'New York, NY',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
},
{
name: 'Olympia',
screenshot: 'img/featured-roaster-4.png',
location: 'Olympia, WA',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
},
{
name: 'Onyx',
screenshot: 'img/featured-roaster-5.jpg',
location: 'Bentonville, AK',
description: 'Brandywine is a premier coffee<br> roaster from wilmington, DE'
}
]
document.querySelector('.featured-roasters-column-2').innerHTML = roasterInfo2.map((data) =>
`<div class="featured-roaster">
<div class="featured-roaster-img-div">
<img class="featured-roaster-img" src="${data.screenshot}" alt="Roaster logo">
</div>
<div class="featured-roaster-info">
<h4 class="featured-roaster-name">${data.name}</h4>
<p class="featured-roaster-location">${data.location}</p>
<div class="roaster-seperator"></div>
<p>${data.description}</p>
</div>
</div>`).join('')