-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
193 lines (184 loc) · 8.15 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
<!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="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="css/styles.css" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./images/favicon-32x32.png"
/>
<script src="js/script.js" defer></script>
<title>Frontend Mentor | Tip calculator app</title>
</head>
<body>
<main>
<form
action="#"
class="tip-calculator container"
autocomplete="off"
aria-labelledby="form-title"
>
<header class="center">
<h1 id="form-title" class="sr-only">Splitter, the tip calculator</h1>
<div class="logo" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="87" height="54">
<path
fill="#3D6666"
d="M6.72 17.472c.944 0 1.792-.12 2.544-.36s1.392-.584 1.92-1.032a4.476 4.476 0 001.212-1.62c.28-.632.42-1.34.42-2.124v-.288c0-1.472-.464-2.584-1.392-3.336-.928-.752-2.272-1.288-4.032-1.608a14.615 14.615 0 01-1.74-.408c-.456-.144-.824-.308-1.104-.492-.28-.184-.476-.392-.588-.624a1.771 1.771 0 01-.168-.78c0-.56.232-1.004.696-1.332.464-.328 1.096-.492 1.896-.492.944 0 1.676.248 2.196.744.52.496.78 1.08.78 1.752v.576h3.168v-.864a5 5 0 00-.396-1.968 4.762 4.762 0 00-1.176-1.656C10.436 1.08 9.792.7 9.024.42 8.256.14 7.376 0 6.384 0c-.88 0-1.676.12-2.388.36s-1.32.576-1.824 1.008c-.504.432-.896.94-1.176 1.524-.28.584-.42 1.22-.42 1.908v.144c0 .832.144 1.536.432 2.112a3.978 3.978 0 001.212 1.44c.52.384 1.132.692 1.836.924.704.232 1.48.42 2.328.564.64.112 1.168.248 1.584.408.416.16.744.34.984.54s.408.424.504.672c.096.248.144.508.144.78 0 .576-.232 1.072-.696 1.488-.464.416-1.176.624-2.136.624-1.232 0-2.14-.3-2.724-.9-.584-.6-.876-1.404-.876-2.412v-.576H0v.72c0 .88.144 1.692.432 2.436a5.47 5.47 0 001.272 1.944c.56.552 1.26.984 2.1 1.296.84.312 1.812.468 2.916.468zm22-.336V10.8h3.408c.864 0 1.616-.144 2.256-.432a4.707 4.707 0 001.596-1.14 4.833 4.833 0 00.96-1.608c.216-.6.324-1.212.324-1.836v-.576c0-.608-.108-1.204-.324-1.788a4.625 4.625 0 00-.96-1.56A4.737 4.737 0 0034.384.756c-.64-.28-1.392-.42-2.256-.42h-6.576v16.8h3.168zm3.096-9.36H28.72V3.36h3.096c.704 0 1.26.192 1.668.576.408.384.612.88.612 1.488v.288c0 .608-.204 1.104-.612 1.488-.408.384-.964.576-1.668.576zm29.464 9.36v-3.024h-7.632V.336H50.48v16.8h10.8zm24.88 0v-3.024h-4.032V3.36h4.032V.336H74.928V3.36h4.032v10.752h-4.032v3.024H86.16zm-78.096 36V39.36h4.464v-3.024H.432v3.024h4.464v13.776h3.168zm24.688 0V39.36h4.464v-3.024H25.12v3.024h4.464v13.776h3.168zm28.624 0v-3.024h-7.728v-3.888H60.8V43.2h-7.152v-3.84h7.44v-3.024H50.48v16.8h10.896zm16.744 0V46.8h3.648c.464 0 .796.12.996.36.2.24.3.552.3.936v5.04h3.168v-5.808c0-.56-.164-1.024-.492-1.392-.328-.368-.772-.584-1.332-.648v-.432c.768-.32 1.336-.78 1.704-1.38a3.63 3.63 0 00.552-1.932v-.576c0-.64-.116-1.24-.348-1.8a4.332 4.332 0 00-1.008-1.476c-.44-.424-.988-.756-1.644-.996-.656-.24-1.416-.36-2.28-.36h-6.432v16.8h3.168zm3.024-9.36H78.12V39.36h3.024c.768 0 1.352.204 1.752.612.4.408.6.892.6 1.452v.288c0 .656-.2 1.164-.6 1.524-.4.36-.984.54-1.752.54z"
/>
</svg>
</div>
</header>
<div
class="tip-calculator__wrapper grid bg-neutral-100"
data-type="primary"
>
<!--Bill-->
<fieldset class="flow">
<legend class="fs-300">Bill</legend>
<label for="bill" class="sr-only">Enter total bill amount</label>
<input
id="bill"
name="bill"
type="number"
placeholder="0"
class="bg-neutral-200"
/>
<div class="error"></div>
</fieldset>
<!--select tip % -->
<fieldset id="tip-selection">
<legend class="fs-300">Select Tip %</legend>
<div class="grid" data-type="secondary">
<div class="tip__wrapper">
<input
type="radio"
id="tip-5"
name="tip"
value="5"
class="btn tip-btn"
data-type="primary"
/>
<label for="tip-5">5%</label>
</div>
<div class="tip__wrapper">
<input
type="radio"
id="tip-10"
name="tip"
value="10"
class="btn tip-btn"
data-type="primary"
/>
<label for="tip-10">10%</label>
</div>
<div class="tip__wrapper">
<input
type="radio"
id="tip-15"
name="tip"
value="15"
class="btn tip-btn"
data-type="primary"
/>
<label for="tip-15">15%</label>
</div>
<div class="tip__wrapper">
<input
type="radio"
id="tip-25"
name="tip"
value="25"
class="btn tip-btn"
data-type="primary"
/>
<label for="tip-25">25%</label>
</div>
<div class="tip__wrapper">
<input
type="radio"
id="tip-50"
name="tip"
value="50"
class="btn tip-btn"
data-type="primary"
/>
<label for="tip-50">50%</label>
</div>
<div class="tip__wrapper bg-neutral-200">
<label for="custom-tip" class="sr-only"
>Enter custom tip percent</label
>
<input
id="custom-tip"
name="custom-tip"
type="number"
placeholder="Custom"
class="btn"
/>
<div class="error"></div>
</div>
</div>
</fieldset>
<!-- number of people -->
<fieldset class="flow">
<legend class="fs-300">Number of People</legend>
<label for="people" class="sr-only">Enter number of people</label>
<input
id="people"
name="people"
type="number"
placeholder="0"
class="bg-neutral-200"
/>
<div class="error"></div>
</fieldset>
<!-- results -->
<section
class="results grid bg-primary-800"
aria-label="calculation results"
>
<div class="flex">
<h2 class="fs-300 text-neutral-100">
Tip Amount
<span class="fs-200 text-neutral-300 d-block">/ person</span>
</h2>
<div id="tip-result" class="fs-500 text-primary-400">
<p><span class="currency">$</span>0.00</p>
</div>
</div>
<div class="flex">
<h2 class="fs-300 text-neutral-100">
Total
<span class="fs-200 text-neutral-300 d-block">/ person</span>
</h2>
<div id="total-result" class="fs-500 text-primary-400">
<p><span class="currency">$</span>0.00</p>
</div>
</div>
<button type="reset" class="btn fs-350 uppercase">Reset</button>
</section>
</div>
</form>
</main>
<footer class="attribution container">
Challenge by
<a href="https://www.frontendmentor.io?ref=challenge" target="_blank"
>Frontend Mentor</a
>. Coded by
<a href="https://www.frontendmentor.io/profile/ania221B" target="_blank"
>ania221B</a
>.
</footer>
</body>
</html>