-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
173 lines (169 loc) · 5.28 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
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>
Dinner calculator
</title>
<link href="https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap" rel="stylesheet">
<link
href="https://fonts.googleapis.com/css2?family=Oxygen+Mono&family=Source+Code+Pro:wght@400;600&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="css/styles.css" />
</head>
<body>
<div id="app" v-cloak>
<h1 class="title">
Dinner calculator
</h1>
<table class="table">
<tbody class="table__body">
<tr class="table__row">
<th class="table__th">
Price
</th>
<td class="table__td table__td--numbers">
{{ price }}€
</td>
<td class="table__td">
<div class="list-buttons">
<button @click="increment('price')" class="list-buttons__item button button--add">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#plus"></use>
</svg>
</i>
</button>
<button @click="decrement('price')" class="list-buttons__item button button--remove">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#minus"></use>
</svg>
</i>
</button>
</div>
</td>
</tr>
<tr class="table__row">
<th class="table__th">
Persons
</th>
<td class="table__td table__td--numbers">
{{ persons }}
</td>
<td class="table__td">
<div class="list-buttons">
<button @click="increment('persons')" class="list-buttons__item button button--add">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#plus"></use>
</svg>
</i>
</button>
<button @click="decrement('persons')" class="list-buttons__item button button--remove">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#minus"></use>
</svg>
</i>
</button>
</div>
</td>
</tr>
<tr class="table__row">
<th class="table__th">
Taxes
</th>
<td class="table__td table__td--numbers">
{{ taxes }}%
</td>
<td class="table__td">
<div class="list-buttons">
<button @click="increment('taxes')" class="list-buttons__item button button--add">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#plus"></use>
</svg>
</i>
</button>
<button @click="decrement('taxes')" class="list-buttons__item button button--remove">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#minus"></use>
</svg>
</i>
</button>
</div>
</td>
</tr>
<tr class="table__row">
<th class="table__th">
Tips
</th>
<td class="table__td table__td--numbers">
{{ tips }}%
</td>
<td class="table__td">
<div class="list-buttons">
<button @click="increment('tips')" class="list-buttons__item button button--add">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#plus"></use>
</svg>
</i>
</button>
<button @click="decrement('tips')" class="list-buttons__item button button--remove">
<i class="icon icon--white">
<svg class="icon__svg">
<use class="icon__use" xlink:href="#minus"></use>
</svg>
</i>
</button>
</div>
</td>
</tr>
<tr class="table__row table__row--calculate">
<th class="table__th">
Total per person<br>
<small>with taxes</small>
</th>
<td class="table__td table__td--numbers">
{{ totalTaxes().toFixed(2) }}€
</td>
<td class="table__td table__td--formula">
<code>(price * (taxes% / 100)) + price</code><br>
<code>({{ price }}€ * {{ taxes / 100 }}) + {{ price }}€</code>
</td>
</tr>
<tr class="table__row table__row--calculate">
<th class="table__th">
Total of all persons<br>
<small>with taxes</small>
</th>
<td class="table__td table__td--numbers">
{{ totalPersons().toFixed(2) }}€
</td>
<td class="table__td table__td--formula">
<code>total dinner with taxes * persons</code><br>
<code>{{ totalTaxes().toFixed(2) }}€ * {{persons}}</code>
</td>
</tr>
<tr class="table__row table__row--calculate">
<th class="table__th">
Total of all persons<br>
<small>with tips</small>
</th>
<td class="table__td table__td--numbers">
{{ totalTips().toFixed(2) }}€
</td>
<td class="table__td table__td--formula">
<code>(total dinners * (tips% / 100)) + total dinners</code><br>
<code>({{ totalPersons().toFixed(2) }}€ * {{ tips / 100 }}) + {{ totalPersons().toFixed(2) }}€</code>
</td>
</tr>
</tbody>
</table>
</div>
<script src="js/vue-2.6.10.js"></script>
<script src="js/app.js"></script>
</body>
</html>