-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1470 lines (1340 loc) · 42.8 KB
/
index.html
File metadata and controls
1470 lines (1340 loc) · 42.8 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
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="dark">
<style>html{background:#0a0a0c!important;color-scheme:dark}</style>
<title>IBIZA PLAN — Tracker</title>
<style>
:root {
--bg: #111118;
--surface: #23232f;
--border: #38384a;
--accent: #e8ff47;
--accent2: #47c8ff;
--accent3: #ff6b47;
--text: #ffffff;
--muted: #9a9ab0;
--success: #47ffb2;
--phase1: #47c8ff;
--phase2: #ff9f47;
--phase3a: #ff6b47;
--phase3b: #e8ff47;
--font-main: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
--font-mono: 'SF Mono', 'Courier New', monospace;
}
- { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(–bg);
color: var(–text);
font-family: var(–font-main);
min-height: 100vh;
overflow-x: hidden;
}
/* Grid background */
body::before {
content: ‘’;
position: fixed;
inset: 0;
background-image:
linear-gradient(rgba(232,255,71,0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(232,255,71,0.03) 1px, transparent 1px);
background-size: 40px 40px;
pointer-events: none;
z-index: 0;
}
.container {
position: relative;
z-index: 1;
max-width: 680px;
margin: 0 auto;
padding: 24px 16px 80px;
}
/* Header */
.header {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 32px;
gap: 16px;
}
.header-left {}
.header-title {
font-size: 28px;
font-weight: 800;
letter-spacing: -1px;
line-height: 1;
color: var(–accent);
}
.header-subtitle {
font-size: 12px;
color: var(–muted);
font-family: var(–font-mono);
margin-top: 4px;
text-transform: uppercase;
letter-spacing: 2px;
}
.countdown-box {
background: var(–surface);
border: 1px solid var(–border);
border-radius: 8px;
padding: 10px 16px;
text-align: right;
flex-shrink: 0;
}
.countdown-num {
font-size: 32px;
font-weight: 800;
color: var(–accent);
line-height: 1;
font-family: var(–font-mono);
}
.countdown-label {
font-size: 10px;
color: var(–muted);
text-transform: uppercase;
letter-spacing: 1px;
font-family: var(–font-mono);
}
/* Phase pill */
.phase-banner {
border-radius: 8px;
padding: 12px 16px;
margin-bottom: 24px;
display: flex;
align-items: center;
justify-content: space-between;
border: 1px solid;
}
.phase-banner .phase-name {
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 2px;
}
.phase-banner .phase-desc {
font-size: 11px;
opacity: 0.7;
font-family: var(–font-mono);
}
.phase-banner .phase-kcal {
font-size: 18px;
font-weight: 800;
font-family: var(–font-mono);
}
/* Macros strip */
.macros-strip {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-bottom: 24px;
}
.macro-card {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
border-radius: 8px;
padding: 10px 12px;
text-align: center;
}
.macro-val {
font-size: 20px;
font-weight: 800;
font-family: var(–font-mono);
}
.macro-label {
font-size: 10px;
color: var(–muted);
text-transform: uppercase;
letter-spacing: 1px;
}
.macro-progress {
height: 3px;
background: var(–border);
border-radius: 2px;
margin-top: 6px;
overflow: hidden;
}
.macro-progress-bar {
height: 100%;
border-radius: 2px;
transition: width 0.4s ease;
}
/* Section */
.section-title {
font-size: 11px;
font-family: var(–font-mono);
color: var(–muted);
text-transform: uppercase;
letter-spacing: 3px;
margin-bottom: 10px;
margin-top: 24px;
}
/* Meal card */
.meal-card {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 12px rgba(0,0,0,0.4);
border-radius: 10px;
margin-bottom: 8px;
overflow: hidden;
transition: border-color 0.2s;
}
.meal-card.completed {
border-color: var(–success);
opacity: 0.7;
}
.meal-card.completed .meal-header {
background: rgba(71,255,178,0.05);
}
.meal-header {
display: flex;
align-items: center;
padding: 12px 14px;
gap: 12px;
cursor: pointer;
user-select: none;
}
.meal-check {
width: 22px;
height: 22px;
border-radius: 50%;
border: 2px solid var(–muted);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
cursor: pointer;
}
.meal-check.done {
background: var(–success);
border-color: var(–success);
}
.meal-check.done::after {
content: ‘✓’;
font-size: 12px;
color: #000;
font-weight: 700;
}
.meal-info { flex: 1; }
.meal-time {
font-size: 11px;
color: var(–muted);
font-family: var(–font-mono);
}
.meal-name {
font-size: 14px;
font-weight: 700;
line-height: 1.2;
}
.meal-kcal {
font-size: 13px;
font-family: var(–font-mono);
color: var(–accent);
font-weight: 700;
flex-shrink: 0;
}
.meal-foods {
padding: 0 14px 12px 48px;
display: none;
}
.meal-card.open .meal-foods { display: block; }
.food-item {
font-size: 12px;
color: var(–muted);
padding: 2px 0;
line-height: 1.5;
}
.food-item::before {
content: ‘—’;
margin-right: 6px;
color: var(–border);
}
.meal-macros {
font-size: 11px;
font-family: var(–font-mono);
color: var(–accent2);
margin-top: 6px;
padding-top: 6px;
border-top: 1px solid var(–border);
}
/* Entreno card */
.workout-card {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
border-radius: 10px;
padding: 14px;
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.workout-icon {
font-size: 22px;
flex-shrink: 0;
}
.workout-info { flex: 1; }
.workout-name { font-size: 14px; font-weight: 700; }
.workout-note { font-size: 11px; color: var(–muted); font-family: var(–font-mono); margin-top: 2px; }
.workout-check {
width: 28px;
height: 28px;
border-radius: 6px;
border: 2px solid var(–muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
flex-shrink: 0;
}
.workout-check.done {
background: var(–accent);
border-color: var(–accent);
}
.workout-check.done::after {
content: ‘✓’;
color: #000;
font-weight: 700;
font-size: 14px;
}
/* Peso */
.weight-card {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
border-radius: 10px;
padding: 14px;
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.weight-input {
background: var(–bg);
border: 1px solid var(–border);
color: var(–text);
font-family: var(–font-mono);
font-size: 20px;
font-weight: 700;
width: 90px;
text-align: center;
border-radius: 6px;
padding: 6px 10px;
outline: none;
transition: border-color 0.2s;
flex-shrink: 0;
}
.weight-input:focus { border-color: var(–accent); }
.weight-unit {
font-size: 14px;
color: var(–muted);
font-family: var(–font-mono);
}
.weight-label { font-size: 14px; font-weight: 700; flex: 1; }
.weight-trend {
font-size: 12px;
font-family: var(–font-mono);
color: var(–muted);
}
/* Suplementos */
.supps-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-bottom: 8px;
}
.supp-card {
background: var(–surface);
border: 1px solid var(–border);
border-radius: 8px;
padding: 10px 12px;
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
transition: all 0.15s;
user-select: none;
}
.supp-card.done {
border-color: var(–success);
background: rgba(71,255,178,0.04);
}
.supp-dot {
width: 10px;
height: 10px;
border-radius: 50%;
border: 2px solid var(–muted);
flex-shrink: 0;
transition: all 0.2s;
}
.supp-card.done .supp-dot {
background: var(–success);
border-color: var(–success);
}
.supp-name { font-size: 12px; font-weight: 600; line-height: 1.2; flex: 1; }
.supp-time { font-size: 10px; color: var(–muted); font-family: var(–font-mono); margin-top: 1px; }
/* Agua */
.agua-card {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
border-radius: 10px;
padding: 14px;
margin-bottom: 8px;
}
.agua-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.agua-title { font-size: 14px; font-weight: 700; }
.agua-target { font-size: 12px; font-family: var(–font-mono); color: var(–accent2); }
.agua-dots {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.agua-dot {
width: 32px;
height: 32px;
border-radius: 6px;
border: 2px solid var(–border);
cursor: pointer;
transition: all 0.15s;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-family: var(–font-mono);
color: var(–muted);
}
.agua-dot.filled {
background: var(–accent2);
border-color: var(–accent2);
color: #000;
font-weight: 700;
}
/* Nav days */
.day-nav {
display: flex;
gap: 6px;
overflow-x: auto;
padding-bottom: 4px;
margin-bottom: 24px;
scrollbar-width: none;
}
.day-nav::-webkit-scrollbar { display: none; }
.day-btn {
flex-shrink: 0;
padding: 8px 14px;
border-radius: 6px;
border: 1px solid var(–border);
background: var(–surface);
color: var(–muted);
font-family: var(–font-mono);
font-size: 11px;
cursor: pointer;
transition: all 0.15s;
text-align: center;
line-height: 1.3;
white-space: nowrap;
}
.day-btn:hover { border-color: var(–accent); color: var(–text); }
.day-btn.active {
background: var(–accent);
border-color: var(–accent);
color: #000;
font-weight: 700;
}
.day-btn.today-btn {
border-color: var(–accent2);
color: var(–accent2);
}
.day-btn.today-btn.active {
background: var(–accent2);
color: #000;
}
/* Notas */
.notes-area {
width: 100%;
background: var(–surface);
border: 1px solid var(–border);
border-radius: 8px;
color: var(–text);
font-family: var(–font-main);
font-size: 13px;
padding: 12px;
resize: vertical;
min-height: 70px;
outline: none;
transition: border-color 0.2s;
}
.notes-area:focus { border-color: var(–accent); }
/* Progress bar total */
.daily-progress {
background: var(–surface);
border: 1px solid var(–border);
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
border-radius: 10px;
padding: 14px;
margin-bottom: 24px;
}
.dp-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.dp-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.dp-pct { font-size: 20px; font-weight: 800; font-family: var(–font-mono); color: var(–accent); }
.dp-bar-bg { height: 6px; background: var(–border); border-radius: 3px; overflow: hidden; }
.dp-bar { height: 100%; background: var(–accent); border-radius: 3px; transition: width 0.5s ease; }
/* Footer nav */
.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(10,10,12,0.95);
border-top: 1px solid var(–border);
display: flex;
z-index: 100;
backdrop-filter: blur(10px);
}
.nav-btn {
flex: 1;
padding: 14px 8px;
border: none;
background: transparent;
color: var(–muted);
cursor: pointer;
font-family: var(–font-main);
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
transition: color 0.15s;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.nav-btn.active { color: var(–accent); }
.nav-btn span:first-child { font-size: 18px; }
/* Tabs */
.tab-content { display: none; }
.tab-content.active { display: block; }
/* Historial */
.history-item {
background: var(–surface);
border: 1px solid var(–border);
border-radius: 8px;
padding: 12px 14px;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 12px;
}
.history-date {
font-family: var(–font-mono);
font-size: 11px;
color: var(–muted);
min-width: 60px;
}
.history-weight {
font-family: var(–font-mono);
font-size: 18px;
font-weight: 700;
color: var(–accent);
}
.history-phase {
font-size: 10px;
padding: 2px 8px;
border-radius: 4px;
font-family: var(–font-mono);
font-weight: 700;
}
.history-meals {
margin-left: auto;
font-size: 11px;
font-family: var(–font-mono);
color: var(–muted);
}
/* Reglas */
.rule-item {
background: var(–surface);
border: 1px solid var(–border);
border-left: 3px solid var(–accent);
border-radius: 8px;
padding: 10px 14px;
margin-bottom: 8px;
font-size: 13px;
line-height: 1.5;
}
.rule-item strong { color: var(–accent); }
/* LIGHT THEME */
body.light {
–bg: #e8e8f0;
–surface: #ffffff;
–border: #c0c0d0;
–text: #0a0a0c;
–muted: #666680;
}
body.light::before { display: none; }
body.light .bottom-nav { background: rgba(245,245,247,0.95); }
body.light .weight-input { background: #f0f0f2; color: #0a0a0c; }
body.light .notes-area { background: #f0f0f2; color: #0a0a0c; }
.theme-btn {
width: 36px; height: 36px;
border-radius: 8px;
border: 1px solid var(–border);
background: var(–surface);
color: var(–text);
font-size: 18px;
cursor: pointer;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
transition: all 0.2s;
}
</style>
</head>
<body>
<div class="container">
<!-- Header -->
<div class="header">
<div class="header-left">
<div class="header-title">IBIZA PLAN</div>
<div class="header-subtitle" id="current-date-label">— · Jordi · 89kg</div>
</div>
<div style="display:flex;flex-direction:column;align-items:flex-end;gap:8px">
<button class="theme-btn" id="theme-btn" onclick="toggleTheme()">🌙</button>
<div class="countdown-box">
<div class="countdown-num" id="countdown-num">—</div>
<div class="countdown-label">días para<br>Ibiza</div>
</div>
</div>
</div>
<!-- Day nav -->
<div class="day-nav" id="day-nav"></div>
<!-- Tabs -->
<div id="tab-hoy" class="tab-content active">
<!-- Phase banner -->
<div class="phase-banner" id="phase-banner">
<div>
<div class="phase-name" id="phase-name">—</div>
<div class="phase-desc" id="phase-desc">—</div>
</div>
<div class="phase-kcal" id="phase-kcal">—</div>
</div>
```
<!-- Progress -->
<div class="daily-progress">
<div class="dp-header">
<div class="dp-label">Progreso del día</div>
<div class="dp-pct" id="dp-pct">0%</div>
</div>
<div class="dp-bar-bg"><div class="dp-bar" id="dp-bar" style="width:0%"></div></div>
</div>
<!-- Macros -->
<div class="section-title">Macros objetivo</div>
<div class="macros-strip">
<div class="macro-card">
<div class="macro-val" style="color:var(--accent2)" id="macro-p-val">—g</div>
<div class="macro-label">Proteína</div>
<div class="macro-progress"><div class="macro-progress-bar" id="macro-p-bar" style="background:var(--accent2);width:0%"></div></div>
</div>
<div class="macro-card">
<div class="macro-val" style="color:var(--accent)" id="macro-c-val">—g</div>
<div class="macro-label">Carbos</div>
<div class="macro-progress"><div class="macro-progress-bar" id="macro-c-bar" style="background:var(--accent);width:0%"></div></div>
</div>
<div class="macro-card">
<div class="macro-val" style="color:var(--accent3)" id="macro-g-val">—g</div>
<div class="macro-label">Grasas</div>
<div class="macro-progress"><div class="macro-progress-bar" id="macro-g-bar" style="background:var(--accent3);width:0%"></div></div>
</div>
</div>
<!-- Comidas -->
<div class="section-title">Comidas</div>
<div id="meals-container"></div>
<!-- Entreno -->
<div class="section-title">Entreno</div>
<div class="workout-card">
<div class="workout-icon">🏋️</div>
<div class="workout-info">
<div class="workout-name" id="workout-name">—</div>
<div class="workout-note" id="workout-note">—</div>
</div>
<div class="workout-check" id="workout-check" onclick="toggleWorkout()"></div>
</div>
<!-- Peso -->
<div class="section-title">Peso matinal</div>
<div class="weight-card">
<div class="weight-label">⚖️ Peso en ayunas</div>
<input class="weight-input" type="number" id="weight-input" placeholder="89.0" step="0.1" min="70" max="120" oninput="saveWeight()">
<div class="weight-unit">kg</div>
</div>
<div class="weight-trend" id="weight-trend" style="text-align:right;margin-bottom:4px;font-size:11px;color:var(--muted);"></div>
<!-- Agua -->
<div class="section-title">Hidratación</div>
<div class="agua-card">
<div class="agua-header">
<div class="agua-title">💧 Agua</div>
<div class="agua-target" id="agua-target">Objetivo: 3L</div>
</div>
<div class="agua-dots" id="agua-dots"></div>
</div>
<!-- Suplementos -->
<div class="section-title">Suplementos</div>
<div class="supps-grid" id="supps-grid"></div>
<!-- Notas -->
<div class="section-title">Notas del día</div>
<textarea class="notes-area" id="notes-area" placeholder="¿Cómo te has sentido? Energía, hambre, sensaciones..." oninput="saveNotes()"></textarea>
```
</div><!-- end tab-hoy -->
<!-- HISTORIAL TAB -->
<div id="tab-historial" class="tab-content">
<div class="section-title">Evolución del peso</div>
<canvas id="weight-chart" style="width:100%;height:180px;margin-bottom:16px;border-radius:8px;background:var(--surface);padding:12px;border:1px solid var(--border);"></canvas>
<div class="section-title">Registro diario</div>
<div id="history-list"></div>
</div>
<!-- REGLAS TAB -->
<div id="tab-reglas" class="tab-content">
<div class="section-title">Reglas de oro</div>
<div class="rule-item">💧 <strong>Agua:</strong> 3L/día Fase 1-2 · 4L vaciado final · 2L en carga</div>
<div class="rule-item">🥩 <strong>Proteína:</strong> 200g mínimo todos los días sin excepción</div>
<div class="rule-item">🏋️ <strong>Entreno:</strong> F1 normal · F2 bajos -20% volumen, mismo peso · F3A ligero · F3B pecho+pierna obligatorio</div>
<div class="rule-item">🚫 <strong>Alcohol:</strong> Cero durante las 3 semanas</div>
<div class="rule-item">🧂 <strong>Sal:</strong> Moderada F1-F2 · Mínima en vaciado y carga</div>
<div class="rule-item">💊 <strong>Creatina:</strong> Mantén todo el plan (el mito de dejarla en definición es falso)</div>
<div class="rule-item">📊 <strong>Peso:</strong> Cada mañana en ayunas. Lo que importa es la tendencia semanal</div>
```
<div class="section-title" style="margin-top:28px;">Fases del plan</div>
<div class="rule-item" style="border-left-color:var(--phase1)">
<strong style="color:var(--phase1)">FASE 1 · 7–20 Abr · 14 días</strong><br>
~1.950 kcal · 200P / 150C / 55G<br>
Déficit controlado. Recarga el sábado o domingo (220g carbos ese día).
</div>
<div class="rule-item" style="border-left-color:var(--phase2)">
<strong style="color:var(--phase2)">FASE 2 · 21–27 Abr · 7 días</strong><br>
Días bajos (L-J): ~1.700 kcal · 210P / 70C / 45G<br>
Días mant. (V-D): vuelve a Fase 1 (1.950 kcal)<br>
-20% volumen entreno en días bajos
</div>
<div class="rule-item" style="border-left-color:var(--phase3a)">
<strong style="color:var(--phase3a)">FASE 3A · 28–29 Abr · 2 días</strong><br>
~1.700 kcal · 210P / 60C / 45G<br>
Vaciado final. 4L agua. Sin sal. Entreno muy ligero.
</div>
<div class="rule-item" style="border-left-color:var(--phase3b)">
<strong style="color:var(--phase3b)">FASE 3B · 30 Abr – 1 May · 2 días</strong><br>
~2.600 kcal · 200P / 380C / 40G<br>
🔥 CARGA FINAL. Carbos cada 3h. Agua solo 2L. Mínima grasa y sal.
</div>
```
</div>
</div><!-- end container -->
<!-- Bottom Nav -->
<div class="bottom-nav">
<button class="nav-btn active" id="nav-hoy" onclick="switchTab('hoy')">
<span>📋</span><span>Hoy</span>
</button>
<button class="nav-btn" id="nav-historial" onclick="switchTab('historial')">
<span>📈</span><span>Historial</span>
</button>
<button class="nav-btn" id="nav-reglas" onclick="switchTab('reglas')">
<span>📌</span><span>Plan</span>
</button>
</div>
<script>
// ============================================================
// DATA
// ============================================================
const PLAN_START = new Date('2026-04-07');
const IBIZA_DATE = new Date('2026-05-01');
const PHASES = {
phase1: {
name: 'FASE 1 — DÉFICIT',
desc: '~1.950 kcal · 200P / 150C / 55G',
kcal: '1.950 kcal',
color: 'var(--phase1)',
macros: { p: 200, c: 150, g: 55 },
agua: 3,
workoutNote: 'Entreno normal — mismo peso, mismas series',
},
phase2low: {
name: 'FASE 2 — VACIADO (día bajo)',
desc: '~1.700 kcal · 210P / 70C / 45G',
kcal: '1.700 kcal',
color: 'var(--phase2)',
macros: { p: 210, c: 70, g: 45 },
agua: 3.5,
workoutNote: '-20% volumen (1 serie menos) · mismo peso en barra',
},
phase2maint: {
name: 'FASE 2 — MANTENIMIENTO (V-D)',
desc: '~1.950 kcal · 200P / 150C / 55G',
kcal: '1.950 kcal',
color: 'var(--phase2)',
macros: { p: 200, c: 150, g: 55 },
agua: 3,
workoutNote: 'Vuelve a Fase 1 — recupera energía para la carga',
},
phase3a: {
name: 'FASE 3A — ÚLTIMO VACIADO',
desc: '~1.700 kcal · 210P / 60C / 45G',
kcal: '1.700 kcal',
color: 'var(--phase3a)',
macros: { p: 210, c: 60, g: 45 },
agua: 4,
workoutNote: 'Entreno muy ligero — pocas series, activa el músculo',
},
phase3b: {
name: '🔥 FASE 3B — CARGA FINAL · PEAK',
desc: '~2.600 kcal · 200P / 380C / 40G',
kcal: '2.600 kcal',
color: 'var(--phase3b)',
macros: { p: 200, c: 380, g: 40 },
agua: 2,
workoutNote: '⚡ PECHO + PIERNA — OBLIGATORIO para absorción de glucógeno',
},
};
const MEALS = {
phase1: [
{ time: '7:30', name: 'Desayuno', kcal: 450, p: 35, c: 55, g: 10,
foods: ['50g avena', '2 yogures griegos proteicos Hacendado', 'Frutos rojos congelados al gusto', '15g frutos secos', 'SIN plátano'] },
{ time: '11:00', name: 'Media mañana', kcal: 205, p: 18, c: 22, g: 5,
foods: ['2 rebanadas pan espelta 100% integral', '80g jamón o lomo ibérico'] },
{ time: '14:30', name: 'Comida', kcal: 385, p: 55, c: 30, g: 5,
foods: ['250g pechuga de pollo o merluza/bacalao', '150g patata, boniato o arroz cocido', 'Verdura abundante (sin límite)'] },
{ time: '17:30', name: 'Pre-entreno', kcal: 140, p: 8, c: 25, g: 1,
foods: ['1 plátano mediano', '20g pavo en lonchas o 1 clara de huevo cocida'] },
{ time: 'Post-gym', name: 'Post-entreno', kcal: 150, p: 30, c: 3, g: 2,
foods: ['30g batido de proteína con agua (inmediato al salir)'] },
{ time: '21:30', name: 'Cena', kcal: 265, p: 45, c: 8, g: 6,
foods: ['200–250g merluza o bacalao al horno/plancha', 'Verdura abundante', 'SIN carbohidrato en cena', 'Opcional: 1 huevo cocido si tienes hambre'] },
],
phase2low: [
{ time: '7:30', name: 'Desayuno', kcal: 275, p: 38, c: 12, g: 8,
foods: ['3 claras de huevo + 1 huevo entero revueltos', '2 yogures griegos proteicos Hacendado', 'Frutos rojos congelados', 'SIN frutos secos, SIN plátano'] },
{ time: '11:00', name: 'Media mañana', kcal: 155, p: 20, c: 12, g: 3,
foods: ['80g pechuga de pavo en lonchas', '1 rebanada pan espelta (reducido)'] },
{ time: '14:30', name: 'Comida', kcal: 285, p: 52, c: 10, g: 4,
foods: ['250g pechuga de pollo o bacalao', 'SIN carbohidrato — solo verdura abundante', 'Pepino, lechuga, tomate, brócoli, espinacas...'] },
{ time: '17:30', name: 'Pre-entreno', kcal: 80, p: 12, c: 8, g: 0,
foods: ['1 yogur griego proteico solo', 'SIN plátano ni pan'] },
{ time: 'Post-gym', name: 'Post-entreno', kcal: 150, p: 30, c: 3, g: 2,
foods: ['30g batido de proteína con agua'] },
{ time: '21:30', name: 'Cena', kcal: 220, p: 42, c: 6, g: 3,
foods: ['200g merluza o bacalao', 'Verdura al vapor o plancha — SIN carbohidrato', 'Sal mínima'] },
],
phase2maint: null, // same as phase1
phase3a: [
{ time: '7:30', name: 'Desayuno', kcal: 265, p: 40, c: 8, g: 8,
foods: ['4 claras de huevo + 1 huevo entero', '2 yogures griegos proteicos', 'SIN carbohidrato ninguno'] },
{ time: '11:00', name: 'Media mañana', kcal: 105, p: 22, c: 0, g: 2,
foods: ['100g pechuga de pavo o pollo', 'SIN pan'] },
{ time: '14:30', name: 'Comida', kcal: 315, p: 60, c: 8, g: 5,
foods: ['300g pechuga de pollo a la plancha', 'Solo verdura — lechuga, pepino, brócoli', 'SIN carbohidrato, SIN sal extra'] },
{ time: '17:30', name: 'Pre-entreno', kcal: 80, p: 12, c: 8, g: 0,
foods: ['1 yogur griego solo', 'Entreno LIGERO estos días'] },
{ time: 'Post-gym', name: 'Post-entreno', kcal: 150, p: 30, c: 3, g: 2,
foods: ['30g batido de proteína'] },
{ time: '21:30', name: 'Cena', kcal: 198, p: 40, c: 5, g: 2,
foods: ['200g merluza o bacalao', 'Verdura al vapor — SIN sal, SIN carbohidrato'] },
],
phase3b: [
{ time: '7:30', name: 'Desayuno', kcal: 645, p: 38, c: 110, g: 6,
foods: ['100g avena (el doble)', '2 yogures griegos proteicos', '2 plátanos maduros', 'Frutos rojos', 'SIN frutos secos (minimiza grasas)'] },
{ time: '11:00', name: 'Media mañana', kcal: 390, p: 22, c: 65, g: 5,
foods: ['4 rebanadas pan espelta con jamón ibérico', '1 plátano'] },
{ time: '14:30', name: 'Comida', kcal: 545, p: 48, c: 80, g: 4,
foods: ['200g pechuga de pollo', '350g arroz blanco cocido o patata (máximo carbos aquí)', 'Verdura — poca cantidad hoy'] },
{ time: '17:30', name: 'Pre-entreno ⚡', kcal: 265, p: 5, c: 60, g: 1,
foods: ['ENTRENO OBLIGATORIO: pectoral + pierna (grupos grandes)', '2 plátanos + 1 rebanada pan con miel'] },
{ time: 'Post-gym', name: 'Post-entreno', kcal: 245, p: 32, c: 25, g: 2,
foods: ['30g batido de proteína', '1 plátano extra post-entreno'] },
{ time: '21:30', name: 'Cena', kcal: 405, p: 45, c: 45, g: 5,
foods: ['200g merluza o salmón', '200g arroz blanco cocido o boniato', 'Verdura ligera'] },
],
};
const SUPPLEMENTS = [
{ name: 'Creatina', time: 'Post-entreno o mañana' },
{ name: 'Omega-3', time: 'Con comida principal' },
{ name: 'Mag. Bisglicinato', time: 'Noche, antes de dormir' },
{ name: 'D3 + K2', time: 'Mañana, con grasa' },
{ name: 'Zinc', time: 'Noche, antes de dormir' },
{ name: 'Ashwagandha', time: 'Mañana o noche' },
];
// ============================================================
// STATE
// ============================================================
let currentDateKey = todayKey();
let activeTab = 'hoy';
function todayKey() {
const d = new Date();
return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`;
}
function getStorage(key, def) {
try { const v = localStorage.getItem(key); return v !== null ? JSON.parse(v) : def; }
catch { return def; }
}
function setStorage(key, val) {
try { localStorage.setItem(key, JSON.stringify(val)); } catch {}
}
function getDayData(dateKey) {
return getStorage(`ibiza_day_${dateKey}`, {
meals: {},
workout: false,
weight: '',
agua: 0,
supps: {},
notes: ''
});
}
function saveDayData(dateKey, data) {
setStorage(`ibiza_day_${dateKey}`, data);
}
// ============================================================
// PHASE LOGIC
// ============================================================
function getPhaseForDate(dateKey) {
const d = new Date(dateKey + 'T12:00:00');
const day = Math.floor((d - new Date('2026-04-07T12:00:00')) / 86400000) + 1;
const dow = d.getDay(); // 0=Sun,1=Mon,...
if (day < 1 || day > 25) return null;
// Phase 1: days 1–14 (Apr 7–20)
if (day >= 1 && day <= 14) {
// weekend recharge?
const isWeekend = dow === 0 || dow === 6;
return { key: 'phase1', isRecharge: isWeekend };
}
// Phase 2: days 15–21 (Apr 21–27)
if (day >= 15 && day <= 18) { // Mon–Thu (21–24 Apr)
return { key: 'phase2low' };
}
if (day >= 19 && day <= 21) { // Fri–Sun (25–27 Apr)
return { key: 'phase2maint' };
}
// Phase 3A: days 22–23 (28–29 Apr)
if (day >= 22 && day <= 23) {
return { key: 'phase3a' };
}