Skip to content

Commit 8c37ad1

Browse files
New Year Update
1 parent 2e68e82 commit 8c37ad1

21 files changed

Lines changed: 306 additions & 174 deletions

pnpm-lock.yaml

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

src/assets/friends.json

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
[
2+
{
3+
"title": "清羽飞扬",
4+
"imgurl": "https://blog.liushen.fun/info/avatar.ico",
5+
"desc": "柳影曳曳,清酒孤灯,扬笔撒墨,心境如霜",
6+
"siteurl": "https://blog.liushen.fun/",
7+
"category": "朋友",
8+
"tags": [""],
9+
"openInNewTab": true
10+
},
211
{
312
"title": "凨狐的小窝",
413
"imgurl": "https://cdn.fis.ink/cdn/2025/08/10/6898552d1089d.webp",
514
"desc": "这个名字...一看就很不想让人搜到",
615
"siteurl": "https://fur.tax",
7-
"category": "朋友",
16+
"category": "博客",
817
"tags": [""],
918
"openInNewTab": true
1019
},
@@ -80,15 +89,6 @@
8089
"tags": [""],
8190
"openInNewTab": true
8291
},
83-
{
84-
"title": "清羽飞扬",
85-
"imgurl": "https://blog.liushen.fun/info/avatar.ico",
86-
"desc": "柳影曳曳,清酒孤灯,扬笔撒墨,心境如霜",
87-
"siteurl": "https://blog.liushen.fun/",
88-
"category": "博客",
89-
"tags": [""],
90-
"openInNewTab": true
91-
},
9292
{
9393
"title": "liuzhen932 的小窝",
9494
"imgurl": "https://blog.liuzhen932.top/favicon.png",
@@ -350,39 +350,12 @@
350350
"tags": [""],
351351
"openInNewTab": true
352352
},
353-
{
354-
"title": "笑笑API",
355-
"imgurl": "http://145.net.cn/zzul/",
356-
"desc": "笑笑API",
357-
"siteurl": "https://api.k9b.cn/",
358-
"category": "其他",
359-
"tags": [""],
360-
"openInNewTab": true
361-
},
362-
{
363-
"title": "fishcpy cloud",
364-
"imgurl": "https://file.fis.ink/img/fishcpy/logo.png",
365-
"desc": "fishcpy cloud",
366-
"siteurl": "https://www.fis.ink",
367-
"category": "赞助商",
368-
"tags": [""],
369-
"openInNewTab": true
370-
},
371353
{
372354
"title": "Astro",
373355
"imgurl": "https://avatars.githubusercontent.com/u/44914786?s=48&v=4",
374-
"desc": "本站框架",
356+
"desc": "博客框架",
375357
"siteurl": "https://github.com/withastro/astro",
376-
"category": "框架&主题",
377-
"tags": [""],
378-
"openInNewTab": true
379-
},
380-
{
381-
"title": "fishcpy theme",
382-
"imgurl": "https://file.fis.ink/img/fishcpy/logo.png",
383-
"desc": "本站主题",
384-
"siteurl": "https://github.com/fishcpy/astro-theme-fishcpy",
385-
"category": "框架&主题",
358+
"category": "框架",
386359
"tags": [""],
387360
"openInNewTab": true
388361
}

src/components/EssayCarousel.astro

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
import essayData from "../assets/essay.json";
3+
---
4+
5+
<div class="essay-carousel-container w-full py-4">
6+
<div class="max-w-[var(--page-width)] mx-auto px-4">
7+
<div class="essay-carousel relative overflow-hidden card-base card-shadow card-glass cursor-pointer" onclick="window.location.href='/essay/'">
8+
<div class="carousel-track flex transition-transform duration-500 ease-in-out" id="carousel-track">
9+
{essayData.map((item, index) => (
10+
<div
11+
key={item.id}
12+
class="carousel-item flex-shrink-0 w-full px-6 py-4"
13+
>
14+
<div class="carousel-content flex items-center justify-center h-full">
15+
<p class="text-content text-center">{item.content}</p>
16+
</div>
17+
</div>
18+
))}
19+
</div>
20+
21+
<!-- 轮播指示器 -->
22+
<div class="carousel-indicators absolute bottom-2 left-1/2 transform -translate-x-1/2 flex gap-1">
23+
{essayData.map((_, index) => (
24+
<button
25+
key={index}
26+
class={`indicator w-1.5 h-1.5 rounded-full transition-all ${index === 0 ? 'bg-primary w-4' : 'bg-muted'}`}
27+
data-index={index}
28+
onclick="event.stopPropagation();"
29+
></button>
30+
))}
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
36+
<script>
37+
document.addEventListener('DOMContentLoaded', () => {
38+
const track = document.getElementById('carousel-track');
39+
const items = document.querySelectorAll('.carousel-item');
40+
const indicators = document.querySelectorAll('.indicator');
41+
42+
if (!track || !items.length) return;
43+
44+
let currentIndex = 0;
45+
const itemWidth = items[0].offsetWidth + 32; // 包含左右padding
46+
47+
function updateCarousel() {
48+
const offset = -currentIndex * itemWidth;
49+
track.style.transform = `translateX(${offset}px)`;
50+
51+
// 更新指示器
52+
indicators.forEach((indicator, index) => {
53+
if (index === currentIndex) {
54+
indicator.classList.add('bg-primary', 'w-4');
55+
indicator.classList.remove('bg-muted');
56+
} else {
57+
indicator.classList.remove('bg-primary', 'w-4');
58+
indicator.classList.add('bg-muted');
59+
}
60+
});
61+
}
62+
63+
function nextSlide() {
64+
currentIndex = (currentIndex + 1) % items.length;
65+
updateCarousel();
66+
}
67+
68+
// 指示器点击事件
69+
indicators.forEach(indicator => {
70+
indicator.addEventListener('click', () => {
71+
currentIndex = parseInt(indicator.getAttribute('data-index') || '0');
72+
updateCarousel();
73+
});
74+
});
75+
76+
// 自动轮播
77+
setInterval(nextSlide, 3000);
78+
79+
// 窗口大小变化时重新计算
80+
window.addEventListener('resize', () => {
81+
updateCarousel();
82+
});
83+
});
84+
</script>
85+
86+
<style scoped>
87+
.essay-carousel-container {
88+
position: relative;
89+
z-index: 20;
90+
}
91+
92+
.carousel-btn {
93+
z-index: 10;
94+
cursor: pointer;
95+
}
96+
97+
.carousel-indicators {
98+
z-index: 10;
99+
}
100+
101+
.indicator {
102+
cursor: pointer;
103+
}
104+
</style>

src/components/LightDarkSwitch.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Icon from "@iconify/svelte";
66
import {
77
applyThemeToDocument,
88
getStoredTheme,
9-
setTheme,
109
isThemeForced,
10+
setTheme,
1111
} from "@utils/setting-utils.ts";
1212
import { onMount } from "svelte";
1313
import type { LIGHT_DARK_MODE } from "@/types/config.ts";

src/components/Navbar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let links: NavBarLink[] = navBarConfig.links.map(
2929
<!-- 左侧:网站标题 -->
3030
<a href={url('/')} class="btn-plain scale-animation rounded-lg h-[3.25rem] px-5 font-bold active:scale-95 flex-shrink-0">
3131
<div class="flex flex-row text-[var(--primary)] items-center text-md">
32-
<img src="https://file.fis.ink/img/fishcpy/logo_c.png" alt="logo" class="w-6 h-6 mr-2" />
32+
<img src="https://img.scdn.io/i/696e0f2b20919_1768820523.webp" alt="logo" class="w-6 h-6 mr-2" />
3333
{navBarConfig.showHomeIcon && <Icon name="material-symbols:home-outline-rounded" class="text-[1.75rem] mb-1 mr-2" />}
3434
{siteConfig.title}
3535
</div>

src/components/TitleBeautify.astro

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
---
22
import { beautifyConfig } from "@/config";
33
4-
const { enable, field, titlePrefixIcon, titlePrefixIconColor, animation, hover, colors, sizes } = beautifyConfig;
4+
const {
5+
enable,
6+
field,
7+
titlePrefixIcon,
8+
titlePrefixIconColor,
9+
animation,
10+
hover,
11+
colors,
12+
sizes,
13+
} = beautifyConfig;
514
615
// 根据配置生成CSS变量
716
const cssVars = {
8-
'--title-icon': `"${titlePrefixIcon}"`,
9-
'--title-icon-color': titlePrefixIconColor,
10-
'--animation-speed': (animation?.enable && animation?.rotate) ? `${animation.speed}s` : '0s',
11-
'--animation-direction': animation?.direction === 'clockwise' ? '360deg' : '-360deg',
12-
'--hover-speed': (hover?.enable && animation?.rotate) ? `${hover.slowSpeed}s` : '0s',
13-
'--hover-color': hover?.color || titlePrefixIconColor,
14-
'--h1-color': colors?.h1 || titlePrefixIconColor,
15-
'--h2-color': colors?.h2 || titlePrefixIconColor,
16-
'--h3-color': colors?.h3 || titlePrefixIconColor,
17-
'--h4-color': colors?.h4 || titlePrefixIconColor,
18-
'--h5-color': colors?.h5 || titlePrefixIconColor,
19-
'--h6-color': colors?.h6 || titlePrefixIconColor,
20-
'--h1-size': sizes?.h1 || '1.3rem',
21-
'--h2-size': sizes?.h2 || '1.1rem',
22-
'--h3-size': sizes?.h3 || '0.95rem',
23-
'--h4-size': sizes?.h4 || '0.8rem',
24-
'--h5-size': sizes?.h5 || '0.7rem',
25-
'--h6-size': sizes?.h6 || '0.66rem',
17+
"--title-icon": `"${titlePrefixIcon}"`,
18+
"--title-icon-color": titlePrefixIconColor,
19+
"--animation-speed":
20+
animation?.enable && animation?.rotate ? `${animation.speed}s` : "0s",
21+
"--animation-direction":
22+
animation?.direction === "clockwise" ? "360deg" : "-360deg",
23+
"--hover-speed":
24+
hover?.enable && animation?.rotate ? `${hover.slowSpeed}s` : "0s",
25+
"--hover-color": hover?.color || titlePrefixIconColor,
26+
"--h1-color": colors?.h1 || titlePrefixIconColor,
27+
"--h2-color": colors?.h2 || titlePrefixIconColor,
28+
"--h3-color": colors?.h3 || titlePrefixIconColor,
29+
"--h4-color": colors?.h4 || titlePrefixIconColor,
30+
"--h5-color": colors?.h5 || titlePrefixIconColor,
31+
"--h6-color": colors?.h6 || titlePrefixIconColor,
32+
"--h1-size": sizes?.h1 || "1.3rem",
33+
"--h2-size": sizes?.h2 || "1.1rem",
34+
"--h3-size": sizes?.h3 || "0.95rem",
35+
"--h4-size": sizes?.h4 || "0.8rem",
36+
"--h5-size": sizes?.h5 || "0.7rem",
37+
"--h6-size": sizes?.h6 || "0.66rem",
2638
};
2739
---
2840

src/components/control/Pagination.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
import type { Page } from "astro";
33
import { Icon } from "astro-icon/components";
4-
import { url } from "../../utils/url-utils";
54
import { cardConfig } from "../../config";
5+
import { url } from "../../utils/url-utils";
66
77
interface Props {
88
page: Page;

src/components/misc/BannerWrapper.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import ImageWrapper from "./ImageWrapper.astro";
32
import { siteConfig } from "../../config";
3+
import ImageWrapper from "./ImageWrapper.astro";
44
55
interface Props {
66
id?: string;
@@ -14,8 +14,8 @@ const bannerConfig = siteConfig.banner;
1414
const isVideo = bannerConfig.type === "video";
1515
const positionClass = {
1616
top: "object-top",
17-
center: "object-center",
18-
bottom: "object-bottom"
17+
center: "object-center",
18+
bottom: "object-bottom",
1919
}[bannerConfig.position || "center"];
2020
---
2121

0 commit comments

Comments
 (0)