@@ -18,21 +18,32 @@ const footerCopyrights: string = "© 2025 Charles Doucet - All Rights Reserved";
18
18
const EVENT_BUS = new EventBus < Events > ( ) ;
19
19
EVENT_BUS . subscribe ( 'button_test' , handlers . button_test ) ;
20
20
21
+ type SocialLink = [
22
+ socialName : string ,
23
+ path : string ,
24
+ image : string ,
25
+ ]
26
+
27
+ const FOO_SOCIALS = [
28
+ [ "Github" , githubProfile , githubIcon ] ,
29
+ [ "LinkedIn" , linkedinProfile , linkedIcon ] ,
30
+ [ "Instagram" , instagramProfile , instagramIcon ]
31
+ ]
21
32
22
33
export function VerticalNav ( ) {
23
34
const menuBox = document . createElement ( "div" ) ;
24
35
menuBox . id = "vertical-nav" ;
25
36
26
- menuBox . appendChild ( navHeaderBlock ( ) ) ;
37
+ menuBox . appendChild ( navHeader ( ) ) ;
27
38
menuBox . appendChild ( testButtons ( ) ) ;
28
- // menuBox.innerHTML += navFooter;
39
+ menuBox . appendChild ( navFooter ( ) ) ;
29
40
30
41
return menuBox ;
31
42
}
32
43
33
44
// ----------------------------------------------------------------------
34
45
35
- function navHeaderBlock ( ) {
46
+ function navHeader ( ) {
36
47
const headerContainer = document . createElement ( "div" ) ;
37
48
const topTriangle = document . createElement ( "div" ) ;
38
49
const info = document . createElement ( "div" ) ;
@@ -82,16 +93,36 @@ function testButtons() {
82
93
}
83
94
84
95
85
- const navFooter = `
86
- <div class="nav-footer">
87
- <ul class="socials">
88
- <li><a href="${ githubProfile } " target="_blank"><img src="${ githubIcon } "/></a></li>
89
- <li><a href="${ linkedinProfile } " target="_blank"><img src="${ linkedIcon } "/></a></li>
90
- <li><a href="${ instagramProfile } " target="_blank"><img src="${ instagramIcon } "/></a></li>
91
- </ul>
92
- <p class="copyrights">${ footerCopyrights } </p>
93
- </div>
94
- `
96
+ function navFooter ( ) {
97
+ const footerContainer = document . createElement ( "div" ) ;
98
+ const socials = document . createElement ( "ul" ) ;
99
+ const copyrights = document . createElement ( "p" ) ;
95
100
101
+ footerContainer . className = "nav-footer" ;
102
+ socials . className = "socials" ;
103
+ copyrights . className = "copyrights" ;
104
+ copyrights . textContent = footerCopyrights ;
105
+
106
+ footerContainer . appendChild ( socials ) ;
107
+ footerContainer . appendChild ( copyrights ) ;
108
+
109
+ FOO_SOCIALS . forEach ( social => {
110
+ const [ name , path , image ] = social ;
111
+ const socialLink = document . createElement ( "li" ) ;
112
+ const link = document . createElement ( "a" ) ;
113
+ const icon = document . createElement ( "img" ) ;
114
+
115
+ link . href = path ;
116
+ link . target = "_blank" ;
117
+ icon . src = image ;
118
+
119
+ socials . appendChild ( socialLink ) ;
120
+ socialLink . appendChild ( link ) ;
121
+ link . appendChild ( icon ) ;
122
+ } )
123
+
124
+ return footerContainer ;
125
+
126
+ }
96
127
97
128
0 commit comments