File tree Expand file tree Collapse file tree 15 files changed +153
-219
lines changed Expand file tree Collapse file tree 15 files changed +153
-219
lines changed Original file line number Diff line number Diff line change
1
+ import clsx from 'clsx' ;
2
+ import { useTheme } from 'next-themes' ;
3
+ import * as React from 'react' ;
4
+ import { FiMoon , FiSun } from 'react-icons/fi' ;
5
+
6
+ import useLoaded from '@/hooks/useLoaded' ;
7
+
8
+ type ThemeButtonProps = React . ComponentPropsWithoutRef < 'button' > ;
9
+
10
+ export default function ThemeButton ( { className, ...rest } : ThemeButtonProps ) {
11
+ const { theme, setTheme } = useTheme ( ) ;
12
+ const isLoaded = useLoaded ( ) ;
13
+
14
+ return (
15
+ < button
16
+ className = { clsx ( className ) }
17
+ { ...rest }
18
+ onClick = { ( ) => setTheme ( theme === 'dark' ? 'light' : 'dark' ) }
19
+ >
20
+ { theme === 'light' && isLoaded ? < FiMoon /> : < FiSun /> }
21
+ </ button >
22
+ ) ;
23
+ }
Original file line number Diff line number Diff line change
1
+ import UnderlineLink from '@/components/links/UnderlineLink' ;
2
+
1
3
export default function Footer ( ) {
2
4
return (
3
- < footer className = 'relative bottom-2 flex w-full justify-center text-gray-700 dark:text-gray-200' >
4
- © { new Date ( ) . getFullYear ( ) } By{ ' ' }
5
- < a
6
- href = 'https://github.com/Chocolate1999'
7
- target = '_blank'
8
- className = 'pl-1'
9
- rel = 'noreferrer'
10
- >
11
- Chocolate
12
- </ a >
5
+ < footer className = 'mt-16 text-right text-[#b3b3b3] dark:text-gray-200' >
6
+ < section className = 'flex flex-col items-end' >
7
+ < div >
8
+ < a
9
+ href = 'https://creativecommons.org/licenses/by-nc-sa/4.0/'
10
+ rel = 'noreferrer'
11
+ target = '_blank'
12
+ >
13
+ CC BY-NC-SA 4.0
14
+ </ a > { ' ' }
15
+ { new Date ( ) . getFullYear ( ) }
16
+ < a
17
+ href = 'https://github.com/Chocolate1999'
18
+ target = '_blank'
19
+ className = 'pl-1'
20
+ rel = 'noreferrer'
21
+ >
22
+ © Yang Chao Yi
23
+ </ a >
24
+ </ div >
25
+ < UnderlineLink href = 'https://beian.miit.gov.cn/' >
26
+ 湘ICP备20002952号
27
+ </ UnderlineLink >
28
+ </ section >
13
29
</ footer >
14
30
) ;
15
31
}
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import { useMemo } from 'react';
3
3
4
4
import clsxm from '@/lib/clsxm' ;
5
5
6
- import HeaderNav from '@/components/layout/hader-nav ' ;
7
- import HeaderButton from '@/components/layout/header-button ' ;
6
+ import HeaderNav from '@/components/layout/HeaderNav ' ;
7
+ import Icon from '@/components/layout/Icon ' ;
8
8
9
9
export default function Header ( ) {
10
10
const docScroll = useScroll ( ) ;
@@ -16,16 +16,18 @@ export default function Header() {
16
16
return (
17
17
< header
18
18
className = { clsxm (
19
- 'fixed top-0 z-50 w-full bg-transparent' ,
19
+ 'sticky top-0 z-50 w-full bg-transparent' ,
20
20
isDocHover &&
21
21
'solid border-b border-black border-opacity-[0.12] bg-white bg-opacity-[98] backdrop-blur-[40px]' ,
22
22
'dark:border-b dark:border-black dark:bg-[#060807]'
23
23
) }
24
24
>
25
- < div className = 'layout flex h-[60px] items-center justify-between leading-[60px]' >
26
- < HeaderNav />
27
- < HeaderButton />
28
- </ div >
25
+ < section className = 'layout' >
26
+ < div className = 'mx-8 flex h-[60px] items-center justify-between leading-[60px]' >
27
+ < HeaderNav />
28
+ < Icon />
29
+ </ div >
30
+ </ section >
29
31
</ header >
30
32
) ;
31
33
}
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ const HeaderNav = () => {
8
8
const navVal = useRecoilValue ( navAtom ) ;
9
9
10
10
return (
11
- < div className = 'flex h-full w-auto flex-row items-center justify-center' >
11
+ < div className = 'flex h-full w-auto flex-row items-center justify-center gap-[24px] ' >
12
12
{ navVal . map ( ( item ) => {
13
13
return (
14
- < div className = 'pr-[32px]' key = { item . name } >
14
+ < div key = { item . name } >
15
15
< UnstyledLink href = { item . link } >
16
16
< span className = 'hover:text-[#0066ff] dark:text-gray-100' >
17
17
{ item . name }
Original file line number Diff line number Diff line change
1
+ import { BsGithub } from 'react-icons/bs' ;
2
+ import { SiBilibili } from 'react-icons/si' ;
3
+
4
+ import ThemeButton from '@/components/buttons/ThemeButton' ;
5
+
6
+ const Logo = ( ) => {
7
+ return (
8
+ < div className = 'flex cursor-pointer gap-[24px] text-[22px]' >
9
+ < a
10
+ href = 'https://github.com/Chocolate1999'
11
+ rel = 'noreferrer'
12
+ target = '_blank'
13
+ >
14
+ < BsGithub />
15
+ </ a >
16
+ < a
17
+ href = 'https://space.bilibili.com/351534170'
18
+ rel = 'noreferrer'
19
+ target = '_blank'
20
+ >
21
+ < SiBilibili />
22
+ </ a >
23
+ < ThemeButton />
24
+ </ div >
25
+ ) ;
26
+ } ;
27
+
28
+ export default Logo ;
Original file line number Diff line number Diff line change @@ -4,12 +4,15 @@ import Footer from '@/components/layout/Footer';
4
4
import Header from '@/components/layout/Header' ;
5
5
6
6
export default function Layout ( { children } : { children : React . ReactNode } ) {
7
- // Put Header or Footer Here
8
7
return (
9
- < div className = 'next-container' >
8
+ < >
10
9
< Header />
11
- { children }
12
- < Footer />
13
- </ div >
10
+ < div className = 'layout' >
11
+ < div className = 'mx-8' >
12
+ { children }
13
+ < Footer />
14
+ </ div >
15
+ </ div >
16
+ </ >
14
17
) ;
15
18
}
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ @keyframes fade-up-header {
2
+ 0% {
3
+ opacity : 0 ;
4
+ transform : translateY (10% );
5
+ }
6
+
7
+ 100% {
8
+ opacity : 1 ;
9
+ transform : translateY (0 );
10
+ }
11
+ }
12
+
13
+ .logo_name {
14
+ }
You can’t perform that action at this time.
0 commit comments