Skip to content

Commit 20e3488

Browse files
committed
wip: nav vertical refactor
1 parent 994d4af commit 20e3488

File tree

3 files changed

+57
-55
lines changed

3 files changed

+57
-55
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import githubIcon from "./assets/github-icon.svg";
2+
import linkedIcon from "./assets/linkedin-icon.svg";
3+
import instagramIcon from "./assets/instagram-icon.svg";
4+
5+
const menuTitle: string = "CD-BASH";
6+
7+
const githubProfile: string = "https://github.com/CD-BASH"
8+
const linkedinProfile: string = "https://www.linkedin.com/in/charlesdouc/"
9+
const instagramProfile: string = "https://www.instagram.com/charlesdouc/"
10+
const footerCopyrights: string = "© 2025 Charles Doucet - All Rights Reserved";
11+
12+
type SocialLink = [
13+
socialName: string,
14+
path: string,
15+
image: string,
16+
]
17+
18+
const FOO_SOCIALS = [
19+
["Github", githubProfile, githubIcon],
20+
["LinkedIn", linkedinProfile, linkedIcon],
21+
["Instagram", instagramProfile, instagramIcon]
22+
]
23+
24+
25+
export function footerNav() {
26+
const footerContainer = document.createElement("div");
27+
const socials = document.createElement("ul");
28+
const copyrights = document.createElement("p");
29+
30+
footerContainer.className = "nav-footer";
31+
socials.className = "socials";
32+
copyrights.className = "copyrights";
33+
copyrights.textContent = footerCopyrights;
34+
35+
footerContainer.appendChild(socials);
36+
footerContainer.appendChild(copyrights);
37+
38+
FOO_SOCIALS.forEach(social => {
39+
const [name, path, image] = social;
40+
const socialLink = document.createElement("li");
41+
const link = document.createElement("a");
42+
const icon = document.createElement("img");
43+
44+
link.href = path;
45+
link.target = "_blank";
46+
icon.src = image;
47+
48+
socials.appendChild(socialLink);
49+
socialLink.appendChild(link);
50+
link.appendChild(icon);
51+
})
52+
53+
return footerContainer;
54+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export * from "./vertical-nav"
1+
import './styles.css';
2+
export * from "./vertical-nav";

src/components/vertical-nav/vertical-nav.ts

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
11
import './styles.css'
22
import cdIcon from "/img/common/cd_icon_green.png"
3-
import githubIcon from './assets/github-icon.svg'
4-
import linkedIcon from './assets/linkedin-icon.svg'
5-
import instagramIcon from './assets/instagram-icon.svg'
3+
64
import {EventBus} from "../../event-bus";
75
import {Events} from "../../consts/events";
86
import {handlers} from "../../consts/handlers";
97

10-
const menuTitle: string = "CD-BASH";
11-
12-
const githubProfile: string = "https://github.com/CD-BASH"
13-
const linkedinProfile: string = "https://www.linkedin.com/in/charlesdouc/"
14-
const instagramProfile: string = "https://www.instagram.com/charlesdouc/"
15-
const footerCopyrights: string = "© 2025 Charles Doucet - All Rights Reserved";
16-
17-
188
const EVENT_BUS = new EventBus<Events>();
199
EVENT_BUS.subscribe('button_test', handlers.button_test);
2010

21-
type SocialLink = [
22-
socialName: string,
23-
path: string,
24-
image: string,
25-
]
2611

27-
const FOO_SOCIALS = [
28-
["Github", githubProfile, githubIcon],
29-
["LinkedIn", linkedinProfile, linkedIcon],
30-
["Instagram", instagramProfile, instagramIcon]
31-
]
3212

3313
export function VerticalNav() {
3414
const menuBox = document.createElement("div");
@@ -93,36 +73,3 @@ function testButtons() {
9373
}
9474

9575

96-
function navFooter() {
97-
const footerContainer = document.createElement("div");
98-
const socials = document.createElement("ul");
99-
const copyrights = document.createElement("p");
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-
}
127-
128-

0 commit comments

Comments
 (0)