-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
226 lines (191 loc) · 9.52 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#171722">
<title>Shoppie</title>
<link rel="stylesheet" href="./index.css">
<link rel="icon" href="./assets/icon-192.png">
<link rel="manifest" href="./manifest.json">
<script src="./dexie.min.js"></script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./sw.js');
});
}
</script>
</head>
<body class="app__container" id="appContainer">
<div class="app__page-loader" id="pageLoader"></div>
<div class="app__overlay hidden" id="appOverlay"></div>
<div class="toast-modal" id="toastModal">
<p id="modalContent"></p>
</div>
<div class="confirm-modal" id="confirmModal">
<p id="modalContent"></p>
<div class="modal-actions">
<button class="red" id="closeButton">No</button>
<button id="actionButton">Yes</button>
</div>
</div>
<div class="info-modal" id="infoModal" onclick="closeInfoModal()">
<div class="content">
<p> - Double click items to select them.</p>
<p> - Click the plus (+) icon above to use the form to create a list.</p>
</div>
<button>click to dismiss forever</button>
</div>
<div class="app__main">
<header class="app__header uniform-align">
<h1 class="header-text">
Shoppie
<span class="bottom-line"></span>
<span class="app-status online" id="appStatus"></span>
</h1>
<div class="header-buttons">
<button class="item options-button" id="appOptionsModalToggler">
<span class="icon large">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 is-active" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 is-inactive" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</span>
</button>
</div>
<div class="app__options-modal" id="appOptionsModal">
<label>
Currency:
<input type="text" id="itemsCurrencyForm" maxlength=1>
</label>
<label>
Theme:
<button class="theme-button" id="themeToggler">
<span class="icon large">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" />
</svg>
</span>
</button>
</label>
<label>
<button class="quick-action-button delete-button" id="optionsDeleteAllButton">
Delete all
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</span>
</button>
</label>
<label>
<button class="quick-action-button" id="purchaseAllButton">
Purchase All
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z" />
</svg>
</span>
</button>
</label>
</div>
</header>
<div class="app__form-toggler">
<span class="icon active" id="itemFormToggler">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 is-inactive" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 is-active" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
</span>
<hr>
</div>
<section class="app__header-section" id="formSection">
<form class="app__form" id="itemForm">
<input type="hidden" id="itemFormMode" value="create">
<input type="hidden" id="currentItemEditing">
<div class="form-inputs">
<label>
Name of Item:
<input type="text" id="nameInput" required>
</label>
<label>
Quantity:
<input type="number" id="quantityInput" value=1 min=1>
</label>
<label>
Price:
<input type="number" id="priceInput" value=0>
</label>
</div>
<button type="submit" id="addItemButton">Add item</button>
</form>
<div class="app__price-display">
<div class="item" id="totalPriceDiv"></div>
<div class="item" id="balancePriceDiv"></div>
</div>
</section>
<div class="clearfix"></div>
<div class="app__items-list">
<div class="list-actions">
<button class="quick-action-button delete-button" id="itemActionsDeleteAllButton">
Delete all
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</span>
</button>
<button id="selectAllButton">
<div class="button-mode are-not-selected">
Select all
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
</div>
<div class="button-mode are-selected">
Unselect all
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</span>
</div>
</button>
<button class="delete-button selection-action" id="deleteSelectedButton">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</span>
Delete selected
</button>
<button class="selection-action" id="purchaseSelectedButton">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z" />
</svg>
</span>
Purchase selected
</button>
<button class="selection-action" id="unPurchaseSelectedButton">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z" />
</svg>
</span>
Unpurchase selected
</button>
</div>
<div class="list-main" id="itemsDiv"></div>
</div>
</div>
<script src="./index.js"></script>
</body>
</html>