diff --git a/src/components/Event/BodyRandomBox/index.css b/src/components/Event/BodyRandomBox/index.css index 5c042ca24..2c07e414a 100644 --- a/src/components/Event/BodyRandomBox/index.css +++ b/src/components/Event/BodyRandomBox/index.css @@ -16,22 +16,6 @@ will-change: transform; } -.c2023fallevent-randombox-side-front { - transform: rotateX(-25deg) rotateY(-25deg) translateZ(250px); -} - -.c2023fallevent-randombox-side-back { - transform: rotateX(-25deg) rotateY(-25deg) rotateY(180deg) translateZ(250px); -} - -.c2023fallevent-randombox-side-left { - transform: rotateX(-25deg) rotateY(-25deg) rotateY(-90deg) translateZ(250px); -} - -.c2023fallevent-randombox-side-right { - transform: rotateX(-25deg) rotateY(-25deg) rotateY(90deg) translateZ(250px); -} - .c2023fallevent-randombox-side-top { transform-origin: 0px 0px 0px; top: -24px; @@ -61,6 +45,7 @@ } .c2023fallevent-randombox-open .c2023fallevent-emoji { + opacity: 0; animation: raiseEmoji 4s 4s ease-out forwards, rotateEmoji 5s 8s linear infinite; } @@ -82,7 +67,14 @@ } @keyframes raiseEmoji { + 0% { + opacity: 0; + } + 20% { + opacity: 0.5; + } 100% { + opacity: 1; transform: rotateX(-25deg) rotateY(-25deg) translate(calc(250px - 50%), -400px); } diff --git a/src/components/Event/BodyRandomBox/index.tsx b/src/components/Event/BodyRandomBox/index.tsx index dba986000..c4958d296 100644 --- a/src/components/Event/BodyRandomBox/index.tsx +++ b/src/components/Event/BodyRandomBox/index.tsx @@ -3,12 +3,11 @@ import { memo, useCallback, useEffect, useRef, useState } from "react"; import "./index.css"; -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 theme from "tools/theme"; + +import BackPlaneImage from "static/events/2023fallRandomboxBack.png"; +import FrontPlaneImage from "static/events/2023fallRandomboxFront.png"; +import FrontPlaneLightImage from "static/events/2023fallRandomboxFrontLight.png"; import { ReactComponent as TopPlane } from "static/events/2023fallRandomboxTop.svg"; type BodyRandomBoxProps = { @@ -41,8 +40,17 @@ const BodyRandomBox = ({ width: "100%", height: "100%", }; - const stylePlaneLRInversion = { - transform: "scaleX(-1)", + const stylePlaneFront = { + position: "absolute" as const, + top: "-32px", + left: "-84px", + width: "670px", + }; + const stylePlaneBack = { + position: "absolute" as const, + top: "-120px", + left: "-80px", + width: "664px", }; const stylePlaneFlash = css` animation: ${keyframes` @@ -73,44 +81,37 @@ const BodyRandomBox = ({ height: `${boxSize}px`, aspectRatio: 1, margin: `0 auto`, + ...theme.cursor(isBoxOpend), transform: `scale(${ (boxSize / 500) * 0.8 }) translateX(-160px) translateY(-70px)`, }} + onClick={onClickBox} > +