You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.2 KiB

import sass from "https://deno.land/x/denosass@1.0.6/mod.ts";
import { Story } from "../wattpad.ts";
import { h, PropsWithChildren } from "../jsx.ts";
import Header from "../components/Header.tsx";
interface StoryProps {
story: Story;
style?: string;
stylepath?: string;
}
export default (props: PropsWithChildren<StoryProps>) => (
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
{/* favicon stuff generated with https://realfavicongenerator.net */}
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<link
rel="mask-icon"
href="/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="apple-mobile-web-app-title" content="Voltpad" />
<meta name="application-name" content="Voltpad" />
<meta name="msapplication-TileColor" content="#2b5797" />
<meta name="theme-color" content="#ffffff" />
<title>{props.story.name}</title>
{(() => {
if (!props.style) props.style = "";
if (props.stylepath)
props.style += Deno.readTextFileSync(props.stylepath);
else return <div></div>;
return <style>{sass(props.style).to_string()}</style>;
})()}
</head>
<Header
id="storyHeader"
entries={props.story.chapters.map((ch, i) => ({
name: ch.name,
href: `/story?id=${ch.workID}&chapter=${i}`
}))}
></Header>
<div class="main">{props.children}</div>
</html>
);