-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2083 lines (1971 loc) · 133 KB
/
Copy pathindex.html
File metadata and controls
2083 lines (1971 loc) · 133 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
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FujiRecipeVault</title>
<link rel="icon" type="image/png" href="/ICON.png?v=2">
<link rel="apple-touch-icon" href="/ICON.png?v=2">
<!--
Komplette Oberfläche in einer Datei.
Oben: Kamera-Auswahl. Es werden nur Rezepte, Filmsimulationen, Parameter und
Plätze der gewählten Kamera gezeigt. Rezepte können mehreren Kameras zugeordnet sein.
Design: Schwarz/Grau, weiße Schrift, Rot als Akzent.
-->
<style>
:root{
--bg:#0c0c0e; --panel:#151517; --panel-2:#1d1d21; --ink:#f4f4f5; --muted:#9a9aa2;
--line:#2a2a30; --field:#111114; --field-line:#33333b;
--accent:#ff453a; --accent-hover:#ff6058; --radius:11px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
[hidden]{ display:none !important; }
/* Rote Häkchen/Regler statt System-Blau (App-Akzent) */
input[type=checkbox], input[type=radio]{ accent-color:var(--accent); }
body{ font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--ink); line-height:1.45; height:100vh; overflow:hidden; display:flex; flex-direction:column; }
.app-header{ flex:none; background:#000; border-bottom:1px solid var(--line); padding:14px 22px; display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.app-mark{ width:26px; height:26px; flex:none; display:block; }
.app-header .divider{ width:1px; height:22px; background:#3a3a42; }
.app-header h1{ margin:0; font-size:22px; font-weight:700; color:#fff; letter-spacing:.2px; line-height:1; }
.cam-picker{ display:flex; align-items:center; gap:8px; margin-left:6px; }
.cam-select{ background:var(--field); border:1px solid var(--field-line); color:var(--ink); border-radius:9px; padding:8px 11px; font:inherit; font-weight:600; }
.cam-select:focus{ outline:none; border-color:var(--accent); }
.btn-quit{ margin-left:auto; background:transparent; border:1px solid var(--field-line); color:var(--muted); border-radius:9px; padding:8px 14px; font:inherit; font-weight:600; font-size:13px; cursor:pointer; }
.btn-quit:hover{ color:var(--accent); border-color:var(--accent); }
.layout{ flex:1; min-height:0; display:grid; grid-template-columns:340px 1fr; }
/* LINKS */
.sidebar{ min-height:0; display:flex; flex-direction:column; border-right:1px solid var(--line); background:var(--panel); }
.sidebar-top{ padding:13px; display:flex; flex-direction:column; gap:9px; border-bottom:1px solid var(--line); }
.control{ width:100%; background:var(--field); border:1px solid var(--field-line); color:var(--ink); border-radius:9px; padding:9px 11px; font:inherit; }
.control::placeholder{ color:#6b6b73; }
.control:focus{ outline:none; border-color:var(--accent); }
.btn-new{ width:100%; background:var(--accent); color:#fff; border:none; border-radius:var(--radius); padding:11px 14px; font:inherit; font-weight:650; cursor:pointer; }
.btn-new:hover{ background:var(--accent-hover); }
.row{ display:flex; gap:9px; }
.row .control{ flex:1; }
.toggle{ background:var(--field); border:1px solid var(--field-line); color:var(--muted); border-radius:9px; padding:0 13px; cursor:pointer; font-weight:600; font-size:14px; }
.toggle.on{ color:#fff; border-color:var(--accent); background:rgba(255,69,58,.16); }
.seg{ display:flex; border:1px solid var(--field-line); border-radius:9px; overflow:hidden; }
.seg button{ flex:1; background:var(--field); color:var(--muted); border:none; padding:8px 6px; font:inherit; font-weight:600; font-size:12.5px; cursor:pointer; border-left:1px solid var(--field-line); }
.seg button:first-child{ border-left:none; }
.seg button.on{ background:rgba(255,69,58,.16); color:#fff; }
.count{ font-size:12px; color:var(--muted); padding-left:2px; }
.recipe-list{ flex:1; min-height:0; overflow:auto; padding:8px; }
.item{ display:flex; align-items:center; gap:8px; padding:10px 10px 10px 12px; border-radius:10px; cursor:pointer; border:1px solid transparent; margin-bottom:4px; }
.item:hover{ background:var(--panel-2); }
.item.active{ background:var(--panel-2); border-color:var(--line); box-shadow:inset 3px 0 0 var(--accent); }
.item.dragging{ opacity:.5; }
.item-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.item .nm{ font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item.active .nm{ color:var(--accent); }
.item .fs{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.heart{ flex:none; background:none; border:none; color:#6b6b73; font-size:17px; cursor:pointer; padding:4px; line-height:1; }
/* Phase 5 – Sterne (Rating) + Tags */
.item-stars{ font-size:11px; letter-spacing:1px; color:var(--accent); line-height:1; margin-top:1px; }
.editor-stars{ display:inline-flex; gap:1px; }
.editor-stars .star{ background:none; border:0; color:#4a4a52; font-size:18px; line-height:1; cursor:pointer; padding:0 1px; }
.editor-stars .star.on{ color:var(--accent); }
.editor-stars .star:hover{ color:var(--accent); }
.tag-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.tag-chips:not(:empty){ margin-bottom:8px; }
.tag-chip{ display:inline-flex; align-items:center; gap:6px; background:var(--panel-2); border:1px solid var(--field-line); border-radius:20px; padding:3px 7px 3px 11px; font-size:12.5px; color:var(--ink); }
.tag-chip button{ background:none; border:0; color:var(--muted); font:inherit; font-size:13px; line-height:1; cursor:pointer; padding:0; }
.tag-chip button:hover{ color:var(--accent); }
#tag-filter{ display:flex; flex-wrap:wrap; gap:6px; }
#tag-filter .tagf{ background:var(--field); border:1px solid var(--field-line); border-radius:20px; padding:3px 11px; font:inherit; font-size:12px; color:var(--muted); cursor:pointer; }
#tag-filter .tagf.on{ background:rgba(255,69,58,.16); border-color:var(--accent); color:#fff; }
.heart:hover,.heart.on{ color:var(--accent); }
.list-empty{ color:var(--muted); font-size:13px; text-align:center; padding:26px 14px; line-height:1.5; }
.list-empty b{ color:var(--ink); font-weight:650; }
.empty-actions{ margin-top:16px; }
.empty-hint{ margin-top:14px; font-size:12px; color:var(--muted); }
/* RECHTS */
.editor-wrap{ min-height:0; overflow:auto; }
.editor-empty{ min-height:100%; display:flex; align-items:flex-start; justify-content:center; padding:36px 22px; }
.empty-inner{ width:min(620px, 100%); }
.empty-title{ font-size:18px; font-weight:700; margin:0 0 4px; }
.empty-sub{ color:var(--muted); font-size:13px; margin:0 0 22px; line-height:1.6; }
.camera-slots{ display:flex; flex-direction:column; gap:10px; }
.cslot{ display:flex; align-items:center; gap:14px; border:1px solid var(--field-line); border-radius:12px; padding:14px 16px; background:var(--field); transition:border-color .15s, background .15s; }
.cslot.drop{ border-color:var(--accent); background:rgba(255,69,58,.14); }
.cslot-n{ font-family:ui-monospace,Menlo,monospace; font-weight:700; color:var(--accent); font-size:15px; width:28px; flex:none; }
.cslot-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cslot.filled .cslot-name{ cursor:pointer; }
.cslot.filled .cslot-name:hover{ color:var(--accent); }
.cslot.empty .cslot-name{ color:#6b6b73; }
.cslot-clear{ flex:none; background:transparent; border:none; color:var(--muted); cursor:pointer; font-size:14px; padding:4px 7px; border-radius:6px; }
.cslot-clear:hover{ color:var(--accent); background:rgba(255,69,58,.12); }
.editor-head{ position:sticky; top:0; z-index:2; background:var(--panel); border-bottom:1px solid var(--line); padding:14px 22px; display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.editor-headline{ display:flex; align-items:center; gap:18px; min-width:0; }
.editor-title{ font-size:16px; font-weight:650; }
.editor-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.code-field{ display:flex; flex-direction:column; gap:3px; }
.code-field label{ font-size:10px; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); font-weight:700; }
.code-field input{ width:135px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-weight:700; letter-spacing:.5px; color:var(--accent); text-transform:uppercase; background:var(--field); border:1px solid #4a2b2c; border-radius:8px; padding:7px 10px; }
.code-field input::placeholder{ color:#7c5b58; }
.code-field input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,69,58,.2); }
.editor-actions{ display:flex; gap:8px; flex:none; align-items:center; }
.btn{ border:none; border-radius:9px; padding:9px 15px; font:inherit; font-weight:650; cursor:pointer; }
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-hover); }
.btn-ghost{ background:var(--panel-2); color:var(--ink); border:1px solid var(--field-line); }
.btn-ghost:hover{ border-color:#4b4b55; }
.btn-danger{ background:transparent; color:var(--accent); border:1px solid #4a2b2c; }
.btn-danger:hover{ background:rgba(255,69,58,.12); }
.icon-btn{ background:transparent; border:1px solid var(--field-line); color:var(--muted); border-radius:8px; padding:7px 11px; cursor:pointer; font-size:16px; line-height:1; }
.icon-btn:hover,.icon-btn.on{ color:var(--accent); border-color:#4a2b2c; }
.editor-body{ padding:18px 22px 46px; max-width:940px; }
.group{ margin-bottom:22px; }
.group-title,.band-title{ font-size:11px; text-transform:uppercase; letter-spacing:.7px; color:var(--muted); font-weight:700; margin:0 0 12px; }
.fields{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:14px; }
.field{ display:flex; flex-direction:column; gap:5px; }
.field.wide{ grid-column:1 / -1; }
label{ font-size:12.5px; color:var(--muted); font-weight:600; display:flex; align-items:center; gap:6px; }
label .req{ color:var(--accent); }
input,select,textarea{ font:inherit; color:var(--ink); background:var(--field); border:1px solid var(--field-line); border-radius:9px; padding:9px 11px; width:100%; }
input::placeholder,textarea::placeholder{ color:#6b6b73; }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,69,58,.20); }
/* Phase 9 – numerische Stepper (−/+ um ein Zahlenfeld; freie Eingabe bleibt möglich) */
.stepper{ display:flex; align-items:stretch; }
.stepper input{ flex:1 1 auto; width:auto; min-width:0; text-align:center; border-radius:0; border-left:0; border-right:0; }
.step-btn{ flex:0 0 34px; background:var(--field); border:1px solid var(--field-line); color:var(--muted); font-size:17px; line-height:1; cursor:pointer; -webkit-user-select:none; user-select:none; }
.step-btn:first-child{ border-radius:9px 0 0 9px; }
.step-btn:last-child{ border-radius:0 9px 9px 0; }
.step-btn:hover{ color:var(--accent); border-color:var(--accent); }
.step-btn:active{ background:var(--panel-2); }
.stepper:focus-within input{ border-color:var(--accent); }
.stepper:focus-within .step-btn{ border-color:var(--accent); }
select option{ background:#151517; color:var(--ink); }
textarea{ resize:vertical; min-height:70px; }
.help{ flex:none; width:17px; height:17px; border-radius:50%; border:1px solid var(--field-line); background:transparent; color:var(--muted); font-size:11px; font-weight:700; line-height:1; cursor:pointer; padding:0; }
.help:hover{ color:var(--accent); border-color:var(--accent); }
.help-pop{ position:fixed; z-index:50; background:#1d1d21; color:var(--ink); border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:10px; padding:11px 13px; font-size:12.5px; line-height:1.5; box-shadow:0 8px 30px rgba(0,0,0,.5); }
/* Kamera-Zugehörigkeit (Chips) */
.cam-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.cam-chip{ display:flex; align-items:center; gap:7px; border:1px solid var(--field-line); border-radius:999px; padding:6px 12px; font-size:12.5px; font-weight:600; color:var(--muted); background:var(--field); cursor:pointer; }
.cam-chip.on{ color:#fff; border-color:var(--accent); background:rgba(255,69,58,.16); }
.cam-chip.locked{ cursor:default; opacity:.9; }
.cam-chip.disabled{ opacity:.4; cursor:not-allowed; }
/* Phase 7 – Kompatibilitäts-Warnung: dezentes Amber-Zeichen mit Tooltip (blockiert nichts). */
.cam-warn{ position:relative; color:#e0a13a; cursor:help; font-size:12.5px; line-height:1; }
.cam-warn::after{ content:attr(data-tip); position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
background:var(--panel-2); color:var(--ink); border:1px solid var(--line); font-size:12px; font-weight:500; line-height:1.45;
padding:7px 10px; border-radius:8px; white-space:normal; width:max-content; max-width:230px; text-align:left;
box-shadow:0 6px 20px rgba(0,0,0,.45); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .15s; z-index:90; }
.cam-warn:hover::after, .cam-warn:focus::after{ opacity:1; visibility:visible; }
/* Bilder */
.image-band{ display:flex; gap:8px; overflow-x:auto; padding:2px 0 8px; }
.thumb{ flex:none; height:5cm; width:auto; display:block; background:#000; cursor:zoom-in; }
.add-thumb{ flex:none; height:5cm; width:110px; border:1px dashed var(--field-line); background:var(--field); color:var(--muted); cursor:pointer; font:inherit; font-weight:600; font-size:13px; display:flex; align-items:center; justify-content:center; }
.add-thumb:hover{ border-color:var(--accent); color:var(--accent); }
.ctx-menu{ position:fixed; z-index:70; background:#1d1d21; border:1px solid var(--line); border-radius:8px; padding:4px; box-shadow:0 8px 30px rgba(0,0,0,.5); }
.ctx-menu button{ display:block; width:100%; background:transparent; border:none; color:var(--ink); font:inherit; padding:8px 16px; text-align:left; cursor:pointer; border-radius:6px; white-space:nowrap; }
.ctx-menu button:hover{ background:var(--accent); color:#fff; }
.lightbox{ position:fixed; inset:0; background:rgba(0,0,0,.9); display:flex; align-items:center; justify-content:center; padding:24px; z-index:60; cursor:zoom-out; }
.lightbox img{ max-width:100%; max-height:100%; }
.modal{ position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; padding:20px; z-index:55; }
#ask-modal{ z-index:80; } /* Bestätigungs-/Hinweis-Dialog immer über anderen Fenstern */
.modal-card{ background:var(--panel); border:1px solid var(--line); border-radius:14px; width:min(600px,100%); max-height:82vh; display:flex; flex-direction:column; }
.modal-head{ padding:14px 18px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; font-weight:650; font-size:15px; }
.modal-body{ padding:14px 18px; overflow:auto; }
.modal-foot{ padding:13px 18px; border-top:1px solid var(--line); display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
/* Phase 8 – eigener Dialog */
#ask-text{ margin:0; color:var(--ink); font-size:14px; line-height:1.55; white-space:pre-line; }
.ask-actions{ display:flex; gap:8px; }
.modal-foot .left{ display:flex; gap:10px; flex-wrap:wrap; }
.diff-head,.diff{ display:grid; grid-template-columns:1.1fr 1fr 16px 1fr; gap:10px; align-items:baseline; font-size:13px; padding:8px 0; border-bottom:1px solid var(--line); }
.diff-head{ color:var(--muted); font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; }
.diff-k{ color:var(--ink); font-weight:600; } .diff-old{ color:var(--muted); text-decoration:line-through; word-break:break-word; }
.diff-arrow{ color:var(--accent); text-align:center; } .diff-new{ color:var(--ink); font-weight:600; word-break:break-word; }
.modal-empty{ color:var(--muted); text-align:center; padding:26px 10px; }
/* Kamera-Verwaltung */
.cam-add{ display:flex; gap:8px; margin-top:6px; flex-wrap:wrap; align-items:center; }
.cam-add input[type=text]{ flex:1; min-width:140px; } .cam-add select{ width:auto; }
.cam-edit-top{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.cam-edit-top .control{ flex:1; }
.cam-edit-form .field{ margin-bottom:12px; }
.cam-edit-form label{ margin-bottom:4px; }
.cam-edit-form textarea{ min-height:58px; font-size:12.5px; }
.cam-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:560px){ .cam-grid2{ grid-template-columns:1fr; } }
.feature-row{ display:flex; gap:18px; flex-wrap:wrap; margin:2px 0 6px; }
.feature-row label{ display:flex; align-items:center; gap:7px; color:var(--ink); font-weight:500; cursor:pointer; }
.feature-row input{ width:auto; }
.cparam-row{ display:flex; gap:8px; align-items:center; margin-bottom:6px; }
.cparam-row .tag{ flex:1; font-size:12.5px; }
.cparam-row .tag b{ color:var(--ink); } .cparam-row .tag span{ color:var(--muted); }
.toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(18px); background:#1d1d21; color:#fff; border:1px solid var(--line); border-left:3px solid var(--accent); padding:11px 18px; border-radius:10px; font-size:14px; font-weight:600; opacity:0; pointer-events:none; transition:.24s; z-index:65; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
/* Klickbare Aktion im Toast (z. B. „Undo" nach dem Löschen). */
.toast-action{ background:none; border:0; color:var(--accent); font:inherit; font-weight:700; cursor:pointer; padding:0; margin-left:8px; pointer-events:auto; }
.toast-action:hover{ text-decoration:underline; }
/* Export / Import (Rezepte teilen) */
.io-row{ display:flex; gap:9px; }
.io-btn{ flex:1; background:var(--field); border:1px solid var(--field-line); color:var(--muted); border-radius:9px; padding:8px 10px; font:inherit; font-weight:600; font-size:13px; cursor:pointer; }
.io-btn:hover{ color:var(--accent); border-color:var(--accent); }
/* Phase 6 – Mehrfachauswahl */
.count-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.linkbtn{ flex:none; background:none; border:0; color:var(--accent); font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; padding:2px 0; }
.linkbtn:hover{ text-decoration:underline; }
.item-cb{ flex:none; width:17px; height:17px; border:1.6px solid var(--field-line); border-radius:5px; display:flex; align-items:center; justify-content:center; font-size:11px; line-height:1; color:transparent; }
.item.checked .item-cb{ background:var(--accent); border-color:var(--accent); color:#fff; }
.item.sel{ cursor:pointer; }
.item.hl{ box-shadow: inset 0 0 0 2px var(--accent); } /* Phase 8: Tastatur-Highlight (↑/↓) */
.bulkbar{ flex:none; border-top:1px solid var(--line); background:var(--panel); padding:10px 12px; display:flex; flex-direction:column; gap:8px; }
.bulkbar-count{ font-size:12px; color:var(--muted); font-weight:600; }
.bulkbar-actions{ display:flex; flex-wrap:wrap; gap:6px; }
.bulk-act{ background:var(--field); color:var(--ink); border:1px solid var(--field-line); border-radius:8px; padding:6px 10px; font:inherit; font-size:12.5px; cursor:pointer; }
.bulk-act:hover:not(:disabled){ border-color:var(--muted); }
.bulk-act.danger{ color:var(--accent); }
.bulk-act:disabled{ opacity:.45; cursor:default; }
.export-intro{ color:var(--muted); font-size:13px; margin-bottom:14px; line-height:1.55; }
.export-intro b{ color:var(--ink); font-weight:650; }
.export-tools{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.export-selall{ display:flex; align-items:center; gap:8px; color:var(--ink); font-weight:600; font-size:13px; cursor:pointer; }
.export-selall input{ width:auto; }
.export-list{ max-height:44vh; overflow:auto; border:1px solid var(--line); border-radius:10px; }
.export-item{ display:flex; align-items:center; gap:10px; padding:9px 12px; border-bottom:1px solid var(--line); cursor:pointer; }
.export-item:last-child{ border-bottom:none; }
.export-item:hover{ background:var(--panel-2); }
.export-item input{ width:auto; flex:none; }
.export-item .ei-nm{ font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.export-item .ei-fs{ color:var(--muted); font-size:12.5px; margin-left:auto; white-space:nowrap; flex:none; padding-left:10px; }
.export-images{ display:flex; align-items:center; gap:9px; color:var(--ink); font-weight:500; font-size:13.5px; cursor:pointer; margin-top:14px; }
.export-images input{ width:auto; }
.export-hint{ color:var(--muted); font-weight:400; font-size:12px; }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
/* Import-Modal (Datei oder Screenshot per KI) */
.import-seg{ margin-bottom:16px; }
.import-help{ color:var(--muted); font-size:13px; line-height:1.55; margin:0 0 14px; }
.import-help b{ color:var(--ink); font-weight:650; }
.import-step{ display:flex; gap:12px; margin-bottom:16px; }
.import-step .step-n{ flex:none; width:24px; height:24px; border-radius:50%; background:rgba(255,69,58,.16); color:var(--accent); font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center; }
.import-step .step-body{ flex:1; min-width:0; font-size:13.5px; line-height:1.5; }
.import-step .step-body b{ color:var(--ink); }
#ai-prompt{ width:100%; min-height:168px; margin:8px 0; font-family:ui-monospace,Menlo,monospace; font-size:12px; line-height:1.5; color:var(--muted); resize:vertical; }
#ai-answer{ width:100%; min-height:92px; margin:8px 0; font-family:ui-monospace,Menlo,monospace; font-size:12px; resize:vertical; }
/* Dezenter Voll-Backup/Restore-Abschnitt (unten im Import-Modal). */
.import-backup{ margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.import-backup-row{ display:flex; align-items:center; gap:14px; justify-content:space-between; }
.import-backup-row + .import-backup-row{ margin-top:12px; }
.import-backup-row .bk-text{ min-width:0; }
.import-backup-row .bk-text b{ display:block; color:var(--ink); font-size:13.5px; font-weight:650; }
.import-backup-row .bk-text span{ color:var(--muted); font-size:12px; line-height:1.45; }
.import-backup-row .btn{ flex:none; }
#restore-pick{ color:var(--accent); }
@media (max-width:820px){
body{ height:auto; overflow:auto; }
.layout{ display:block; } /* natürlicher Fluss statt fester Grid-Höhe */
.editor-wrap{ overflow:visible; } /* mit der Seite scrollen, nicht intern */
.editor-empty{ min-height:0; }
.sidebar{ border-right:none; border-bottom:1px solid var(--line); }
.recipe-list{ max-height:44vh; }
/* Phase 9 – Mobil-Politur: kompaktere Ränder, sauberer Umbruch, größere Touch-Flächen */
.app-header{ padding:12px 16px; gap:10px; }
.app-header h1{ font-size:18px; }
.cam-picker{ margin-left:0; }
.editor-head{ padding:12px 16px; }
.editor-body{ padding:16px 16px 40px; }
.editor-headline{ gap:12px 18px; width:100%; flex-wrap:wrap; }
.editor-actions{ flex-wrap:wrap; width:100%; } /* volle Zeile -> Knöpfe brechen sauber um */
.editor-actions .btn{ flex:1 1 auto; justify-content:center; } /* Knöpfe teilen sich die Breite */
.image-band{ overscroll-behavior-x:contain; } /* horizontales Scrollen zieht die Seite nicht mit */
.btn, .io-btn, .icon-btn, .bulk-act, .step-btn, .cam-chip{ min-height:42px; } /* bequemer per Finger */
.step-btn{ flex-basis:44px; }
.cslot{ padding:14px; }
/* Master-Detail: ist ein Rezept gewählt, nur dieses (als Zurück-Anker) + den Editor zeigen */
body.detail .sidebar-top{ display:none; }
body.detail .sidebar{ border-bottom:none; }
body.detail .recipe-list .item:not(.active){ display:none; }
body.detail .recipe-list{ max-height:none; padding:8px 8px 0; }
body.detail .recipe-list .item.active{ border:1px solid var(--line); }
body.detail .recipe-list .item.active .nm::before{ content:"‹ "; color:var(--accent); font-weight:700; }
}
/* Phase 10 – Druck: Bildschirm-Teile (Ausgabebereich versteckt, Dialog-Thumbnails) */
#print-root{ display:none; }
.oncam-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 4px; }
.oncam-head .empty-title{ margin:0; }
.print-thumbs{ display:flex; flex-wrap:wrap; gap:10px; }
.print-thumb{ width:84px; height:84px; border-radius:10px; overflow:hidden; border:2px solid var(--field-line); cursor:pointer; background:var(--field); flex:none; padding:0; }
.print-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.print-thumb.sel{ border-color:var(--accent); }
.print-thumb.none{ display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:11px; text-align:center; line-height:1.3; }
/* Batch 2b – Druck: A5-Rezeptkarte (Hell/Dunkel) + A4-Spickzettel.
Die Karte ist exakt 559×794px = A5 bei 96dpi und füllt die Seite (@page margin:0).
Dieselben Styles rendern die Live-Vorschau im Dialog UND den Ausdruck.
Schriften: System-Stacks (App ist 100 % offline – kein Google-Fonts-Import). */
:root{
--pc-sans:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Arial,sans-serif;
--pc-mono:ui-monospace,'SF Mono','SFMono-Regular',Menlo,Consolas,'Liberation Mono',monospace;
}
.print-card{
width:100%; height:100%; box-sizing:border-box;
--u:0.178891cqw; /* 1 Referenz-px (Karte 559px breit) als Anteil der Seitenbreite */
padding:calc(40*var(--u)) calc(42*var(--u)) calc(34*var(--u));
display:flex; flex-direction:column; gap:calc(21*var(--u)); overflow:hidden;
font-family:var(--pc-sans); background:var(--c-bg); color:var(--c-v);
}
/* Farb-Themes der Karte – nur die Variablen wechseln, die Element-Regeln bleiben gleich. */
.print-card.dark{ --c-bg:#0d0d0f; --c-name:#fff; --c-sub:#9b98a0; --c-code:#cbc8ce; --c-accent:#ff453a; --c-gt:#77747c; --c-line:#26262b; --c-k:#b4b1b8; --c-v:#fff; --c-notes:#cbc8ce; --c-foot:#5c5960; }
.print-card.light{ --c-bg:#fff; --c-name:#111214; --c-sub:#6f6b68; --c-code:#45423f; --c-accent:#d8342b; --c-gt:#9c968f; --c-line:#e7e2dd; --c-k:#56524e; --c-v:#111; --c-notes:#45423f; --c-foot:#b0aaa4; }
.pc-head{ display:flex; flex-direction:column; gap:calc(8*var(--u)); }
.pc-name{ font-weight:800; font-size:calc(33*var(--u)); line-height:1.04; letter-spacing:-.022em; color:var(--c-name); word-break:break-word; }
.pc-sub{ font-size:calc(13*var(--u)); color:var(--c-sub); letter-spacing:.02em; }
.pc-code{ font-family:var(--pc-mono); color:var(--c-code); }
.pc-rule{ width:calc(46*var(--u)); height:calc(3*var(--u)); background:var(--c-accent); border-radius:calc(2*var(--u)); margin-top:calc(6*var(--u)); }
.pc-photo{ width:100%; height:calc(196*var(--u)); border-radius:calc(11*var(--u)); overflow:hidden; position:relative; flex:none; background:var(--c-line); }
.pc-photo-img{ width:100%; height:100%; object-fit:cover; display:block; user-select:none; -webkit-user-drag:none; }
.pc-groups{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(19*var(--u)) calc(28*var(--u)); flex-grow:1; align-content:start; }
.pc-group{ display:flex; flex-direction:column; gap:calc(7*var(--u)); }
.pc-group-title{ font-size:calc(9*var(--u)); text-transform:uppercase; letter-spacing:.14em; color:var(--c-gt); font-weight:600; padding-bottom:calc(6*var(--u)); border-bottom:1px solid var(--c-line); }
.pc-rows{ display:flex; flex-direction:column; gap:calc(6*var(--u)); font-size:calc(12.5*var(--u)); }
.pc-row{ display:flex; justify-content:space-between; gap:calc(12*var(--u)); }
.pc-row .k{ color:var(--c-k); }
.pc-row .v{ font-family:var(--pc-mono); color:var(--c-v); text-align:right; }
.pc-notes{ border-top:1px solid var(--c-line); padding-top:calc(13*var(--u)); }
.pc-notes .lbl{ display:block; font-size:calc(9*var(--u)); text-transform:uppercase; letter-spacing:.14em; color:var(--c-gt); font-weight:600; margin-bottom:calc(6*var(--u)); }
.pc-notes .txt{ font-size:calc(12*var(--u)); color:var(--c-notes); line-height:1.5; }
.pc-foot{ display:flex; justify-content:space-between; align-items:center; font-family:var(--pc-mono); font-size:calc(9.5*var(--u)); letter-spacing:.04em; color:var(--c-foot); }
/* Kamera-Spickzettel – A4 (794×1123px @96dpi), zentrierte Spalte, druckfreundlich hell */
/* Höhe = Inhalt (kein erzwungenes A4), sonst läuft der Zettel auf eine 2. Seite über. */
.print-sheet{ width:794px; box-sizing:border-box; padding:40px 58px 30px; background:#fff; color:#1a1a1c; font-family:var(--pc-sans); --c-accent:#d8342b; --c-line:#e7e2dd; }
.ps-inner{ max-width:640px; margin:0 auto; }
.ps-head{ font-weight:800; font-size:26px; letter-spacing:-.02em; color:#111214; }
.ps-rule{ width:42px; height:3px; background:var(--c-accent); border-radius:2px; margin:8px 0 9px; }
.ps-sub{ font-size:11.5px; color:#6f6b68; letter-spacing:.02em; margin-bottom:14px; }
.ps-slot{ display:flex; gap:14px; padding:11px 0; border-top:1px solid var(--c-line); break-inside:avoid; }
.ps-cn{ flex:none; width:38px; height:38px; border-radius:9px; background:#faf3f2; color:var(--c-accent); font-family:var(--pc-mono); font-weight:500; font-size:14px; display:flex; align-items:center; justify-content:center; }
.ps-body{ flex:1; min-width:0; }
.ps-nm{ font-size:14px; font-weight:600; color:#1a1a1c; }
.ps-meta{ font-size:11px; color:#6f6b68; margin-top:1px; }
.ps-meta .code{ font-family:var(--pc-mono); color:#45423f; }
.ps-settings{ font-size:10.5px; color:#56524e; line-height:1.55; margin-top:5px; }
.ps-settings .v{ font-family:var(--pc-mono); color:#1a1a1c; }
.ps-empty{ color:#b0aaa4; font-style:italic; font-size:11.5px; padding-top:8px; }
.ps-foot{ display:flex; justify-content:space-between; font-family:var(--pc-mono); font-size:9px; letter-spacing:.04em; color:#b0aaa4; margin-top:16px; border-top:1px solid var(--c-line); padding-top:10px; }
/* Druck-Dialog: Live-Vorschau (herunterskaliert) + Foto-Positionierung (Ziehen/Zoom) */
.print-modal-grid{ display:flex; gap:22px; align-items:flex-start; }
.print-controls{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; gap:16px; }
.print-preview-col{ flex:none; }
.print-preview{ overflow:hidden; border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,.45); }
#print-preview-scaler{ width:559px; height:794px; container-type:size; transform-origin:top left; }
#print-preview-scaler .pc-photo{ cursor:grab; touch-action:none; }
#print-preview-scaler .pc-photo.grabbing{ cursor:grabbing; }
.pf-field{ display:flex; flex-direction:column; gap:8px; }
.pf-label{ font-size:12px; color:var(--muted); font-weight:600; }
.pf-hint-inline{ color:var(--muted); font-weight:400; }
.pf-range{ width:100%; accent-color:var(--accent); }
@media(max-width:660px){ .print-modal-grid{ flex-direction:column-reverse; } .print-preview-col{ align-self:center; } }
@media print {
body > *:not(#print-root){ display:none !important; }
#print-root{ display:block !important; }
html, body{ margin:0; background:#fff; overflow:visible; }
*{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
/* Rezeptkarte: füllt exakt EINE Seite über die height:100%-Kette (adaptiv A4/A5,
zuverlässiger als position:fixed). #print-root wird zum Größen-Container für cqw. */
html:has(#print-root.mode-card), body:has(#print-root.mode-card){ height:100%; }
#print-root.mode-card{ width:100%; height:100%; overflow:hidden; container-type:size; }
#print-root.mode-card .print-card{ width:100%; height:100%; }
/* Ganze Seite in Kartenfarbe -> kein weißer Streifen/Rand, auch am Rand nicht. */
body:has(#print-root.mode-card.theme-dark){ background:#0d0d0f; }
#print-root .print-card, #print-root .print-sheet{ box-shadow:none; }
}
</style>
<header class="app-header">
<!-- Logo: Mount-Fuji-Kachel (dein Logo, ICON.png) – transparente Ecken auf schwarzem Header -->
<img class="app-mark" src="/ICON.png" alt="FujiRecipeVault logo">
<h1>FujiRecipeVault</h1>
<div class="cam-picker">
<select id="camera-select" class="cam-select"></select>
<button type="button" id="btn-cameras" class="icon-btn" title="Manage cameras">⚙</button>
<button type="button" id="btn-backup" class="icon-btn" title="Back up or restore your whole library">⤓</button>
</div>
<button type="button" id="btn-quit" class="btn-quit" title="Shut down server">⏻ Quit</button>
</header>
<main class="layout">
<aside class="sidebar">
<div class="sidebar-top">
<button id="btn-new" class="btn-new">+ New recipe</button>
<input id="search" class="control" type="search" placeholder="Search (name, code, creator …)">
<select id="filter-sim" class="control"><option value="">All film simulations</option></select>
<div class="seg" id="filter-cbw">
<button type="button" data-v="" class="on">All</button>
<button type="button" data-v="color">Color</button>
<button type="button" data-v="bw">B&W</button>
</div>
<div class="row">
<select id="sort" class="control">
<option value="new">Newest first</option>
<option value="old">Oldest first</option>
<option value="name">Name A–Z</option>
<option value="name_desc">Name Z–A</option>
<option value="fav">Favorites first</option>
<option value="rating">Rating</option>
<option value="sim">Film simulation</option>
</select>
<button id="filter-fav" class="toggle" title="Favorites only">♥</button>
</div>
<div id="tag-filter" hidden></div>
<div class="count-row">
<div id="count" class="count"></div>
<button type="button" id="btn-select" class="linkbtn" hidden>Select</button>
</div>
<div class="io-row">
<button type="button" id="btn-export" class="io-btn" title="Export recipes to a file you can share">↑ Export</button>
<button type="button" id="btn-import" class="io-btn" title="Import recipes from a shared file">↓ Import</button>
</div>
</div>
<div id="recipe-list" class="recipe-list"></div>
<div id="bulkbar" class="bulkbar" hidden>
<div class="bulkbar-count"><span id="bulk-n">0</span> selected</div>
<div class="bulkbar-actions">
<button type="button" id="bulk-export" class="bulk-act">Export</button>
<select id="bulk-assign" class="bulk-act" title="Assign the selected recipes to a camera"><option value="">Assign camera…</option></select>
<button type="button" id="bulk-tag" class="bulk-act">Tag…</button>
<button type="button" id="bulk-delete" class="bulk-act danger">Delete</button>
</div>
</div>
</aside>
<section class="editor-wrap">
<div id="editor-empty" class="editor-empty">
<div class="empty-inner">
<div class="oncam-head">
<h2 id="empty-title" class="empty-title">On the camera</h2>
<button type="button" id="btn-print-sheet" class="btn btn-ghost" title="Print a camera cheat sheet" hidden>⎙ Print</button>
</div>
<div id="camera-slots" class="camera-slots"></div>
</div>
</div>
<form id="editor" hidden>
<div class="editor-head">
<div class="editor-headline">
<div>
<div id="editor-title" class="editor-title">New recipe</div>
<div id="editor-sub" class="editor-sub"></div>
</div>
<div class="code-field">
<label for="short_code">Short code <button type="button" class="help" data-key="short_code">?</button></label>
<input id="short_code" name="short_code" type="text" maxlength="14" placeholder="e.g. KG+4-5" autocomplete="off">
</div>
</div>
<div class="editor-actions">
<div id="editor-stars" class="editor-stars" title="Rating"></div>
<button type="button" id="btn-heart" class="icon-btn" title="Mark as favorite" hidden>♡</button>
<button type="button" id="btn-changes" class="btn btn-ghost" title="Changes vs. the original" hidden>Changes</button>
<button type="button" id="btn-dup" class="btn btn-ghost" title="Duplicate this recipe" hidden>⧉ Duplicate</button>
<button type="button" id="btn-print-card" class="btn btn-ghost" title="Print this recipe (A5 card)" hidden>⎙ Print</button>
<button type="button" id="btn-delete" class="btn btn-danger">Delete</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
<div class="editor-body">
<div id="image-section" class="group">
<p class="band-title">Sample photos</p>
<div id="image-band" class="image-band"></div>
<input id="image-input" type="file" accept="image/*" multiple hidden>
</div>
<div class="group">
<p class="group-title">Basics</p>
<div class="fields">
<div class="field wide">
<label for="name">Name <span class="req">*</span> <button type="button" class="help" data-key="name">?</button></label>
<input id="name" name="name" type="text" placeholder="e.g. Kodak Portra Warm">
</div>
<div class="field wide">
<label for="film_simulation">Film simulation <button type="button" class="help" data-key="film_simulation">?</button></label>
<select id="film_simulation" name="film_simulation"></select>
</div>
<div class="field">
<label for="dynamic_range">Dynamic range <button type="button" class="help" data-key="dynamic_range">?</button></label>
<select id="dynamic_range" name="dynamic_range"><option value="">–</option><option>AUTO</option><option>DR100</option><option>DR200</option><option>DR400</option></select>
</div>
<div class="field">
<label for="d_range_priority">D-Range priority <button type="button" class="help" data-key="d_range_priority">?</button></label>
<select id="d_range_priority" name="d_range_priority"><option value="">–</option><option>OFF</option><option>WEAK</option><option>STRONG</option><option>AUTO</option></select>
</div>
<div class="field">
<label for="editor-slot">Slot on this camera <button type="button" class="help" data-key="camera_slot">?</button></label>
<select id="editor-slot"></select>
</div>
</div>
</div>
<div class="group">
<p class="group-title">Tone & color</p>
<div class="fields">
<div class="field"><label for="highlight_tone">Highlight <button type="button" class="help" data-key="highlight_tone">?</button></label><input id="highlight_tone" name="highlight_tone" type="text" placeholder="0"></div>
<div class="field"><label for="shadow_tone">Shadow <button type="button" class="help" data-key="shadow_tone">?</button></label><input id="shadow_tone" name="shadow_tone" type="text" placeholder="0"></div>
<div class="field"><label for="color">Color <button type="button" class="help" data-key="color">?</button></label><input id="color" name="color" type="text" placeholder="0"></div>
<div class="field"><label for="sharpness">Sharpness <button type="button" class="help" data-key="sharpness">?</button></label><input id="sharpness" name="sharpness" type="text" placeholder="0"></div>
<div class="field"><label for="noise_reduction">Noise reduction <button type="button" class="help" data-key="noise_reduction">?</button></label><input id="noise_reduction" name="noise_reduction" type="text" placeholder="0"></div>
<div class="field" id="field-clarity"><label for="clarity">Clarity <button type="button" class="help" data-key="clarity">?</button></label><input id="clarity" name="clarity" type="text" placeholder="0"></div>
</div>
</div>
<div class="group">
<p class="group-title">Effects</p>
<div class="fields">
<div class="field"><label for="grain_effect">Grain effect <button type="button" class="help" data-key="grain_effect">?</button></label><select id="grain_effect" name="grain_effect"><option value="">–</option><option>OFF</option><option>WEAK</option><option>STRONG</option></select></div>
<div class="field" id="field-grainsize"><label for="grain_size">Grain size <button type="button" class="help" data-key="grain_size">?</button></label><select id="grain_size" name="grain_size"><option value="">–</option><option>SMALL</option><option>LARGE</option></select></div>
<div class="field"><label for="color_chrome_effect">Color Chrome Effect <button type="button" class="help" data-key="color_chrome_effect">?</button></label><select id="color_chrome_effect" name="color_chrome_effect"><option value="">–</option><option>OFF</option><option>WEAK</option><option>STRONG</option></select></div>
<div class="field" id="field-ccfxblue"><label for="color_chrome_effect_blue">Color Chrome FX Blue <button type="button" class="help" data-key="color_chrome_effect_blue">?</button></label><select id="color_chrome_effect_blue" name="color_chrome_effect_blue"><option value="">–</option><option>OFF</option><option>WEAK</option><option>STRONG</option></select></div>
<div class="field"><label for="bw_adj_warm_cool">B&W warm–cool <button type="button" class="help" data-key="bw_adj_warm_cool">?</button></label><input id="bw_adj_warm_cool" name="bw_adj_warm_cool" type="text" placeholder="0"></div>
</div>
</div>
<div class="group">
<p class="group-title">White balance</p>
<div class="fields">
<div class="field wide">
<label for="white_balance">White balance <button type="button" class="help" data-key="white_balance">?</button></label>
<input id="white_balance" name="white_balance" type="text" list="wb-list" placeholder="e.g. AUTO, DAYLIGHT / FINE, COLOR TEMPERATURE (Kelvin) …">
<datalist id="wb-list"><option>AUTO</option><option>DAYLIGHT / FINE</option><option>SHADE</option><option>FLUORESCENT 1</option><option>FLUORESCENT 2</option><option>FLUORESCENT 3</option><option>INCANDESCENT</option><option>UNDERWATER</option><option>COLOR TEMPERATURE (Kelvin)</option><option>CUSTOM 1</option><option>CUSTOM 2</option><option>CUSTOM 3</option></datalist>
</div>
<div class="field"><label for="wb_kelvin">Color temperature (Kelvin) <button type="button" class="help" data-key="wb_kelvin">?</button></label><input id="wb_kelvin" name="wb_kelvin" type="text" placeholder="e.g. 5500"></div>
<div class="field"><label for="wb_shift_red">WB shift red <button type="button" class="help" data-key="wb_shift_red">?</button></label><input id="wb_shift_red" name="wb_shift_red" type="text" placeholder="0"></div>
<div class="field"><label for="wb_shift_blue">WB shift blue <button type="button" class="help" data-key="wb_shift_blue">?</button></label><input id="wb_shift_blue" name="wb_shift_blue" type="text" placeholder="0"></div>
</div>
</div>
<div class="group">
<p class="group-title">Exposure & extras</p>
<div class="fields">
<div class="field"><label for="iso">ISO (recommended) <button type="button" class="help" data-key="iso">?</button></label><input id="iso" name="iso" type="text" placeholder="e.g. Auto (max 6400)"></div>
<div class="field"><label for="exposure_compensation">Exposure compensation <button type="button" class="help" data-key="exposure_compensation">?</button></label><input id="exposure_compensation" name="exposure_compensation" type="text" placeholder="e.g. +1/3 to +1"></div>
<div class="field"><label for="creator">Creator <button type="button" class="help" data-key="creator">?</button></label><input id="creator" name="creator" type="text" placeholder="optional – source / author"></div>
<div class="field wide"><label for="notes">Notes <button type="button" class="help" data-key="notes">?</button></label><textarea id="notes" name="notes" placeholder="Your own notes …"></textarea></div>
<div class="field wide">
<label for="tag-input">Tags</label>
<div id="tag-chips" class="tag-chips"></div>
<input id="tag-input" class="tag-input" type="text" placeholder="Add a tag, then Enter or comma" autocomplete="off">
</div>
</div>
</div>
<div class="group" id="custom-group" hidden>
<p class="group-title">More parameters</p>
<div id="custom-params" class="fields"></div>
</div>
<div class="group">
<p class="group-title">Which cameras? <button type="button" class="help" data-key="cameras">?</button></p>
<div id="cam-memberships" class="cam-chips"></div>
</div>
</div>
</form>
</section>
</main>
<div id="modal" class="modal" hidden>
<div class="modal-card">
<div class="modal-head"><span>Changes vs. the original</span><button type="button" id="modal-close" class="icon-btn">✕</button></div>
<div id="modal-body" class="modal-body"></div>
<div class="modal-foot">
<div class="left">
<button type="button" id="btn-reset" class="btn btn-ghost">Reset to original</button>
<button type="button" id="btn-set-original" class="btn btn-ghost">Set current as new original</button>
</div>
<button type="button" id="modal-ok" class="btn btn-primary">Close</button>
</div>
</div>
</div>
<!-- Phase 8: eigener Bestätigungs-/Hinweis-Dialog im App-Stil (ersetzt native confirm/alert). -->
<div id="ask-modal" class="modal" hidden>
<div class="modal-card" style="width:min(420px,100%)">
<div class="modal-head"><span id="ask-title">Please confirm</span></div>
<div class="modal-body"><p id="ask-text"></p></div>
<div class="modal-foot"><span></span>
<span class="ask-actions">
<button type="button" id="ask-cancel" class="btn btn-ghost">Cancel</button>
<button type="button" id="ask-ok" class="btn btn-primary">OK</button>
</span>
</div>
</div>
</div>
<div id="cam-modal" class="modal" hidden>
<div class="modal-card" style="width:min(760px,100%)">
<div class="modal-head"><span>Manage cameras</span><button type="button" id="cam-modal-close" class="icon-btn">✕</button></div>
<div class="modal-body">
<div class="cam-edit-top">
<select id="cam-edit-select" class="control"></select>
<button type="button" id="cam-del-btn" class="btn btn-danger">Delete</button>
</div>
<div id="cam-edit-form" class="cam-edit-form"></div>
<hr style="border:none;border-top:1px solid var(--line);margin:20px 0 14px">
<p class="group-title">Add a new camera</p>
<div class="cam-add">
<input id="cam-new-name" type="text" placeholder="Name (e.g. My X-T4)">
<select id="cam-new-preset"></select>
<input id="cam-new-slots" type="number" min="1" max="14" value="7" title="Number of custom slots" style="width:80px">
<button type="button" id="cam-add-btn" class="btn btn-primary">Add</button>
</div>
</div>
<div class="modal-foot"><span></span><button type="button" id="cam-modal-ok" class="btn btn-primary">Done</button></div>
</div>
</div>
<div id="export-modal" class="modal" hidden>
<div class="modal-card">
<div class="modal-head"><span>Export recipes</span><button type="button" id="export-close" class="icon-btn">✕</button></div>
<div class="modal-body">
<div id="export-intro" class="export-intro"></div>
<div class="export-tools">
<label class="export-selall"><input type="checkbox" id="export-selall"> Select all</label>
<span id="export-count" class="count"></span>
</div>
<div id="export-list" class="export-list"></div>
<label class="export-images"><input type="checkbox" id="export-with-images" checked> Include sample photos <span class="export-hint">(bigger file)</span></label>
</div>
<div class="modal-foot">
<span></span>
<div class="left">
<button type="button" id="export-cancel" class="btn btn-ghost">Cancel</button>
<button type="button" id="export-do" class="btn btn-primary">Export</button>
</div>
</div>
</div>
</div>
<div id="import-modal" class="modal" hidden>
<div class="modal-card">
<div class="modal-head"><span>Import recipes</span><button type="button" id="import-close" class="icon-btn">✕</button></div>
<div class="modal-body">
<div class="seg import-seg" id="import-seg">
<button type="button" data-mode="file" class="on">From a file</button>
<button type="button" data-mode="photo">From a photo</button>
<button type="button" data-mode="ai">From a screenshot</button>
</div>
<div id="import-file" class="import-pane">
<p class="import-help">Choose a <b>.zip</b> file that was exported from FujiRecipeVault. Its recipes are added to <b class="import-cam"></b> — nothing is overwritten.</p>
<button type="button" id="import-pick" class="btn btn-primary">Choose file…</button>
</div>
<div id="import-photo" class="import-pane" hidden>
<p class="import-help">Choose an <b>unedited JPEG straight from your Fujifilm camera</b> — its film-simulation settings are read from the photo and a new recipe is created on <b class="import-cam"></b>. Edited or exported photos usually no longer carry these details.</p>
<button type="button" id="import-photo-pick" class="btn btn-primary">Choose photo…</button>
</div>
<div id="import-ai" class="import-pane" hidden>
<p class="import-help">No export file? Turn a <b>screenshot</b> of a recipe into a library entry with any AI assistant (Gemini, ChatGPT, Claude …). The new recipe is added to <b class="import-cam"></b>.</p>
<div class="import-step"><span class="step-n">1</span><div class="step-body">Copy this prompt.
<textarea id="ai-prompt" readonly></textarea>
<button type="button" id="ai-copy" class="btn btn-ghost">⧉ Copy prompt</button>
</div></div>
<div class="import-step"><span class="step-n">2</span><div class="step-body">Paste it <b>together with your screenshot</b> into the assistant and send.</div></div>
<div class="import-step"><span class="step-n">3</span><div class="step-body">Paste the assistant's answer here:
<textarea id="ai-answer" placeholder="Paste the assistant's JSON answer here …"></textarea>
<button type="button" id="ai-add" class="btn btn-primary">Add to library</button>
</div></div>
</div>
</div>
<div class="modal-foot"><span></span><button type="button" id="import-done" class="btn btn-ghost">Close</button></div>
</div>
</div>
<input id="import-input" type="file" accept=".zip,application/zip" hidden>
<input id="import-photo-input" type="file" accept="image/*" hidden>
<input id="restore-input" type="file" accept=".frvbackup,.zip,application/zip" hidden>
<!-- Batch 2: eigenes Backup-&-Restore-Fenster (aus dem Import herausgelöst) -->
<div id="backup-modal" class="modal" hidden>
<div class="modal-card" style="width:min(470px,100%)">
<div class="modal-head"><span>Backup & restore</span><button type="button" id="backup-close" class="icon-btn">✕</button></div>
<div class="modal-body">
<div class="import-backup-row">
<div class="bk-text"><b>Full backup</b><span>Save your whole library — recipes, cameras and photos — as one file.</span></div>
<button type="button" id="backup-download" class="btn btn-primary">↓ Download</button>
</div>
<div class="import-backup-row" style="margin-top:16px">
<div class="bk-text"><b>Restore everything</b><span>Replace the whole library from a backup file. A safety copy is saved first.</span></div>
<button type="button" id="restore-pick" class="btn btn-ghost">↺ Restore…</button>
</div>
</div>
<div class="modal-foot"><span></span><button type="button" id="backup-done" class="btn btn-ghost">Close</button></div>
</div>
</div>
<div id="lightbox" class="lightbox" hidden><img id="lightbox-img" src="" alt="Sample photo"></div>
<div id="img-menu" class="ctx-menu" hidden><button type="button" id="img-menu-remove">Remove image</button></div>
<div id="help-pop" class="help-pop" hidden></div>
<!-- Phase 10: Druck. Seitengröße wird per JS auf A5 (Karte) bzw. A4 (Spickzettel) gesetzt. -->
<style id="page-size">@page { size: A5; margin: 12mm; }</style>
<div id="print-root"></div>
<!-- Druckdialog: Theme-Wahl, Fotoauswahl, Foto-Positionierung + Live-Vorschau -->
<div id="print-modal" class="modal" hidden>
<div class="modal-card" style="width:min(760px,100%)">
<div class="modal-head"><span>Print recipe card</span><button type="button" id="print-close" class="icon-btn">✕</button></div>
<div class="modal-body">
<div class="print-modal-grid">
<div class="print-controls">
<div class="pf-field">
<label class="pf-label">Theme</label>
<div class="seg" id="print-theme">
<button type="button" data-v="dark" class="on">Dark</button>
<button type="button" data-v="light">Light</button>
</div>
</div>
<div class="pf-field" id="print-photo-field">
<label class="pf-label">Photo</label>
<div id="print-thumbs" class="print-thumbs"></div>
</div>
<div class="pf-field" id="print-zoom-field">
<label class="pf-label">Zoom <span id="print-zoom-val" class="pf-hint-inline">100%</span></label>
<input type="range" id="print-zoom" class="pf-range" min="100" max="300" step="5" value="100">
<p class="import-help" id="print-pos-hint" style="margin:0">Drag the photo in the preview to reposition it.</p>
<button type="button" id="print-reset" class="linkbtn" style="align-self:flex-start">Reset photo</button>
</div>
</div>
<div class="print-preview-col">
<div id="print-preview" class="print-preview"><div id="print-preview-scaler"></div></div>
</div>
</div>
</div>
<div class="modal-foot"><span class="import-help" style="margin:0">Fills the page · print or save as PDF</span>
<button type="button" id="print-go" class="btn btn-primary">⎙ Print / Save as PDF</button>
</div>
</div>
</div>
<div id="toast" class="toast"></div>
<script>
const $ = id => document.getElementById(id);
const listEl=$('recipe-list'), countEl=$('count'), searchEl=$('search'), simEl=$('filter-sim'),
cbwEl=$('filter-cbw'), sortEl=$('sort'), favEl=$('filter-fav'), form=$('editor'),
emptyEl=$('editor-empty'), titleEl=$('editor-title'), subEl=$('editor-sub'),
heartBtn=$('btn-heart'), btnChng=$('btn-changes'), btnDel=$('btn-delete'), btnNew=$('btn-new'), btnDup=$('btn-dup'),
starsEl=$('editor-stars'), tagChipsEl=$('tag-chips'), tagInputEl=$('tag-input'), tagFilterEl=$('tag-filter'),
btnSelect=$('btn-select'), bulkbar=$('bulkbar'), bulkN=$('bulk-n'), bulkAssign=$('bulk-assign'),
modal=$('modal'), modalBody=$('modal-body'), imageSection=$('image-section'), imageBand=$('image-band'),
imageInput=$('image-input'), lightbox=$('lightbox'), lightboxImg=$('lightbox-img'), imgMenu=$('img-menu'),
helpPop=$('help-pop'), toast=$('toast'), camSelect=$('camera-select'), cameraSlotsEl=$('camera-slots'),
editorSlot=$('editor-slot'), camMemberships=$('cam-memberships'), camModal=$('cam-modal');
const LABELS = {
name:'Name', short_code:'Short code', film_simulation:'Film simulation', dynamic_range:'Dynamic range',
d_range_priority:'D-Range priority', grain_effect:'Grain effect', grain_size:'Grain size',
color_chrome_effect:'Color Chrome', color_chrome_effect_blue:'Color Chrome FX Blue', white_balance:'White balance',
wb_kelvin:'Kelvin', wb_shift_red:'WB red', wb_shift_blue:'WB blue', bw_adj_warm_cool:'B&W warm–cool',
highlight_tone:'Highlight', shadow_tone:'Shadow', color:'Color', sharpness:'Sharpness',
noise_reduction:'Noise reduction', clarity:'Clarity', iso:'ISO', exposure_compensation:'Exposure compensation',
creator:'Creator', notes:'Notes'
};
const EDITABLE_KEYS = Object.keys(LABELS);
const DIFF_KEYS = EDITABLE_KEYS.filter(k => !['short_code','creator','notes'].includes(k));
const PRESETS = [
{id:'xt3',name:'X-T3'},{id:'xt30',name:'X-T30'},
{id:'xt4',name:'X-T4'},{id:'xpro3',name:'X-Pro3'},{id:'x100v',name:'X100V'},
{id:'xt30ii',name:'X-T30 II'},{id:'xe4',name:'X-E4'},{id:'xs10',name:'X-S10'},
{id:'xt5',name:'X-T5'},{id:'xh2',name:'X-H2'},{id:'xh2s',name:'X-H2S'},{id:'xs20',name:'X-S20'},
{id:'x100vi',name:'X100VI'}
];
const DEFAULT_DD = { dynamic_range:['AUTO','DR100','DR200','DR400'], d_range_priority:['OFF','WEAK','STRONG','AUTO'], grain_effect:['OFF','WEAK','STRONG'], grain_size:['SMALL','LARGE'], color_chrome_effect:['OFF','WEAK','STRONG'], color_chrome_effect_blue:['OFF','WEAK','STRONG'] };
const HELP = {
short_code:'Short code for the camera (2–4 letters + ±R±B). It records the white-balance shift, which the camera does not store per custom bank.',
name:'A free-form name used in this app. On the camera itself a custom name is limited to 12 characters.',
film_simulation:'The base picture profile. Only the film simulations of the selected camera are offered.',
dynamic_range:'Protects the highlights. DR200 needs ISO 320+, DR400 needs ISO 640+.',
d_range_priority:'Automatic contrast/dynamic-range control. WEAK/STRONG overrides Highlight, Shadow & DR.',
grain_effect:'Film-grain strength (OFF/WEAK/STRONG).',
grain_size:'Grain size (small/large) – only on cameras from the X-T4 onwards.',
color_chrome_effect:'Adds tonal depth to strong, saturated colors.',
color_chrome_effect_blue:'Like Color Chrome, but for blue tones – only on cameras from the X-T4 onwards.',
white_balance:'White-balance mode. Enter the red/blue shift in the fields and in the short code.',
wb_kelvin:'Fixed color temperature in Kelvin (about 2500–10000 K).',
wb_shift_red:'WB fine-tuning red (+)/cyan (−), −9 to +9.',
wb_shift_blue:'WB fine-tuning blue (+)/yellow (−), −9 to +9.',
bw_adj_warm_cool:'Toning warm (+)/cool (−). Only for ACROS/Monochrome.',
highlight_tone:'Contrast in the highlights. Usually −2 to +4.',
shadow_tone:'Contrast in the shadows. Usually −2 to +4.',
color:'Color saturation. Usually −4 to +4.',
sharpness:'Sharpening. Usually −4 to +4.',
noise_reduction:'Noise reduction. Usually −4 to +4.',
clarity:'Micro-contrast/structure – only on cameras from the X-T4 onwards.',
iso:'Recommended ISO or upper limit.',
exposure_compensation:'Recommended exposure compensation in EV.',
creator:'Who created the recipe, or the source. Optional.',
notes:'Space for your own notes.',
camera_slot:'Which custom bank this recipe sits in on THIS camera. For overview only – nothing is written to the camera.',
cameras:'Which cameras this recipe belongs to. The current camera is fixed. You can add others whose film simulation matches.'
};
let allRecipes = [], cameras = [], currentCameraId = null, currentId = undefined, favOnly = false, cbw = '', imgMenuTarget = null, camEditId = null;
let tagFilter = '', editRating = 0, editTags = []; // Phase 5: aktiver Tag-Filter + Editor-Zustand
const parseTags = s => String(s || '').split(',').map(t => t.trim()).filter(Boolean);
let selectMode = false; const selected = new Set(); // Phase 6: Auswahl-Modus + markierte IDs
let dirty = false, hlId = null; // Phase 8: ungespeicherte Änderungen + Tastatur-Highlight
// --- Phase 8: eigene Dialoge (Promise-basiert, im App-Modal-Stil) --------
const askModal = $('ask-modal');
let askResolve = null;
function openAsk(opts){
return new Promise(resolve => {
askResolve = resolve;
$('ask-title').textContent = opts.title || 'Please confirm';
$('ask-text').textContent = opts.text || '';
const okBtn = $('ask-ok'); okBtn.textContent = opts.ok || 'OK';
okBtn.className = 'btn ' + (opts.danger ? 'btn-danger' : 'btn-primary');
const cancelBtn = $('ask-cancel');
cancelBtn.textContent = opts.cancel || 'Cancel';
cancelBtn.hidden = (opts.cancel === null); // alert() zeigt kein „Cancel"
askModal.hidden = false;
okBtn.focus();
});
}
function closeAsk(result){
if(askModal.hidden) return;
askModal.hidden = true;
const r = askResolve; askResolve = null;
if(r) r(result);
}
$('ask-ok').addEventListener('click', () => closeAsk(true));
$('ask-cancel').addEventListener('click', () => closeAsk(false));
askModal.addEventListener('click', e => { if(e.target === askModal) closeAsk(false); });
// confirmDialog -> Promise<boolean> ; alertDialog -> Promise (nur OK)
function confirmDialog(text, opts){ return openAsk(Object.assign({ text, ok:'OK', cancel:'Cancel' }, opts)); }
function alertDialog(text, opts){ return openAsk(Object.assign({ title:'Heads up', text, cancel:null }, opts)); }
// Wächter vor dem Verwerfen ungespeicherter Änderungen.
async function maybeDiscard(){
if(!dirty) return true;
return await confirmDialog('Discard unsaved changes?', { ok:'Discard', danger:true });
}
const esc = s => String(s ?? '').replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c]));
const camById = id => cameras.find(c => c.id === id);
const currentCamera = () => camById(currentCameraId) || cameras[0] || {id:'',name:'',slots:7,features:{},film_sims:[],slotmap:{}};
const recipeCameras = r => (r.cameras || '').split(',').filter(Boolean);
const isBW = r => { const f=(r.film_simulation||'').toUpperCase(); return f.startsWith('ACROS')||f.startsWith('MONOCHROME')||f.startsWith('SEPIA'); };
function isModified(r){
if(!r.original_json) return false;
let o; try{ o=JSON.parse(r.original_json); }catch(e){ return false; }
return DIFF_KEYS.some(k => String(r[k] ?? '') !== String(o[k] ?? ''));
}
// Kleiner Wrapper um fetch für schreibende Aktionen: fängt „Server nicht
// erreichbar" (Netzwerkfehler, z. B. App beendet/abgestürzt) ab und zeigt einen
// dezenten Hinweis, statt die Aktion still verpuffen zu lassen. Gibt die Antwort
// zurück (bestehende res.ok-Prüfungen laufen weiter); bei Abbruch wird der Fehler
// weitergereicht, damit optimistisch geänderte UI nicht fälschlich als gespeichert gilt.
async function api(url, opts){
try{
return await fetch(url, opts);
}catch(err){
showToast('Couldn’t reach the app — is it still running?', { duration: 5000 });
throw err;
}
}
async function loadAll(){
cameras = await (await fetch('/api/cameras')).json();
if(!camById(currentCameraId)){
currentCameraId = localStorage.getItem('currentCamera');
if(!camById(currentCameraId)) currentCameraId = cameras[0] ? cameras[0].id : null;
}
allRecipes = await (await fetch('/api/recipes')).json();
renderCamSelect(); refreshSimFilter(); renderList(); renderCamera();
}
const loadRecipes = loadAll; // Slot/Recipe-Änderungen laden beides neu
// Mitgelieferte Beispiel-Rezepte in die aktuelle Kamera laden (Knopf im leeren Zustand).
async function loadExamples(){
const btn = document.getElementById('btn-load-examples');
if(btn){ btn.disabled = true; btn.textContent = 'Loading…'; }
try{
await fetch('/api/examples?camera=' + encodeURIComponent(currentCameraId), { method:'POST' });
await loadAll();
}catch(e){
if(btn){ btn.disabled = false; btn.textContent = 'Load example recipes'; }
}
}
function renderCamSelect(){
camSelect.innerHTML = cameras.map(c => `<option value="${c.id}"${c.id===currentCameraId?' selected':''}>${esc(c.name)}</option>`).join('');
}
function refreshSimFilter(){
const cam = currentCamera();
const used = new Set(allRecipes.filter(r => recipeCameras(r).includes(currentCameraId)).map(r => r.film_simulation).filter(Boolean));
const sims = (cam.film_sims||[]).filter(s => used.has(s)).concat([...used].filter(s => !(cam.film_sims||[]).includes(s)));
const cur = simEl.value;
simEl.innerHTML = '<option value="">All film simulations</option>' + [...new Set(sims)].map(s => `<option${s===cur?' selected':''}>${esc(s)}</option>`).join('');
}
function renderList(){
renderTagFilter(); // Phase 5: Tag-Chips in der Sidebar aktuell halten
const q = searchEl.value.trim().toLowerCase(), sim = simEl.value;
let items = allRecipes.filter(r => {
if(!recipeCameras(r).includes(currentCameraId)) return false;
if(favOnly && r.liked !== '1') return false;
if(sim && r.film_simulation !== sim) return false;
if(cbw === 'color' && isBW(r)) return false;
if(cbw === 'bw' && !isBW(r)) return false;
if(tagFilter && !parseTags(r.tags).includes(tagFilter)) return false;
if(q && !((r.name+' '+r.film_simulation+' '+r.notes+' '+r.short_code+' '+r.creator+' '+(r.tags||'')).toLowerCase().includes(q))) return false;
return true;
});
const s = sortEl.value;
items.sort((a,b) => {
if(s==='name') return (a.name||'').localeCompare(b.name||'');
if(s==='name_desc') return (b.name||'').localeCompare(a.name||'');
if(s==='old') return (a.id||'').localeCompare(b.id||'');
if(s==='fav') return (b.liked==='1')-(a.liked==='1') || (a.name||'').localeCompare(b.name||'');
if(s==='rating') return ((parseInt(b.rating)||0)-(parseInt(a.rating)||0)) || (a.name||'').localeCompare(b.name||'');
if(s==='sim') return (a.film_simulation||'').localeCompare(b.film_simulation||'') || (a.name||'').localeCompare(b.name||'');
return (b.id||'').localeCompare(a.id||'');
});
if(!selectMode) countEl.textContent = items.length + ' recipe' + (items.length===1?'':'s') + ' · ' + esc(currentCamera().name);
btnSelect.hidden = (items.length === 0 && !selectMode); // „Select" nur zeigen, wenn es Rezepte gibt
if(items.length===0){
const noneAtAll = allRecipes.length === 0; // wirklich leere Bibliothek (frischer Start)?
listEl.innerHTML = '<div class="list-empty">'
+ 'No recipes for <b>' + esc(currentCamera().name) + '</b> yet.'
+ (noneAtAll
? '<div class="empty-actions"><button id="btn-load-examples" class="btn btn-ghost">Load example recipes</button></div>'
+ '<div class="empty-hint">New here? Load a few examples to see how it works — '
+ 'or click <b>+ New recipe</b> above to add your own.</div>'
: '<div class="empty-hint">Click <b>+ New recipe</b> above to add one.</div>')
+ '</div>';
const be = document.getElementById('btn-load-examples');
if(be) be.addEventListener('click', loadExamples);
return;
}
listEl.innerHTML = items.map(r => {
const liked = r.liked === '1';
const stars = (parseInt(r.rating)||0) ? `<span class="item-stars">${'★'.repeat(parseInt(r.rating)||0)}</span>` : '';
const main = `<div class="item-main"><span class="nm">${esc(r.name||'Untitled')}</span><span class="fs">${esc(r.film_simulation||'—')}</span>${stars}</div>`;
if(selectMode){ // Auswahl-Modus: Checkbox statt Herz, Klick markiert/entmarkiert
return `<div class="item sel${selected.has(r.id)?' checked':''}" data-id="${r.id}" onclick="toggleSelect('${r.id}')">
<span class="item-cb">✓</span>${main}</div>`;
}
return `<div class="item${r.id===currentId?' active':''}" draggable="true" data-id="${r.id}" onclick="clickRecipe('${r.id}')">
${main}
<button class="heart${liked?' on':''}" title="Mark as favorite" onclick="toggleLike(event,'${r.id}')">${liked?'♥':'♡'}</button>
</div>`;
}).join('');
}
function renderCamera(){
const cam = currentCamera();
$('empty-title').textContent = 'On the camera · ' + cam.name;
const n = cam.slots || 7, sm = cam.slotmap || {};
let html = '', filled = 0;
for(let i=1;i<=n;i++){
const s = 'C'+i, r = allRecipes.find(x => x.id === sm[s]);
if(r) filled++;
html += `<div class="cslot ${r?'filled':'empty'}" data-slot="${s}">
<span class="cslot-n">${s}</span>
<span class="cslot-name"${r?` onclick="pickRecipe('${r.id}')"`:''}>${r?esc(r.name):'— empty — (drag a recipe here)'}</span>
${r?`<button type="button" class="cslot-clear" title="Clear slot" onclick="clearSlot('${s}')">✕</button>`:''}
</div>`;
}
cameraSlotsEl.innerHTML = html;
$('btn-print-sheet').hidden = filled === 0; // Phase 10: Spickzettel nur bei belegten Slots
}
async function assignSlot(slot, recipeId){
await api('/api/cameras/slot?camera='+encodeURIComponent(currentCameraId)+'&slot='+encodeURIComponent(slot)+'&recipe='+encodeURIComponent(recipeId||''), { method:'PUT' });
await loadAll();
}
async function clearSlot(slot){ await assignSlot(slot, ''); }