diff --git a/src/components/Sidebar/Sidebar.svelte b/src/components/Sidebar/Sidebar.svelte index b936680e..307358c0 100644 --- a/src/components/Sidebar/Sidebar.svelte +++ b/src/components/Sidebar/Sidebar.svelte @@ -77,6 +77,13 @@ label="Todo List" href="/todo" /> + + import dayjs from 'dayjs'; + import { onMount } from 'svelte'; + + export let event; + + let now = dayjs(); + + onMount(() => { + const interval = setInterval(() => { + now = dayjs(); + }, 1000); + + return () => { + clearInterval(interval); + }; + }); + + $: started = now.isAfter(event.start); + $: ended = now.isAfter(event.end); + $: diffStart = event.start.diff(now); + $: diffEnd = event.end.diff(now); + + +
+ {event.name} +

{event.name}

+

+ + {event.start.format('ddd, D MMM YYYY HH:mm')} + {#if !event.startOnly}-{/if} + + {#if !event.startOnly} + {event.end.format('ddd, D MMM YYYY HH:mm')} + {/if} +

+

+ {#if !started} + Starting in {dayjs.duration(diffStart).format(diffStart > 86400000 ? 'D[d] HH:mm:ss' : 'HH:mm:ss')} + {:else if started && !ended && !event.startOnly} + Ending in {dayjs.duration(diffEnd).format(diffEnd > 86400000 ? 'D[d] HH:mm:ss' : 'HH:mm:ss')} + {:else if event.startOnly} + Live Now! + {:else} + Finished + {/if} +

+
diff --git a/src/routes/timeline/_item.svelte b/src/routes/timeline/_item.svelte new file mode 100644 index 00000000..c612ab4f --- /dev/null +++ b/src/routes/timeline/_item.svelte @@ -0,0 +1,78 @@ + + +
+
+ + {event.name} + + {#if started && !ended && !event.startOnly} +
+ + {dayjs.duration(diffEnd).format(diffEnd > 86400000 ? 'D[d] HH:mm:ss' : 'HH:mm:ss')} + +
+ {:else if !started && !ended} +
+ + {dayjs.duration(diffStart).format(diffStart > 86400000 ? 'D[d] HH:mm:ss' : 'HH:mm:ss')} + +
+ {/if} +
+ + diff --git a/src/routes/timeline/index.svelte b/src/routes/timeline/index.svelte new file mode 100644 index 00000000..2470c4ce --- /dev/null +++ b/src/routes/timeline/index.svelte @@ -0,0 +1,259 @@ + + + + Timeline - Paimon.moe + + + + +
+

Timeline

+
+
+ + {#each dates as date, i} +
+ + {date} + +
+ {/each} + + {#each monthList as [month, item]} +
+ {month} +
+ {/each} + + {#each events as event, i} + {#if Array.isArray(event)} + {#each event as item, j} + 0 ? event[j - 1] : null} + next={j < event.length - 1 ? event[j + 1] : null} + now={today} + event={item} + openDetail={() => openDetail(item)} + {dayWidth} + {marginTop} + {eventHeight} + {eventMargin} + {i} + /> + {/each} + {:else} + openDetail(event)} + {event} + {dayWidth} + {marginTop} + {eventHeight} + {eventMargin} + {i} + /> + {/if} + {/each} + +
+
+ {today.format('HH:mm:ss')} +
+
+
+
+
+ + diff --git a/static/images/events/epitome_invocation.jpg b/static/images/events/epitome_invocation.jpg new file mode 100644 index 00000000..64fa80c5 Binary files /dev/null and b/static/images/events/epitome_invocation.jpg differ diff --git a/static/images/events/lantern-lit_sky.jpg b/static/images/events/lantern-lit_sky.jpg new file mode 100644 index 00000000..df6e02ac Binary files /dev/null and b/static/images/events/lantern-lit_sky.jpg differ diff --git a/static/images/events/moment_of_bloom.jpg b/static/images/events/moment_of_bloom.jpg new file mode 100644 index 00000000..2ce23358 Binary files /dev/null and b/static/images/events/moment_of_bloom.jpg differ diff --git a/static/images/events/spiral_abyss.jpg b/static/images/events/spiral_abyss.jpg new file mode 100644 index 00000000..e208e7f7 Binary files /dev/null and b/static/images/events/spiral_abyss.jpg differ diff --git a/static/images/events/update14.png b/static/images/events/update14.png new file mode 100644 index 00000000..47c22180 Binary files /dev/null and b/static/images/events/update14.png differ diff --git a/static/images/events/vishaps_and_where_to_find_them.jpg b/static/images/events/vishaps_and_where_to_find_them.jpg new file mode 100644 index 00000000..3d545588 Binary files /dev/null and b/static/images/events/vishaps_and_where_to_find_them.jpg differ diff --git a/static/images/timeline.png b/static/images/timeline.png new file mode 100644 index 00000000..44a0cc2f Binary files /dev/null and b/static/images/timeline.png differ diff --git a/static/sitemap.txt b/static/sitemap.txt index ffc28663..b69f6d85 100644 --- a/static/sitemap.txt +++ b/static/sitemap.txt @@ -4,3 +4,4 @@ https://paimon.moe/wish https://paimon.moe/calculator https://paimon.moe/items https://paimon.moe/todo +https://paimon.moe/timeline diff --git a/yarn.lock b/yarn.lock index b55ca21c..be78e8d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1278,9 +1278,9 @@ cssesc@^3.0.0: integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== dayjs@^1.9.4: - version "1.9.4" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.9.4.tgz#fcde984e227f4296f04e7b05720adad2e1071f1b" - integrity sha512-ABSF3alrldf7nM9sQ2U+Ln67NRwmzlLOqG7kK03kck0mw3wlSSEKv/XhKGGxUjQcS57QeiCyNdrFgtj9nWlrng== + version "1.10.4" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" + integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw== debug@2.6.9: version "2.6.9"