@@ -9,47 +9,13 @@ import { SocialIcon } from '../SocialIcon';
9
9
import { TextUpTransitionView } from '@/components/ui/transition/TextUpTransitionView' ;
10
10
import { cn } from '@/lib/helper' ;
11
11
import { TwoColumnLayout } from '@/components/layout/TwoColumnLayout' ;
12
+ import { heroDesc , heroOwnerInfo , heroTitle } from '~/about' ;
12
13
13
14
export const Hero = ( ) => {
14
- const title = {
15
- template : [
16
- { type : 'h1' , text : `Hi, I'm ` , class : ' font-light text-4xl font-900 inline-block' } ,
17
- { type : 'h1' , text : `zw` , class : ' text-4xl font-bold inline-block' } ,
18
- {
19
- type : 'h1' ,
20
- text : `👋` ,
21
- class :
22
- ' font-light text-4xl font-bold inline-block hover:scale-[1.05] cursor-pointer origin-center transition-all' ,
23
- } ,
24
- { type : 'h1' , text : ` ` , class : ' h-0 w-0 scale-0' } ,
25
- {
26
- type : 'span' ,
27
- text : 'A NodeJS Full Stack ' ,
28
- class : 'font-light text-4xl font-900 inline-block mt-[5px]' ,
29
- } ,
30
- {
31
- type : 'code' ,
32
- text : '<Developer />' ,
33
- class :
34
- ' inline-block font-medium mx-2 text-3xl rounded p-2 bg-gray-200 dark:bg-gray-800/0 hover:dark:bg-gray-800/100 bg-opacity-0 hover:bg-opacity-100 transition-background duration-200"><div><span class="inline-block whitespace-pre' ,
35
- } ,
36
- ] ,
37
- } ;
38
-
39
- const description = 'An independent developer coding with love.' ;
40
-
41
- const siteOwner = {
42
- avatar : '/image/owner.jpg' ,
43
- socialIds : {
44
- github : 'https://github.com/yangxuanxuan1998' ,
45
- twitter : 'https://twitter.com/yangxuanxuan1998' ,
46
- } ,
47
- } ;
48
-
49
- const { avatar, socialIds } = siteOwner ;
15
+ const { avatar, socialIds } = heroOwnerInfo ;
50
16
51
17
const titleAnimateD =
52
- title . template . reduce ( ( acc , cur ) => {
18
+ heroTitle . template . reduce ( ( acc , cur ) => {
53
19
return acc + ( cur . text ?. length || 0 ) ;
54
20
} , 0 ) * 50 ;
55
21
@@ -63,10 +29,10 @@ export const Hero = () => {
63
29
animate = { { y : 0 , opacity : 1 } }
64
30
transition = { { type : 'spring' , damping : 10 , stiffness : 100 } }
65
31
>
66
- { title . template . map ( ( t , i ) => {
32
+ { heroTitle . template . map ( ( t , i ) => {
67
33
const { type, text, class : className } = t ;
68
34
69
- const prevAllTextLength = title . template . slice ( 0 , i ) . reduce ( ( acc , cur ) => {
35
+ const prevAllTextLength = heroTitle . template . slice ( 0 , i ) . reduce ( ( acc , cur ) => {
70
36
return acc + ( cur . text ?. length || 0 ) ;
71
37
} , 0 ) ;
72
38
@@ -93,7 +59,7 @@ export const Hero = () => {
93
59
} }
94
60
className = "my-3 text-center lg:text-left lg:ml-24"
95
61
>
96
- < span className = " opacity-70" > { description } </ span >
62
+ < span className = " opacity-70" > { heroDesc } </ span >
97
63
</ m . div >
98
64
99
65
< ul className = "center mx-[60px] mt-8 flex flex-wrap gap-6 lg:mx-auto lg:mt-24 lg:justify-start lg:gap-4 lg:ml-24" >
0 commit comments