2023-09-26 14:27:38 +08:00
|
|
|
---
|
|
|
|
import Layout from "./Layout.astro";
|
2024-01-21 13:54:41 +09:00
|
|
|
import Navbar from "@components/Navbar.astro";
|
|
|
|
import SideBar from "@components/widget/SideBar.astro";
|
|
|
|
import Footer from "@components/Footer.astro";
|
|
|
|
import BackToTop from "@components/control/BackToTop.astro";
|
2024-07-27 21:51:32 +08:00
|
|
|
import { Icon } from 'astro-icon/components';
|
|
|
|
import { siteConfig } from "../config";
|
2023-09-26 14:27:38 +08:00
|
|
|
|
|
|
|
interface Props {
|
2024-07-21 15:47:49 +08:00
|
|
|
title?: string;
|
2023-10-02 01:52:08 +08:00
|
|
|
banner?: string;
|
2024-04-23 00:04:43 +08:00
|
|
|
description?: string;
|
2023-09-26 14:27:38 +08:00
|
|
|
}
|
|
|
|
|
2024-04-23 00:04:43 +08:00
|
|
|
const { title, banner, description } = Astro.props
|
2023-10-02 01:52:08 +08:00
|
|
|
|
2024-07-27 21:51:32 +08:00
|
|
|
const hasBannerCredit = siteConfig.banner.enable && siteConfig.banner.credit.enable
|
|
|
|
const hasBannerLink = !!(siteConfig.banner.credit.url)
|
|
|
|
|
2023-09-26 14:27:38 +08:00
|
|
|
---
|
2023-10-06 03:02:46 +08:00
|
|
|
|
2024-04-23 00:04:43 +08:00
|
|
|
<Layout title={title} banner={banner} description={description}>
|
2024-04-29 17:04:15 +08:00
|
|
|
<slot slot="head" name="head"></slot>
|
2024-02-18 18:13:43 +08:00
|
|
|
<div class="max-w-[var(--page-width)] min-h-screen grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto]
|
|
|
|
mx-auto gap-4 relative px-0 md:px-4"
|
2023-09-26 14:27:38 +08:00
|
|
|
>
|
2024-07-27 21:51:32 +08:00
|
|
|
<div id="top-row" class="relative transition-all duration-700 col-span-2 grid-rows-1" class:list={[""]}>
|
2024-03-12 14:04:58 +08:00
|
|
|
<Navbar></Navbar>
|
2024-07-27 21:51:32 +08:00
|
|
|
|
|
|
|
<!-- Banner image credit -->
|
|
|
|
{hasBannerCredit && <a href={siteConfig.banner.credit.url} id="banner-credit" target="_blank" rel="noopener" aria-label="Visit image source"
|
|
|
|
class:list={["group onload-animation transition-all absolute flex justify-center items-center rounded-full " +
|
|
|
|
"px-3 right-0 bottom-0 bg-black/60 hover:bg-black/70 h-9", {"hover:pr-9 active:bg-black/80": hasBannerLink}]}
|
|
|
|
>
|
|
|
|
<Icon class="text-white/75 text-[1.25rem] mr-1" name="material-symbols:copyright-outline-rounded" ></Icon>
|
|
|
|
<div class="text-white/75 text-xs">{siteConfig.banner.credit.text}</div>
|
|
|
|
<Icon class:list={["transition absolute text-[oklch(0.75_0.14_var(--hue))] right-2 text-[1.25rem] opacity-0",
|
|
|
|
{"group-hover:opacity-100": hasBannerLink}]}
|
|
|
|
name="material-symbols:chevron-right-rounded">
|
|
|
|
</Icon>
|
|
|
|
</a>}
|
|
|
|
|
2023-09-26 14:27:38 +08:00
|
|
|
</div>
|
2024-03-12 16:13:10 +08:00
|
|
|
<SideBar class="row-start-3 row-end-4 col-span-2 lg:row-start-2 lg:row-end-3 lg:col-span-1 lg:max-w-[17.5rem] onload-animation"></SideBar>
|
2023-09-26 14:27:38 +08:00
|
|
|
|
2024-03-12 16:13:10 +08:00
|
|
|
<div id="content-wrapper" class="row-start-2 row-end-3 col-span-2 lg:col-span-1 overflow-hidden onload-animation">
|
2023-09-26 14:27:38 +08:00
|
|
|
<!-- the overflow-hidden here prevent long text break the layout-->
|
2024-07-27 15:20:35 +08:00
|
|
|
<main id="swup" class="transition-swup-fade">
|
2024-03-12 14:04:58 +08:00
|
|
|
<slot></slot>
|
|
|
|
</main>
|
2023-09-29 11:58:14 +08:00
|
|
|
|
2023-09-26 14:27:38 +08:00
|
|
|
</div>
|
|
|
|
|
2024-03-12 16:13:10 +08:00
|
|
|
<div id="footer" class="grid-rows-3 col-span-2 mt-4 onload-animation">
|
2024-03-12 14:04:58 +08:00
|
|
|
<Footer></Footer>
|
2023-09-29 11:58:14 +08:00
|
|
|
</div>
|
|
|
|
<BackToTop></BackToTop>
|
2023-09-26 14:27:38 +08:00
|
|
|
</div>
|
|
|
|
</Layout>
|