-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
693 lines (623 loc) · 40.2 KB
/
Copy pathindex.html
File metadata and controls
693 lines (623 loc) · 40.2 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
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
<!DOCTYPE html>
<html lang="en" class="antialiased">
<head>
<meta charset="UTF-8">
<script>
(function() {
var link = document.createElement('link');
link.rel = 'canonical';
var protocol = window.location.protocol + '//';
var host = window.location.host;
var path = window.location.pathname;
var cleanPath = path.replace(/\/(index\.html|index)$|(\.html)$/i, '');
if (cleanPath.length > 0 && !cleanPath.startsWith('/')) {
cleanPath = '/' + cleanPath;
}
var finalUrl = protocol + host + (cleanPath === '/' ? '' : cleanPath);
link.href = finalUrl;
document.head.appendChild(link);
})();
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Primary Meta Tags -->
<title>Daily Expense Tracker - Responsive Pastel</title>
<meta name="title" content="Daily Expense Tracker - Responsive Pastel">
<meta name="description" content="Track your daily spending instantly with DailyExpenseTracker.org. 100% private - no data stored on our servers. Calculate your 'Life Energy Traded' and get a professional PDF money audit report for free. No login required.">
<script src="https://cdn.tailwindcss.com"></script>
<style>
:root {
--radius: 28px;
--shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.06);
--pastel-blue: #e0f2fe;
--pastel-purple: #f5f3ff;
--pastel-pink: #fdf2f8;
--pastel-green: #f0fdf4;
--pastel-yellow: #fefce8;
--pastel-indigo: #eef2ff;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-color: #f7f9ff; /* Soft pastel indigo tint */
color: #475569;
-webkit-tap-highlight-color: transparent;
}
.premium-card {
background: #ffffff;
border-radius: var(--radius);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
border: 1px solid rgba(226, 232, 240, 0.8);
}
.premium-input {
border-radius: 18px;
transition: all 0.3s ease;
font-weight: 500;
background-color: #ffffff;
border: 2px solid #f1f5f9;
-webkit-appearance: none;
-moz-appearance: textfield;
}
.premium-input::-webkit-outer-spin-button,
.premium-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.premium-input:focus {
box-shadow: 0 0 0 4px rgba(199, 210, 254, 0.5);
border-color: #c7d2fe;
outline: none;
}
.premium-btn {
border-radius: 20px;
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.premium-btn:active { transform: scale(0.96); }
#print-only-report { display: none; }
@media print {
@page {
size: A4;
margin: 15mm;
}
html, body {
height: auto !important;
min-height: auto !important;
overflow: visible !important;
display: block !important;
}
body {
background: white !important;
color: black !important;
margin: 0;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.no-print { display: none !important; }
/* Ensure main wrapper doesn't clip content or force single-page flex height */
body > div.flex {
display: block !important;
overflow: visible !important;
width: 100% !important;
max-width: none !important;
margin: 0 !important;
padding: 0 !important;
height: auto !important;
}
/* Menghapus batasan lebar kontainer saat print */
#app-container {
max-width: none !important;
width: 100% !important;
padding: 0 !important;
margin: 0 !important;
display: block !important;
height: auto !important;
min-height: auto !important;
}
#print-only-report {
display: block !important;
width: 100% !important;
height: auto !important;
padding: 0 !important;
background: white;
box-sizing: border-box;
margin: 0;
overflow: visible !important;
padding-bottom: 80px !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.print-border { border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 20px; page-break-inside: avoid; -webkit-print-color-adjust: exact; }
.print-dark-box { background: #0f172a !important; color: white !important; border-radius: 12px; padding: 25px; page-break-inside: avoid; -webkit-print-color-adjust: exact; }
.print-accent-box { background: #f1f5f9 !important; border-radius: 12px; padding: 20px; page-break-inside: avoid; -webkit-print-color-adjust: exact; }
table { width: 100%; border-collapse: collapse; margin: 15px 0; }
th { border-bottom: 2px solid #0f172a; padding: 10px 5px; text-align: left; font-size: 12px; text-transform: uppercase; }
td { padding: 10px 5px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
.print-footer {
position: relative;
margin-top: 0px;
text-align: center;
font-size: 11px;
color: #828fa2;
padding: 15px 0;
border-top: 1px solid #c0c4ca;
background-color: white !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
width: 100%;
}
/* Spacer to prevent overlap at the bottom of each page */
.print-footer-spacer {
height: 70px;
display: block;
}
/* VISUAL SUMMARY (Page 2) */
.pdf-visual-summary {
display: block !important;
clear: both !important;
page-break-before: always !important;
}
.pdf-card {
border-radius: 20px;
padding: 24px;
margin-bottom: 24px;
page-break-inside: avoid !important;
break-inside: avoid !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.pdf-bg-indigo { background-color: #eef2ff !important; color: #6366f1 !important; }
.pdf-bg-pink { background-color: #fdf2f8 !important; color: #ec4899 !important; }
.pdf-bg-yellow { background-color: #fefce8 !important; color: #ca8a04 !important; }
.pdf-bg-blue { background-color: #e0f2fe !important; color: #0284c7 !important; }
/* Prevent boxes from being cut between pages, but ALLOW sections to break */
.print-border, .print-dark-box, .print-accent-box, .pdf-card {
page-break-inside: avoid !important;
break-inside: avoid !important;
margin-bottom: 25px;
display: block;
position: relative;
}
.pdf-section {
page-break-inside: auto !important;
break-inside: auto !important;
display: block;
position: relative;
}
table#p-items-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
th { border-bottom: 2px solid #0f172a; padding: 10px 5px; text-align: left; font-size: 12px; text-transform: uppercase; }
td { padding: 10px 5px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
}
@media (prefers-color-scheme: dark) {
body { background-color: #0f172a; color: #cbd5e1; }
.premium-card { background: #1e293b; border-color: rgba(255,255,255,0.05); }
.premium-input { background: #334155; color: white; border-color: #475569; }
.no-print h1 { color: white; }
}
/* Pastel backgrounds */
.bg-pastel-blue { background-color: var(--pastel-blue); }
.bg-pastel-purple { background-color: var(--pastel-purple); }
.bg-pastel-pink { background-color: var(--pastel-pink); }
.bg-pastel-green { background-color: var(--pastel-green); }
.bg-pastel-yellow { background-color: var(--pastel-yellow); }
.bg-pastel-indigo { background-color: var(--pastel-indigo); }
.section-header {
font-size: 0.65rem;
text-transform: uppercase;
letter-spacing: 0.15em;
font-weight: 800;
color: #94a3b8;
margin-bottom: 1rem;
}
/* Animations */
@keyframes fadeInScale {
from { opacity: 0; transform: scale(0.98) translateY(5px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-row {
animation: fadeInScale 0.3s ease-out forwards;
}
/* Responsive spacing adjustments */
@media (max-width: 640px) {
.premium-card { padding: 1.25rem !important; }
.premium-input { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
}
</style>
</head>
<body>
<!-- Main Wrapper -->
<div class="flex flex-col md:flex-row md:justify-center md:items-start md:gap-12 max-w-6xl mx-auto px-4">
<div id="app-container" class="max-w-md w-full md:mx-0 mx-auto min-h-screen flex flex-col pt-4 md:pt-6 pb-24">
<!-- Header -->
<header class="flex justify-between items-center mb-8 md:mb-10 no-print">
<div>
<h1 class="text-xl md:text-2xl font-black tracking-tight text-slate-800 dark:text-white">EXPENSE<span class="text-indigo-400">TRACKER</span></h1>
<p class="text-[8px] md:text-[9px] text-slate-400 font-black uppercase tracking-[0.3em]">Soft & Serene Edition</p>
</div>
<div class="bg-pastel-indigo text-indigo-500 px-3 md:px-4 py-1.5 md:py-2 rounded-2xl text-[9px] md:text-[10px] font-black uppercase tracking-widest shadow-sm">
Streak <span id="streak-counter">1</span>
</div>
</header>
<!-- Input Form -->
<div id="input-section" class="premium-card p-6 md:p-8 mb-6 no-print">
<form onsubmit="handleCheckup(event)">
<!-- Total Spending -->
<div class="mb-8 md:mb-10 text-center">
<p class="section-header">Live Total Counter</p>
<div class="relative inline-block w-full">
<span class="absolute left-4 md:left-6 top-1/2 -translate-y-1/2 text-xl md:text-2xl font-black text-slate-300">$</span>
<input type="number" id="spend" readonly
class="premium-input w-full pl-10 md:pl-12 pr-4 md:pr-6 py-6 md:py-8 text-4xl md:text-5xl font-black bg-pastel-indigo border-none shadow-sm text-indigo-500 text-center"
value="0.00">
</div>
</div>
<!-- Itemized Spend -->
<div class="mb-8 md:mb-10 pt-6 md:pt-8 border-t border-slate-50 dark:border-slate-800">
<p class="section-header">Spending Log Today</p>
<div id="items-container" class="space-y-3 md:space-y-4 mb-6">
<!-- Initial Row -->
<div class="flex items-center gap-2 sm:gap-3 item-row animate-row">
<div class="flex flex-col gap-0.5 shrink-0">
<button type="button" onclick="moveRowUp(this)" class="text-slate-400 hover:text-indigo-500 transition-all flex items-center justify-center w-5 h-5 sm:w-6 sm:h-5">
<svg class="w-3 sm:w-3.5 h-3 sm:h-3.5" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24"><path d="m18 15-6-6-6 6"/></svg>
</button>
<button type="button" onclick="moveRowDown(this)" class="text-slate-400 hover:text-indigo-500 transition-all flex items-center justify-center w-5 h-5 sm:w-6 sm:h-5">
<svg class="w-3 sm:w-3.5 h-3 sm:h-3.5" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>
</button>
</div>
<input type="text" placeholder="Item/Service" class="premium-input flex-1 px-3 sm:px-5 py-3 sm:py-4 text-xs sm:text-sm bg-white dark:bg-slate-800 border-2 border-slate-100 item-name" required>
<input type="number" step="0.01" placeholder="0.00" class="premium-input w-20 sm:w-28 px-2 sm:px-4 py-3 sm:py-4 text-xs sm:text-sm bg-white dark:bg-slate-800 border-2 border-slate-100 item-price text-right font-black text-indigo-400" oninput="calculateTotal()" required>
<button type="button" onclick="if(document.querySelectorAll('.item-row').length > 1) { this.parentElement.remove(); calculateTotal(); }" class="text-slate-300 hover:text-rose-400 transition-colors p-1 shrink-0">
<svg class="w-4 h-4 sm:w-5 sm:h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
</button>
</div>
</div>
<button type="button" onclick="addNewRow()" class="w-full text-[10px] sm:text-[11px] font-black text-indigo-400 flex items-center justify-center gap-2 bg-pastel-indigo py-3 sm:py-4 rounded-3xl hover:bg-indigo-100 transition-all uppercase tracking-widest">
<svg class="w-3.5 h-3.5 sm:w-4 sm:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg>
Add Item
</button>
</div>
<!-- Income & Budget Row -->
<div class="grid grid-cols-2 gap-3 md:gap-4 mb-8 md:mb-10 pt-6 md:pt-8 border-t border-slate-50 dark:border-slate-800">
<div class="bg-pastel-green p-3 md:p-4 rounded-[20px] md:rounded-[24px]">
<label class="block text-[8px] md:text-[10px] font-black text-green-600 mb-1.5 md:mb-2 uppercase tracking-widest leading-tight">Monthly Income</label>
<input type="number" id="income" class="premium-input w-full px-3 py-2.5 md:py-3 text-xs md:text-sm bg-white border-none text-green-700" placeholder="5000">
</div>
<div class="bg-pastel-purple p-3 md:p-4 rounded-[20px] md:rounded-[24px]">
<label class="block text-[8px] md:text-[10px] font-black text-purple-600 mb-1.5 md:mb-2 uppercase tracking-widest leading-tight">Target Budget</label>
<input type="number" id="budget" class="premium-input w-full px-3 py-2.5 md:py-3 text-xs md:text-sm bg-white border-none text-purple-700" placeholder="2000">
</div>
</div>
<button type="submit" class="premium-btn w-full bg-slate-800 dark:bg-indigo-500 text-white font-black text-xs md:text-sm uppercase tracking-[0.2em] py-5 md:py-6 shadow-xl shadow-slate-200 dark:shadow-none hover:translate-y-[-2px]">
ANALYZE SPENDING
</button>
</form>
<!-- Footer Nav -->
<nav class="mt-8 pt-6 md:pt-8 border-t border-slate-50 dark:border-slate-800 flex flex-col items-center gap-6 no-print">
<div class="flex flex-wrap justify-center gap-x-6 md:gap-x-8 gap-y-2">
<a href="." class="text-[9px] md:text-[10px] font-black text-slate-400 hover:text-indigo-400 uppercase tracking-widest transition-colors">Home</a>
<a href="about" class="text-[9px] md:text-[10px] font-black text-slate-400 hover:text-indigo-400 uppercase tracking-widest transition-colors">About</a>
<a href="news" class="text-[9px] md:text-[10px] font-black text-slate-400 hover:text-indigo-400 uppercase tracking-widest transition-colors">News</a>
<a href="privacy" class="text-[9px] md:text-[10px] font-black text-slate-400 hover:text-indigo-400 uppercase tracking-widest transition-colors">Privacy</a>
<a href="terms" class="text-[9px] md:text-[10px] font-black text-slate-400 hover:text-indigo-400 uppercase tracking-widest transition-colors">Terms</a>
</div>
<div class="text-center space-y-3 md:space-y-4 max-w-xs px-2">
<p class="text-[9px] md:text-[10px] font-bold text-slate-400 uppercase tracking-widest leading-loose">100% private - No data stored on our servers.</p>
<p class="text-[9px] md:text-[10px] font-medium text-slate-300 leading-relaxed tracking-wide">© <span id="year"></span> DailyExpenseTracker.Org. All rights reserved. <br class="hidden sm:block"> Calculate your 'Life Energy Traded' instantly.</p>
</div>
</nav>
</div>
<!-- Result Section -->
<div id="result-section" class="hidden space-y-6 md:space-y-8 no-print pb-24 px-1 md:px-0">
<div id="time-card" class="premium-card p-8 md:p-10 bg-pastel-indigo text-indigo-500 border-0 overflow-hidden text-center">
<p class="text-[9px] md:text-[10px] font-black uppercase tracking-widest mb-3 md:mb-4">Life Energy Traded</p>
<div class="flex items-baseline justify-center gap-1.5 md:gap-2">
<span id="res-hours" class="text-6xl md:text-7xl font-black tracking-tighter">0</span>
<span class="text-lg md:text-xl font-black uppercase opacity-60">hrs</span>
</div>
<p class="text-[10px] md:text-[11px] font-bold mt-4 md:mt-6 leading-relaxed opacity-80 max-w-[240px] mx-auto">
The finite amount of your life you traded to pay for today's consumption.
</p>
</div>
<div class="grid grid-cols-2 gap-4 md:gap-6">
<div class="premium-card p-6 md:p-8 text-center bg-pastel-pink text-pink-500">
<p class="text-[8px] md:text-[9px] font-black mb-1.5 md:mb-2 uppercase tracking-widest opacity-70">Total Spent</p>
<p id="res-spend" class="text-xl md:text-2xl font-black">$0</p>
</div>
<div class="premium-card p-6 md:p-8 text-center bg-pastel-yellow text-yellow-600">
<p id="res-days-label" class="text-[8px] md:text-[9px] font-black mb-1.5 md:mb-2 uppercase tracking-widest opacity-70">Burn Rate</p>
<p id="res-days" class="text-xl md:text-2xl font-black">--</p>
</div>
</div>
<div class="premium-card p-8 md:p-10">
<p class="section-header">Financial Reality Check</p>
<p id="res-narration" class="text-sm md:text-base font-bold text-slate-700 dark:text-slate-200 leading-relaxed mb-6 md:mb-8 italic"></p>
<div class="bg-pastel-blue p-5 md:p-6 rounded-[24px] md:rounded-[28px] border-none shadow-sm">
<p class="text-[8px] md:text-[9px] font-black text-blue-500 uppercase tracking-[0.2em] mb-2 md:mb-3">Advice for Tomorrow</p>
<p id="res-advice" class="text-sm md:text-base font-black text-blue-700 dark:text-blue-300 leading-snug"></p>
</div>
</div>
<div class="grid grid-cols-1 gap-3 md:gap-4 pt-2 md:pt-4">
<button onclick="window.print()" class="premium-btn bg-slate-800 text-white font-black py-5 md:py-6 text-[10px] md:text-xs uppercase tracking-widest shadow-xl shadow-slate-200 dark:shadow-none translate-y-0 active:translate-y-0.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"></path></svg>
Download Audit PDF
</button>
<div class="flex gap-3 md:gap-4">
<button onclick="shareResults()" class="premium-btn flex-1 bg-white border border-slate-100 text-slate-500 font-black py-4 md:py-5 text-[10px] md:text-xs uppercase tracking-widest">
Share
</button>
<button onclick="location.reload()" class="premium-btn flex-1 bg-slate-100 text-slate-500 font-black py-4 md:py-5 text-[10px] md:text-xs uppercase tracking-widest">
Restart
</button>
</div>
</div>
</div>
<!-- Mobile Ad Unit -->
<div class="md:hidden space-y-6 no-print pt-4 pb-8 flex flex-col items-center">
<div class="premium-card overflow-hidden w-full max-w-[336px] min-h-[200px] sm:h-[280px] flex flex-col items-center justify-center bg-pastel-indigo border-none px-4 py-8">
<div class="flex flex-col items-center gap-4">
<div class="w-12 h-12 bg-indigo-500/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-indigo-400 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"></path></svg>
</div>
<div class="text-center">
<span class="block text-[9px] sm:text-[10px] font-black text-indigo-400 uppercase tracking-widest opacity-60">Mobile Ad Unit</span>
<span class="block text-[11px] sm:text-[12px] font-black text-indigo-400 mt-1 uppercase tracking-tighter">Responsive Placement</span>
</div>
</div>
</div>
</div>
</div>
<!-- Desktop Sidebar Ads -->
<aside class="hidden md:flex flex-col gap-8 w-[336px] md:sticky md:top-8 md:mt-8 shrink-0 no-print mb-12">
<div class="premium-card overflow-hidden w-[336px] h-[280px] flex flex-col border-none bg-pastel-indigo">
<div class="p-4 text-[10px] font-black text-indigo-400 text-center uppercase tracking-[0.3em] opacity-60">Partner Unit</div>
<div class="flex-1 flex flex-col items-center justify-center p-6 text-center bg-white/40 backdrop-blur-sm m-4 rounded-[24px]">
<div class="w-12 h-12 mb-4 bg-indigo-500/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-indigo-400 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"></path></svg>
</div>
<p class="text-[11px] font-black text-slate-500 uppercase tracking-widest">Ad Slot 1</p>
<p class="text-[12px] font-black text-indigo-400 mt-2">336 x 280 px</p>
</div>
</div>
<div class="premium-card overflow-hidden w-[336px] h-[280px] flex flex-col border-none bg-pastel-indigo">
<div class="p-4 text-[10px] font-black text-indigo-400 text-center uppercase tracking-[0.3em] opacity-60">Partner Unit</div>
<div class="flex-1 flex flex-col items-center justify-center p-6 text-center bg-white/40 backdrop-blur-sm m-4 rounded-[24px]">
<div class="w-12 h-12 mb-4 bg-indigo-500/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-indigo-400 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"></path></svg>
</div>
<p class="text-[11px] font-black text-slate-500 uppercase tracking-widest">Ad Slot 2</p>
<p class="text-[12px] font-black text-indigo-400 mt-2">336 x 280 px</p>
</div>
</div>
</aside>
</div>
<!-- PDF TEMPLATE -->
<div id="print-only-report">
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; border-bottom: 4px solid #0f172a; padding-bottom: 15px;">
<div>
<h1 style="font-size: 32px; font-weight: 900; margin: 0; letter-spacing: -1px;">DAILY EXPENSE TRACKER</h1>
<div style="display: flex; align-items: center; gap: 10px; margin-top: 5px;">
<p id="p-date" style="font-size: 12.7px; color: #64748b; margin: 0; font-weight: bold;"></p>
<span style="font-size: 12.7px; color: #4f46e5; text-decoration: none;"> | </span> <a href="https://dailyexpensetracker.org" style="font-size: 12.7px; color: #4f46e5; text-decoration: none; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px;">DAILYEXPENSETRACKER.ORG</a>
</div>
</div>
<div style="text-align: right;">
<div style="background: #0f172a; color: white; padding: 10px 20px; border-radius: 8px; font-weight: 900; margin-bottom: 8px;">
STREAK: <span id="p-streak">1</span> DAYS
</div>
<div style="font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; line-height: 1.4;">
Income: <span id="p-income" style="color: #0f172a;">$0</span>
</div>
<div style="font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; line-height: 1.4;">
Budget: <span id="p-budget" style="color: #0f172a;">$0</span>
</div>
</div>
</div>
<!-- Breakdown -->
<div class="print-border pdf-section">
<h3 style="font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #64748b; margin-top: 0;">Itemized Breakdown</h3>
<table id="p-items-table">
<thead>
<tr>
<th>Transaction Detail</th>
<th style="text-align: right;">Cost</th>
</tr>
</thead>
<tbody id="p-items-body"></tbody>
</table>
<div style="text-align: right; margin-top: 15px; border-top: 2px solid #0f172a; padding-top: 8px;">
<span style="font-size: 13px; font-weight: bold; color: #64748b;">GRAND TOTAL:</span>
<span id="p-spend" style="font-size: 24px; font-weight: 900; margin-left: 10px;">$0.00</span>
</div>
</div>
<!-- Energy Section -->
<div style="display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 20px;" class="pdf-section">
<div class="print-dark-box">
<p style="font-size: 10px; font-weight: 900; color: #94a3b8; margin: 0 0 5px 0; text-transform: uppercase;">Life Energy Traded</p>
<h2 style="font-size: 38px; font-weight: 900; margin: 0;"><span id="p-hours">0</span> Hours</h2>
<p style="font-size: 12px; line-height: 1.5; margin-top: 10px; opacity: 0.8;">
True cost converted into hours of your finite time.
</p>
</div>
<div class="print-accent-box">
<p style="font-size: 10px; font-weight: 900; color: #64748b; margin: 0 0 10px 0; text-transform: uppercase;">Sustainability</p>
<div style="margin-bottom: 12px;">
<span style="display: block; font-size: 9px; color: #64748b;">Status:</span>
<span id="p-burn-score" style="font-size: 18px; font-weight: 900;">--</span>
</div>
<div>
<span style="display: block; font-size: 9px; color: #64748b;">Projection:</span>
<span id="p-days" style="font-size: 18px; font-weight: 900; color: #4f46e5;">--</span>
</div>
</div>
</div>
<!-- Narration -->
<div style="padding: 20px; border: 1px solid #e2e8f0; border-radius: 12px; background-color: #fafafa; margin-bottom: 25px; page-break-inside: avoid;" class="pdf-section">
<h3 style="margin: 0 0 8px 0; font-size: 12px; font-weight: 900; text-transform: uppercase;">Financial Reality Check</h3>
<p id="p-narration" style="font-size: 13px; line-height: 1.5; color: #334155; margin-bottom: 12px; font-style: italic;"></p>
<div style="background: white; border-left: 4px solid #4f46e5; padding: 12px; font-weight: bold; font-size: 13px;">
ADVICE: <span id="p-advice"></span>
</div>
</div>
<!-- Summary Page -->
<div class="pdf-section pdf-visual-summary" style="border-top: 1px dashed #e2e8f0; padding-top: 25px; margin-top: 25px;">
<p style="font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 4px; text-align: center; margin-bottom: 0px;">Visual Audit Summary</p>
<p id="p-dates" style="font-size: 12.7px; color: #64748b; margin: 0; font-weight: bold;text-align: center; margin-bottom: 30px;"></p>
<!-- Energy Card (Full Width) -->
<div class="pdf-card pdf-bg-indigo" style="text-align: center; margin-bottom: 20px;">
<p style="font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; opacity: 0.7;">Life Energy Traded</p>
<h2 style="font-size: 64px; font-weight: 900; margin: 0; line-height: 1;"><span id="p-v-hours">0</span> <span style="font-size: 24px;">HRS</span></h2>
<p style="font-size: 13px; font-weight: 500; margin-top: 15px; opacity: 0.8; max-width: 400px; margin-left: auto; margin-right: auto;">
The finite amount of your life you traded to pay for today's consumption.
</p>
</div>
<!-- Summary Chips -->
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;">
<div class="pdf-card pdf-bg-pink" style="text-align: center;">
<p style="font-size: 10px; font-weight: 900; text-transform: uppercase; margin-bottom: 8px; opacity: 0.7;">Total Spent</p>
<p id="p-v-spend" style="font-size: 28px; font-weight: 900; margin: 0;">$0</p>
</div>
<div class="pdf-card pdf-bg-yellow" style="text-align: center;">
<p style="font-size: 10px; font-weight: 900; text-transform: uppercase; margin-bottom: 8px; opacity: 0.7;">Burn Rate</p>
<p id="p-v-days" style="font-size: 28px; font-weight: 900; margin: 0;">--</p>
</div>
</div>
<!-- Financial Reality Check (Visual) -->
<div style="border: 1px solid #f1f5f9; border-radius: 28px; padding: 30px; margin-bottom: 0px; margin-top: 0px; background: white; page-break-inside: avoid;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
<p style="font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 2px; margin: 0;">Financial Reality Check</p>
<span id="p-v-burn-score" style="font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px;"></span>
</div>
<p id="p-v-narration" style="font-size: 18px; font-weight: 700; color: #1e293b; line-height: 1.6; margin-bottom: 25px;"></p>
<div class="pdf-bg-blue" style="padding: 24px; border-radius: 24px;">
<p style="font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;">Advice for Tomorrow</p>
<p id="p-v-advice" style="font-size: 16px; font-weight: 900; color: #0369a1; margin: 0;"></p>
</div>
</div>
</div>
<div class="print-footer">
Confidentially generated by <a style="font-weight:bold;" href="https://dailyexpensetracker.org">DAILYEXPENSETRACKER.ORG</a>.
<br>
Verify all figures independently. 100% Private - No data was stored on server.
</div>
</div>
<script>
function addNewRow() {
const container = document.getElementById('items-container');
const row = document.createElement('div');
row.className = 'flex items-center gap-2 sm:gap-3 item-row animate-row';
row.innerHTML = `
<div class="flex flex-col gap-0.5 shrink-0">
<button type="button" onclick="moveRowUp(this)" class="text-slate-400 hover:text-indigo-500 transition-all flex items-center justify-center w-5 h-5 sm:w-6 sm:h-5">
<svg class="w-3 sm:w-3.5 h-3 sm:h-3.5" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24"><path d="m18 15-6-6-6 6"/></svg>
</button>
<button type="button" onclick="moveRowDown(this)" class="text-slate-400 hover:text-indigo-500 transition-all flex items-center justify-center w-5 h-5 sm:w-6 sm:h-5">
<svg class="w-3 sm:w-3.5 h-3 sm:h-3.5" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>
</button>
</div>
<input type="text" placeholder="Item/Service" class="premium-input flex-1 px-3 sm:px-5 py-3 sm:py-4 text-xs sm:text-sm bg-white dark:bg-slate-800 border-2 border-slate-100 item-name" required>
<input type="number" step="0.01" placeholder="0.00" class="premium-input w-20 sm:w-28 px-2 sm:px-4 py-3 sm:py-4 text-xs sm:text-sm bg-white dark:bg-slate-800 border-2 border-slate-100 item-price text-right font-black text-indigo-400" oninput="calculateTotal()" required>
<button type="button" onclick="this.parentElement.remove(); calculateTotal();" class="text-slate-300 hover:text-rose-400 transition-colors p-1 shrink-0">
<svg class="w-4 h-4 sm:w-5 sm:h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
</button>
`;
container.appendChild(row);
}
function moveRowUp(btn) {
const row = btn.closest('.item-row');
const prev = row.previousElementSibling;
if (prev) row.parentNode.insertBefore(row, prev);
}
function moveRowDown(btn) {
const row = btn.closest('.item-row');
const next = row.nextElementSibling;
if (next) row.parentNode.insertBefore(next, row);
}
function calculateTotal() {
const prices = document.querySelectorAll('.item-price');
let total = 0;
prices.forEach(input => {
total += parseFloat(input.value) || 0;
});
document.getElementById('spend').value = total.toFixed(2);
}
function handleCheckup(e) {
e.preventDefault();
const spend = parseFloat(document.getElementById('spend').value) || 0;
const income = parseFloat(document.getElementById('income').value) || 5000;
const budget = parseFloat(document.getElementById('budget').value) || 2000;
if (spend <= 0) return;
const hourlyRate = income / 160;
const hours = (spend / hourlyRate).toFixed(1);
const dailyAllowance = budget / 30;
const overBudget = spend > dailyAllowance;
const daysLeft = Math.floor(budget / (spend || 1));
const dateStr = new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
let narration = "";
let advice = "";
if (spend < (dailyAllowance * 0.5)) {
narration = "Today was a masterclass in financial restraint. You've reclaimed hours that belong to you.";
advice = "Invest the surplus. Maintain this awareness.";
} else if (!overBudget) {
narration = "You're operating within the safety zone. This respects your future self.";
advice = "Focus only on items that bring genuine joy tomorrow.";
} else {
narration = "Today's spending represents a leakage. You've traded too much time.";
advice = "Try a 'No-Spend Day' tomorrow to balance the scales.";
}
// UI Update
document.getElementById('res-hours').innerText = hours;
document.getElementById('res-spend').innerText = `$${spend.toLocaleString()}`;
document.getElementById('res-days').innerText = daysLeft > 365 ? "∞" : `${daysLeft} days`;
document.getElementById('res-narration').innerText = narration;
document.getElementById('res-advice').innerText = advice;
// PDF Print Update
document.getElementById('p-date').innerText = dateStr;
document.getElementById('p-spend').innerText = `$${spend.toLocaleString()}`;
document.getElementById('p-hours').innerText = hours;
document.getElementById('p-days').innerText = daysLeft > 365 ? "Stable" : `${daysLeft} days`;
document.getElementById('p-income').innerText = `$${income.toLocaleString()}`;
document.getElementById('p-budget').innerText = `$${budget.toLocaleString()}`;
document.getElementById('p-burn-score').innerText = overBudget ? "Aggressive" : "Sustainable";
document.getElementById('p-burn-score').style.color = overBudget ? "#ef4444" : "#10b981";
document.getElementById('p-narration').innerText = narration;
document.getElementById('p-advice').innerText = advice;
// Update Visual Audit Summary Section (PDF)
document.getElementById('p-dates').innerText = dateStr;
document.getElementById('p-v-hours').innerText = hours;
document.getElementById('p-v-spend').innerText = `$${spend.toLocaleString()}`;
document.getElementById('p-v-days').innerText = daysLeft > 365 ? "Stable" : `${daysLeft} days`;
document.getElementById('p-v-burn-score').innerText = overBudget ? "Aggressive" : "Sustainable";
document.getElementById('p-v-burn-score').style.color = overBudget ? "#ef4444" : "#10b981";
document.getElementById('p-v-narration').innerText = narration;
document.getElementById('p-v-advice').innerText = advice;
const itemsBody = document.getElementById('p-items-body');
itemsBody.innerHTML = '';
document.querySelectorAll('.item-row').forEach(row => {
const name = row.querySelector('.item-name').value;
const price = parseFloat(row.querySelector('.item-price').value) || 0;
if (price > 0) {
const tr = document.createElement('tr');
tr.innerHTML = `<td>${name || 'Item'}</td><td style="text-align:right">$${price.toFixed(2)}</td>`;
itemsBody.appendChild(tr);
}
});
document.getElementById('input-section').classList.add('hidden');
document.getElementById('result-section').classList.remove('hidden');
window.scrollTo(0, 0);
}
function shareResults() {
const spend = document.getElementById('res-spend').innerText;
const msg = `I spent ${spend} today. Tracking my life energy trade!`;
if (navigator.share) {
navigator.share({ title: 'Daily Checkup', text: msg, url: window.location.href }).catch(() => {});
} else {
alert("Ready to share: " + msg);
}
}
document.getElementById("year").innerHTML = new Date().getFullYear();
</script>
</body>
</html>