@@ -27,6 +27,7 @@ const Header = styled('div')<{ emblemUrl: string }>(({ emblemUrl }) => ({
27
27
padding : '0 20px' ,
28
28
boxSizing : 'border-box' ,
29
29
zIndex : 1000 ,
30
+ font : 'Helvetica' ,
30
31
} ) ) ;
31
32
32
33
const OverlayImage = styled ( 'img' ) ( {
@@ -46,29 +47,71 @@ const DisplayName = styled('div')({
46
47
fontWeight : 'bold' ,
47
48
} ) ;
48
49
49
- const ButtonContainer = styled ( 'div' ) ( {
50
+ const BottomContainer = styled ( 'div' ) ( {
50
51
position : 'absolute' ,
51
- bottom : '0px' ,
52
- left : '50%' ,
53
- transform : 'translateX(-50%)' ,
52
+ bottom : '0' ,
53
+ left : 0 ,
54
+ right : 0 ,
55
+ display : 'flex' ,
56
+ justifyContent : 'center' ,
57
+ alignItems : 'flex-end' ,
58
+ } ) ;
59
+
60
+ const ButtonContainer = styled ( 'div' ) ( {
54
61
display : 'flex' ,
55
62
gap : '20px' ,
56
63
} ) ;
57
64
58
- const CharacterText = styled ( 'div' ) < { isSelected : boolean } > ( ( { isSelected } ) => ( {
65
+ const sharedTextStyles = {
59
66
fontSize : '24px' ,
60
67
cursor : 'pointer' ,
61
- color : isSelected ? 'white' : 'rgba(255, 255, 255, 0.6)' ,
62
- opacity : isSelected ? 1 : 0.6 ,
63
- borderBottom : isSelected ? '4px solid white' : 'none' ,
64
68
paddingBottom : '5px' ,
65
- transition : 'opacity 0.3s' ,
66
- textTransform : 'capitalize' ,
69
+ transition : 'opacity 0.3s, transform 0.3s ' ,
70
+ position : 'relative' as const ,
67
71
'&:hover' : {
68
72
opacity : 1 ,
73
+ transform : 'translateY(-2px)' ,
74
+ } ,
75
+ } ;
76
+
77
+ const CharacterText = styled ( 'div' ) < { isSelected : boolean } > ( ( { isSelected } ) => ( {
78
+ ...sharedTextStyles ,
79
+ color : isSelected ? 'white' : 'rgba(255, 255, 255, 0.6)' ,
80
+ opacity : isSelected ? 1 : 0.6 ,
81
+ textTransform : 'capitalize' ,
82
+ '&::after' : {
83
+ content : '""' ,
84
+ position : 'absolute' ,
85
+ bottom : 0 ,
86
+ left : 0 ,
87
+ width : '100%' ,
88
+ height : '4px' ,
89
+ backgroundColor : 'white' ,
90
+ transform : isSelected ? 'scaleX(1)' : 'scaleX(0)' ,
91
+ transition : 'transform 0.3s' ,
69
92
} ,
70
93
} ) ) ;
71
94
95
+ const LinksContainer = styled ( 'div' ) ( {
96
+ position : 'absolute' ,
97
+ right : '20px' ,
98
+ bottom : '-2px' ,
99
+ display : 'flex' ,
100
+ gap : '20px' ,
101
+ alignItems : 'flex-end' ,
102
+ } ) ;
103
+
104
+ const StyledLink = styled ( 'a' ) ( {
105
+ ...sharedTextStyles ,
106
+ color : 'rgba(255, 255, 255, 0.6)' ,
107
+ textDecoration : 'none' ,
108
+ opacity : 0.6 ,
109
+ '&:hover' : {
110
+ ...sharedTextStyles [ '&:hover' ] ,
111
+ color : 'white' ,
112
+ } ,
113
+ } ) ;
114
+
72
115
const HeaderComponent : React . FC < HeaderComponentProps > = ( {
73
116
emblemUrl,
74
117
overlayUrl,
@@ -88,17 +131,31 @@ const HeaderComponent: React.FC<HeaderComponentProps> = ({
88
131
< Header emblemUrl = { emblemUrl } >
89
132
< OverlayImage src = { overlayUrl } alt = "Overlay" />
90
133
< DisplayName > { displayName } </ DisplayName >
91
- < ButtonContainer >
92
- { [ 0 , 1 , 2 ] . map ( ( index ) => (
93
- < CharacterText
94
- key = { index }
95
- isSelected = { selectedCharacter ?. id === index }
96
- onClick = { ( ) => handleCharacterClick ( index ) }
97
- >
98
- { characters [ index ] . class }
99
- </ CharacterText >
100
- ) ) }
101
- </ ButtonContainer >
134
+ < BottomContainer >
135
+ < ButtonContainer >
136
+ { characters . map ( ( character , index ) => (
137
+ < CharacterText
138
+ key = { index }
139
+ isSelected = { selectedCharacter ?. id === character . id }
140
+ onClick = { ( ) => handleCharacterClick ( index ) }
141
+ >
142
+ { character . class }
143
+ </ CharacterText >
144
+ ) ) }
145
+ </ ButtonContainer >
146
+ </ BottomContainer >
147
+ < LinksContainer >
148
+ < StyledLink
149
+ href = "https://buymeacoffee.com/d2loadouts"
150
+ target = "_blank"
151
+ rel = "noopener noreferrer"
152
+ >
153
+ Coffee
154
+ </ StyledLink >
155
+ < StyledLink href = "https://patreon.com/d2loadouts" target = "_blank" rel = "noopener noreferrer" >
156
+ Patreon
157
+ </ StyledLink >
158
+ </ LinksContainer >
102
159
</ Header >
103
160
) ;
104
161
} ;
0 commit comments