This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
151 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { useState } from "react"; | ||
import { Route, Routes } from "react-router-dom"; | ||
import Home from "./pages/home"; | ||
import Result from "./pages/result"; | ||
import Shooter from "./pages/shooter"; | ||
import Yatai from "./pages/yatai"; | ||
import { useState } from "react"; | ||
|
||
const AppRoutes = () => { | ||
const [score, setScore] = useState<number>(0); | ||
const [score, setScore] = useState<number>(0); | ||
|
||
return ( | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
<Route | ||
path="/shooter" | ||
element={<Shooter setScore={setScore} />} | ||
/> | ||
<Route | ||
path="/result" | ||
element={<Result score={score} />} | ||
/> | ||
<Route path="/yatai" element={<Yatai />} /> | ||
</Routes> | ||
); | ||
return ( | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/shooter" element={<Shooter setScore={setScore} />} /> | ||
<Route path="/result" element={<Result score={score} />} /> | ||
<Route path="/yatai" element={<Yatai />} /> | ||
</Routes> | ||
); | ||
}; | ||
|
||
export default AppRoutes; |
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 |
---|---|---|
@@ -1,62 +1,61 @@ | ||
import { DefaultButton } from "../../components/ui/Button"; | ||
import GetImage from "../../components/GetImage"; | ||
import { DefaultButton } from "../../components/ui/Button"; | ||
import styles from "./index.module.css"; | ||
|
||
type ResultProps = { | ||
score: number; | ||
score: number; | ||
}; | ||
|
||
const Result = ({ score }: ResultProps) => { | ||
const images = [ | ||
"/drink/bottle0.webp", | ||
"/drink/bottle1.webp", | ||
"/drink/bottle2.webp", | ||
"/drink/bottle3.webp", | ||
]; | ||
const images = [ | ||
"/drink/bottle0.webp", | ||
"/drink/bottle1.webp", | ||
"/drink/bottle2.webp", | ||
"/drink/bottle3.webp", | ||
]; | ||
|
||
|
||
const image = images[score] ; | ||
const image = images[score]; | ||
|
||
return ( | ||
<div> | ||
<div className={styles["result-text"]}> | ||
<p>結果発表!</p> | ||
</div> | ||
<div className={styles["get-image-container"]}> | ||
<GetImage | ||
images={[image]} | ||
alt={`スコア ${score} に対応するボトル画像`} | ||
width={160} | ||
height={160} | ||
/> | ||
</div> | ||
<div className={styles["background-logo"]}> | ||
<img | ||
src="/logo.webp" | ||
alt="背景にばーちゃるなつまつりのロゴ" | ||
width="350" | ||
height="350" | ||
/> | ||
</div> | ||
<div className={styles["get-text"]}> | ||
<p>${score}本倒した!</p> | ||
</div> | ||
<div className={styles["share-btn"]}> | ||
<a | ||
href="https://twitter.com/intent/tweet?text=Webの射的で遊んだよ.${score}本倒した!%20%23virtualnatsumatsuri" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<DefaultButton variant="contained" color="black" size="md"> | ||
Xで共有する | ||
</DefaultButton> | ||
</a> | ||
</div> | ||
<div className={styles["replay-text"]}> | ||
<p>また遊びにきてや〜</p> | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<div className={styles["result-text"]}> | ||
<p>結果発表!</p> | ||
</div> | ||
<div className={styles["get-image-container"]}> | ||
<GetImage | ||
images={[image]} | ||
alt={`スコア ${score} に対応するボトル画像`} | ||
width={160} | ||
height={160} | ||
/> | ||
</div> | ||
<div className={styles["background-logo"]}> | ||
<img | ||
src="/logo.webp" | ||
alt="背景にばーちゃるなつまつりのロゴ" | ||
width="350" | ||
height="350" | ||
/> | ||
</div> | ||
<div className={styles["get-text"]}> | ||
<p>${score}本倒した!</p> | ||
</div> | ||
<div className={styles["share-btn"]}> | ||
<a | ||
href="https://twitter.com/intent/tweet?text=Webの射的で遊んだよ.${score}本倒した!%20%23virtualnatsumatsuri" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<DefaultButton variant="contained" color="black" size="md"> | ||
Xで共有する | ||
</DefaultButton> | ||
</a> | ||
</div> | ||
<div className={styles["replay-text"]}> | ||
<p>また遊びにきてや〜</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Result; |
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