diff --git a/src/pages/layouts/Timeline.jsx b/src/pages/layouts/Timeline.jsx index 8bb87f7..f2a191e 100644 --- a/src/pages/layouts/Timeline.jsx +++ b/src/pages/layouts/Timeline.jsx @@ -1,43 +1,53 @@ +import React from "react"; import { Box, chakra, Container, + Text, HStack, + VStack, Flex, useColorModeValue, useBreakpointValue, } from "@chakra-ui/react"; -import { motion } from "framer-motion"; -import TimelineCard from "../../components/cards/TimelineCard"; -import "../../assets/styles/pages/layouts/Timeline.css"; const milestones = [ { id: 1, date: "20th July, 2024", title: "Registrations Open", - description: ``, + description: `The beginning of an exciting journey!`, }, { id: 2, date: "18th July, 2024", title: "Awareness Session", - description: ``, + description: `An informative session to kick things off.`, }, { id: 3, date: "18th July, 2024", title: "Registrations Close", - description: ``, + description: `Last chance to be a part of this event.`, + }, + { + id: 4, + date: "24th July, 2024", + title: "Online Session", + description: `Join us online for an engaging session.`, }, - { id: 4, date: "24th July, 2024", title: "Online Session", description: `` }, { id: 5, date: "10th August, 2024", title: "Qualifier Round", - description: ``, + description: `Show your skills and qualify for the finale.`, + }, + { + id: 6, + date: "11th August, 2024", + title: "The Finale", + description: `The grand finale - don't miss it!`, }, - { id: 6, date: "11th August, 2024", title: "The Finale", description: `` }, ]; const Milestones = () => { @@ -45,122 +55,139 @@ const Milestones = () => { const isDesktop = useBreakpointValue({ base: false, md: true }); return ( -
- - - Timeline + + + + + Milestones - {milestones.map((milestone, index) => ( + {milestones.map((milestone) => ( - {isDesktop && index % 2 === 0 && ( + {/* Desktop view(left card) */} + {isDesktop && milestone.id % 2 === 0 && ( <> - - + + )} + {/* Mobile view */} {isMobile && ( <> - - + + )} - {isDesktop && index % 2 !== 0 && ( + {/* Desktop view(right card) */} + {isDesktop && milestone.id % 2 !== 0 && ( <> - - + + )} ))} - {/* Adding stars and floating elements */} -
-
-
-
-
-
-
+ ); }; -const CardX = ({ id, title, description, date, align }) => { +const Card = ({ id, title, description, date }) => { + // For even id show card on left side + // For odd id show card on right side + const isEvenId = id % 2 === 0; + let borderWidthValue = isEvenId ? "15px 15px 15px 0" : "15px 0 15px 15px"; + let leftValue = isEvenId ? "-15px" : "unset"; + let rightValue = isEvenId ? "unset" : "-15px"; + const isMobile = useBreakpointValue({ base: true, md: false }); - const alignValue = isMobile ? "center" : align; + if (isMobile) { + leftValue = "-15px"; + rightValue = "unset"; + borderWidthValue = "15px 15px 15px 0"; + } return ( - + + + {date} + + + + + {title} + + {description} + + ); }; -const LineWithDot = ({ isFinal }) => { +const LineWithDot = () => { return ( - +