Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #98 from isd-sgcu/feature/rkm66-84-game-before-e-t…
Browse files Browse the repository at this point in the history
…icket

Feature/rkm66 84 game before e ticket
  • Loading branch information
betich authored Aug 4, 2023
2 parents 08cc981 + 37d985f commit 6558398
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 28 deletions.
36 changes: 18 additions & 18 deletions src/components/Game/lib/GameBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ export default function GameBackground(bg: any) {
return <></>;
case '2':
return (
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-full w-full select-none bg-white object-cover object-top" />
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-screen w-screen select-none bg-white object-cover object-top" />
);
case '3':
return (
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-full w-full select-none bg-black object-cover object-top" />
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-screen w-screen select-none bg-black object-cover object-top" />
);
case '4':
return (
<Image
src={scene4}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '15':
Expand All @@ -43,7 +43,7 @@ export default function GameBackground(bg: any) {
src={scene15}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '17':
Expand All @@ -52,7 +52,7 @@ export default function GameBackground(bg: any) {
src={scene17}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '19':
Expand All @@ -61,7 +61,7 @@ export default function GameBackground(bg: any) {
src={scene19}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '21':
Expand All @@ -70,7 +70,7 @@ export default function GameBackground(bg: any) {
src={scene21}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '24':
Expand All @@ -79,7 +79,7 @@ export default function GameBackground(bg: any) {
src={scene24}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '25':
Expand All @@ -88,7 +88,7 @@ export default function GameBackground(bg: any) {
src={scene25}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '29':
Expand All @@ -97,7 +97,7 @@ export default function GameBackground(bg: any) {
src={scene29}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '30':
Expand All @@ -106,7 +106,7 @@ export default function GameBackground(bg: any) {
src={scene30}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '32':
Expand All @@ -115,7 +115,7 @@ export default function GameBackground(bg: any) {
src={scene32}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '33':
Expand All @@ -124,7 +124,7 @@ export default function GameBackground(bg: any) {
src={scene33}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '34':
Expand All @@ -133,7 +133,7 @@ export default function GameBackground(bg: any) {
src={scene34}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '37':
Expand All @@ -142,7 +142,7 @@ export default function GameBackground(bg: any) {
src={scene37}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '42':
Expand All @@ -151,7 +151,7 @@ export default function GameBackground(bg: any) {
src={scene42}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
case '48':
Expand All @@ -160,12 +160,12 @@ export default function GameBackground(bg: any) {
src={scene48}
alt=""
sizes="(min-width: 1024px) 0, 100vw"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-full w-full select-none object-cover"
className="pointer-events-none fixed left-0 top-0 -z-40 block h-screen w-screen select-none object-cover"
/>
);
default:
return (
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-full w-full select-none bg-black object-cover object-top" />
<div className="pointer-events-none fixed left-0 top-0 -z-40 h-screen w-screen select-none bg-black object-cover object-top" />
);
}
}
6 changes: 3 additions & 3 deletions src/components/Game/lib/GameContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ function ChoicesButton({
);
} else if (choices.length === 2) {
return (
<div className="mx-auto my-10 flex flex-col justify-center gap-4 text-sm">
<div className="w- mx-auto my-10 flex justify-center gap-2 text-sm font-extralight">
<Button
content={choices[0].message}
onClick={() => {
console.log(goto);
setPage(goto);
Score(choices[0].score);
}}
additionalStyle="mx-4 bg-pink-400 w-fit px-2 shadow-md border-pink-600 border-4 rounded-xl"
additionalStyle="font-extralight text-s mx-5 bg-pink-400 px-2 shadow-md border-pink-600 border-4 rounded-xl"
/>
<Button
content={choices[1].message}
Expand All @@ -47,7 +47,7 @@ function ChoicesButton({
setPage(goto);
Score(choices[1].score);
}}
additionalStyle="mx-4 bg-pink-400 w-fit px-2 shadow-md border-pink-600 border-4 rounded-xl"
additionalStyle="text-s mx-5 bg-pink-400 px-2 shadow-md border-pink-600 border-4 rounded-xl"
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Game/lib/Planet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Planet: React.FC<{ num: number }> = ({ num }) => {
{user?.firstname || ''} {user?.lastname || ''}
</h2>
</div>
<Bar description={planets[0].planetDes} />
<Bar description={planets[num].planetDes} />
{planets[num].detail && (
<Bar description={planets[num].detail as string} />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Game/lib/Scene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const GameScene: Scene = {
Game32: {
bg: '32',
message: (
<p className="text-white">วินาทีนั้น แสงก็พุ่งมาอยู่ตรงหน้า</p>
<p className="text-black">วินาทีนั้น แสงก็พุ่งมาอยู่ตรงหน้า</p>
),
choices: [],
goto: 'Game33',
Expand Down
Binary file removed src/pages/.article-page.tsx.icloud
Binary file not shown.
Binary file removed src/pages/.estamp-home.tsx.icloud
Binary file not shown.
9 changes: 7 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AppContextProvider } from '@/context/ModalContext';

import { ibmPlexSansThai } from '@/components/font';
import PhaseTwoNavbar from '@/components/PhaseTwoNavbar';
import { useRouter } from 'next/router';

function MetaData() {
return (
Expand Down Expand Up @@ -55,18 +56,22 @@ function MetaData() {
}

export default function App({ Component, pageProps }: AppProps) {
const router = useRouter();

return (
<main className={`${ibmPlexSansThai.variable} font-ibm text-white`}>
<ToastProvider>
<AuthProvider>
<AppContextProvider>
<MetaData />

<PhaseTwoNavbar />
{!router.pathname.startsWith('/game') && (
<PhaseTwoNavbar />
)}
<Component {...pageProps} />

<Background />
<Footer />
{!router.pathname.startsWith('/game') && <Footer />}
</AppContextProvider>
</AuthProvider>
</ToastProvider>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useAuth } from '@/context/AuthContext';
import Planet from '@/components/Game/lib/Planet';
import Score from '@/components/Game/lib/Score';

// import CollectScore from './lib/CollectScore'

const GameLogic = () => {
const { user } = useAuth();
const [page, setPage] = useState<string>('Game40');
const [page, setPage] = useState<string>('Game01');
<GameContainer
scene={{
id: page,
Expand Down Expand Up @@ -49,6 +47,7 @@ const GameLogic = () => {
return <Planet num={planetNum as number}></Planet>;
}
return (
// <Planet num={2}></Planet>
<div>
<GameContainer
scene={{
Expand Down

0 comments on commit 6558398

Please sign in to comment.