-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
528 lines (465 loc) · 27.3 KB
/
index.html
File metadata and controls
528 lines (465 loc) · 27.3 KB
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>SuperLijst</title>
<meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="apple-touch-icon" href="android-chrome-192x192.png">
<link rel="manifest" href="manifest.json">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.0/Sortable.min.js"></script>
<script src="https://unpkg.com/dexie/dist/dexie.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
dark: { 900: '#0f172a', 800: '#1e293b', 700: '#334155' },
accent: { 500: '#10b981', 600: '#059669' }
}
}
}
}
</script>
<style>
body { font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: auto; padding-top: env(safe-area-inset-top); }
.safe-header { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); padding-bottom: 1rem; }
#loading-overlay { background: #0f172a; position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s; }
.sortable-ghost { opacity: 0.4; background: #334155; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
</style>
</head>
<body class="bg-dark-900 text-slate-100 min-h-screen flex flex-col items-center overflow-hidden">
<div id="loading-overlay">
<div class="flex flex-col items-center">
<i class="fa-solid fa-circle-notch fa-spin text-4xl text-emerald-500 mb-4"></i>
<p class="text-gray-400 animate-pulse text-sm">Lijsten laden...</p>
</div>
</div>
<div id="app" class="w-full max-w-md bg-dark-900 shadow-2xl relative flex flex-col">
<header class="safe-header px-4 bg-dark-800/90 backdrop-blur-md z-20 border-b border-gray-700/50 flex justify-between items-center shrink-0">
<h1 id="header-title" class="text-xl font-bold bg-gradient-to-r from-emerald-400 to-cyan-500 bg-clip-text text-transparent">SuperLijst</h1>
<div id="header-actions" class="flex gap-3"></div>
</header>
<main id="main-content" class="flex-grow p-4 overflow-auto"></main>
<div id="notification-container" class="fixed bottom-6 left-1/2 transform -translate-x-1/2 w-11/12 max-w-sm z-50 flex flex-col gap-2 pointer-events-none"></div>
<div id="fixed-action-bar" class="fixed inset-x-0 bottom-0 z-30"></div>
</div>
<template id="tpl-dashboard">
<div class="space-y-6 animate-fade-in pb-10">
<div id="saved-section">
<h2 class="text-xs uppercase tracking-wider text-gray-500 font-bold mb-3 pl-1">Mijn Lijsten</h2>
<div id="saved-list-container" class="grid grid-cols-1 gap-3">
<div id="empty-state" class="hidden text-center py-10 text-gray-600">
<i class="fa-solid fa-clipboard-list text-4xl mb-3 block"></i>
<p>Geen lijsten gevonden.</p>
</div>
</div>
</div>
<button onclick="app.startEmpty()" class="w-full py-4 border-2 border-dashed border-gray-700 rounded-xl text-gray-400 hover:text-emerald-400 hover:border-emerald-500/50 hover:bg-dark-800 transition flex items-center justify-center gap-2 group">
<div class="w-8 h-8 rounded-full bg-dark-800 group-hover:bg-emerald-500/20 flex items-center justify-center transition"><i class="fa-solid fa-plus"></i></div>
<span class="font-medium">Nieuwe lijst maken</span>
</button>
</div>
</template>
<template id="tpl-editor">
<div class="flex flex-col h-full animate-fade-in pb-80">
<div class="mb-4 sticky top-0 bg-dark-900 z-10 py-2 border-b border-gray-800/50">
<label class="text-xs text-gray-500 uppercase font-bold ml-1">Lijst Naam</label>
<input type="text" id="list-name-input" class="w-full bg-transparent text-2xl font-bold border-b border-gray-700 focus:border-emerald-500 outline-none py-2 text-white placeholder-gray-600 transition-colors" placeholder="Bijv. Weekend Boodschappen">
</div>
<ul id="editor-items" class="space-y-2 mb-6 min-h-[10px]"></ul>
</div>
</template>
<template id="tpl-editor-actions">
<div id="editor-actions-fixed-bar" class="bg-dark-800/95 backdrop-blur-md px-4 pt-4 border-t border-gray-700 w-full animate-slide-up shadow-[0_-4px_20px_rgba(0,0,0,0.3)]" style="padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));">
<div class="w-full max-w-md mx-auto">
<div class="flex gap-2 mb-4">
<div class="relative flex-grow">
<input type="text" id="new-item-input" class="w-full bg-dark-900 rounded-xl px-4 py-3 outline-none focus:ring-2 focus:ring-emerald-500/50 text-white placeholder-gray-500 border border-gray-700" placeholder="Product toevoegen..." onkeypress="if(event.key === 'Enter') app.addItem()">
</div>
<button onclick="app.addItem()" class="bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl w-12 flex items-center justify-center transition shadow-lg flex-shrink-0"><i class="fa-solid fa-plus"></i></button>
</div>
<div class="flex flex-col items-center gap-3 w-full">
<button onclick="app.saveAndShop()" class="w-full bg-yellow-400 hover:bg-yellow-300 text-black font-extrabold text-lg py-3 rounded-2xl shadow-xl transform transition hover:scale-[1.02] flex items-center justify-center gap-2">
<i class="fa-solid fa-cart-shopping"></i> Start Winkelen
</button>
<div class="grid grid-cols-2 gap-3 w-full">
<button onclick="app.renderDashboard()" class="text-gray-500 hover:text-white py-2 rounded-xl border border-gray-700 hover:border-gray-500 transition text-sm font-medium">Annuleren</button>
<button onclick="app.saveOnly()" class="text-emerald-400 hover:text-emerald-300 py-2 rounded-xl border border-gray-700 hover:border-emerald-500/50 transition text-sm font-medium"><i class="fa-solid fa-floppy-disk mr-1"></i> Opslaan</button>
</div>
</div>
</div>
</div>
</template>
<template id="tpl-shopping">
<div class="flex flex-col h-full animate-fade-in pb-24">
<div class="bg-dark-800/50 p-4 rounded-xl mb-6 border border-gray-800">
<div class="flex justify-between items-end mb-2">
<h2 id="shopping-title" class="text-lg font-bold text-white truncate pr-4">Lijst</h2>
<span id="progress-text" class="text-sm text-emerald-400 font-mono font-bold">0%</span>
</div>
<div class="w-full h-2 bg-dark-900 rounded-full overflow-hidden">
<div id="progress-bar" class="h-full bg-gradient-to-r from-emerald-500 to-emerald-400 transition-all duration-500" style="width: 0%"></div>
</div>
</div>
<ul id="shopping-items" class="space-y-3"></ul>
<div class="mt-8 mb-4 w-full flex justify-center">
<button onclick="app.finishShopping()" class="w-full max-w-xs bg-emerald-500 hover:bg-emerald-400 text-white font-bold py-4 rounded-xl shadow-xl transform transition hover:scale-[1.02] flex items-center justify-center gap-2">
<i class="fa-solid fa-check"></i> Klaar met winkelen
</button>
</div>
</div>
</template>
<template id="tpl-stats">
<div class="flex flex-col h-full animate-fade-in pb-8">
<div class="flex justify-between items-center mb-4">
<button onclick="app.changeStatMonth(-1)" class="p-2 text-gray-400 hover:text-white"><i class="fa-solid fa-chevron-left"></i></button>
<h2 id="stats-month-year" class="text-lg font-bold text-white capitalize"></h2>
<button onclick="app.changeStatMonth(1)" class="p-2 text-gray-400 hover:text-white"><i class="fa-solid fa-chevron-right"></i></button>
</div>
<div class="bg-dark-800 p-4 rounded-xl border border-gray-800 mb-6">
<div id="calendar-days" class="calendar-grid"></div>
</div>
<div class="grid grid-cols-2 gap-4 mb-6">
<div class="bg-dark-800 p-4 rounded-xl border border-gray-800 flex flex-col items-center">
<span class="text-gray-400 text-xs mb-1">Deze maand</span>
<span id="stat-count-month" class="text-3xl font-bold text-emerald-400">0</span>
</div>
<div class="bg-dark-800 p-4 rounded-xl border border-gray-800 flex flex-col items-center">
<span class="text-gray-400 text-xs mb-1">Dit jaar</span>
<span id="stat-count-year" class="text-3xl font-bold text-cyan-400">0</span>
</div>
</div>
<button onclick="app.clearStats()" class="w-full py-3 text-red-400 hover:text-red-300 border border-red-900/30 rounded-xl bg-red-500/5 transition text-sm font-medium flex items-center justify-center gap-2">
<i class="fa-solid fa-trash-can"></i> Wis Alle Statistieken
</button>
</div>
</template>
<script type="module">
import OfflineManager from './offline_manager.js';
// CONFIGURATIE
const APP_NAME = 'supermarkey';
const CLIENT_ID = 'sandman'; // Tip: kan ook uit localStorage komen
const API_URL = 'http://10.10.2.20:5000';
const manager = new OfflineManager(API_URL, CLIENT_ID, APP_NAME);
/**
* ------------------------------------------------------------------
* DATA SERVICE
* ------------------------------------------------------------------
*/
const DataService = {
getLists: async () => {
const lists = await manager.getSmartCollection('lists');
return lists.map(l => ({ id: l._id || l.id, data: l }));
},
saveList: async (listObj) => {
// De manager V3 handelt _id en duplicaten nu zelf af!
return await manager.saveSmartDocument('lists', listObj);
},
deleteList: async (id) => {
// Gebruik gateway direct voor delete
await manager.gateway.deleteDocument('lists', id);
await manager.refreshCache('lists');
},
getHistory: async () => {
const history = await manager.getSmartCollection('history');
return history;
},
addHistory: async (entry) => {
await manager.saveSmartDocument('history', entry);
},
clearHistory: async () => {
// Gebruik de Smart Clear van de manager V3
await manager.clearSmartCollection('history');
}
};
/**
* ------------------------------------------------------------------
* APP LOGIC
* ------------------------------------------------------------------
*/
window.app = {
currentList: null,
shoppingList: [],
statDate: new Date(),
deleteTimeout: null,
init: async () => {
await app.renderDashboard();
const overlay = document.getElementById('loading-overlay');
if(overlay) {
overlay.style.opacity = '0';
setTimeout(() => overlay.remove(), 500);
}
if (navigator.onLine) {
manager.syncOutbox().then(() => app.renderDashboard());
}
window.addEventListener('online', () => {
app.showToast("Verbinding hersteld, sync gestart...");
manager.syncOutbox().then(() => app.renderDashboard());
});
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js').catch(e => console.error(e));
}
},
showToast: (msg, type = 'success') => {
const container = document.getElementById('notification-container');
const toast = document.createElement('div');
toast.className = `p-4 rounded-xl shadow-lg border text-sm font-medium animate-slide-up pointer-events-auto flex justify-between items-center ${
type === 'success' ? 'bg-emerald-500/10 border-emerald-500/50 text-emerald-400' : 'bg-red-500/10 border-red-500/50 text-red-400'
}`;
toast.innerHTML = `<span>${msg}</span><i class="fa-solid fa-xmark ml-4 opacity-50 cursor-pointer" onclick="this.parentElement.remove()"></i>`;
container.appendChild(toast);
setTimeout(() => toast.remove(), 4000);
},
clearFixedActions: () => {
document.getElementById('fixed-action-bar').innerHTML = '';
},
renderDashboard: async () => {
app.clearFixedActions();
const main = document.getElementById('main-content');
main.innerHTML = '';
const tpl = document.getElementById('tpl-dashboard').content.cloneNode(true);
const savedContainer = tpl.getElementById('saved-list-container');
const emptyState = tpl.getElementById('empty-state');
document.getElementById('header-title').innerText = "SuperLijst";
document.getElementById('header-actions').innerHTML = `<button onclick="app.renderStats()" class="text-gray-400 hover:text-white transition"><i class="fa-solid fa-calendar-days text-xl"></i></button>`;
try {
const lists = await DataService.getLists();
if (lists.length === 0) {
emptyState.classList.remove('hidden');
} else {
// Sorteren op naam
lists.sort((a, b) => (a.data.name || "").localeCompare(b.data.name || ""));
lists.forEach(item => savedContainer.appendChild(app.createListCard(item)));
}
} catch (e) {
console.error(e);
}
main.appendChild(tpl);
},
createListCard: (item) => {
const div = document.createElement('div');
div.className = "bg-dark-800 p-4 rounded-xl border border-gray-700 hover:border-emerald-500/50 transition flex justify-between items-center group cursor-pointer";
div.onclick = () => app.startEdit(item.data);
div.innerHTML = `
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-dark-900 flex items-center justify-center text-emerald-400 group-hover:scale-110 transition">
<i class="fa-solid fa-list-ul"></i>
</div>
<div>
<div class="font-bold text-white">${item.data.name || 'Naamloze lijst'}</div>
<div class="text-xs text-gray-500">${item.data.items?.length || 0} producten</div>
</div>
</div>
`;
const delBtn = document.createElement('button');
delBtn.className = "p-2 text-gray-600 hover:text-red-400 opacity-0 group-hover:opacity-100 transition";
delBtn.innerHTML = '<i class="fa-solid fa-trash-can"></i>';
delBtn.onclick = (e) => {
e.stopPropagation();
if (confirm("Lijst verwijderen?")) {
DataService.deleteList(item.id).then(() => app.renderDashboard());
}
};
div.appendChild(delBtn);
return div;
},
startEdit: (data) => {
// Schone kopie maken voor bewerken
app.currentList = JSON.parse(JSON.stringify(data));
app.renderEditor();
},
startEmpty: () => {
app.currentList = { name: '', items: [] };
app.renderEditor();
},
renderEditor: () => {
const main = document.getElementById('main-content');
main.innerHTML = '';
const tpl = document.getElementById('tpl-editor').content.cloneNode(true);
const nameInput = tpl.getElementById('list-name-input');
nameInput.value = app.currentList.name || '';
nameInput.oninput = (e) => app.currentList.name = e.target.value;
const ul = tpl.getElementById('editor-items');
// Filter out null/undefined items and ensure they have required properties
const validItems = app.currentList.items.filter(item => item && typeof item.name === 'string');
validItems.forEach((item, idx) => {
const li = document.createElement('li');
li.className = "bg-dark-800 p-3 rounded-xl flex justify-between items-center border border-gray-700";
const button = document.createElement('button');
button.className = "text-gray-500 hover:text-red-400 touch-manipulation";
button.innerHTML = '<i class="fa-solid fa-xmark"></i>';
button.addEventListener('click', (e) => {
e.stopPropagation();
e.preventDefault();
app.removeItem(idx);
});
button.addEventListener('touchstart', (e) => {
e.stopPropagation();
e.preventDefault();
app.removeItem(idx);
}, { passive: false });
li.innerHTML = `<span>${item.name}</span>`;
li.appendChild(button);
ul.appendChild(li);
});
document.getElementById('header-title').innerText = "Bewerken";
document.getElementById('header-actions').innerHTML = '';
main.appendChild(tpl);
const actionsTpl = document.getElementById('tpl-editor-actions').content.cloneNode(true);
document.getElementById('fixed-action-bar').innerHTML = '';
document.getElementById('fixed-action-bar').appendChild(actionsTpl);
new Sortable(ul, {
animation: 150,
disabled: true,
onEnd: (evt) => {
const items = [...app.currentList.items];
const [moved] = items.splice(evt.oldIndex, 1);
items.splice(evt.newIndex, 0, moved);
app.currentList.items = items;
}
});
},
addItem: () => {
const input = document.getElementById('new-item-input');
if (!input.value.trim()) return;
app.currentList.items.push({ name: input.value.trim() });
input.value = '';
app.renderEditor();
},
removeItem: (filteredIndex) => {
// Prevent multiple rapid deletions
if (app.deleteTimeout) return;
// Find the actual item in the original array
const validItems = app.currentList.items.filter(item => item && typeof item.name === 'string');
const itemToRemove = validItems[filteredIndex];
if (itemToRemove) {
const originalIndex = app.currentList.items.indexOf(itemToRemove);
if (originalIndex !== -1) {
app.currentList.items.splice(originalIndex, 1);
}
}
app.renderEditor();
// Add small delay to prevent accidental multiple deletions
app.deleteTimeout = setTimeout(() => {
app.deleteTimeout = null;
}, 300);
},
saveOnly: async () => {
if (!app.currentList.name) app.currentList.name = "Naamloze lijst";
try {
await DataService.saveList(app.currentList);
app.showToast("Opgeslagen");
// Geef de manager even tijd om de _id koppeling te doen bij een sync
setTimeout(() => app.renderDashboard(), 200);
} catch (e) {
app.showToast("Opslaan mislukt", "danger");
}
},
saveAndShop: async () => {
if (!app.currentList.name) app.currentList.name = "Mijn lijst";
if (app.currentList.items.length === 0) {
app.showToast("Voeg eerst producten toe!", "danger");
return;
}
try {
await DataService.saveList(app.currentList);
app.shoppingList = app.currentList.items.map(i => ({ ...i, done: false }));
app.renderShopping();
} catch (e) {
app.showToast("Fout: " + e.message, "danger");
}
},
renderShopping: () => {
app.clearFixedActions();
const main = document.getElementById('main-content');
main.innerHTML = '';
const tpl = document.getElementById('tpl-shopping').content.cloneNode(true);
tpl.getElementById('shopping-title').innerText = app.currentList.name;
const ul = tpl.getElementById('shopping-items');
app.shoppingList.forEach((item, idx) => {
const li = document.createElement('li');
li.className = `p-4 rounded-xl border cursor-pointer transition flex items-center gap-3 ${item.done ? 'bg-dark-800/30 border-gray-800 opacity-50' : 'bg-dark-800 border-gray-700 shadow-md'}`;
li.onclick = () => {
item.done = !item.done;
app.renderShopping();
};
li.innerHTML = `
<div class="w-6 h-6 rounded-full border-2 flex items-center justify-center transition ${item.done ? 'bg-emerald-500 border-emerald-500' : 'border-gray-600'}">
${item.done ? '<i class="fa-solid fa-check text-white text-xs"></i>' : ''}
</div>
<span class="${item.done ? 'line-through' : 'font-medium'}">${item.name}</span>
`;
ul.appendChild(li);
});
document.getElementById('header-title').innerText = "Winkelen";
main.appendChild(tpl);
app.updateProgress();
},
updateProgress: () => {
const total = app.shoppingList.length;
const done = app.shoppingList.filter(i => i.done).length;
const percent = total ? Math.round((done / total) * 100) : 0;
const bar = document.getElementById('progress-bar');
const text = document.getElementById('progress-text');
if (bar) bar.style.width = percent + '%';
if (text) text.innerText = percent + '%';
},
finishShopping: async () => {
await DataService.addHistory({
date: new Date().toISOString(),
listName: app.currentList.name,
itemCount: app.shoppingList.length
});
app.showToast("Winkelen voltooid!");
app.renderDashboard();
},
renderStats: async () => {
app.clearFixedActions();
const main = document.getElementById('main-content');
main.innerHTML = '';
const tpl = document.getElementById('tpl-stats').content.cloneNode(true);
const year = app.statDate.getFullYear();
const month = app.statDate.getMonth();
tpl.getElementById('stats-month-year').innerText = new Intl.DateTimeFormat('nl-NL', { month: 'long', year: 'numeric' }).format(app.statDate);
const history = await DataService.getHistory();
const monthHistory = history.filter(h => {
const d = new Date(h.date);
return d.getMonth() === month && d.getFullYear() === year;
});
tpl.getElementById('stat-count-month').innerText = monthHistory.length;
tpl.getElementById('stat-count-year').innerText = history.filter(h => new Date(h.date).getFullYear() === year).length;
const daysContainer = tpl.getElementById('calendar-days');
const daysInMonth = new Date(year, month + 1, 0).getDate();
for (let day = 1; day <= daysInMonth; day++) {
const count = monthHistory.filter(h => new Date(h.date).getDate() === day).length;
const div = document.createElement('div');
div.className = `aspect-square rounded-lg flex flex-col items-center justify-center text-sm border ${count > 0 ? 'bg-emerald-500/20 border-emerald-500 text-white shadow-[0_0_10px_rgba(16,185,129,0.2)]' : 'bg-dark-900 border-gray-800 text-gray-500'}`;
div.innerHTML = `<span>${day}</span>${count > 0 ? `<span class="text-[9px] text-emerald-400 font-bold">+${count}</span>` : ''}`;
daysContainer.appendChild(div);
}
document.getElementById('header-title').innerText = "Statistieken";
document.getElementById('header-actions').innerHTML = `<button onclick="app.renderDashboard()" class="text-gray-400 hover:text-white transition"><i class="fa-solid fa-house"></i></button>`;
main.appendChild(tpl);
},
changeStatMonth: (dir) => {
app.statDate.setMonth(app.statDate.getMonth() + dir);
app.renderStats();
},
clearStats: async () => {
if (confirm("Alle geschiedenis wissen?")) {
await DataService.clearHistory();
app.showToast("Geschiedenis gewist");
app.renderStats();
}
}
};
window.addEventListener('DOMContentLoaded', app.init);
</script>
</body>
</html>