-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
125 lines (120 loc) · 6.56 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
<!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="manifest" href="/manifest.json" />
<meta name="theme-color" content="#333" />
<link rel="apple-touch-icon" href="./images/icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<title>SPLITTER</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<link rel="stylesheet" href="calc-styles.css">
</head>
<body>
<main>
<div class="container-fluid">
<div class="row justify-content-center mt-5 mt-md-0 mb-5">
<div class="col-4 text-center">
<h1><img src="./images/logo.svg" alt="SPLITTER."></h1>
</div>
</div>
<div class="row justify-content-center">
<div class="col-12 col-md-10 col-lg-8">
<div class="calculator-component">
<div class="calculation py-1">
<div class="m-4">
<div class="row justify-content-center">
<div class="col-12 col-md-6 mb-5 mb-md-0">
<div class="bill-amount mb-2 position-relative">
<label class="mb-2" for="bill-amount">Bill</label>
<span id="bill-error" class="error-handler position-absolute d-none">Enter Valid Dollar Amount</span><br>
<input class="w-100 text-end calc-inputs" type="text" id="bill-amount" name="bill-amount" placeholder="0">
<span class="input-logo"><img src="./images/icon-dollar.svg" alt="dollar sign icon."></span>
</div>
<div class="tip-buttons mb-5">
<p class="mb-0">Select Tip %</p>
<div class="btn-container w-100">
<div class="row">
<div class="col-6 col-md-4">
<label class="tip-percent w-100 h-75 text-center" for="5percent">
<input type="radio" class="visually-hidden percentage" name="percentages" id="5percent" value="5">5%
</label>
</div>
<div class="col-6 col-md-4">
<label class="tip-percent w-100 h-75 text-center" for="10percent">
<input type="radio" class="visually-hidden percentage" name="percentages" id="10percent" value="10">10%
</label>
</div>
<div class="col-6 col-md-4">
<label class="tip-percent w-100 h-75 text-center" for="15percent">
<input type="radio" class="visually-hidden percentage" name="percentages" id="15percent" value="15">15%
</label>
</div>
<div class="col-6 col-md-4">
<label class="tip-percent w-100 h-75 text-center" for="25percent">
<input type="radio" class="visually-hidden percentage" name="percentages" id="25percent" value="25">25%
</label>
</div>
<div class="col-6 col-md-4">
<label class="tip-percent w-100 h-75 text-center" for="50percent">
<input type="radio" class="visually-hidden percentage" name="percentages" id="50percent" value="50">50%
</label>
</div>
<div class="col-6 col-md-4">
<input type="text" id="custom-percent" class="tip-percent custom-tip w-100 h-75 text-end percentage" placeholder="Custom">
</div>
</div>
</div>
</div>
<div class="number-people position-relative mb-2">
<label class="mb-2" for="num-people">Number of People</label>
<span id="num-people-error" class="error-handler position-absolute d-none">Can't be zero</span><br>
<input class="w-100 text-end calc-inputs" type="text" id="num-people" name="num-people" placeholder="1">
<span class="input-logo"><img src="./images/icon-person.svg" alt="person icon."></span>
</div>
</div>
<div class="col-12 col-md-6">
<div class="display-amount h-100 w-100" style="display:flex; flex-direction:column; flex:1;">
<div class="results pt-4 ps-4 pb-5 pb-md-0">
<div class="row justify-content-between">
<div class="col-6 pt-2">
<p class="amounts m-0">Tip Amount</p>
<p class="per-person">/ person</p>
</div>
<div class="col-6 ps-0 pe-4 text-center pt-2 pt-md-0">
<span class="money">$<span id="tip-per-person">0.00</span></span>
</div>
</div>
<div class="mt-4 row justify-content-between">
<div class="col-6 pt-2">
<p class="amounts m-0">Total</p>
<p class="per-person">/ person</p>
</div>
<div class="col-6 ps-0 pe-4 text-center pt-2 pt-md-0">
<span class="money">$<span id="total-per-person">0.00</span></span>
</div>
</div>
</div>
<button id="reset" class="reset-btn mt-auto mx-auto mb-4 w-75">RESET</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="attribution mt-4 mb-5 pb-2">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="https://github.com/fbell884">Francis Bell</a>.
</div>
</footer>
<script src="functionality.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>