From b29cfd3a8e9413fc13da6f1240b59f65b910aaf4 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Tue, 6 Sep 2022 03:04:33 +0700 Subject: [PATCH] Improve calendar view on mobile --- src/routes/calendar/index.svelte | 242 ++++++++++++++++--------------- 1 file changed, 124 insertions(+), 118 deletions(-) diff --git a/src/routes/calendar/index.svelte b/src/routes/calendar/index.svelte index c3aaf560..9e5a449b 100644 --- a/src/routes/calendar/index.svelte +++ b/src/routes/calendar/index.svelte @@ -349,128 +349,130 @@ />
-
-
- - -
-

- {browserTimeZone} -

-

- {monthName} - {selectedYear} -

-

- {$server} Server -

-
- - -
-
- {#each weekNames as day} -
- {day} +
+
+
+ + +
+

+ {browserTimeZone} +

+

+ {monthName} + {selectedYear} +

+

+ {$server} Server +

- {/each} -
- {#each month as week} -
- {#each week as day} -
-

{day.d}

-
- {#if day.wc} -
openDetail('banners', day.wc)} - style="--tw-ring-color: {day.wc.color}; background-color: {day.wc.color};" - class="cursor-pointer rounded-md inline-flex items-center text-sm px-2 space-x-1 ring-offset-1 ring-offset-background hover:ring-2" - > - - {#each day.wc.featured as char} - {char} - {/each} - {#each day.wc.featuredRare as char} - {char} - {/each} - -
- {/if} - {#if day.wp} -
openDetail('banners', day.wp)} - class="cursor-pointer bg-orange-200 rounded-md inline-flex items-center text-sm px-2 ring-orange-200 ring-offset-1 ring-offset-background hover:ring-2" - > - - {#each day.wp.featured as weapon} - {weapon} - {/each} - -
- {/if} - {#if day.b} -
openBirthday(day.b, day.d, day.m)} - class="cursor-pointer bg-purple-400 rounded-md inline-flex items-center px-2 ring-purple-400 ring-offset-1 ring-offset-background hover:ring-2" - > - {#each day.b as char} - {char} - {/each} - 🎁 -
- {/if} - {#if day.e} - {#each day.e as event} -
hoverEvent(event.e.name)} - on:mouseleave={() => hoverEvent('')} - on:click={() => openDetail('events', event.e)} - style="--tw-ring-color: {event.e.color}; --color: {event.e.color};" - class="cursor-pointer rounded-md ring-offset-1 ring-offset-background h-6 w-full inline-flex items-center text-xs px-2 space-x-1 event-strip {event.s - ? '' - : 'end'} {hovered === event.e.name ? 'ring-2' : ''}" - > -

{event.e.name}

-
- {/each} - {/if} -
+ + +
+
+ {#each weekNames as day} +
+ {day}
{/each}
- {/each} + {#each month as week} +
+ {#each week as day} +
+

{day.d}

+
+ {#if day.wc} +
openDetail('banners', day.wc)} + style="--tw-ring-color: {day.wc.color}; background-color: {day.wc.color};" + class="cursor-pointer rounded-md inline-flex items-center text-sm px-2 space-x-1 ring-offset-1 ring-offset-background hover:ring-2" + > + + {#each day.wc.featured as char} + {char} + {/each} + {#each day.wc.featuredRare as char} + {char} + {/each} + +
+ {/if} + {#if day.wp} +
openDetail('banners', day.wp)} + class="cursor-pointer bg-orange-200 rounded-md inline-flex items-center text-sm px-2 ring-orange-200 ring-offset-1 ring-offset-background hover:ring-2" + > + + {#each day.wp.featured as weapon} + {weapon} + {/each} + +
+ {/if} + {#if day.b} +
openBirthday(day.b, day.d, day.m)} + class="cursor-pointer bg-purple-400 rounded-md inline-flex items-center px-2 ring-purple-400 ring-offset-1 ring-offset-background hover:ring-2" + > + {#each day.b as char} + {char} + {/each} + 🎁 +
+ {/if} + {#if day.e} + {#each day.e as event} +
hoverEvent(event.e.name)} + on:mouseleave={() => hoverEvent('')} + on:click={() => openDetail('events', event.e)} + style="--tw-ring-color: {event.e.color}; --color: {event.e.color};" + class="cursor-pointer rounded-md ring-offset-1 ring-offset-background h-6 w-full inline-flex items-center text-xs px-2 space-x-1 event-strip {event.s + ? '' + : 'end'} {hovered === event.e.name ? 'ring-2' : ''}" + > +

{event.e.name}

+
+ {/each} + {/if} +
+
+ {/each} +
+ {/each} +

{$t('calendar.lastAppearance')}

※ {$t('calendar.lastAppearanceDesc')}

-
+
@@ -484,11 +486,13 @@ {#each sortedLegendary as [char, val]} goToBannerTime(lastBannerStart[char])}> - + - @@ -508,11 +512,13 @@ {#each sortedRare as [char, val]} goToBannerTime(lastBannerStart[char])}> - + -
- {char} + {char} {characters[char].name}{characters[char].name} {val} + {lastBannerDate[char].humanize(true)}
- {char} + {char} {characters[char].name}{characters[char].name} {val} + {lastBannerDate[char].humanize(true)}