Revela-v4/src/layouts/Layout.astro

184 lines
4.6 KiB
Text

---
import { ViewTransitions } from "astro:transitions";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import ThemeLoader from "../components/ThemeLoader.astro";
import CloakLoader from "../components/CloakLoader.astro";
import WelcomeLogging from "../components/WelcomeLogging.astro";
import UVRegistrar from "../components/ProxyRegistrar.astro";
type Preload = {
href: string;
as: string;
};
interface Props {
title: string;
optionalPreloads?: Preload[];
}
const { title, optionalPreloads } = Astro.props;
---
<!doctype html>
<html lang="en">
<head>
<ThemeLoader transition:persist />
<CloakLoader transition:persist />
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Varela+Round&display=swap"
rel="stylesheet"
as="style"
/>
{
optionalPreloads?.map((item) => {
return <link rel="preload" href={item.href} as={item.as} />;
})
}
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<ViewTransitions />
</head>
<body>
<Header />
<slot transition:animate={"fade"} />
<WelcomeLogging />
<UVRegistrar />
<Footer />
<style is:global>
:root {
--background-color: #080808;
--background-highlight: #252525;
--accent-color: #6b00c9;
--accent-color-brighter: #7e00e0;
--text-color: #fff;
--text-color-accent: #c7c7c7;
--dropdown-background-color: #1e1e1e;
}
* {
box-sizing: border-box;
}
body {
opacity: 0;
animation: fadeIn ease 0.4s forwards;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
[data-theme="mocha"] {
/* Catppucin Mocha theme */
--background-color: #1e1e2e;
--background-highlight: #45475a;
--accent-color: #181825;
--accent-color-brighter: #242539;
--text-color: #cdd6f4;
--text-color-accent: #bac2de;
--dropdown-background-color: #32324e;
}
[data-theme="macchiato"] {
/* Catppuccin Macchiato Theme */
--background-color: #24273a;
--background-highlight: #494d64;
--accent-color: #1e2030;
--accent-color-brighter: #2a2d42;
--text-color: #cad3f5;
--text-color-accent: #b8c0e0;
--dropdown-background-color: #323550;
}
[data-theme="rose_pine"] {
/* Rosé Pine Theme */
--background-color: #191724;
--background-highlight: #1f1d2e;
--accent-color: #26233a;
--accent-color-brighter: #2e2b4a;
--text-color: #e0def4;
--text-color-accent: #c7c5e0;
--dropdown-background-color: #1f1d2e;
}
body,
html {
margin: 0;
padding: 0;
height: 100%;
font-family: "Varela Round", sans-serif;
}
body {
background-color: var(--background-color);
max-width: 100vw;
margin: 0;
display: flex;
flex-direction: column;
min-height: 100vh;
}
body > * {
opacity: 1;
}
.title-text {
color: var(--text-color);
text-align: center;
font-weight: 400;
}
::-webkit-scrollbar {
display: none;
}
#proxy-frame {
display: block;
position: absolute;
z-index: 1000;
width: 100vw;
height: 95vh;
top: 5vh;
left: 0;
border: none;
background-color: var(--background-color);
transition: opacity 250ms ease-in-out;
pointer-events: none;
}
#proxy-frame {
opacity: 0;
}
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 1rem;
height: 5vh;
background-color: var(--accent-color);
color: var(--text-color);
position: fixed;
top: 0;
left: 0;
width: 100vw;
z-index: 100;
transition: opacity 350ms ease-in-out;
pointer-events: none;
}
.close-button {
padding: 5px;
padding-inline: 40px;
border: none;
background-color: var(--background-highlight);
color: var(--text-color-accent);
border-radius: 15px;
cursor: pointer;
}
</style>
</body>
</html>