joplin-plugin-my-calendar 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,724 @@
1
+ /* src/ui/mycalendar.css */
2
+
3
+ html, body {
4
+ height: 100%;
5
+ margin: 0;
6
+ overflow: auto;
7
+ }
8
+
9
+ /* TODO:[1]: parent --scrollbar-size is invisible inside of iframe, and size is 7px always. How to solve that? */
10
+ body::-webkit-scrollbar, select::-webkit-scrollbar {
11
+ width: var(--scrollbar-size, 7px);
12
+ height: var(--scrollbar-size, 7px);
13
+ }
14
+
15
+ body::-webkit-scrollbar-corner, select::-webkit-scrollbar-corner {
16
+ background: none;
17
+ }
18
+
19
+ body::-webkit-scrollbar-track, select::-webkit-scrollbar-track {
20
+ border: none;
21
+ }
22
+
23
+ body::-webkit-scrollbar-thumb, select::-webkit-scrollbar-thumb {
24
+ background: var(--scrollbar-thumb-color);
25
+ border-radius: calc(var(--scrollbar-size, 7px) * 0.7);
26
+ }
27
+
28
+ body::-webkit-scrollbar-track:hover, select::-webkit-scrollbar-track:hover {
29
+ background: rgba(0, 0, 0, 0.1);
30
+ }
31
+
32
+ body::-webkit-scrollbar-thumb:hover, select::-webkit-scrollbar-thumb:hover {
33
+ background: var(--scrollbar-thumb-color-hover);
34
+ }
35
+
36
+ :root {
37
+ --scrollbar-thumb-color: var(--joplin-scrollbar-thumb-color);
38
+ --scrollbar-thumb-color-hover: var(--joplin-scrollbar-thumb-color-hover);
39
+ --mc-default-event-color: #1470d9;
40
+ --mc-past-opacity: 0.45;
41
+ /* Subtle weekend highlight (theme-aware) */
42
+ --mc-weekend-head-bg: color-mix(in srgb, var(--joplin-background-color3) 70%, transparent);
43
+ --mc-weekend-cell-bg: color-mix(in srgb, var(--joplin-background-color3) 45%, transparent);
44
+
45
+ }
46
+
47
+ /*#joplin-plugin-content-root {*/
48
+ /* min-width: 315px;*/
49
+ /*}*/
50
+
51
+
52
+ /* Outer container that will actually scroll */
53
+ #mc-cal-scroll {
54
+ height: 100%;
55
+ max-height: 100%;
56
+ overflow-y: auto;
57
+ overflow-x: hidden;
58
+ }
59
+
60
+ #cal-root {
61
+ display: grid;
62
+ grid-template-rows: auto auto 1fr;
63
+ gap: 8px;
64
+ color: var(--joplin-color);
65
+ width: 100%;
66
+ min-width: 0;
67
+ margin: 0;
68
+ padding: 8px 8px 12px;
69
+ box-sizing: border-box;
70
+ }
71
+
72
+ #mc-toolbar {
73
+ display: flex;
74
+ align-items: center;
75
+ }
76
+
77
+ .mc-toolbar-inner {
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 8px;
81
+ }
82
+
83
+ .mc-btn {
84
+ padding: 4px 8px;
85
+ border: 1px solid var(--joplin-divider-color);
86
+ background: var(--joplin-background-color2);
87
+ border-radius: 6px;
88
+ cursor: pointer;
89
+ }
90
+
91
+ .mc-title {
92
+ margin-left: 4px;
93
+ font-weight: 700;
94
+ flex: 1;
95
+ }
96
+
97
+ #mc-grid {
98
+ border: 1px solid var(--joplin-divider-color);
99
+ border-radius: 8px;
100
+ overflow: hidden;
101
+ position: relative;
102
+ }
103
+
104
+ /* Full-cover overlay */
105
+ #mc-grid .mc-grid-loader {
106
+ position: absolute;
107
+ inset: 0;
108
+ display: none; /* shown via .mc-loading */
109
+ align-items: center;
110
+ justify-content: center;
111
+ background: color-mix(in srgb, var(--joplin-background-color) 70%, transparent);
112
+ backdrop-filter: blur(1px);
113
+ z-index: 10;
114
+ }
115
+
116
+ /* Show loader when grid is loading */
117
+ #mc-grid.mc-loading .mc-grid-loader {
118
+ display: flex;
119
+ }
120
+
121
+ /* Rotating spinner (Joplin-themed) */
122
+ #mc-grid .mc-grid-spinner {
123
+ width: 28px;
124
+ height: 28px;
125
+ border-radius: 50%;
126
+ border: 3px solid color-mix(in srgb, var(--joplin-color) 20%, transparent);
127
+ border-top-color: var(--joplin-color);
128
+ animation: mc-spin 900ms linear infinite;
129
+ }
130
+
131
+ @keyframes mc-spin {
132
+ to {
133
+ transform: rotate(360deg);
134
+ }
135
+ }
136
+
137
+ @media (pointer: coarse) and (hover: none) {
138
+ #mc-grid .mc-grid-spinner {
139
+ width: 34px;
140
+ height: 34px;
141
+ border-width: 4px;
142
+ }
143
+ }
144
+
145
+ .mc-grid-head, .mc-grid-body {
146
+ display: grid;
147
+ grid-template-columns: repeat(7, 1fr);
148
+ gap: 4px;
149
+ }
150
+
151
+ .mc-grid-head {
152
+ background: var(--joplin-background-color3);
153
+ }
154
+
155
+ /* Week day name */
156
+ .mc-grid-head-cell {
157
+ font-size: 11px;
158
+ font-weight: bold;
159
+ padding: 6px 8px;
160
+ text-align: center;
161
+ border-right: 1px solid var(--joplin-divider-color);
162
+ }
163
+
164
+ .mc-grid-head-cell:last-child {
165
+ border-right: none;
166
+ }
167
+
168
+ /*****/
169
+ /* --- Responsive grid width fix (320px -> 200px) --- */
170
+
171
+ /* Make #mc-grid a size container so we can scale based on its own width */
172
+ #mc-grid {
173
+ container-type: inline-size;
174
+
175
+ /* Defaults (>= ~320px) */
176
+ --mc-grid-gap: 4px;
177
+ --mc-head-font: 12px;
178
+ --mc-head-pad-y: 6px;
179
+ --mc-head-pad-x: 4px;
180
+
181
+ --mc-cell-pad-y: 4px;
182
+ --mc-cell-pad-x: 4px;
183
+ --mc-daynum-font: 12px;
184
+ --mc-count-font: 14px;
185
+
186
+ --mc-radius: 8px;
187
+ }
188
+
189
+ /* Critical: allow columns to shrink below min-content (prevents header “forcing” width) */
190
+ .mc-grid-head,
191
+ .mc-grid-body {
192
+ grid-template-columns: repeat(7, minmax(0, 1fr));
193
+ gap: var(--mc-grid-gap);
194
+ }
195
+
196
+ /* Ensure header cells can shrink and don’t overflow the grid */
197
+ .mc-grid-head-cell {
198
+ min-width: 0;
199
+ overflow: hidden;
200
+ text-overflow: ellipsis;
201
+ white-space: nowrap;
202
+
203
+ font-size: var(--mc-head-font);
204
+ padding: var(--mc-head-pad-y) var(--mc-head-pad-x);
205
+ }
206
+
207
+ /* Same shrink behavior for day cells */
208
+ .mc-grid-body .mc-cell {
209
+ min-width: 0;
210
+ padding: var(--mc-cell-pad-y) var(--mc-cell-pad-x);
211
+ }
212
+
213
+ /* Scale typography inside cells */
214
+ .mc-daynum {
215
+ font-size: var(--mc-daynum-font);
216
+ }
217
+
218
+ .mc-count {
219
+ font-size: var(--mc-count-font);
220
+ }
221
+
222
+ /* Optional: keep borders visually consistent at tiny widths */
223
+ #mc-grid {
224
+ border-radius: var(--mc-radius);
225
+ }
226
+
227
+ /* --- Container-based scaling: 320px -> 200px --- */
228
+ @container (max-width: 320px) {
229
+ #mc-grid {
230
+ /* cqw = 1% of container width */
231
+ --mc-grid-gap: clamp(2px, 1cqw, 4px);
232
+
233
+ --mc-head-font: clamp(10px, 3.6cqw, 12px);
234
+ --mc-head-pad-y: clamp(3px, 1.6cqw, 6px);
235
+ --mc-head-pad-x: clamp(4px, 2.2cqw, 8px);
236
+
237
+ --mc-cell-pad-y: clamp(2px, 1.4cqw, 4px);
238
+ --mc-cell-pad-x: clamp(3px, 2.0cqw, 6px);
239
+
240
+ --mc-daynum-font: clamp(10px, 3.6cqw, 12px);
241
+ --mc-count-font: clamp(11px, 4.2cqw, 14px);
242
+
243
+ --mc-radius: clamp(6px, 2.6cqw, 8px);
244
+ }
245
+
246
+ /* Slightly reduce border thickness perception at very tight widths */
247
+ .mc-grid-head-cell {
248
+ padding: var(--mc-head-pad-y) var(--mc-head-pad-x);
249
+ }
250
+ }
251
+
252
+ /* Extra-tight: below ~240px make weekday labels shorter if you ever localize to longer strings */
253
+ @container (max-width: 240px) {
254
+ .mc-grid-head-cell {
255
+ letter-spacing: -0.1px;
256
+ }
257
+ }
258
+
259
+ /*****/
260
+
261
+ .mc-grid-body .mc-cell {
262
+ /*position: relative;*/
263
+ /*min-height: 50px;*/
264
+ border-right: 1px solid var(--joplin-divider-color);
265
+ border-top: 1px solid var(--joplin-divider-color);
266
+ padding: 4px 6px;
267
+ overflow: hidden;
268
+ }
269
+
270
+ /* Highlight weekends inside the current month only (keep .mc-out styling as-is) */
271
+ .mc-grid-body .mc-cell.mc-weekend:not(.mc-out) {
272
+ background: var(--mc-weekend-cell-bg);
273
+ }
274
+
275
+ .mc-grid-body .mc-cell:nth-child(7n) {
276
+ border-right: none;
277
+ }
278
+
279
+ .mc-daynum {
280
+ font-size: 12px;
281
+ opacity: 0.8;
282
+ margin-bottom: 2px;
283
+ }
284
+
285
+ .mc-dots {
286
+ position: absolute;
287
+ left: 6px;
288
+ bottom: 6px;
289
+ display: flex;
290
+ align-items: center;
291
+ gap: 3px;
292
+ }
293
+
294
+ .mc-more {
295
+ font-size: 11px;
296
+ opacity: 0.7;
297
+ }
298
+
299
+ .mc-out {
300
+ background: var(--joplin-background-color3);
301
+ }
302
+
303
+ .mc-today {
304
+ outline: 2px solid var(--joplin-color);
305
+ outline-offset: -2px;
306
+ }
307
+
308
+ .mc-selected {
309
+ box-shadow: inset 0 0 0 2px var(--joplin-color);
310
+ }
311
+
312
+ /* Past days in the month grid */
313
+ .mc-cell.mc-past {
314
+ opacity: var(--mc-past-opacity);
315
+ }
316
+
317
+ /* Keep selection slightly more readable even if the day is in the past */
318
+ .mc-cell.mc-past.mc-selected {
319
+ opacity: 0.7;
320
+ }
321
+
322
+ .mc-events-header {
323
+ display: flex;
324
+ align-items: center;
325
+ justify-content: space-between;
326
+ gap: 10px;
327
+ }
328
+
329
+ #mc-events-day-label {
330
+ opacity: 0.8;
331
+ font-weight: 600;
332
+ white-space: nowrap;
333
+ }
334
+
335
+ #mc-events, #mc-import {
336
+ border: 1px solid var(--joplin-divider-color);
337
+ border-radius: 8px;
338
+ overflow: hidden;
339
+ }
340
+
341
+ .mc-events-header, .mc-import-header {
342
+ background: var(--joplin-background-color3);
343
+ padding: 6px 10px;
344
+ font-size: 12px;
345
+ font-weight: 600;
346
+ }
347
+
348
+ #mc-events-list {
349
+ list-style: none;
350
+ margin: 0;
351
+ padding: 8px 6px;
352
+ }
353
+
354
+ .mc-event {
355
+ display: flex;
356
+ align-items: center;
357
+ gap: 8px;
358
+ padding: 6px;
359
+ border-radius: 6px;
360
+ cursor: pointer;
361
+ }
362
+
363
+ .mc-event:hover {
364
+ background: var(--joplin-background-color3)
365
+ }
366
+
367
+ .mc-color {
368
+ width: 10px;
369
+ height: 10px;
370
+ border-radius: 50%;
371
+ display: inline-block;
372
+ }
373
+
374
+ .mc-time {
375
+ opacity: 0.7;
376
+ font-size: 12px;
377
+ }
378
+
379
+ .mc-empty {
380
+ opacity: 0.7;
381
+ padding: 6px;
382
+ }
383
+
384
+
385
+ /* The container of strips in the cell */
386
+ .mc-bars {
387
+ /*position: absolute;*/
388
+ left: 4px;
389
+ right: 4px;
390
+ bottom: 6px;
391
+ display: block;
392
+ grid-auto-rows: 4px;
393
+ gap: 2px;
394
+ z-index: 2;
395
+ }
396
+
397
+ .mc-bar {
398
+ height: 4px;
399
+ border-radius: 2px;
400
+ background: var(--mc-default-event-color);
401
+ opacity: 0.95;
402
+ margin-bottom: 1px;
403
+ }
404
+
405
+ /* Badge-chiller is up to the right */
406
+ .mc-count {
407
+ /*position: absolute;*/
408
+ top: 2px;
409
+ right: 4px;
410
+ font-size: 14px;
411
+ font-weight: bold;
412
+ text-align: center;
413
+ line-height: 1;
414
+ padding: 2px 4px;
415
+ border-radius: 6px;
416
+ background: var(--joplin-background-color3);
417
+ border: 1px solid var(--joplin-divider-color);
418
+ opacity: 0.85;
419
+ z-index: 3;
420
+ }
421
+
422
+ .mc-dots {
423
+ display: none;
424
+ }
425
+
426
+ .mc-calendar-nav-btn {
427
+ color: var(--joplin-color) !important; /* make the text white */
428
+ background: transparent; /* The background is transparent */
429
+ border: none;
430
+ font-size: 12px;
431
+ font-weight: 700;
432
+ cursor: pointer;
433
+ }
434
+
435
+ .mc-calendar-nav-btn:hover {
436
+ color: var(--joplin-color) !important; /* lighter when creeping */
437
+ }
438
+
439
+ /* --- Events panel layout: list scroll + import at bottom --- */
440
+
441
+
442
+ /* --- Import block inside day events --- */
443
+
444
+ /* --- Import form loader overlay (same style as grid loader) --- */
445
+ #mc-ics-import-form {
446
+ position: relative;
447
+ }
448
+
449
+ /* Full-cover overlay */
450
+ #mc-ics-import-form .mc-grid-loader {
451
+ position: absolute;
452
+ inset: 0;
453
+ display: none; /* shown via .mc-loading */
454
+ align-items: center;
455
+ justify-content: center;
456
+ background: color-mix(in srgb, var(--joplin-background-color) 70%, transparent);
457
+ backdrop-filter: blur(1px);
458
+ z-index: 10;
459
+ border-radius: 8px;
460
+ }
461
+
462
+ /* Show loader when form is loading */
463
+ #mc-ics-import-form.mc-loading .mc-grid-loader {
464
+ display: flex;
465
+ }
466
+
467
+ /* Spinner (reuse same look) */
468
+ #mc-ics-import-form .mc-grid-spinner {
469
+ width: 28px;
470
+ height: 28px;
471
+ border-radius: 50%;
472
+ border: 3px solid color-mix(in srgb, var(--joplin-color) 20%, transparent);
473
+ border-top-color: var(--joplin-color);
474
+ animation: mc-spin 900ms linear infinite;
475
+ }
476
+
477
+ #mc-import > summary {
478
+ cursor: pointer;
479
+ font-weight: 600;
480
+ user-select: none;
481
+ list-style: none;
482
+ }
483
+
484
+ /* Removes the standard summary marker in some browsers (optional) */
485
+ #mc-import > summary::-webkit-details-marker {
486
+ display: none;
487
+ }
488
+
489
+ /* Container to be scrolled */
490
+ #mc-import-body {
491
+ margin: 0;
492
+ max-height: 260px; /* choose the height that suits you */
493
+ padding: 8px 6px; /* so that the scroll does not "stick" to the content */
494
+ }
495
+
496
+ /* Very important for <input type="file"> in flex-line: otherwise it can inflate the width */
497
+ #mc-import-body input[type="file"] {
498
+ max-width: 100%;
499
+ min-width: 0;
500
+ }
501
+
502
+ .mc-setting-select-control {
503
+ display: inline-block;
504
+ color: var(--joplin-color);
505
+ font-family: var(--joplin-font-family);
506
+ background-color: var(--joplin-background-color);
507
+ padding: 4px 6px;
508
+ border-radius: 3px;
509
+ border-color: var(--joplin-border-color4);
510
+ }
511
+
512
+ .mc-setting-btn {
513
+ color: var(--joplin-color);
514
+ background-color: var(--joplin-background-color);
515
+ align-items: center;
516
+ border-radius: 3px;
517
+ border: 1px solid var(--joplin-border-color4);
518
+ box-sizing: border-box;
519
+ display: flex;
520
+ flex-direction: row;
521
+ height: 26px;
522
+ justify-content: center;
523
+ max-height: 26px;
524
+ min-height: 26px;
525
+ min-width: 76px;
526
+ opacity: 1;
527
+ padding: 0 14px;
528
+ user-select: none;
529
+ width: auto;
530
+ }
531
+
532
+ .mc-event {
533
+ /* ... */
534
+ transition: opacity 150ms ease-in-out;
535
+ flex-wrap: wrap;
536
+ }
537
+
538
+ /* Past/ended events in the day list */
539
+ .mc-event.mc-event-past {
540
+ opacity: var(--mc-past-opacity);
541
+ }
542
+
543
+ /* thin 24h timeline under the event */
544
+ .mc-event-timeline {
545
+ position: relative;
546
+ flex: 0 0 100%;
547
+ height: 2px;
548
+ /*margin-top: 4px;*/
549
+ border-radius: 999px;
550
+ background: color-mix(in srgb, var(--joplin-color) 18%, transparent);
551
+ overflow: hidden;
552
+ }
553
+
554
+ /* event segment (start..end) */
555
+ .mc-event-timeline .mc-event-timeline-seg {
556
+ position: absolute;
557
+ top: 0;
558
+ bottom: 0;
559
+ border-radius: 999px;
560
+ opacity: 0.9;
561
+ }
562
+
563
+ /* dot “now” */
564
+ .mc-event-timeline .mc-event-timeline-now {
565
+ position: absolute;
566
+ top: 50%;
567
+ width: 6px;
568
+ height: 6px;
569
+ border-radius: 50%;
570
+ transform: translate(-50%, -50%);
571
+ background: var(--joplin-color);
572
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--joplin-background-color) 65%, transparent);
573
+ }
574
+
575
+ /* slightly mute the timeline for past events */
576
+ .mc-event.mc-event-past .mc-event-timeline {
577
+ opacity: 0.65;
578
+ }
579
+
580
+ /* --- ICS Import Styles --- */
581
+ #mc-imp-log {
582
+ margin-top: 8px;
583
+ padding: 6px;
584
+ border: 1px dashed var(--joplin-divider-color);
585
+ max-height: 220px;
586
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
587
+ font-size: 12px;
588
+ }
589
+
590
+ .mc-import-section-header {
591
+ font-weight: 600;
592
+ margin-top: 10px;
593
+ margin-bottom: 6px;
594
+ }
595
+
596
+ .mc-import-row {
597
+ display: flex;
598
+ gap: 8px;
599
+ align-items: center;
600
+ margin: 8px 0;
601
+ }
602
+
603
+ .mc-import-row-label {
604
+ font-weight: 600;
605
+ }
606
+
607
+ .mc-import-options {
608
+ display: flex;
609
+ flex-direction: column;
610
+ gap: 6px;
611
+ margin: 8px 0;
612
+ }
613
+
614
+ .mc-import-option-label {
615
+ display: flex;
616
+ align-items: center;
617
+ gap: 8px;
618
+ cursor: pointer;
619
+ }
620
+
621
+ .mc-import-color-picker-row {
622
+ display: flex;
623
+ align-items: center;
624
+ gap: 8px;
625
+ margin-left: 24px;
626
+ }
627
+
628
+ .mc-import-color-picker-label {
629
+ opacity: 0.85;
630
+ }
631
+
632
+ #mc-ics-import-form {
633
+ margin: 0;
634
+ padding: 0;
635
+ }
636
+
637
+ #mc-ics-export-link {
638
+ margin-top: 10px;
639
+ }
640
+
641
+ .mc-export-link-row {
642
+ display: flex;
643
+ gap: 6px;
644
+ flex-wrap: wrap;
645
+ }
646
+
647
+ .mc-export-link-btn {
648
+ text-decoration: none;
649
+ }
650
+
651
+ .mc-flex-1 {
652
+ flex: 1;
653
+ }
654
+
655
+ .mc-w-100 {
656
+ width: 100%;
657
+ }
658
+
659
+
660
+ @media (pointer: coarse) and (hover: none) {
661
+ #mc-import {
662
+ display: none !important;
663
+ }
664
+
665
+ /* Stretch the entire width of the panel, drop the fields */
666
+ #cal-root {
667
+ margin: 0 !important;
668
+ padding: 0 !important;
669
+ width: 100% !important;
670
+ min-width: 0 !important;
671
+ box-sizing: border-box;
672
+ }
673
+
674
+ /* A little denser to spread the items on the phones */
675
+ .mc-toolbar-inner {
676
+ gap: 6px;
677
+ }
678
+
679
+ .mc-grid-head {
680
+ gap: 2px;
681
+ }
682
+
683
+ /* Weekend columns (Sat/Sun) */
684
+ .mc-grid-head-cell.mc-weekend {
685
+ background: var(--mc-weekend-head-bg);
686
+ }
687
+
688
+ .mc-grid-body {
689
+ gap: 2px;
690
+ }
691
+
692
+ .mc-cell {
693
+ padding: 6px;
694
+ }
695
+
696
+ .mc-daynum {
697
+ font-size: 12px;
698
+ }
699
+
700
+ .mc-events-header, .mc-import-header {
701
+ font-weight: normal;
702
+ font-size: 12px;
703
+ }
704
+
705
+ .mc-title {
706
+ font-size: 12px;
707
+ font-weight: normal;
708
+ }
709
+
710
+ /* Weekday header: smaller + bolder + less padding so "Mon/Wed" fits */
711
+ .mc-grid-head-cell {
712
+ font-size: 11px;
713
+ font-weight: Bold;
714
+ padding: 6px 4px;
715
+
716
+ /* Avoid "M..." / "W..." on mobile when it mostly fits */
717
+ text-overflow: clip;
718
+ }
719
+
720
+ /* Keep weekend header highlight as you already have */
721
+ .mc-grid-head-cell.mc-weekend {
722
+ background: var(--mc-weekend-head-bg);
723
+ }
724
+ }