Skip to content

Commit 354da12

Browse files
authored
feat: Update dependencies and refactor homepage components (#15)
* feat: Update dependencies and refactor homepage components * feat:Update favicon.ico for better branding * fix:Remove unused dependencies and clean up pnpm-lock.yaml * feat: Enhance Hero component with image carousel and update dependencies * fix: Update GitHub Action doc link for Shiroi Docker --------- Signed-off-by: PaloMiku <[email protected]>
1 parent 7b6e9f0 commit 354da12

File tree

5 files changed

+87
-66
lines changed

5 files changed

+87
-66
lines changed

app/components/home/Hero.tsx

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,80 @@
1+
"use client"
2+
13
import Link from 'next/link';
24
import Image from 'next/image';
3-
import Img from './img.png';
4-
import { cn } from '@/utils/cn';
5-
import { buttonVariants } from '@/app/components/ui/button';
5+
import { useState } from 'react';
6+
const images = [
7+
'/assets/images/preview/shiro.png',
8+
'/assets/images/preview/kami.png',
9+
'/assets/images/preview/console.png'
10+
];
11+
const imageNames = ['Shiro主题','Kami主题','控制台'];
12+
import { cn } from 'utils/cn';
13+
import { buttonVariants } from 'app/components/ui/button';
614
import { LuCirclePlay } from "react-icons/lu";
715
import { FaGithub } from "react-icons/fa";
816

917
export function Hero() {
10-
return (
11-
<div className="container relative z-[2] flex flex-col overflow-hidden border-x border-t rounded-t-2xl bg-fd-background px-6 pt-12 max-md:text-center md:px-12 md:pt-16 [.uwu_&]:hidden">
12-
<h1 className="mb-8 text-4xl font-medium">
13-
Mix Space
14-
<br />
15-
An Alternative Personal Space.
16-
</h1>
17-
<p className="mb-8 text-fd-muted-foreground md:max-w-[80%] md:text-xl">
18-
Mix Space 是一个小型个人空间站点程序。不同于传统的博客程序,采用前后端分离设计,
19-
适合那些喜欢写不同风格或类型的写作爱好者。
20-
</p>
21-
<div className="inline-flex items-center gap-3 max-md:mx-auto">
22-
<Link
23-
href="/docs/core"
24-
className={cn(
25-
buttonVariants({ size: 'lg', className: 'rounded-full' }),
26-
)}
27-
>
28-
<LuCirclePlay className="size-4 mr-2" /> 开始使用
29-
</Link>
30-
<a
31-
href="https://github.com/mx-space"
32-
className={cn(
33-
buttonVariants({
34-
size: 'lg',
35-
variant: 'outline',
36-
className: 'rounded-full bg-fd-background flex items-center',
37-
}),
38-
)}
39-
>
40-
<FaGithub className="size-4 mr-2" /> Github
41-
</a>
18+
const [currentImage, setCurrentImage] = useState(0);
19+
return (
20+
<div className="container relative z-[2] flex flex-col overflow-hidden rounded-lg bg-background px-6 pt-12 max-md:text-center md:px-12 md:pt-16">
21+
<h1 className="mb-8 text-4xl font-medium">
22+
Mix Space
23+
<br />
24+
An Alternative Personal Space.
25+
</h1>
26+
<p className="mb-8 text-muted-foreground md:max-w-[80%] md:text-xl">
27+
Mix Space 是一个小型个人空间站点程序。不同于传统的博客程序,采用前后端分离设计,
28+
适合那些喜欢写不同风格或类型的写作爱好者。
29+
</p>
30+
<div className="inline-flex items-center gap-3 max-md:mx-auto">
31+
<Link
32+
href="/docs/core"
33+
className={cn(
34+
buttonVariants({ size: 'lg', className: 'rounded-full' }),
35+
)}
36+
>
37+
<LuCirclePlay className="size-4 mr-2" /> 开始使用
38+
</Link>
39+
<a
40+
href="https://github.com/mx-space"
41+
className={cn(
42+
buttonVariants({
43+
size: 'lg',
44+
variant: 'outline',
45+
className: 'rounded-full bg-background flex items-center',
46+
}),
47+
)}
48+
>
49+
<FaGithub className="size-4 mr-2" /> Github
50+
</a>
51+
</div>
52+
<div className="relative mt-8">
53+
<div className="flex justify-center gap-2 mb-4">
54+
{images.map((_, index) => (
55+
<button
56+
key={index}
57+
onClick={() => setCurrentImage(index)}
58+
className={`px-3 py-1 text-sm rounded-full transition-colors ${
59+
index === currentImage
60+
? 'bg-primary text-white'
61+
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
62+
}`}
63+
>
64+
{imageNames[index]}
65+
</button>
66+
))}
4267
</div>
4368
<Image
44-
src={Img}
69+
src={images[currentImage]}
4570
alt="preview"
46-
className="mb-[-100px] mt-8 min-w-[800px] select-none duration-1000 animate-in fade-in slide-in-from-bottom-12 md:mb-[-170px] md:min-w-[1100px]"
71+
width={1200}
72+
height={675}
73+
className="w-full max-w-[1200px] select-none duration-1000 animate-in fade-in slide-in-from-bottom-12"
4774
priority
4875
/>
49-
<div
50-
className="absolute inset-0 z-[-1]"
51-
style={{
52-
backgroundImage: [
53-
'radial-gradient(ellipse at top, transparent 60%, hsla(250,90%,90%,0.2))',
54-
'linear-gradient(to bottom, transparent 30%, hsl(var(--primary) / 0.2))',
55-
'linear-gradient(to bottom, hsl(var(--background)) 40%, transparent)',
56-
'repeating-linear-gradient(45deg, transparent,transparent 60px, hsl(var(--primary)) 61px, transparent 62px)',
57-
].join(', '),
58-
}}
59-
/>
6076
</div>
61-
);
62-
}
77+
<div className="absolute inset-0 z-[-1] bg-gradient-to-b from-background/50 to-background" />
78+
</div>
79+
);
80+
}

content/docs/themes/community.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { FileText } from 'lucide-react'
1111
<Cards>
1212
<Card
1313
title="GitHub Action构建Shiroi Docker镜像"
14-
href="https://blog.sotkg.com/2024/10/https-www-sotkg-com-posts-site-shiroi-docker-deployment.html"
14+
href="https://blog.sotkg.com/posts/site/shiroi-docker-deployment"
1515
icon={<FileText />}
1616
target="_blank"
1717
>前端部署方式拓展博文教程 | By Mikuの鬆 </Card>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"copy-to-clipboard": "^3.3.3",
2323
"cz-conventional-changelog": "^3.3.0",
2424
"dotenv": "^16.4.7",
25-
"framer-motion": "^11.16.2",
25+
"framer-motion": "^11.16.4",
2626
"fumadocs-core": "14.6.4",
2727
"fumadocs-mdx": "11.2.1",
2828
"fumadocs-typescript": "^3.0.2",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)