1+ "use client"
2+
13import Link from 'next/link' ;
24import 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' ;
614import { LuCirclePlay } from "react-icons/lu" ;
715import { FaGithub } from "react-icons/fa" ;
816
917export 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+ }
0 commit comments