Skip to content

Commit

Permalink
feat: tap to continue
Browse files Browse the repository at this point in the history
  • Loading branch information
mildrrnt committed Jan 11, 2024
1 parent 40e65a7 commit 58438c1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/components/story/Tap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
interface Props {
redirect: string;
}

const Tap = ({ redirect }: Props) => {
const handleEvents = () => {
location.href = redirect;
};

return (
<div
className="absolute my-auto h-full w-full opacity-50 hover:cursor-pointer"
onTouchEnd={handleEvents}
>
<p className="absolute bottom-72 right-8 text-center font-medium">
Tap to
<br />
continue
</p>
</div>
);
};

export default Tap;
4 changes: 3 additions & 1 deletion src/pages/story/3.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
import BaseLayout from "../../layouts/BaseLayout.astro";
import Tap from "../../components/story/Tap";
---

<BaseLayout>
<h1 class="text-3xl">Well done!</h1>
นี่คือหน้าเปล่าที่แตะแล้วไปต่อได้
<Tap client:load redirect="./4" />
</BaseLayout>
7 changes: 7 additions & 0 deletions src/pages/story/4.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
import BaseLayout from "../../layouts/BaseLayout.astro";
---

<BaseLayout>
<h1 class="text-3xl">Well done!</h1>
</BaseLayout>

0 comments on commit 58438c1

Please sign in to comment.