-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (115 loc) · 4.27 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- displays site properly based on user's device -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png" />
<link rel="stylesheet" href="./styles.css" />
<title>Frontend Mentor | [Pricing component with toggle]</title>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:700&display=swap"
rel="stylesheet"
/>
<script>
document.addEventListener(
'DOMContentLoaded',
() => {
const $toggle = document.querySelector('.toggle input');
const $mothlyPriceElements = document.querySelectorAll('.monthly-price');
const $yearlyPriceElements = document.querySelectorAll('.yearly-price');
$toggle.addEventListener('change', update);
function update() {
if ($toggle.checked) {
// Monthly
$mothlyPriceElements.forEach(element => (element.style.display = ''));
$yearlyPriceElements.forEach(element => (element.style.display = 'none'));
} else {
// Yearly
$yearlyPriceElements.forEach(element => (element.style.display = ''));
$mothlyPriceElements.forEach(element => (element.style.display = 'none'));
}
}
update();
},
{ once: true },
);
</script>
</head>
<body>
<div class="root">
<img class="bg-top" src="images/bg-top.svg" role="presentation" alt="" />
<img class="bg-bottom" src="images/bg-bottom.svg" role="presentation" alt="" />
<div class="title">Our Pricing</div>
<div class="plan-type">
<span>Annually</span>
<label class="toggle">
<input type="checkbox" checked />
<span class="thumb"></span>
</label>
<span>Monthly</span>
</div>
<div class="membership">
<label class="membership-plan">
<input type="radio" name="membership" />
<div class="wrapper">
<div class="content">
<span class="title">Basic</span>
<span class="price">
<span class="monthly-price">$ 19.99</span>
<span class="yearly-price">$ 239.88</span>
</span>
<ul class="features">
<li>500 GB Storage</li>
<li>2 Users Allowed</li>
<li>Send Up to 3GB</li>
</ul>
<button class="learn-more">Learn more</button>
</div>
</div>
</label>
<label class="membership-plan">
<input type="radio" name="membership" checked />
<div class="wrapper">
<div class="content">
<span class="title">Professional</span>
<span class="price">
<span class="monthly-price">$ 24.99</span>
<span class="yearly-price">$ 299.88</span>
</span>
<ul class="features">
<li>1 TB Storage</li>
<li>5 Users Allowed</li>
<li>Send Up to 10GB</li>
</ul>
<button class="learn-more">Learn more</button>
</div>
</div>
</label>
<label class="membership-plan">
<input type="radio" name="membership" />
<div class="wrapper">
<div class="content">
<span class="title">Master</span>
<span class="price">
<span class="monthly-price">$ 39.99</span>
<span class="yearly-price">$ 479.88</span>
</span>
<ul class="features">
<li>2 TB Storage</li>
<li>10 Users Allowed</li>
<li>Send Up to 20GB</li>
</ul>
<button class="learn-more">Learn more</button>
</div>
</div>
</label>
</div>
<div class="attribution">
Challenge by
<a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="https://github.com/crissdev">Cristian Trifan</a>.
</div>
</div>
</body>
</html>