|
|
@ -5,7 +5,8 @@ import watt from "../wattpad.ts";
|
|
|
|
import FourOhFour from "./404.tsx";
|
|
|
|
import FourOhFour from "./404.tsx";
|
|
|
|
|
|
|
|
|
|
|
|
import Script from "../components/Script.tsx";
|
|
|
|
import Script from "../components/Script.tsx";
|
|
|
|
import FavoriteStoryButtonScript from "../scripts/FavoriteStory.ts";
|
|
|
|
import StoryButtonScript from "../scripts/Story.ts";
|
|
|
|
|
|
|
|
import StoryProgressSavingScript from "../scripts/StoryProgressSaving.ts";
|
|
|
|
|
|
|
|
|
|
|
|
export default async (params: URLSearchParams) => {
|
|
|
|
export default async (params: URLSearchParams) => {
|
|
|
|
if (!params.get("id")) return <FourOhFour />;
|
|
|
|
if (!params.get("id")) return <FourOhFour />;
|
|
|
@ -15,11 +16,9 @@ export default async (params: URLSearchParams) => {
|
|
|
|
// chapters
|
|
|
|
// chapters
|
|
|
|
if (params.get("chapter")) {
|
|
|
|
if (params.get("chapter")) {
|
|
|
|
await story.chapters[Number(params.get("chapter") as string)].init();
|
|
|
|
await story.chapters[Number(params.get("chapter") as string)].init();
|
|
|
|
|
|
|
|
|
|
|
|
console.log(story.chapters.length);
|
|
|
|
|
|
|
|
console.log(Number(params.get("chapter")));
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
|
|
|
|
<Script function={StoryProgressSavingScript} />
|
|
|
|
<div style="margin-left: 1em; margin-right: 1em;">
|
|
|
|
<div style="margin-left: 1em; margin-right: 1em;">
|
|
|
|
{
|
|
|
|
{
|
|
|
|
story.chapters[Number(params.get("chapter") as string)]
|
|
|
|
story.chapters[Number(params.get("chapter") as string)]
|
|
|
@ -76,7 +75,7 @@ export default async (params: URLSearchParams) => {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
<Story story={story} stylepath="css/index.scss">
|
|
|
|
<Script function={FavoriteStoryButtonScript} />
|
|
|
|
<Script function={StoryButtonScript} />
|
|
|
|
<div style="display:flex;align-items:center;justify-content:center;flex-direction:column;">
|
|
|
|
<div style="display:flex;align-items:center;justify-content:center;flex-direction:column;">
|
|
|
|
<div class="story">
|
|
|
|
<div class="story">
|
|
|
|
<img id="storycover" src={story.storyJSON.cover} />
|
|
|
|
<img id="storycover" src={story.storyJSON.cover} />
|
|
|
@ -99,9 +98,11 @@ export default async (params: URLSearchParams) => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button id="favorite" class="favorite-story-button">
|
|
|
|
<div id="detail-buttons" class="detail-buttons">
|
|
|
|
Favorite
|
|
|
|
<button id="favorite" class="favorite-story-button">
|
|
|
|
</button>
|
|
|
|
Favorite
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Story>
|
|
|
|
</Story>
|
|
|
|
);
|
|
|
|
);
|
|
|
|