|
|
|
@ -7,6 +7,7 @@ import FourOhFour from "./404.tsx";
|
|
|
|
|
import Script from "../components/Script.tsx";
|
|
|
|
|
import StoryButtonScript from "../scripts/Story.ts";
|
|
|
|
|
import StoryProgressSavingScript from "../scripts/StoryProgressSaving.ts";
|
|
|
|
|
import ScrollHeader from "../scripts/ScrollHeader.ts";
|
|
|
|
|
|
|
|
|
|
export default async (params: URLSearchParams) => {
|
|
|
|
|
if (!params.get("id")) return <FourOhFour />;
|
|
|
|
@ -17,8 +18,13 @@ export default async (params: URLSearchParams) => {
|
|
|
|
|
if (params.get("chapter")) {
|
|
|
|
|
await story.chapters[Number(params.get("chapter") as string)].init();
|
|
|
|
|
return (
|
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
|
<Story
|
|
|
|
|
story={story}
|
|
|
|
|
stylepath="css/index.scss"
|
|
|
|
|
currentHref={"/story?" + params.toString()}
|
|
|
|
|
>
|
|
|
|
|
<Script function={StoryProgressSavingScript} />
|
|
|
|
|
<Script function={ScrollHeader} />
|
|
|
|
|
<div style="margin-left: 1em; margin-right: 1em;">
|
|
|
|
|
{
|
|
|
|
|
story.chapters[Number(params.get("chapter") as string)]
|
|
|
|
@ -74,8 +80,13 @@ export default async (params: URLSearchParams) => {
|
|
|
|
|
// metadata
|
|
|
|
|
else {
|
|
|
|
|
return (
|
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
|
<Story
|
|
|
|
|
story={story}
|
|
|
|
|
stylepath="css/index.scss"
|
|
|
|
|
currentHref={"/story?" + params.toString()}
|
|
|
|
|
>
|
|
|
|
|
<Script function={StoryButtonScript} />
|
|
|
|
|
<Script function={ScrollHeader} />
|
|
|
|
|
<div style="display:flex;align-items:center;justify-content:center;flex-direction:column;">
|
|
|
|
|
<div class="story">
|
|
|
|
|
<img id="storycover" src={story.storyJSON.cover} />
|
|
|
|
|