This commit is contained in:
MeowcaTheoRange 2024-04-30 11:30:44 -05:00
parent 012d34ce92
commit 328643144e
5 changed files with 60 additions and 18 deletions

View file

@ -2,18 +2,29 @@ import { MainLayout } from "@/layout/MainLayout/MainLayout";
import Link from "next/link"; import Link from "next/link";
import buttons from "@/buttons.json"; import buttons from "@/buttons.json";
import Searchbar from "@/components/Searchbar/Searchbar"; import Searchbar from "@/components/Searchbar/Searchbar";
import { Outage } from "@/components/Outage/Outage";
export default async function Home() { export default async function Home() {
const data = await fetch("https://pronouns.cc/api/v1/users/mtr").then(x=>x.json()); const data = await fetch("https://pronouns.cc/api/v1/users/mtr").then(x=>x.json());
let domains;
try {
const domainreq = await fetch("https://blog.abtmtr.link/api/collections/paste/posts/domain") const domainreq = await fetch("https://blog.abtmtr.link/api/collections/paste/posts/domain")
.then(x=>x.json()); .then(x=>x.json());
const domains = JSON.parse(domainreq?.data?.body.replace(/[“”]/g, "\"")) ?? []; domains = JSON.parse(domainreq?.data?.body.replace(/[“”]/g, "\"")) ?? [];
} catch(err) {
domains = [];
}
const goodNames = data.names.filter((x:{status:string})=>x.status == "okay"); const goodNames = data.names.filter((x:{status:string})=>x.status == "okay");
return ( return (
<MainLayout currentPage="/" title="Root"> <MainLayout currentPage="/" title="Root">
<img className="headerImage" src="/welcome.png" alt="WELCOME! Enjoy your stay at abtmtr.link!"></img> <img className="headerImage" src="/welcome.png" alt="WELCOME! Enjoy your stay at abtmtr.link!"></img>
<Searchbar /> <Searchbar />
<Outage title="abtmtr.link outage">
<p>the server was being stinky and died on me</p>
<p>feel free to support me during these trying times</p>
<p><a href="https://liberapay.com/abtmtr.link/">https://liberapay.com/abtmtr.link/</a></p>
</Outage>
<p>abtmtr.link is a domain for a suite of services, ranging from micro-blogging to web search.</p> <p>abtmtr.link is a domain for a suite of services, ranging from micro-blogging to web search.</p>
<p>I'm {goodNames[0].value}, otherwise known as {goodNames.slice(1).map((name:{value:string}, idx:number) => ( <p>I'm {goodNames[0].value}, otherwise known as {goodNames.slice(1).map((name:{value:string}, idx:number) => (
idx == goodNames.length - 2 ? (<>or <b>{name.value}</b></>) : (<><b>{name.value}</b>{goodNames.length <= 2 ? ", " : " "}</>) idx == goodNames.length - 2 ? (<>or <b>{name.value}</b></>) : (<><b>{name.value}</b>{goodNames.length <= 2 ? ", " : " "}</>)

View file

@ -0,0 +1,8 @@
import styles from "./styles.module.css";
export function Outage({title, children}:{title: string, children: React.ReactNode}) {
return <div className={styles.Outage}>
<h1>{title}</h1>
{children}
</div>
}

View file

@ -0,0 +1,15 @@
.Outage {
background-color: #c00000;
color: white;
padding: 8px;
border-radius: 8px;
}
.Outage a {
color: currentColor;
}
.Outage h1,
.Outage p {
margin: 8px 0;
}

View file

@ -38,18 +38,18 @@ export function SidebarMain({currentPage}:{currentPage:string}) {
<span className={styles.Main_List_Button_Badge}>NEW</span> <span className={styles.Main_List_Button_Badge}>NEW</span>
</div> </div>
</Link> </Link>
<Link {/* <Link
href="/search/" href="/search/"
className={currentPage.includes("/search/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/search/") ? styles.Main_List_CurrentLink : ""}
tabIndex={-1} tabIndex={-1}
// onClick={() => currentPage === "/" ? impossiblePlay() : openPlay()} // onClick={() => currentPage === "/" ? impossiblePlay() : openPlay()}
// onMouseEnter={hoverPlay} // onMouseEnter={hoverPlay}
> > */}
<div className={`fw ${styles.Main_List_Button}`}> <div className={`fw ${styles.Main_List_Button}`}>
<span className="icon">search</span> <span className="icon">search</span>
<span>Search</span> <span>Search</span>
</div> </div>
</Link> {/* </Link> */}
<Link <Link
href="/projects/" href="/projects/"
className={currentPage.includes("/projects/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/projects/") ? styles.Main_List_CurrentLink : ""}
@ -62,54 +62,54 @@ export function SidebarMain({currentPage}:{currentPage:string}) {
<span>Projects</span> <span>Projects</span>
</div> </div>
</Link> </Link>
<Link {/* <Link
href="/characters/" href="/characters/"
className={currentPage.includes("/characters/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/characters/") ? styles.Main_List_CurrentLink : ""}
tabIndex={-1} tabIndex={-1}
// onClick={() => currentPage.includes("/characters/") ? impossiblePlay() : openPlay()} // onClick={() => currentPage.includes("/characters/") ? impossiblePlay() : openPlay()}
// onMouseEnter={hoverPlay} // onMouseEnter={hoverPlay}
> > */}
<div className={`fw ${styles.Main_List_Button}`}> <div className={`fw ${styles.Main_List_Button}`}>
<span className="icon">group</span> <span className="icon">group</span>
<span>Characters</span> <span>Characters</span>
</div> </div>
</Link> {/* </Link> */}
<Link {/* <Link
href="/blog/" href="/blog/"
className={currentPage.includes("/blog/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/blog/") ? styles.Main_List_CurrentLink : ""}
tabIndex={-1} tabIndex={-1}
// onClick={() => currentPage.includes("/blog/") ? impossiblePlay() : openPlay()} // onClick={() => currentPage.includes("/blog/") ? impossiblePlay() : openPlay()}
// onMouseEnter={hoverPlay} // onMouseEnter={hoverPlay}
> > */}
<div className={`fw ${styles.Main_List_Button}`}> <div className={`fw ${styles.Main_List_Button}`}>
<span className="icon">description</span> <span className="icon">description</span>
<span>Blog</span> <span>Blog</span>
</div> </div>
</Link> {/* </Link> */}
<Link {/* <Link
href="/gallery/" href="/gallery/"
className={currentPage.includes("/gallery/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/gallery/") ? styles.Main_List_CurrentLink : ""}
tabIndex={-1} tabIndex={-1}
// onClick={() => currentPage.includes("/gallery/") ? impossiblePlay() : openPlay()} // onClick={() => currentPage.includes("/gallery/") ? impossiblePlay() : openPlay()}
// onMouseEnter={hoverPlay} // onMouseEnter={hoverPlay}
> > */}
<div className={`fw ${styles.Main_List_Button}`}> <div className={`fw ${styles.Main_List_Button}`}>
<span className="icon">image</span> <span className="icon">image</span>
<span>Gallery</span> <span>Gallery</span>
</div> </div>
</Link> {/* </Link> */}
<Link {/* <Link
href="/stories/" href="/stories/"
className={currentPage.includes("/stories/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/stories/") ? styles.Main_List_CurrentLink : ""}
tabIndex={-1} tabIndex={-1}
// onClick={() => currentPage.includes("/stories/") ? impossiblePlay() : openPlay()} // onClick={() => currentPage.includes("/stories/") ? impossiblePlay() : openPlay()}
// onMouseEnter={hoverPlay} // onMouseEnter={hoverPlay}
> > */}
<div className={`fw ${styles.Main_List_Button}`}> <div className={`fw ${styles.Main_List_Button}`}>
<span className="icon">book</span> <span className="icon">book</span>
<span>Stories</span> <span>Stories</span>
</div> </div>
</Link> {/* </Link> */}
<Link <Link
href="/links/" href="/links/"
className={currentPage.includes("/links/") ? styles.Main_List_CurrentLink : ""} className={currentPage.includes("/links/") ? styles.Main_List_CurrentLink : ""}

View file

@ -9,6 +9,7 @@ export interface Database {
content: ContentTable; content: ContentTable;
judgements: JudgementTable; judgements: JudgementTable;
tokens: TokenTable; tokens: TokenTable;
slowchat: SlowchatTable;
} }
export interface AppTable { export interface AppTable {
@ -66,6 +67,13 @@ export interface JudgementTable {
published: number; published: number;
} }
export interface SlowchatTable {
id: string;
author_id: string;
content: string;
published: number;
}
export const db = createKysely<Database>({ export const db = createKysely<Database>({
}); });