@axium/calendar 0.1.3 → 0.1.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/calendar",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Calendar for Axium",
6
6
  "funding": {
@@ -13,8 +13,9 @@
13
13
 
14
14
  const { user } = data.session;
15
15
 
16
- const today = new Date();
17
- today.setHours(0, 0, 0, 0);
16
+ const now = new SvelteDate();
17
+ setInterval(() => now.setTime(Date.now()), 60_000);
18
+ const today = $derived(new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0));
18
19
 
19
20
  let start = new SvelteDate(data.filter.start);
20
21
  let end = new SvelteDate(data.filter.end);
@@ -249,6 +250,10 @@
249
250
  {/if}
250
251
  </Popover>
251
252
  {/each}
253
+
254
+ {#if today.getTime() == day.getTime()}
255
+ <div class="now" style:top="{(now.getHours() * 60 + now.getMinutes()) / 14.4}%"></div>
256
+ {/if}
252
257
  </div>
253
258
  </div>
254
259
  {/each}
@@ -567,10 +572,29 @@
567
572
  .day-content {
568
573
  flex-grow: 1;
569
574
  position: relative;
575
+
576
+ .now {
577
+ position: absolute;
578
+ width: 100%;
579
+ border-bottom: 1px solid hsl(0 33 var(--fg-light));
580
+ z-index: 9;
581
+ pointer-events: none;
582
+
583
+ &::before {
584
+ content: '';
585
+ position: absolute;
586
+ left: -0.25em;
587
+ top: -0.25em;
588
+ width: 0.5em;
589
+ height: 0.5em;
590
+ border-radius: 50%;
591
+ background-color: hsl(0 33 var(--fg-light));
592
+ }
593
+ }
570
594
  }
571
595
 
572
596
  .event {
573
- width: 100%;
597
+ width: calc(100% - 0.5em);
574
598
  position: absolute;
575
599
  border-radius: 0.5em;
576
600
  padding: 0.25em;