Skip to content

Commit

Permalink
feat: infinite loop story
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeranan Chaisuwan authored and Neeranan Chaisuwan committed Jan 24, 2024
1 parent 3264a4f commit 0804872
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 41 deletions.
Empty file.
28 changes: 28 additions & 0 deletions src/components/story/Textbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// src/components/story/Textbox.astro

import type { ReactNode } from "react";

Check failure on line 3 in src/components/story/Textbox.tsx

View workflow job for this annotation

GitHub Actions / lint

'ReactNode' is defined but never used

Check failure on line 3 in src/components/story/Textbox.tsx

View workflow job for this annotation

GitHub Actions / lint

'ReactNode' is defined but never used

interface Props {
header: string;
}

const Textbox = ({ header }: Props) => {
return (
<div className="border-1 mt-1 flex flex-col h-80 w-80 items-start justify-start gap-2 rounded-2xl
border border-mutedpurple bg-mutedpurple px-8 py-4 text-left font-sans shadow-md">
<p className="mb-2 whitespace-pre-line text-lg font-bold text-white">
{header}
</p>
<label htmlFor="userAnswer" className="text-white">
เขียนคำตอบของคุณ....
</label>
<textarea
id="userAnswer"
className="border-none bg-mutedpurple rounded-md p-2 text-lg h-full w-full text-white" // Added 'text-white'
onChange={(e) => console.log(`User's answer: ${e.target.value}`)}
/>
</div>
);
};

export default Textbox;
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added src/images/bg_bar.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/pages/story/Q11A.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import Scene from "../../images/bg_bar.JPG";
import BaseLayout from "@/layouts/BaseLayout.astro";
import Textbox from "@/components/story/Textbox";
import ChoiceCard from "@/components/story/ChoiceCard";
const redirect = "./Scene11";
---

<BaseLayout>
<div class="flex flex-col items-center justify-center h-screen relative">
<img class="z-0 mx-auto object-contain" src={Scene.src} alt="Scene Image" />
<form class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center gap-8" action={redirect}>
<ChoiceCard header= "แล้วสำหรับคุณ \nคำว่า‘ความสุข’ คืออะไร">
<Textbox />
</ChoiceCard>
</form>
</div>
</BaseLayout>

19 changes: 19 additions & 0 deletions src/pages/story/Q11B.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import Scene from "../../images/bg_bar.JPG";
import BaseLayout from "@/layouts/BaseLayout.astro";
import Textbox from "@/components/story/Textbox";
import ChoiceCard from "@/components/story/ChoiceCard";
const redirect = "./Scene11";
---

<BaseLayout>
<div class="flex flex-col items-center justify-center h-screen relative">
<img class="z-0 mx-auto object-contain" src={Scene.src} alt="Scene Image" />
<form class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center gap-8" action={redirect}>
<ChoiceCard header= "แล้วสำหรับคุณ \nคำว่า‘ความสุข’ คืออะไร">
<Textbox />
</ChoiceCard>
</form>
</div>
</BaseLayout>

Empty file added src/pages/story/Q12.astro
Empty file.
19 changes: 19 additions & 0 deletions src/pages/story/Q13.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import Scene from "../../images/bg_bar.JPG";
import BaseLayout from "@/layouts/BaseLayout.astro";
import Textbox from "@/components/story/Textbox";
import ChoiceCard from "@/components/story/ChoiceCard";
const redirect = "./Scene12";
---

<BaseLayout>
<div class="flex flex-col items-center justify-center h-screen relative">
<img class="z-0 mx-auto object-contain" src={Scene.src} alt="Scene Image" />
<form class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center gap-8" action={redirect}>
<ChoiceCard header="ถ้ามี ‘คนที่คุณรัก‘ \nมานั่งฟังเรื่องราวของคุณ \nคิดว่าเขาจะพูดอะไรกับคุณ">
<Textbox />
</ChoiceCard>
</form>
</div>
</BaseLayout>

19 changes: 19 additions & 0 deletions src/pages/story/Q14.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import Scene from "../../images/bg_bar.JPG";
import BaseLayout from "@/layouts/BaseLayout.astro";
import Textbox from "@/components/story/Textbox";
import ChoiceCard from "@/components/story/ChoiceCard";
const redirect = "./Q15";
---

<BaseLayout>
<div class="flex flex-col items-center justify-center h-screen relative">
<img class="z-0 mx-auto object-contain" src={Scene.src} alt="Scene Image" />
<form class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center gap-8" action={redirect}>
<ChoiceCard header="คุณเมาแล้วนึกถึงเรื่องอดีต \nคุณคิดถึงใครบางคน \nผู้คนที่ทำให้คุณมีวันนี้ คนนั้นคือใคร">
<Textbox />
</ChoiceCard>
</form>
</div>
</BaseLayout>

19 changes: 19 additions & 0 deletions src/pages/story/Q15.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import Scene from "../../images/bg_bar.JPG";
import BaseLayout from "@/layouts/BaseLayout.astro";
import Textbox from "@/components/story/Textbox";
import ChoiceCard from "@/components/story/ChoiceCard";
const redirect = "./Q16";
---

<BaseLayout>
<div class="flex flex-col items-center justify-center h-screen relative">
<img class="z-0 mx-auto object-contain" src={Scene.src} alt="Scene Image" />
<form class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center gap-8" action={redirect}>
<ChoiceCard header="แล้วคุณอยากจะกล่าวอะไร \nกับผู้คนเหล่านั้น">
<Textbox />
</ChoiceCard>
</form>
</div>
</BaseLayout>

50 changes: 28 additions & 22 deletions src/pages/story/scene1.astro
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
---
import Scene from "../../images/IMG_1029.gif"
import Craycircle from "../../images/Bubble box 1.png"
import Scene from "../../images/Scene1.gif"
import BubbleBox from "../../images/BubbleBox.png"
import BaseLayout from "../../layouts/BaseLayout.astro"
import Tap from "../../components/story/Tap.tsx"
---

<BaseLayout>
<div class="relative h-full w-full">

<div class="fade-in">
<div class="absolute z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center" style="font-size: 16px">
เฮ้ออ<br/>หมดไปอีกหนึ่งวัน
<div class="relative h-full w-full">
<div class="fade-in">
<div class="absolute z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center" style="font-size: 16px; font-weight: bold">
เฮ้ออ<br/>หมดไปอีกหนึ่งวัน
</div>

<div class="absolute z-40 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
<img src={Craycircle.src} alt="Bubble box 1.png">
<img src={BubbleBox.src} alt="Bubble box 1.png">
</div>

<a href="/" class="absolute z-50 bottom-10 left-1/2 -translate-x-1/ text-black text-opacity-50 px-4 py-2 rounded-md text-center" onclick="handleContinueClick()">
Tap to<br/>Continue
</a>
</div>

<img class="relative z-0 h-screen mx-auto object-contain" src={Scene.src}></img>

<div class="relative fade-in">
<Tap redirect="./Scene2"/>
</div>
</div>

Check failure on line 25 in src/pages/story/scene1.astro

View workflow job for this annotation

GitHub Actions / lint

Parsing error: Unknown token at 848, expected: "<style", actual: "</div>\n

Check failure on line 25 in src/pages/story/scene1.astro

View workflow job for this annotation

GitHub Actions / lint

Parsing error: Unknown token at 848, expected: "<style", actual: "</div>\n

<img class="relative z-0 h-screen mx-auto object-contain" src={Scene.src}></img>
</div>
</BaseLayout>

<style>
</BaseLayout>

<style>
@keyframes fadeIn {
0% { opacity: 0; }
100% { opacity: 1; }
}

.fade-in {
animation: fadeIn 2s ease-in-out;
animation: fadeIn 2s ease-in-out;
}

/* Add a class for bold Thai text */
.bold-thai {
font-weight: bold;
}
</style>
</style>

13 changes: 4 additions & 9 deletions src/pages/story/scene3.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
---
import Scene from "../../images/IMG_1010.gif"
import Scene from "../../images/Scene3.gif"
import BaseLayout from "../../layouts/BaseLayout.astro"
import Tap from "../../components/story/Tap.tsx"
---

<BaseLayout>
<div class="relative h-full w-full">

<div class="fade-in">
<a href="/" class="absolute z-50 bottom-10 left-1/2 -translate-x-1/ text-black text-opacity-50 px-4 py-2 rounded-md text-center" onclick="handleContinueClick()">
Tap to<br/>Continue
</a>
<img class="relative z-0 h-screen mx-auto object-contain" src={Scene.src} />
<div class="relative fade-in"><Tap redirect="./Q4"/></div>
</div>

<img class="relative z-0 h-screen mx-auto object-contain" src={Scene.src}></img>
</div>
</BaseLayout>

<style>
Expand Down
16 changes: 6 additions & 10 deletions src/pages/story/scene4.astro
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
---
import Scene from "../../images/IMG_1011.gif"
import Craycircle from "../../images/Bubble box 1.png"
import Scene from "../../images/Scene4.gif"
import BubbleBox from "../../images/BubbleBox.png"
import BaseLayout from "../../layouts/BaseLayout.astro"
import Tap from "../../components/story/Tap.tsx"
---

<BaseLayout>
<div class="relative h-full w-full">

<div class="fade-in">
<div class="absolute z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" style="font-size: 16px">
<div class="absolute z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" style="font-size: 16px; font-weight: bold">
เป็นแผนที่ดีนะ
</div>

<div class="absolute z-40 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
<img src={Craycircle.src} alt="Bubble box 1.png">
<img src={BubbleBox.src} alt="BubbleBox.png">
</div>

<a href="/" class="absolute z-50 bottom-10 left-1/2 -translate-x-1/ text-black text-opacity-50 px-4 py-2 rounded-md text-center" onclick="handleContinueClick()">
Tap to<br/>Continue
</a>
</div>

<img class="relative z-0 h-screen mx-auto object-contain" src={Scene.src}></img>
<div class="relative fade-in"><Tap redirect="./Q6"/></div>
</div>
</BaseLayout>

Expand Down

0 comments on commit 0804872

Please sign in to comment.