diff --git a/public/2D_material/red_lite.webp b/public/2D_material/red_lite.webp index 86ef1ad..0d19398 100644 Binary files a/public/2D_material/red_lite.webp and b/public/2D_material/red_lite.webp differ diff --git a/src/components/responsive/homePC/index.module.css b/src/components/responsive/homePC/index.module.css new file mode 100644 index 0000000..6ef54f8 --- /dev/null +++ b/src/components/responsive/homePC/index.module.css @@ -0,0 +1,113 @@ +@keyframes infinity-scroll-left { + from { + transform: translateX(0); + } + to { + transform: translateX(-100%); + } +} + +.scroll-infinity__wrap { + display: flex; + overflow: hidden; + width: 100vw; +} + +.scroll-infinity__list { + display: flex; + list-style: none; + padding: 0; +} + +.scroll-infinity__list--left { + animation: infinity-scroll-left 60s infinite linear 0.5s both; +} + +.scroll-infinity__item { + width: 33.33vw; +} + +.scroll-infinity__item > img { + width: 100%; +} + +.background-logo { + opacity: 0.2; + position: absolute; + top: 50%; + left: 24%; + transform: translate(-50%, -50%); + justify-content: center; + align-items: center; + max-width: 48%; +} + +li { + font-size: 40px; + padding: 0 32px; +} + +.go-game-pc { + position: absolute; + top: 80%; + left: 24%; + transform: translate(-50%, -50%); + justify-content: center; + align-items: center; + width: 40%; + text-align: center; + z-index: 10; +} + +.go-game-pc button { + width: 100%; + padding: 16px 0; + font-size: 24px; +} + +.red-lite{ + opacity: 0.8; + position: absolute; + top: 2%; + right: 0; +} + +.pistol-img{ + opacity: 0.2; + position: absolute; + top: 25%; + right: 8%; + transform: scale(-1, 1); +} + +.overlay-square { + position: absolute; + top: 20%; + right: 120px; + width: 520px; + height: 532px; + background-color: rgba(255, 255, 255, 0.8); + z-index: 1; +} + +.id-room{ + position: absolute; + top: 20%; + right: 300px; + font-size: 32px; + z-index: 10; +} + +.qr-scan{ + position: absolute; + top: 60%; + right: -10px; + z-index: 10; +} + +.link-copy{ + position: absolute; + top: 80%; + right: 300px; + z-index: 10; +} \ No newline at end of file diff --git a/src/components/responsive/homePC/index.tsx b/src/components/responsive/homePC/index.tsx new file mode 100644 index 0000000..38bad05 --- /dev/null +++ b/src/components/responsive/homePC/index.tsx @@ -0,0 +1,91 @@ +import { DefaultButton } from "../../ui/Button"; +import TextButton from "../../ui/TextButton"; +import styles from "./index.module.css"; + +function HomePC() { + const handleClick = () => { + const audio = new Audio("/sound/wadaiko.mp3"); + audio + .play() + .then(() => { + setTimeout(() => { + window.location.href = "/yatai"; + }, 500); + }) + .catch((error) => { + console.error("オーディオの音が出なかった", error); + window.location.href = "/yatai"; + }); + }; + + return ( +
+
+
+
    +
  • + VIRTUAL_NATSUMATSURI +
  • +
  • + VIRTUAL_NATSUMATSURI +
  • +
  • + VIRTUAL_NATSUMATSURI +
  • +
+
+
+
+ 背景にばーちゃるなつまつりのロゴ +
+
+ + 射的へ向かう + +
+
+
+

屋台のID

+
+
+ 赤提灯 +
+
+ ピストル +
+
+ qr-scan +
+
+ +
+
+ ); +} +export default HomePC; diff --git a/src/components/responsive/homeSP/index.module.css b/src/components/responsive/homeSP/index.module.css new file mode 100644 index 0000000..d206a1a --- /dev/null +++ b/src/components/responsive/homeSP/index.module.css @@ -0,0 +1,64 @@ +@keyframes infinity-scroll-left { + from { + transform: translateX(0); + } + to { + transform: translateX(-100%); + } +} + +.scroll-infinity__wrap { + display: flex; + overflow: hidden; + width: 100vw; +} + +.scroll-infinity__list { + display: flex; + list-style: none; + padding: 0; +} + +.scroll-infinity__list--left { + animation: infinity-scroll-left 80s infinite linear 0.5s both; +} + +.scroll-infinity__item { + width: 100vw; +} + +.scroll-infinity__item > img { + width: 100%; +} + +.background-logo { + opacity: 0.2; + position: absolute; + top: 10%; + left: 50%; + transform: translateX(-50%); + justify-content: center; + align-items: center; +} + +li { + font-size: 24px; + padding: 0 24px; +} + +.go-game-sp { + position: absolute; + top: 40%; + left: 50%; + transform: translate(-50%, -50%); + justify-content: center; + align-items: center; + width: 80%; + text-align: center; +} + +.go-game-sp button { + width: 100%; + padding: 12px 0; + font-size: 18px; +} diff --git a/src/components/responsive/homeSP/index.tsx b/src/components/responsive/homeSP/index.tsx new file mode 100644 index 0000000..58fee29 --- /dev/null +++ b/src/components/responsive/homeSP/index.tsx @@ -0,0 +1,58 @@ +import { DefaultButton } from "../../ui/Button"; +import styles from "./index.module.css"; + +function HomeSP() { + const handleClick = () => { + const audio = new Audio("/sound/wadaiko.mp3"); + audio + .play() + .then(() => { + setTimeout(() => { + window.location.href = "/shooter"; + }, 500); + }) + .catch((error) => { + console.error("オーディオの音が出なかった", error); + window.location.href = "/shooter"; + }); + }; + + return ( +
+
+
+
+
    +
  • + VIRTUAL_NATSUMATSURI +
  • +
  • + VIRTUAL_NATSUMATSURI +
  • +
  • + VIRTUAL_NATSUMATSURI +
  • +
+
+
+
+ 背景にばーちゃるなつまつりのロゴ +
+
+ + 射的へ向かう + +
+
+
+ ); +} + +export default HomeSP; diff --git a/src/components/ui/Button/index.module.css b/src/components/ui/Button/index.module.css index ef69462..bee8aab 100644 --- a/src/components/ui/Button/index.module.css +++ b/src/components/ui/Button/index.module.css @@ -1,12 +1,6 @@ .button-style { border-width: 0; - &:hover { - &:not([disabled]) { - scale: 1.2; - } - } - &[data-size="sm"] { padding: 4px 8px; font-size: 12px; diff --git a/src/components/ui/TextButton/index.module.css b/src/components/ui/TextButton/index.module.css new file mode 100644 index 0000000..70179ab --- /dev/null +++ b/src/components/ui/TextButton/index.module.css @@ -0,0 +1,26 @@ +.textButton { + background: none; + border: none; + cursor: pointer; + font: inherit; + padding: 0; + text-decoration: none; + outline: none; + font-family: 'Yuji Syuku', serif; +} + +.textButton.sm { + font-size: 12px; +} + +.textButton.md { + font-size: 16px; +} + +.textButton.lg { + font-size: 20px; +} + +.underline { + text-decoration: underline; +} diff --git a/src/components/ui/TextButton/index.tsx b/src/components/ui/TextButton/index.tsx new file mode 100644 index 0000000..1acfec7 --- /dev/null +++ b/src/components/ui/TextButton/index.tsx @@ -0,0 +1,35 @@ +import styles from "./index.module.css"; + +type TextButtonProps = { + text: string; + onClick?: () => void; + color?: string; + size?: "sm" | "md" | "lg"; + disabled?: boolean; + type?: "button" | "submit" | "reset"; + underline?: boolean; +}; + +const TextButton: React.FC = ({ + text, + onClick, + color = "black", + size = "md", + disabled = false, + type = "button", + underline = false, +}) => { + return ( + + ); +}; + +export default TextButton; diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 0ca19b9..a84b062 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; -import { DefaultButton } from "../../components/ui/Button"; +import HomePC from "../../components/responsive/homePC"; +import HomeSP from "../../components/responsive/homeSP"; import { device } from "../../utils/device"; -import styles from "./index.module.css"; function Home() { const [isPcScreen, setIsPcScreen] = useState( @@ -11,9 +11,7 @@ function Home() { useEffect(() => { const mediaQuery = window.matchMedia(device.pc); - const handleChange = (event: { - matches: boolean | ((prevState: boolean) => boolean); - }) => { + const handleChange = (event: { matches: boolean }) => { setIsPcScreen(event.matches); }; @@ -23,57 +21,7 @@ function Home() { }; }, []); - const handleClick = () => { - const audio = new Audio("/sound/wadaiko.mp3"); - audio - .play() - .then(() => { - setTimeout(() => { - window.location.href = isPcScreen ? "/yatai" : "/shooter"; - }, 500); - }) - .catch((error) => { - console.error("オーディオの音が出なかった", error); - window.location.href = isPcScreen ? "/yatai" : "/shooter"; - }); - }; - - return ( -
-
-
-
    -
  • - VIRTUAL_NATSUMATSURI -
  • -
  • - VIRTUAL_NATSUMATSURI -
  • -
  • - VIRTUAL_NATSUMATSURI -
  • -
-
-
-
- 背景にばーちゃるなつまつりのロゴ -
-
- - 射的へ向かう - -
-
- ); + return isPcScreen ? : ; } export default Home;