From f0db19a89f188940351cad8faf5142bc09715792 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 6 Mar 2022 16:13:05 +0100 Subject: [PATCH] Responsive design --- src/App.svelte | 51 ++++++++++++++++++++++---------------------- src/FilterBar.svelte | 2 +- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 0286a32..dc8b509 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -21,11 +21,12 @@ let openModal = false; const toggle = () => (openModal = !openModal); + const mobile = window.innerWidth < 765; let calendar; let options = writable({ - initialView: window.innerWidth < 765 ? 'listWeek' : 'timeGridWeek', + initialView: mobile ? 'listWeek' : 'timeGridWeek', plugins: [ timeGridPlugin, dayGridPlugin, @@ -37,9 +38,11 @@ locale: frLocale, allDayContent: '', headerToolbar: { - left: 'prev,next today', + left: mobile ? false : 'prev,next today', center: 'title', - right: 'dayGridMonth,timeGridWeek,listWeek' + right: mobile + ? 'prev,today,next dayGridMonth,timeGridWeek,listWeek' + : 'dayGridMonth,timeGridWeek,listWeek' }, height: '100%', schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives', @@ -49,7 +52,11 @@ openModal = true; event.set(info.event); }, - titleFormat: { year: '2-digit', month: 'numeric', day: 'numeric' }, + titleFormat: { + year: mobile ? '2-digit' : 'numeric', + month: mobile ? 'numeric' : 'long', + day: 'numeric' + }, events: [], themeSystem: 'bootstrap5' }); @@ -82,8 +89,8 @@ $: updateEvents(selectedCalendars); -
-

Calendrier de la vie étudiante à l'ENS

+
+

Calendrier de la vie étudiante à l'ENS

@@ -95,28 +102,20 @@
+
diff --git a/src/FilterBar.svelte b/src/FilterBar.svelte index 18fe5fe..12efc24 100644 --- a/src/FilterBar.svelte +++ b/src/FilterBar.svelte @@ -11,7 +11,7 @@ const toggle = () => (open = !open); -