mirror of
https://github.com/Ad-closeNN/blog-fuwari.git
synced 2026-05-31 01:20:06 -04:00
feat(config): 加入 周日知更鸟主题
Fuwari 藏得东西还是太多了 1. 知更鸟背景 2. 档案,在银河中孤独摇摆 3. 紫色主题色
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
@@ -1,7 +1,16 @@
|
||||
---
|
||||
|
||||
import { siteConfig } from "../config";
|
||||
---
|
||||
|
||||
<div id="config-carrier" data-hue={siteConfig.themeColor.hue}>
|
||||
</div>
|
||||
// 周日判断
|
||||
const isSunday = new Date().getDay() === 0;
|
||||
|
||||
// 这tm重置色
|
||||
---
|
||||
{isSunday &&
|
||||
<div id="config-carrier" data-hue={290}></div>
|
||||
}
|
||||
{!isSunday &&
|
||||
<div id="config-carrier" data-hue={siteConfig.themeColor.hue}></div>
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import { url } from "../../utils/url-utils";
|
||||
import ImageWrapper from "../misc/ImageWrapper.astro";
|
||||
|
||||
const config = profileConfig;
|
||||
|
||||
const isSunday = new Date().getDay() === 0;
|
||||
---
|
||||
<div class="card-base p-3">
|
||||
<div class="text-center text-sm text-neutral-500 dark:text-neutral-400 border-neutral-100 dark:border-neutral-700">一言 / hitokoto</div>
|
||||
@@ -49,6 +51,10 @@ const config = profileConfig;
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 星期日 -->
|
||||
{isSunday &&
|
||||
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2155423467&auto=0&height=66"></iframe>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -14,12 +14,24 @@ export function getDefaultHue(): number {
|
||||
}
|
||||
|
||||
export function getHue(): number {
|
||||
const currentDay = new Date().getDay();
|
||||
// 去你妈的给我查日期先
|
||||
if (currentDay === 0){
|
||||
return 290;
|
||||
}
|
||||
// 如果不是,则返回默认值
|
||||
const stored = localStorage.getItem("hue");
|
||||
return stored ? Number.parseInt(stored) : getDefaultHue();
|
||||
}
|
||||
|
||||
export function setHue(hue: number): void {
|
||||
localStorage.setItem("hue", String(hue));
|
||||
const currentDay = new Date().getDay();
|
||||
if (currentDay === 0){
|
||||
//
|
||||
}
|
||||
if (currentDay != 0){
|
||||
localStorage.setItem("hue", String(hue));
|
||||
}
|
||||
const r = document.querySelector(":root") as HTMLElement;
|
||||
if (!r) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user