diff --git a/src/data/timeline.js b/src/data/timeline.js index 1e600bef..b132a848 100644 --- a/src/data/timeline.js +++ b/src/data/timeline.js @@ -1,4 +1,52 @@ export const eventsData = [ + [ + { + name: 'Mesmerizing Dream at Sea', + pos: '20% 23%', + image: 'mesmerizing_dream_at_sea.jpg', + start: '2022-07-22 10:00:00', + end: '2022-07-31 23:59:59', + color: '#8cd8f1', + zoom: '300%', + url: 'https://www.hoyolab.com/article/6129641', + showOnHome: true, + }, + { + name: 'A Journey Through Pages', + pos: '20% 23%', + image: 'a_journey_through_pages.jpg', + start: '2022-08-17 12:00:00', + end: '2022-08-23 23:59:59', + color: '#f0ece1', + zoom: '300%', + url: 'https://www.hoyolab.com/article/7018436', + showOnHome: true, + }, + ], + [ + { + name: 'Go Go, Forest Rangers!', + pos: '0% 30%', + image: 'go_go_forest_rangers.jpg', + start: '2022-08-19 12:00:00', + end: '2022-08-24 23:59:59', + color: '#2dd378', + zoom: '200%', + url: 'https://www.hoyolab.com/article/7056771', + showOnHome: true, + }, + { + name: 'Fayz Trials', + pos: '0% 40%', + image: 'fayz_trials.jpg', + start: '2022-09-08 10:00:00', + end: '2022-09-26 03:59:59', + color: '#ff9486', + zoom: '100%', + url: 'https://www.hoyolab.com/article/7113923', + showOnHome: true, + }, + ], [ { name: 'A Muddy Bizzare Adventure', @@ -22,17 +70,6 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/5444663', showOnHome: true, }, - { - name: 'Mesmerizing Dream at Sea', - pos: '20% 23%', - image: 'mesmerizing_dream_at_sea.jpg', - start: '2022-07-22 10:00:00', - end: '2022-07-31 23:59:59', - color: '#8cd8f1', - zoom: '300%', - url: 'https://www.hoyolab.com/article/6129641', - showOnHome: true, - }, { name: 'Reminiscent Regimen', pos: '0% 35%', @@ -44,6 +81,17 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/6533766', showOnHome: true, }, + { + name: 'Lost Riches', + pos: '0% 50%', + image: 'lost_riches_2.jpg', + start: '2022-09-02 10:00:00', + end: '2022-09-19 03:59:59', + color: '#FFF2DC', + zoom: '250%', + url: 'https://www.hoyolab.com/article/7113923', + showOnHome: true, + }, ], [ { @@ -79,6 +127,17 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/6171423', showOnHome: true, }, + { + name: 'Graven Innocence', + pos: '0% 20%', + zoom: '200%', + image: 'graven_innocence.jpg', + start: '2022-08-24 06:00:00', + end: '2022-09-28 06:00:00', + color: '#c4e6f8', + url: 'https://www.hoyolab.com/article/7113808', + showOnHome: true, + }, ], [ { @@ -115,6 +174,34 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/5958494', showOnHome: true, }, + { + name: 'I', + start: '2022-08-24 06:00:00', + end: '2022-08-27 03:59:59', + color: '#c4e6f8', + }, + { + name: 'II', + start: '2022-08-27 04:00:00', + end: '2022-08-30 03:59:59', + color: '#c4e6f8', + }, + { + name: 'III', + start: '2022-08-30 04:00:00', + end: '2022-09-02 03:59:59', + color: '#c4e6f8', + }, + { + name: 'Stage IV', + pos: '0% 20%', + zoom: '200%', + image: 'graven_innocence.jpg', + start: '2022-09-02 04:00:00', + end: '2022-09-28 06:00:00', + color: '#c4e6f8', + url: 'https://www.hoyolab.com/article/7113808', + }, ], [ { @@ -152,6 +239,18 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/6857289', showOnHome: true, }, + { + name: 'Viridescent Vigil - Tighnari Banner', + pos: '30% 15%', + zoom: '200%', + image: 'viridescent_vigil_1.jpg', + start: '2022-08-24 06:00:00', + end: '2022-09-09 17:59:59', + color: '#76df81', + url: 'https://www.hoyolab.com/article/7113809', + showOnHome: true, + timezoneDependent: true, + }, ], [ { @@ -200,6 +299,18 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/6197311', showOnHome: true, }, + { + name: 'Gentry of Hermitage - Zhongli Banner', + pos: '30% 15%', + zoom: '200%', + image: 'gentry_of_hermitage_4.jpg', + start: '2022-08-24 06:00:00', + end: '2022-09-09 17:59:59', + color: '#D1A55C', + url: 'https://www.hoyolab.com/article/7113810', + showOnHome: true, + timezoneDependent: true, + }, ], [ { @@ -248,6 +359,18 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/6197314', showOnHome: true, }, + { + name: 'Epitome Invocation - Weapon Banner', + pos: '30% 30%', + zoom: '150%', + image: 'epitome_invocation_33.jpg', + start: '2022-08-24 06:00:00', + end: '2022-09-09 17:59:59', + color: '#FFAA4B', + url: 'https://www.hoyolab.com/article/7113811', + showOnHome: true, + timezoneDependent: true, + }, ], [ { @@ -374,5 +497,15 @@ export const eventsData = [ url: 'https://www.hoyolab.com/article/5916190', timezoneDependent: true, }, + { + name: 'Battle Pass - Luxuriant Woodlands', + pos: '0% 12%', + image: 'luxuriant_woodlands.jpg', + start: '2022-08-24 06:00:00', + end: '2022-09-26 03:59:59', + color: '#7bc9af', + url: 'https://www.hoyolab.com/article/7113923', + timezoneDependent: true, + }, ], ]; diff --git a/src/routes/timeline/_detail.svelte b/src/routes/timeline/_detail.svelte new file mode 100644 index 00000000..5983f14e --- /dev/null +++ b/src/routes/timeline/_detail.svelte @@ -0,0 +1,69 @@ + + +
+ + {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 event.url} ++ {event.url} +
+ {/if} + {#if event.description} ++ {event.description} +
+ {/if} ++ {#if !started} + {$t('timeline.starting')} + {`${diffStart > 86400000 ? `${Math.trunc(dayjs.duration(diffStart).asDays())}d` : ''} ${dayjs + .duration(diffStart) + .format('HH:mm:ss')}`} + {:else if started && !ended && !event.startOnly} + {$t('timeline.ending')} + {`${diffEnd > 86400000 ? `${Math.trunc(dayjs.duration(diffEnd).asDays())}d` : ''} ${dayjs + .duration(diffEnd) + .format('HH:mm:ss')}`} + {:else if event.startOnly} + {$t('timeline.live')} + {:else} + {$t('timeline.finished')} + {/if} +
+