phobos/src/layouts/CharacterList.astro

60 lines
1.6 KiB
Text

---
import Sidebar from "../components/Sidebar.astro";
import pb from "../lib/pb";
const avatarRec = await pb
.collection("images")
.getFirstListItem("useAsAvatar=true");
const backgroundRec = await pb
.collection("images")
.getFirstListItem("useAsBackground=true");
const icon = await pb.files.getUrl(avatarRec, avatarRec.file);
const background = await pb.files.getUrl(backgroundRec, backgroundRec.file);
const socials = await pb.collection("socials").getFullList();
const config = {
icon,
socials,
background,
title: import.meta.env.PUBLIC_TITLE,
description: import.meta.env.PUBLIC_DESCRIPTION,
};
export const prerender = false;
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{config.title}</title>
</head>
<body>
<div
class="xl:fixed xl:left-0 xl:top-0 w-full xl:w-96 bg-[#11111156] backdrop-blur-md h-full pt-4 box-border text-center"
>
<Sidebar />
</div>
<slot />
</body>
</html>
<style define:vars={{ background: `url(${config.background})` }}>
.container {
width: calc(100% - 25rem);
}
body {
font-family: system-ui, sans-serif;
background: var(--background);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
color: whitesmoke;
}
</style>