Skip to content

Commit 122e603

Browse files
authored
trying to clear
1 parent 8a50a30 commit 122e603

File tree

12 files changed

+102
-1163
lines changed

12 files changed

+102
-1163
lines changed

.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

bun.lock

Lines changed: 85 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
"overlayscrollbars": "^2.13.0",
5353
"pagefind": "^1.4.0",
5454
"photoswipe": "^5.4.4",
55+
"postcss-import": "^16.1.1",
56+
"postcss-nesting": "^13.0.2",
5557
"rehype-autolink-headings": "^7.1.0",
5658
"rehype-components": "^0.3.0",
5759
"rehype-katex": "^7.0.1",
@@ -66,7 +68,7 @@
6668
"sharp": "^0.34.5",
6769
"stylus": "^0.64.0",
6870
"svelte": "^5.45.6",
69-
"tailwindcss": "^4.1.17",
71+
"tailwindcss": "^3.4.18",
7072
"typescript": "^5.9.3",
7173
"unist-util-visit": "^5.0.0"
7274
},

postcss.config.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import postcssImport from 'postcss-import';
2+
import postcssNesting from 'tailwindcss/nesting/index.js';
13
import tailwindcss from 'tailwindcss';
24

35
export default {
4-
plugins: {
5-
"@tailwindcss/postcss": {},
6-
}
7-
}
6+
plugins: {
7+
'postcss-import': postcssImport, // to combine multiple css files
8+
'tailwindcss/nesting': postcssNesting,
9+
tailwindcss: tailwindcss,
10+
}
11+
};

src/layouts/Layout.astro

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ import { pathsEqual, url } from "../utils/url-utils";
1919
2020
import "katex/dist/katex.css";
2121
import "../styles/navbar.css";
22-
import "../styles/banner.css";
2322
2423
2524
interface Props {
2625
title?: string;
27-
banner?: string;
2826
description?: string;
2927
lang?: string;
3028
setOGTypeArticle?: boolean;
3129
postSlug?: string;
3230
}
3331
34-
let { title, banner, description, lang, setOGTypeArticle, postSlug } =
32+
let { title, description, lang, setOGTypeArticle, postSlug } =
3533
Astro.props;
3634
3735
// apply a class to the body element to decide the height of the banner, only used for initial page load
@@ -153,11 +151,6 @@ const siteLang = lang.replace("_", "-");
153151
// Apply the hue to the document
154152
document.documentElement.style.setProperty('--hue', hue);
155153
156-
// calculate the --banner-height-extend, which needs to be a multiple of 4 to avoid blurry text
157-
let offset = Math.floor(window.innerHeight * (BANNER_HEIGHT_EXTEND / 100));
158-
offset = offset - offset % 4;
159-
document.documentElement.style.setProperty('--banner-height-extend', `${offset}px`);
160-
161154
// Initialize wallpaper mode using the proper initialization function
162155
setTimeout(() => {
163156
// Import and call the proper wallpaper initialization
@@ -166,13 +159,6 @@ const siteLang = lang.replace("_", "-");
166159
});
167160
}, 100);
168161
169-
// Banner carousel initialization function
170-
window.initBannerCarousel = function() {
171-
const carousel = document.getElementById('banner-carousel');
172-
const carouselConfigData = carousel?.getAttribute('data-carousel-config');
173-
const carouselConfig = carouselConfigData ? JSON.parse(carouselConfigData) : {};
174-
175-
const carouselItems = document.querySelectorAll('.carousel-item');
176162
177163
// 根据屏幕尺寸过滤有效的轮播项
178164
const isMobile = window.innerWidth < BREAKPOINT_LG;
@@ -625,15 +611,7 @@ const setup = () => {
625611
bodyElement!.classList.remove('lg:is-home');
626612
}
627613
628-
// Control banner text visibility based on page
629-
const bannerTextOverlay = document.querySelector('.banner-text-overlay')
630-
if (bannerTextOverlay) {
631-
if (isHomePage) {
632-
bannerTextOverlay.classList.remove('hidden')
633-
} else {
634-
bannerTextOverlay.classList.add('hidden')
635-
}
636-
}
614+
637615
638616
// Control navbar transparency based on page
639617
const navbar = document.getElementById('navbar')

src/layouts/MainGridLayout.astro

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,20 @@ import Navbar from "@components/Navbar.astro";
55
import SideBar from "@components/widget/SideBar.astro";
66
import type { MarkdownHeading } from "astro";
77
import { Icon } from "astro-icon/components";
8-
import Banner from "../components/misc/Banner.astro";
98
import IconifyLoader from "../components/misc/IconifyLoader.astro";
109
import TOC from "../components/widget/TOC.astro";
1110
import {
1211
siteConfig,
1312
sidebarLayoutConfig,
1413
postConfig,
1514
} from "../config";
16-
import {
17-
BANNER_HEIGHT,
18-
BANNER_HEIGHT_EXTEND,
19-
MAIN_PANEL_OVERLAPS_BANNER_HEIGHT,
20-
} from "../constants/constants";
2115
import { widgetManager } from "../utils/widget-manager";
2216
import Layout from "./Layout.astro";
2317
2418
import "../styles/maingrid.css";
2519
2620
const {
2721
title,
28-
banner,
2922
description,
3023
lang,
3124
setOGTypeArticle,
@@ -164,7 +157,6 @@ const mainContentClass = `
164157

165158
<Layout
166159
title={title}
167-
banner={banner}
168160
description={description}
169161
lang={lang}
170162
setOGTypeArticle={setOGTypeArticle}
@@ -198,16 +190,6 @@ const mainContentClass = `
198190
</div>
199191
</div>
200192

201-
<!-- Banner - 总是渲染但通过CSS控制可见性 -->
202-
<Banner
203-
config={siteConfig.wallpaper}
204-
bannerImages={bannerImages}
205-
isHomePage={isHomePage}
206-
mobileNonHomeBannerClass={mobileNonHomeBannerClass}
207-
carouselConfig={siteConfig.wallpaper.carousel}
208-
class={siteConfig.wallpaper.mode === "banner" ? "" : "hidden"}
209-
/>
210-
211193
<!-- Main content -->
212194
<div
213195
class={`absolute w-full z-30 pointer-events-none ${mobileNonHomeBannerClass ? "mobile-main-no-banner" : ""} ${siteConfig.wallpaper.mode !== "banner" ? "no-banner-layout" : ""} ${transparentClass}`}
@@ -221,44 +203,6 @@ const mainContentClass = `
221203
id="main-grid"
222204
class={`transition duration-700 w-full left-0 right-0 grid ${gridCols} grid-rows-[auto_1fr_auto] lg:grid-rows-[auto] mx-auto gap-4 px-0 md:px-4 ${!mobileShowSidebar ? "mobile-no-sidebar" : ""} ${(hasLeftSidebar || hasRightSidebar) ? "mobile-both-sidebar" : ""}`}
223205
>
224-
<!-- Banner image credit -->
225-
{
226-
hasBannerCredit && (
227-
<a
228-
href={siteConfig.wallpaper.banner?.credit?.url}
229-
id="banner-credit"
230-
target="_blank"
231-
rel="noopener"
232-
aria-label="Visit image source"
233-
class:list={[
234-
"group onload-animation transition-all absolute flex justify-center items-center rounded-full " +
235-
"px-3 right-4 -top-[3.25rem] bg-black/60 hover:bg-black/70 h-9",
236-
{
237-
"hover:pr-9 active:bg-black/80":
238-
hasBannerLink,
239-
},
240-
]}
241-
>
242-
<Icon
243-
class="text-white/75 text-[1.25rem] mr-1"
244-
name="material-symbols:copyright-outline-rounded"
245-
/>
246-
<div class="text-white/75 text-xs">
247-
{siteConfig.wallpaper.banner?.credit?.text}
248-
</div>
249-
<Icon
250-
class:list={[
251-
"transition absolute text-[oklch(0.75_0.14_var(--hue))] right-4 text-[0.75rem] opacity-0",
252-
{
253-
"group-hover:opacity-100":
254-
hasBannerLink,
255-
},
256-
]}
257-
name="fa6-solid:arrow-up-right-from-square"
258-
/>
259-
</a>
260-
)
261-
}
262206

263207
{
264208
(mobileShowSidebar ||

src/pages/posts/[...slug].astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ const jsonLd = {
108108
---
109109

110110
<MainGridLayout
111-
banner={entry.data.image}
112111
title={entry.data.title}
113112
description={entry.data.description}
114113
lang={entry.data.lang}

0 commit comments

Comments
 (0)