-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (107 loc) · 4.7 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
<!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">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="static/styles.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="js/script.js"></script>
<title>Tip calculator app</title>
</head>
<body>
<div class="container">
<div class="center">
<div class="row">
<div class="col-sm-3 col-md-3"></div>
<div class="col-sm-6 col-md-6">
<center><img src="images/logo.svg" /></center>
</div>
<div class="col"></div>
</div><br/>
<div class="row">
<div class="card" id="mainPanel">
<div class="card-body" >
<div class="row" >
<div class="col-md-6">
<small style="font-size: 70%;" class="form-title">Bill</small>
<div class="input-group bill-container">
<div class="input-group-icon" style="background-color:white;border-right-color:white;"><img src="images/icon-dollar.svg" /></div>
<div class="input-group-area"><input type="text" id="billForm" placeholder="0"></div>
</div>
<small style="font-size: 70%;" class="form-title">Select Tip %</small>
<div class="row" style="flex-wrap:nowrap!important;">
<div class="col-sm-4 col-md-3">
<button onclick="selected(this, 5)" id="5" type="button" class="btn btn-primary tip">5%</button>
</div>
<div class="col-md-1 d-none d-sm-block"></div>
<div class="col-sm-4 col-md-3">
<button onclick="selected(this, 10)" id="10" type="button " class="btn btn-primary tip">10%</button>
</div>
<div class="col-md-1 d-none d-sm-block"></div>
<div class="col-sm-4 col-md-3">
<button onclick="selected(this, 15)" id="15" type="button " class="btn btn-primary tip">15%</button>
</div>
</div><br/>
<div class="row" style="flex-wrap:nowrap!important;">
<div class="col-sm-4 col-md-3">
<button onclick="selected(this, 25)" id="25" type="button " class="btn btn-primary tip">25%</button>
</div>
<div class="col-md-1 d-none d-sm-block"></div>
<div class="col-sm-4 col-md-3">
<button onclick="selected(this, 50)" id="50" type="button " class="btn btn-primary tip">50%</button>
</div>
<div class="col-md-1 d-none d-sm-block"></div>
<div class="col-sm-4 col-md-3">
<input onclick="selected(this, this.value)" type="text" class="form-control custom" id="customInput" placeholder="Custom">
</div>
</div><br/>
<small style="font-size: 70%;" class="form-title">Number of people</small>
<small id="cantbezero" style="font-size: 70%;color:red;float:right;display:none" class="form-title">Can't be zero</small>
<div class="input-group number-container">
<div class="input-group-icon" style="background-color:white;border-right-color:white;"><img src="images/icon-person.svg" /></div>
<div class="input-group-area"><input type="text" id="numberPeople" placeholder="0"></div>
</div>
</div>
<div class="col-md-6 d-flex flex-column">
<div class="card" id="rightCard">
<div class="card-body ">
<div class="row" style="flex-wrap:nowrap!important;">
<div class="col-sm-8 col-md-6">
<small style="font-size: 70%;"><span style="color:white;">Tip Amount</span><br>
/ person</small>
</div>
<div class="col-sm-4 col-md-6">
<p class="large" id="tipAmount">$0.00</p>
</div>
</div><br/>
<div class="row" style="flex-wrap:nowrap!important;">
<div class="col-sm-8 col-md-6">
<small style="font-size: 70%;"><span style="color:white;">Total</span><br>
/ person</small>
</div>
<div class="col-sm-4 col-md-6">
<p class="large" id="total">$0.00</p>
</div>
</div>
<div class="mt-5">
<button type="button" id="reset" class="btn btn-primary btn-sm btn-block">RESET</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br/>
<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="http://twitch.tv/accacoding">Matteo Curci</a>.
</div>
</div>
</div>
</body>
</html>