From 9320c8dbfbc30776abfc6eb9766df1585834035b Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Sun, 31 Dec 2023 14:55:00 -0300 Subject: [PATCH] Improved cellphone support for calendars. --- components/charts/calendar.tsx | 9 ++++++--- pages/_year-data.tsx | 22 +++++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/components/charts/calendar.tsx b/components/charts/calendar.tsx index ed7c609..b74343c 100644 --- a/components/charts/calendar.tsx +++ b/components/charts/calendar.tsx @@ -21,17 +21,20 @@ export const Calendar = (props: Omit) => { dayBorderWidth={2} legends={[ { - anchor: "top", - direction: "row", + anchor: typeof window !== "undefined" && window.innerWidth / window.innerHeight < 1 ? 'left' : 'top', + translateX: typeof window !== "undefined" && window.innerWidth / window.innerHeight < 1 ? 0 : -50, + direction: typeof window !== "undefined" && window.innerWidth / window.innerHeight < 1 ? 'column' : 'row', itemCount: 8, itemWidth: 42, - itemHeight: 0, + itemHeight: 30, itemsSpacing: 14, itemDirection: "right-to-left", itemTextColor: "#DBDFD8", //framed-white }, ]} theme={{ textColor: "#DBDFD8" }} //framed-white + direction={typeof window !== "undefined" && window.innerWidth / window.innerHeight < 1 ? 'vertical' : 'horizontal'} + align={typeof window !== "undefined" && window.innerWidth / window.innerHeight < 1 ? 'right' : 'center'} {...props} /> ); diff --git a/pages/_year-data.tsx b/pages/_year-data.tsx index a25c8e7..4c61b58 100644 --- a/pages/_year-data.tsx +++ b/pages/_year-data.tsx @@ -708,12 +708,18 @@ export default function WrapYear(year: number, flavourText: { intro: any; top10s -
+
-

+

Share Your Shot Calendar in {year}

-

+

Hall of Framed Calendar in {year}