|
| 1 | +import styled from "@emotion/styled"; |
| 2 | +import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; |
| 3 | +import { AccordionDetails, AccordionSummary, Accordion as MuiAccordion, Stack, Typography } from "@mui/material"; |
| 4 | +import * as React from "react"; |
| 5 | +import Marquee from "react-fast-marquee"; |
| 6 | +import { useAppContext } from "../../../../../apps/pyconkr/src/contexts/app_context"; |
| 7 | +import PyCon2025HostLogoBig from "../../assets/pyconkr2025_hostlogo_big.png"; |
| 8 | +import PyCon2025HostLogoSmall from "../../assets/pyconkr2025_hostlogo_small.png"; |
| 9 | + |
| 10 | +const MarqueeAccordion: React.FC = () => { |
| 11 | + const marqueeWidth = window.innerWidth * 0.9; |
| 12 | + const marqueeGradientWidth = window.innerWidth * 0.1; |
| 13 | + const items = React.useMemo(() => { |
| 14 | + return Array.from({ length: 100 }, (_, i) => { |
| 15 | + return ( |
| 16 | + <Stack direction={"row"} sx={{ gap: 0 }}> |
| 17 | + <StyledTypography>{"AUG 15 - 17"}</StyledTypography> |
| 18 | + <img src={PyCon2025HostLogoSmall} /> |
| 19 | + </Stack> |
| 20 | + ); |
| 21 | + }); |
| 22 | + }, []); |
| 23 | + |
| 24 | + return ( |
| 25 | + // <Stack sx={{ maxWidth: "90%" }}> |
| 26 | + <Marquee loop={0} gradient={true} gradientWidth={marqueeGradientWidth} speed={30} style={{ width: marqueeWidth }}> |
| 27 | + {items} |
| 28 | + </Marquee> |
| 29 | + // </Stack> |
| 30 | + ); |
| 31 | +}; |
| 32 | + |
| 33 | +export const MobileAccordion: React.FC = () => { |
| 34 | + const { language } = useAppContext(); |
| 35 | + const [expanded, setExpanded] = React.useState<boolean>(false); |
| 36 | + |
| 37 | + return ( |
| 38 | + <AccordionWrapper> |
| 39 | + <StyledAccordion square={false} expanded={expanded} onChange={() => setExpanded((prev) => !prev)}> |
| 40 | + <AccordionSummary |
| 41 | + expandIcon={ |
| 42 | + <ExpandMoreIcon |
| 43 | + fontSize={"large"} |
| 44 | + sx={{ |
| 45 | + color: "#8E9B5D", |
| 46 | + borderWidth: 1, |
| 47 | + position: "relative", |
| 48 | + top: expanded ? -16 : 0, |
| 49 | + }} |
| 50 | + /> |
| 51 | + } |
| 52 | + sx={{ margin: 0, padding: 0 }} |
| 53 | + > |
| 54 | + {expanded ? null : <MarqueeAccordion />} |
| 55 | + </AccordionSummary> |
| 56 | + <StyledAccordionDetails> |
| 57 | + <Stack> |
| 58 | + <Stack sx={{ padding: "30px 0px", borderRadius: "16px", alignItems: "center", justifyContent: "center" }}> |
| 59 | + <img src={PyCon2025HostLogoBig} alt="PyCon 2025 Host Logo" style={{ width: "90%", height: "90%" }} /> |
| 60 | + </Stack> |
| 61 | + {language === "ko" ? ( |
| 62 | + <Stack direction="column" sx={{ transform: "translateY(-280%)" }}> |
| 63 | + <Typography color="#938A85" textAlign="center" fontSize="11px" fontWeight={400}> |
| 64 | + {"서울특별시 중구 필동로 1길 30 동국대학교 신공학관"} |
| 65 | + </Typography> |
| 66 | + </Stack> |
| 67 | + ) : ( |
| 68 | + <Stack direction="column" sx={{ transform: "translateY(-180%)" }}> |
| 69 | + <Typography color="#938A85" textAlign="center" fontSize="10px" fontWeight={400}> |
| 70 | + {"New Engineering Building, Dongguk University"} |
| 71 | + </Typography> |
| 72 | + <Typography color="#938A85" textAlign="center" fontWeight={400} fontSize="10px"> |
| 73 | + {"Pildong-ro 1-gil, Jung-gu, Seoul, Republic of Korea"} |
| 74 | + </Typography> |
| 75 | + </Stack> |
| 76 | + )} |
| 77 | + </Stack> |
| 78 | + </StyledAccordionDetails> |
| 79 | + </StyledAccordion> |
| 80 | + </AccordionWrapper> |
| 81 | + ); |
| 82 | +}; |
| 83 | + |
| 84 | +const AccordionWrapper = styled.div` |
| 85 | + display: flex; |
| 86 | + flex-direction: column; |
| 87 | + box-shadow: |
| 88 | + 0 4px 16px rgba(0, 0, 0, 0.1), |
| 89 | + 0 -4px 16px rgba(0, 0, 0, 0.1); |
| 90 | + margin: 0; |
| 91 | + padding: 0; |
| 92 | + border-radius: 16; |
| 93 | +`; |
| 94 | + |
| 95 | +const StyledAccordion = styled(MuiAccordion)` |
| 96 | + box-shadow: none; |
| 97 | + border-radius: 16; |
| 98 | +
|
| 99 | + &:before { |
| 100 | + display: none; |
| 101 | + } |
| 102 | +
|
| 103 | + &.MuiAccordion-root { |
| 104 | + margin: 0; |
| 105 | +
|
| 106 | + &:first-of-type { |
| 107 | + border-top: none; |
| 108 | + } |
| 109 | +
|
| 110 | + &:last-of-type { |
| 111 | + border-bottom: none; |
| 112 | + } |
| 113 | + } |
| 114 | +
|
| 115 | + .MuiAccordionSummary-root { |
| 116 | + padding: 10px 0px 10px 0px; |
| 117 | + min-height: 60px; |
| 118 | + max-height: 60px; |
| 119 | +
|
| 120 | + .MuiAccordionSummary-content { |
| 121 | + display: flex; |
| 122 | + align-items: center; |
| 123 | + margin: 0; |
| 124 | + } |
| 125 | +
|
| 126 | + &.Mui-expanded { |
| 127 | + min-height: 0px; |
| 128 | + max-height: 0px; |
| 129 | + object-fit: contain; |
| 130 | + } |
| 131 | + } |
| 132 | +
|
| 133 | + "& .muiaccordionsummary-expandiconwrapper": { |
| 134 | + position: 'absolute', |
| 135 | + top: 10; |
| 136 | + } |
| 137 | +
|
| 138 | + , |
| 139 | + .MuiAccordionDetails-root { |
| 140 | + margin: 6px 0px 24px 0px; |
| 141 | + } |
| 142 | +
|
| 143 | + width: 100%; |
| 144 | + max-width: 100vw; |
| 145 | + box-sizing: border-box; |
| 146 | + position: relative; |
| 147 | + marginleft: 0; |
| 148 | + paddingleft: 0; |
| 149 | +`; |
| 150 | + |
| 151 | +const StyledTypography = styled(Typography)` |
| 152 | + font-weight: 500; |
| 153 | + font-size: 20px; |
| 154 | + color: #938a85; |
| 155 | + text-align: center; |
| 156 | + padding: 0 20px; |
| 157 | +`; |
| 158 | + |
| 159 | +const StyledAccordionDetails = styled(AccordionDetails)` |
| 160 | + font-size: 14px; |
| 161 | + font-weight: 400; |
| 162 | + width: 100%; |
| 163 | + height: 100%; |
| 164 | + margin: 0; |
| 165 | + padding: 0; |
| 166 | +`; |
0 commit comments