-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
232 lines (210 loc) · 5.65 KB
/
index.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<title>Frontend Mentor | FAQ Accordion Card</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@400;700&display=swap');
:root {
/* Text-after-effect */
--txt-color1: hsl(238, 29%, 16%);
--txt-color2: hsl(14, 88%, 65%);
/* Background gradient */
--bg-grad1: hsl(273, 75%, 66%);
--bg-grad2: hsl(240, 73%, 65%);
/* Text-normal */
--txt-color3: hsl(237, 12%, 33%);
--txt-color3: hsl(240, 6%, 50%);
/* Dividers */
--divider: hsl(240, 5%, 91%);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
width: 100%;
min-height: 100vh;
font-family: 'Kumbh Sans', sans-serif;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(var(--bg-grad1), var(--bg-grad2));
}
main {
display: flex;
align-items: center;
justify-content: center;
height: 540px;
width: 800px;
border-radius: 30px;
background-color: hsl(0, 0%, 100%);
font-weight: 400;
}
.box {
margin-right: -85px;
margin-bottom: -100px;
z-index: 1;
}
h1{
font-weight: 700;
}
section:nth-child(1),
section:nth-child(2) {
width: 50%;
height: 100%;
}
section:nth-child(1) {
display: flex;
align-items: center;
overflow: hidden;
}
.faq-svgs img {
width: 100%;
margin-left: -65px;
}
.faq-ques {
height: 80%;
width: 80%;
display: flex;
flex-direction: column;
justify-content: space-around;
margin-top: 10%;
}
.ques {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.ques:hover{
color: hsl(14, 88%, 65%);
}
.hide {
display: none;
line-height: 1.5rem;
}
.arrow{
padding: 2px 5px;
cursor: pointer;
}
hr{
border: none;
border-bottom: 1px solid var(--divider);
}
@media screen and (max-width: 640px) {
main {
flex-direction: column;
width: 325px;
height: 650px;
justify-content: space-between;
}
.faq-ques{
width: unset;
}
.faq-svgs{
height: 20%;
}
.faq-svgs img{
margin: 0;
margin-top: -150px;
margin-left: -35px;
width: 140%;
}
.box{
margin: unset;
position: absolute;
top: 90px;
margin-left: -160px;
width: 120px;
}
body{
flex-direction: column;
position: relative;
padding: 150px 0 50px 0;
}
section:nth-child(1){
overflow: visible;
height: 20%;
}
section:nth-child(2){
width: 80%;
}
h1{
text-align: center;
}
}
</style>
</head>
<body>
<img class="box" src="images/illustration-box-desktop.svg" alt="desktop-img">
<main>
<section>
<div class="faq-svgs">
<img src="images/illustration-woman-online-desktop.svg" alt="women">
</div>
</section>
<section>
<div class="faq-ques">
<h1>FAQ</h1>
<div class="ques-container">
<div class="ques">How many team members can I invite? <img class="arrow" src="images/icon-arrow-down.svg" alt="arrow"></div>
<div class="ans hide">You can invite up to 2 additional users on the Free plan. There is no limit on
team members for the Premium plan.</div>
</div>
<hr>
<div class="ques-container">
<div class="ques">What is the maximum file upload size? <img class="arrow" src="images/icon-arrow-down.svg" alt="arrow">
</div>
<div class="ans hide"> No more than 2GB. All files in your account must fit your allotted storage space.
</div>
</div>
<hr>
<div class="ques-container">
<div class="ques">How do I reset my password? <img class="arrow" src="images/icon-arrow-down.svg" alt="arrow"></div>
<div class="ans hide">Click “Forgot password” from the login page or “Change password” from your profile page.
A reset link will be emailed to you.</div>
</div>
<hr>
<div class="ques-container">
<div class="ques">Can I cancel my subscription? <img class="arrow" src="images/icon-arrow-down.svg" alt="arrow"></div>
<div class="ans hide">Yes! Send us a message and we’ll process your request no questions asked.</div>
</div>
<hr>
<div class="ques-container">
<div class="ques">Do you provide additional support? <img class="arrow" src="images/icon-arrow-down.svg" alt="arrow"></div>
<div class="ans hide">Chat and email support is available 24/7. Phone lines are open during normal business hours.
</div>
</div>
</div>
</section>
</main>
<script>
const arrows = document.querySelectorAll(".arrow");
const answers = document.querySelectorAll(".ans");
const questions = document.querySelectorAll(".ques");
console.log(answers);
arrows[0].addEventListener('click',function(){
answers[0].classList.toggle('hide');
});
arrows[1].addEventListener('click',function(){
answers[1].classList.toggle('hide');
});
arrows[2].addEventListener('click',function(){
answers[2].classList.toggle('hide');
});
arrows[3].addEventListener('click',function(){
answers[3].classList.toggle('hide');
});
arrows[4].addEventListener('click',function(){
answers[4].classList.toggle('hide');
});
</script>
</body>
</html>