diff --git a/src/pages/conversationPage.jsx b/src/pages/conversationPage.jsx index 49c2128..e6dc980 100644 --- a/src/pages/conversationPage.jsx +++ b/src/pages/conversationPage.jsx @@ -11,6 +11,7 @@ function ConversationPage({data , onClicked}) { return (
onClicked(data.goTo-1)} style={{ display: 'flex', justifyContent: 'center', diff --git a/src/pages/introductionPage.jsx b/src/pages/introductionPage.jsx index 6193cec..75cf4a9 100644 --- a/src/pages/introductionPage.jsx +++ b/src/pages/introductionPage.jsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; import '../css/global.css'; import BlackButton from './components/customButton'; import Animation from './components/animation.jsx'; @@ -9,7 +10,7 @@ import SelectionCharacter from './components/selectionCharacter.jsx'; import Character from './class/character.jsx'; function IntroductionPage() { - + const navigate = useNavigate(); const [loading, setLoading] = useState(true); const [positionState, setPositionState] = useState("middle"); const [isClickedIntroduction, setIsClickedIntroduction] = useState(false); @@ -34,6 +35,7 @@ function IntroductionPage() { const handleClickedButton = () => { console.log(character.name(numChar)) + if(character.name(numChar)=='Porsche') navigate(`/vs/0`); } return ( diff --git a/src/pages/optionPage.jsx b/src/pages/optionPage.jsx index a6679c2..042a349 100644 --- a/src/pages/optionPage.jsx +++ b/src/pages/optionPage.jsx @@ -26,15 +26,10 @@ function OptionPage({data , onClicked}) {
- {/*
-
- {data.name} -
-
*/}
{ data.option.map((item,i) => -
{item.text}
) +
onClicked(item.goTo-1)} key={i} className='optionBox title'>{item.text}
) }
diff --git a/src/pages/storyPage.jsx b/src/pages/storyPage.jsx index 266c60b..08e2c72 100644 --- a/src/pages/storyPage.jsx +++ b/src/pages/storyPage.jsx @@ -8,7 +8,7 @@ function StoryPage({data , onClicked}) { return (
onClicked(data.goTo-1)} style={{ display: 'flex', justifyContent: 'center', diff --git a/src/pages/vistualNovelHandler.jsx b/src/pages/vistualNovelHandler.jsx index 6022362..67e23e5 100644 --- a/src/pages/vistualNovelHandler.jsx +++ b/src/pages/vistualNovelHandler.jsx @@ -46,12 +46,17 @@ function VitualNovelHandler() { return
Loading...
; } - const handleNextStep = () => { - console.log(data); - if (currentStep < data.length - 1) { - setCurrentStep(currentStep + 1); - navigate(`/vs/${currentStep + 1}`); - } + const handleNextStep = (nextstep) => { + // console.log(data); + console.log(nextstep) + setCurrentStep(nextstep); + navigate(`/vs/${nextstep}`); + + + // else if (nextstep < data.length - 1) { + // setCurrentStep(nextstep + 1); + // navigate(`/vs/${nextstep + 1}`); + // } }; const currentStepData = data[currentStep];