-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #656 from sparcs-kaist/dev
Main branch update from Dev branch
- Loading branch information
Showing
95 changed files
with
2,873 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { css, keyframes } from "@emotion/react"; | ||
import { useCallback, useEffect, useRef, useState } from "react"; | ||
|
||
import { ReactComponent as BackPlane } from "static/events/2023fallRandomboxBack.svg"; | ||
import { ReactComponent as FrontPlane } from "static/events/2023fallRandomboxFront.svg"; | ||
import { ReactComponent as FrontPlaneLight } from "static/events/2023fallRandomboxFrontLight.svg"; | ||
import { ReactComponent as LeftPlane } from "static/events/2023fallRandomboxLeft.svg"; | ||
import { ReactComponent as RightPlane } from "static/events/2023fallRandomboxRight.svg"; | ||
import { ReactComponent as RightPlaneLight } from "static/events/2023fallRandomboxRightLight.svg"; | ||
import { ReactComponent as TopPlane } from "static/events/2023fallRandomboxTop.svg"; | ||
|
||
type BodyRandomBoxProps = { | ||
isBoxOpend: boolean; | ||
onClickBox?: () => void; | ||
itemImageUrl?: string; | ||
}; | ||
|
||
const BodyRandomBox = ({ | ||
isBoxOpend, | ||
onClickBox, | ||
itemImageUrl, | ||
}: BodyRandomBoxProps) => { | ||
const bodyRef = useRef<HTMLDivElement>(null); | ||
const getBodyWidth = useCallback(() => bodyRef.current?.clientWidth || 0, []); | ||
const [bodyWidth, setBodyWidth] = useState<number>(getBodyWidth()); | ||
const boxSize = bodyWidth * 0.6; | ||
|
||
useEffect(() => { | ||
const resizeEvent = () => setBodyWidth(getBodyWidth()); | ||
resizeEvent(); | ||
window.addEventListener("resize", resizeEvent); | ||
return () => window.removeEventListener("resize", resizeEvent); | ||
}, []); | ||
|
||
const stylePlane = { | ||
position: "absolute" as const, | ||
top: 0, | ||
left: 0, | ||
width: "100%", | ||
height: "100%", | ||
}; | ||
const stylePlaneLRInversion = { | ||
transform: "scaleX(-1)", | ||
}; | ||
const stylePlaneFlash = css` | ||
animation: ${keyframes` | ||
0% { | ||
opacity: 0; | ||
} | ||
50% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
`} 2s linear infinite; | ||
`; | ||
|
||
return ( | ||
<div ref={bodyRef} css={{ height: `${boxSize * 1.3}px` }}> | ||
<div | ||
css={{ | ||
width: "1rem", | ||
aspectRatio: 1, | ||
margin: `${boxSize / 2 + 20}px auto 0`, | ||
transform: `scale(${(boxSize / 16) * 0.8})`, | ||
}} | ||
> | ||
<div | ||
className={[ | ||
"c2023fallevent-randombox", | ||
...(isBoxOpend ? ["c2023fallevent-randombox-open"] : []), | ||
].join(" ")} | ||
onClick={onClickBox} | ||
> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-front"> | ||
<FrontPlane css={stylePlane} /> | ||
<FrontPlaneLight css={[stylePlane, stylePlaneFlash]} /> | ||
</div> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-back"> | ||
<BackPlane css={{ ...stylePlane, ...stylePlaneLRInversion }} /> | ||
</div> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-left"> | ||
<LeftPlane css={{ ...stylePlane, ...stylePlaneLRInversion }} /> | ||
</div> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-right"> | ||
{/* <RightPlaneLight css={stylePlane} /> | ||
<RightPlane css={[stylePlane, stylePlaneFlash]} /> */} | ||
<RightPlane css={stylePlane} /> | ||
<RightPlaneLight css={[stylePlane, stylePlaneFlash]} /> | ||
</div> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-top"> | ||
<TopPlane css={stylePlane} /> | ||
</div> | ||
<div className="c2023fallevent-randombox-side c2023fallevent-randombox-side-bottom" /> | ||
<div className="c2023fallevent-emoji">🎟</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BodyRandomBox; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import theme from "tools/theme"; | ||
|
||
type ButtonAboveFooterProps = { | ||
text: string; | ||
onClick?: () => void; | ||
}; | ||
|
||
const ButtonAboveFooter = ({ text, onClick }: ButtonAboveFooterProps) => ( | ||
<div css={{ ...theme.font12, padding: "6px" }}> | ||
<a | ||
onClick={onClick} | ||
style={{ | ||
textDecoration: "none", | ||
color: theme.gray_text, | ||
...theme.cursor(), | ||
}} | ||
> | ||
{text} | ||
</a> | ||
</div> | ||
); | ||
|
||
export default ButtonAboveFooter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { ReactNode, memo, useCallback, useState } from "react"; | ||
import { Link } from "react-router-dom"; | ||
|
||
import { ModalCredit, ModalPrivacyPolicy } from "components/ModalPopup"; | ||
|
||
import ButtonAboveFooter from "./ButtonAboveFooter"; | ||
|
||
import { ReactComponent as SparcsLogo } from "static/assets/sparcsLogos/SparcsLogoWithText.svg"; | ||
|
||
type FooterProps = { | ||
type?: "only-logo" | "full" | "event-2023fall"; | ||
children?: ReactNode; | ||
}; | ||
|
||
const Footer = ({ type = "full", children }: FooterProps) => { | ||
const [isOpenPrivacyPolicy, setIsOpenPrivacyPolicy] = useState(false); | ||
const [isOpenCredit, setIsOpenCredit] = useState(false); | ||
|
||
const onClickPrivacyPolicy = useCallback( | ||
() => setIsOpenPrivacyPolicy(true), | ||
[setIsOpenPrivacyPolicy] | ||
); | ||
const onClickCredit = useCallback( | ||
() => setIsOpenCredit(true), | ||
[setIsOpenCredit] | ||
); | ||
|
||
return ( | ||
<div | ||
css={{ | ||
paddingTop: "45px", | ||
textAlign: "center", | ||
}} | ||
> | ||
{children} | ||
{type === "full" && ( | ||
<> | ||
<ModalPrivacyPolicy | ||
isOpen={isOpenPrivacyPolicy} | ||
onChangeIsOpen={setIsOpenPrivacyPolicy} | ||
/> | ||
<ModalCredit isOpen={isOpenCredit} onChangeIsOpen={setIsOpenCredit} /> | ||
<a className="popup-channeltalk"> | ||
<ButtonAboveFooter text="채널톡 문의하기" /> | ||
</a> | ||
<ButtonAboveFooter | ||
text="개인정보 처리방침" | ||
onClick={onClickPrivacyPolicy} | ||
/> | ||
<Link to="/event/2023spring-guide" css={{ textDecoration: "none" }}> | ||
<ButtonAboveFooter text="택시 살펴보기" /> | ||
</Link> | ||
<ButtonAboveFooter text="만든 사람들" onClick={onClickCredit} /> | ||
</> | ||
)} | ||
{type === "event-2023fall" && ( | ||
<> | ||
<ModalCredit | ||
defaultSelectedCatagory="2023FallEvent" | ||
isOpen={isOpenCredit} | ||
onChangeIsOpen={setIsOpenCredit} | ||
/> | ||
<ButtonAboveFooter | ||
text="한가위 송편 이벤트를 만든 사람들" | ||
onClick={onClickCredit} | ||
/> | ||
<Link to="/event/2023spring-guide" css={{ textDecoration: "none" }}> | ||
<ButtonAboveFooter text="택시 살펴보기" /> | ||
</Link> | ||
<a className="popup-channeltalk"> | ||
<ButtonAboveFooter text="채널톡 문의하기" /> | ||
</a> | ||
</> | ||
)} | ||
<div css={{ padding: "6px" }}> | ||
<a href="https://sparcs.org/" target="_blank" rel="noreferrer"> | ||
<SparcsLogo style={{ height: "27px", opacity: 0.632 }} /> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default memo(Footer); |
Oops, something went wrong.