Skip to content

Commit d21886e

Browse files
authored
feat: [#46] vertical nav redesign
* wip: new design for the vertical nav * feat: fresh vertical nav aligned with new design
1 parent 7ae53c7 commit d21886e

File tree

7 files changed

+143
-258
lines changed

7 files changed

+143
-258
lines changed

src/components/vertical-nav/index.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const linkedinProfile: string = "https://www.linkedin.com/in/charlesdouc/"
1111
const instagramProfile: string = "https://www.instagram.com/charlesdouc/"
1212
const footerCopyrights: string = "© 2025 Charles Doucet - All Rights Reserved";
1313

14-
1514
type SocialLink = [
1615
path: string,
1716
image: string,
@@ -23,25 +22,23 @@ const FOO_SOCIALS: SocialLink[] = [
2322
[instagramProfile, instagramIcon]
2423
]
2524

26-
2725
//-----------------------------------------------------------------------
2826

2927
export function buildVerticalNav() {
3028
const navBox = document.createElement("div");
31-
const navWrapper = document.createElement("div");
29+
const navHeader = header();
3230
const navBreadcrumbs = document.createElement("div");
3331
const navInfo = document.createElement("div");
32+
const navFooter = footer();
3433

3534
navBox.id = "vertical-nav";
36-
navWrapper.id = "nav-wrapper";
3735
navBreadcrumbs.id = "nav-breadcrumbs";
3836
navInfo.id = "nav-info";
3937

40-
navBox.appendChild(header());
41-
navBox.appendChild(navWrapper);
42-
navWrapper.appendChild(navBreadcrumbs);
43-
navWrapper.appendChild(navInfo);
44-
navBox.appendChild(footer());
38+
navBox.appendChild(navHeader);
39+
navHeader.appendChild(navBreadcrumbs);
40+
navBox.appendChild(navInfo);
41+
navBox.appendChild(navFooter);
4542

4643
return navBox;
4744
}
@@ -58,7 +55,7 @@ export function renderNavInfo(info: HTMLElement) {
5855

5956
//-----------------------------------------------------------------------
6057

61-
function header() {
58+
const header = () => {
6259
const container = document.createElement("div");
6360
const topTriangle = document.createElement("div");
6461
const logo = document.createElement("div");
@@ -83,7 +80,7 @@ function header() {
8380
}
8481

8582

86-
function footer() {
83+
const footer = () => {
8784
const container = document.createElement("div");
8885
const socials = document.createElement("ul");
8986
const copyrights = document.createElement("p");

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

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,55 @@
11
import {renderer} from "./project-data-cube.ts";
22

3-
export type OutsideLink = [
4-
name: string,
5-
path: string,
6-
]
7-
8-
export type LinkCollection = [
9-
title: string,
10-
links: OutsideLink[],
11-
]
123

13-
export type LinkButton = [
4+
export type ButtonLink = [
145
label: string,
6+
path: string,
7+
highlight: boolean,
158
]
169

1710
//-----------------------------------------------------------------------
1811

19-
export function projectInfo(collections: LinkCollection[], buttons: LinkButton[]) {
12+
export function projectInfo(buttons: ButtonLink[]) {
2013
const container = document.createElement('div');
14+
const buttonList = document.createElement('ul');
15+
2116
container.className = "project-info";
17+
buttonList.className = "button-list";
2218
container.appendChild(dataSection());
23-
24-
collections.forEach(collection => {
25-
const [title, links] = collection;
26-
container.appendChild(linkSection(title, links));
27-
})
19+
container.appendChild(buttonList);
2820

2921
buttons.forEach(button => {
30-
const [label] = button;
31-
container.appendChild(buttonSection(label));
22+
buttonList.appendChild(createButton(button));
3223
})
3324

3425
return container;
3526
}
3627

3728
//-----------------------------------------------------------------------
3829

39-
function linkSection(title: string, links: OutsideLink[]) {
40-
const section = document.createElement('section');
41-
const sectionTitle = document.createElement("h4");
42-
const linkList = document.createElement('ul');
43-
44-
sectionTitle.textContent = title;
45-
46-
section.appendChild(sectionTitle);
47-
section.appendChild(linkList);
48-
49-
links.forEach(link => {
50-
const [name, path] = link;
51-
const linkLine = document.createElement('li');
52-
const linkElement = document.createElement("a");
53-
54-
linkElement.href = path;
55-
linkElement.target = "_blank";
56-
linkElement.textContent = name;
57-
58-
linkList.appendChild(linkLine);
59-
linkLine.appendChild(linkElement);
60-
})
61-
62-
return section;
63-
}
6430

65-
function buttonSection(label: string) {
66-
const section = document.createElement('section');
67-
const buttonLine = document.createElement('button');
31+
function createButton(newButton: ButtonLink) {
32+
const btn = document.createElement('li');
33+
const btnLine = document.createElement('a');
34+
const [label, path, highlight] = newButton;
6835

69-
buttonLine.type = "button";
70-
buttonLine.textContent = label;
36+
if (highlight) {
37+
btn.className = "btn-highlight";
38+
}
7139

72-
section.appendChild(buttonLine);
40+
btnLine.type = "button";
41+
btnLine.textContent = label;
42+
btnLine.href = path;
43+
btnLine.target = "_blank";
7344

74-
return section;
45+
btn.appendChild(btnLine);
46+
return btn;
7547
}
7648

7749
function dataSection() {
7850
const detailSection = document.createElement("section");
7951
const detailTitle = document.createElement("h4");
80-
detailTitle.textContent = "Tech Distribution";
52+
detailTitle.textContent = "Made with";
8153

8254
detailSection.appendChild(detailTitle);
8355
detailSection.appendChild(renderer.domElement);

src/components/vertical-nav/project-data-cube.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const scene = new THREE.Scene();
88
const camera = new THREE.PerspectiveCamera( 75, 1, 0.1, 1000 );
99

1010
export const renderer = new THREE.WebGLRenderer();
11-
renderer.setSize( 230, 230 );
11+
renderer.setSize( 185, 185 );
1212
renderer.setAnimationLoop( animate );
1313

1414
const geometry = new THREE.BoxGeometry( 1, 1, 1 );

0 commit comments

Comments
 (0)