mirror of
https://github.com/Ad-closeNN/blog-fuwari.git
synced 2026-05-31 02:20:05 -04:00
feat(config): 加入 周日知更鸟主题
Fuwari 藏得东西还是太多了 1. 知更鸟背景 2. 档案,在银河中孤独摇摆 3. 紫色主题色
This commit is contained in:
@@ -129,7 +129,9 @@ const bannerOffset =
|
||||
}
|
||||
|
||||
// Load the hue from local storage
|
||||
const hue = localStorage.getItem('hue') || configHue;
|
||||
const currentDay = new Date().getDay();
|
||||
const hue = currentDay === 3 ? 290 : (localStorage.getItem('hue') || configHue);
|
||||
//const hue = localStorage.getItem('hue') || configHue;
|
||||
document.documentElement.style.setProperty('--hue', hue);
|
||||
|
||||
// calculate the --banner-height-extend, which needs to be a multiple of 4 to avoid blurry text
|
||||
|
||||
@@ -39,6 +39,13 @@ const hasBannerLink = !!siteConfig.banner.credit.url;
|
||||
const mainPanelTop = siteConfig.banner.enable
|
||||
? `calc(${BANNER_HEIGHT}vh - ${MAIN_PANEL_OVERLAPS_BANNER_HEIGHT}rem)`
|
||||
: "5.5rem";
|
||||
|
||||
// 周日判断
|
||||
const isSunday = new Date().getDay() === 0;
|
||||
|
||||
// 周六判断
|
||||
const isSaturday = new Date().getDay() === 6;
|
||||
|
||||
---
|
||||
|
||||
<Layout title={title} banner={banner} description={description} lang={lang} setOGTypeArticle={setOGTypeArticle}>
|
||||
@@ -51,8 +58,20 @@ const mainPanelTop = siteConfig.banner.enable
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 控制 Banner -->
|
||||
<!-- Banner -->
|
||||
{siteConfig.banner.enable && <div id="banner-wrapper" class={`absolute z-10 w-full transition duration-700 overflow-hidden`} style={`top: -${BANNER_HEIGHT_EXTEND}vh`}>
|
||||
|
||||
<!-- 周日版本 -->
|
||||
{isSunday && siteConfig.banner.enable && <div id="banner-wrapper" class={`absolute z-10 w-full transition duration-700 overflow-hidden`} style={`top: -${BANNER_HEIGHT_EXTEND}vh`}>
|
||||
<ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700 opacity-0 scale-105"]}
|
||||
src={"/assets/132398672_p0_master1200_edited.jpg"} position={siteConfig.banner.position}
|
||||
>
|
||||
</ImageWrapper>
|
||||
</div>}
|
||||
|
||||
<!-- 其他版本 -->
|
||||
<!-- 使用 ! 取反号取反 false 为 true -->
|
||||
{!isSunday && siteConfig.banner.enable && <div id="banner-wrapper" class={`absolute z-10 w-full transition duration-700 overflow-hidden`} style={`top: -${BANNER_HEIGHT_EXTEND}vh`}>
|
||||
<ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700 opacity-0 scale-105"]}
|
||||
src={siteConfig.banner.src} position={siteConfig.banner.position}
|
||||
>
|
||||
@@ -67,7 +86,21 @@ const mainPanelTop = siteConfig.banner.enable
|
||||
mx-auto gap-4 px-0 md:px-4"
|
||||
>
|
||||
<!-- Banner image credit -->
|
||||
{hasBannerCredit && <a href={siteConfig.banner.credit.url} id="banner-credit" target="_blank" rel="noopener" aria-label="Visit image source"
|
||||
<!-- 周日版本 -->
|
||||
{isSunday && hasBannerCredit && <a href={"https://www.pixiv.net/artworks/132398672"} 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-4 -top-[3.25rem] 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">{"KiraraShss"}</div>
|
||||
<Icon class:list={["transition absolute text-[oklch(0.75_0.14_var(--hue))] right-4 text-[0.75rem] opacity-0",
|
||||
{"group-hover:opacity-100": hasBannerLink}]}
|
||||
name="fa6-solid:arrow-up-right-from-square">
|
||||
</Icon>
|
||||
</a>}
|
||||
|
||||
<!-- 其他版本 -->
|
||||
{!isSunday && 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-4 -top-[3.25rem] bg-black/60 hover:bg-black/70 h-9", {"hover:pr-9 active:bg-black/80": hasBannerLink}]}
|
||||
>
|
||||
@@ -78,8 +111,15 @@ const mainPanelTop = siteConfig.banner.enable
|
||||
name="fa6-solid:arrow-up-right-from-square">
|
||||
</Icon>
|
||||
</a>}
|
||||
<script>
|
||||
|
||||
|
||||
// 检查是否是周6
|
||||
// 检查 localStorage 是否已有记录
|
||||
if (isSaturday && !localStorage.getItem("hasSeenPopup")) {
|
||||
alert("网站可能会在每个周日变个样...");
|
||||
localStorage.setItem("hasSeenPopup", "true"); // 记录已弹出
|
||||
}
|
||||
</script>
|
||||
<SideBar class="mb-4 row-start-2 row-end-3 col-span-2 lg:row-start-1 lg:row-end-2 lg:col-span-1 lg:max-w-[17.5rem] onload-animation" headings={headings}></SideBar>
|
||||
|
||||
<main id="swup-container" class="transition-swup-fade col-span-2 lg:col-span-1 overflow-hidden">
|
||||
|
||||
Reference in New Issue
Block a user