From b5d8bdd9a4aa03d4269ce80bde26575c26fa41c2 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Mon, 18 Nov 2024 10:53:28 +0100 Subject: [PATCH] Fix mobile videos height and fit chart in screen --- src/components/energy/section-1/index.tsx | 16 +++++++-------- src/components/energy/section-4/index.tsx | 24 ++++++++++++++--------- src/components/energy/section-7/index.tsx | 2 +- src/components/home/section-4/index.tsx | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/components/energy/section-1/index.tsx b/src/components/energy/section-1/index.tsx index b193783..2509cfd 100644 --- a/src/components/energy/section-1/index.tsx +++ b/src/components/energy/section-1/index.tsx @@ -25,17 +25,17 @@ export default function Section1() { const gridColumns = isMobile ? "flex flex-col" : { - "grid transition-all duration-500": true, - "grid-cols-[1.3fr_0.9fr_0.9fr_0.9fr]": hoveredIndex === 0, - "grid-cols-[0.9fr_1.3fr_0.9fr_0.9fr]": hoveredIndex === 1, - "grid-cols-[0.9fr_0.9fr_1.3fr_0.9fr]": hoveredIndex === 2, - "grid-cols-[0.9fr_0.9fr_0.9fr_1.3fr]": hoveredIndex === 3, - "grid-cols-[1fr_1fr_1fr_1fr]": hoveredIndex === null, - }; + "grid transition-all duration-500": true, + "grid-cols-[1.3fr_0.9fr_0.9fr_0.9fr]": hoveredIndex === 0, + "grid-cols-[0.9fr_1.3fr_0.9fr_0.9fr]": hoveredIndex === 1, + "grid-cols-[0.9fr_0.9fr_1.3fr_0.9fr]": hoveredIndex === 2, + "grid-cols-[0.9fr_0.9fr_0.9fr_1.3fr]": hoveredIndex === 3, + "grid-cols-[1fr_1fr_1fr_1fr]": hoveredIndex === null, + }; return (
-
+
(null); const [step, setStep] = useState("step1"); - + const isMobile = useIsMobile(); const variantsDescription: Record = { "step-2": { initial: { top: "100%", opacity: 0 }, - animate: { top: "30%", opacity: 1, transition }, + animate: { top: isMobile ? "10%" : "30%", opacity: 1, transition }, exit: { top: 0, opacity: 0 }, }, "step-3": { @@ -57,12 +63,12 @@ export default function Section4() { const renderChart = (
- + -
+
According to observations, it can be seen that during the first week of August 2018, temperatures reached 40°C in the southwestern part of the Iberian Peninsula due to a warm air intrusion that moved up from Africa. Two @@ -161,7 +167,7 @@ export default function Section4() { be mitigated by the use of air conditioning, but this caused a 10% rise in Iberian energy consumption and blackouts in Lisbon suburbs.
-
{renderChart}
+
{renderChart}
{legend}
Source: Destination Earth
diff --git a/src/components/energy/section-7/index.tsx b/src/components/energy/section-7/index.tsx index e143714..f00a365 100644 --- a/src/components/energy/section-7/index.tsx +++ b/src/components/energy/section-7/index.tsx @@ -75,7 +75,7 @@ export default function Section7() { const [openedKnowMore, setOpenedKnowMore] = useState(false); return (
-
+
-
+