Skip to content

Commit 63de953

Browse files
committed
首页重新设计
1 parent d84250c commit 63de953

File tree

7 files changed

+85
-466
lines changed

7 files changed

+85
-466
lines changed

bun.lock

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"@expressive-code/plugin-line-numbers": "^0.41.3",
2727
"@iconify-json/devicon": "^1.2.20",
2828
"@playform/compress": "^0.2.0",
29-
"@waline/client": "^3.6.0",
29+
"@rive-app/canvas": "2.19.8",
3030
"@unocss/preset-wind3": "^66.0.0",
3131
"@unocss/reset": "^66.0.0",
32+
"@waline/client": "^3.6.0",
3233
"@xt0rted/expressive-code-file-icons": "^1.0.0",
3334
"astro": "5.5.3",
3435
"astro-expressive-code": "^0.41.3",

packages/pure/components/basic/Header.astro

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ import { Icon } from '../user'
3939

4040
{/* buttons */}
4141
<div class='z-30 flex gap-x-4 group-[.not-top]:gap-x-2' style='transition:gap 0.3s'>
42-
<button
42+
<!-- <button
4343
id='toggleDarkMode'
44-
class='group/dark box-content size-5 rounded-md border p-1.5 transition-colors hover:bg-border sm:group-[.not-top]:rounded-xl'
44+
class:list={[
45+
'group/dark box-content size-5 rounded-md border p-1.5 transition-colors hover:bg-border sm:group-[.not-top]:rounded-xl',
46+
isHome && 'hidden',
47+
]}
4548
>
4649
<span class='sr-only'>Dark Theme</span>
4750
<Icon class='system size-5 group-hover/dark:text-primary' name='computer' />
4851
<Icon class='light hidden size-5 group-hover/dark:text-primary' name='sun' />
4952
<Icon class='dark hidden size-5 group-hover/dark:text-primary' name='moon' />
50-
</button>
53+
</button> -->
5154
<button
5255
id='toggleMenu'
5356
class='rounded-md border p-1.5 transition-colors hover:bg-border sm:hidden sm:group-[.not-top]:rounded-xl'
@@ -88,13 +91,15 @@ import { Icon } from '../user'
8891

8992
// Dark Mode
9093
const darkModeBtn = this.querySelector('#toggleDarkMode') as HTMLElement
91-
darkModeBtn.addEventListener('click', () => {
92-
const newTheme = setTheme(undefined, true)
93-
// Update both button and html root element
94-
darkModeBtn.dataset.theme = newTheme
95-
document.documentElement.dataset.theme = newTheme
96-
showToast({ message: `Set theme to ${newTheme}` })
97-
})
94+
if (darkModeBtn) {
95+
darkModeBtn.addEventListener('click', () => {
96+
const newTheme = setTheme(undefined, true)
97+
// Update both button and html root element
98+
darkModeBtn.dataset.theme = newTheme
99+
document.documentElement.dataset.theme = newTheme
100+
showToast({ message: `Set theme to ${newTheme}` })
101+
})
102+
}
98103

99104
// Menu
100105
this.querySelector('#toggleMenu')?.addEventListener('click', () => {

public/clouds/hero-home.riv

616 KB
Binary file not shown.

public/styles/global.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import url("https://fontsapi.zeoseven.com/89/main/result.css");
2-
32
body {
43
font-family: "JyunsaiKaai";
54
font-weight: normal;

src/layouts/BaseLayout.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import '@waline/client/waline-meta.css'
1919
interface Props {
2020
meta: SiteMeta
2121
highlightColor?: string
22+
bodyClass?: string
2223
}
2324
24-
const { meta, highlightColor, ...props } = Astro.props
25+
const { meta, highlightColor, bodyClass, ...props } = Astro.props
2526
const {
2627
articleDate,
2728
description = config.description,
@@ -36,7 +37,7 @@ const {
3637
<ThemeProvider />
3738
</head>
3839

39-
<body class='flex justify-center bg-background text-foreground' {...props}>
40+
<body class:list={['flex justify-center bg-background text-foreground', bodyClass]} {...props}>
4041
{
4142
highlightColor && (
4243
<div

0 commit comments

Comments
 (0)