-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
76 lines (74 loc) · 2.07 KB
/
index.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
const FAQ = [
{
q: "How much does Photoshop cost?",
a: "Plans start at US$22.99/mo."
},
{
q: "Can you use Photoshop to edit videos?",
a: "Yes, you can use Photoshop to edit videos."
},
{
q: "Is Photoshop available without a subscription?",
a: "Photoshop is only available as part of a Creative Cloud plan, which includes the latest features, updates, fonts, and more."
}
];
// add code here if needed
function processBackgroundColor(el) {
// add code here
}
function processHero(el) {
processBackgroundColor(el);
// add code here
}
function processBrick(el) {
processBackgroundColor(el);
// add code here
}
function processFaq(el) {
// improve this code
el.innerHTML = `
<div class="faq-set">
<div class="question">
<div>
<h3>${FAQ[0].q}</h3>
</div>
</div>
<div class="answer">
<div>
<p>${FAQ[0].a}</p>
</div>
</div>
</div>
<div class="faq-set">
<div class="question">
<div>
<h3>${FAQ[1].q}</h3>
</div>
</div>
<div class="answer">
<div>
<p>${FAQ[1].a}</p>
</div>
</div>
</div>
<div class="faq-set">
<div class="question">
<div>
<h3>${FAQ[2].q}</h3>
</div>
</div>
<div class="answer">
<div>
<p>${FAQ[2].a}</p>
</div>
</div>
</div>`;
// add code here
}
function processBanner(el) {
// add code here
}
document.querySelectorAll('.hero').forEach(processHero);
document.querySelectorAll('.brick').forEach(processBrick);
document.querySelectorAll('.faq').forEach(processFaq);
document.querySelectorAll('.banner').forEach(processBanner);