-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavigation.js
More file actions
35 lines (28 loc) · 1.4 KB
/
navigation.js
File metadata and controls
35 lines (28 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const navItems = [
{ text: "Master Settings", href: "davinci-master-settings.html" },
{ text: "Blackmagic Cloud", href: "davinci-cloud.html" },
{ text: "Image Scaling", href: "davinci-image-scaling.html" },
{ text: "Color Management", href: "davinci-color-management.html" },
{ text: "General Options", href: "davinci-general-options.html" },
{ text: "Camera Raw", href: "davinci-camera-raw.html" },
{ text: "Capture and Playback", href: "davinci-capture-playback.html" },
{ text: "Subtitles and Transcription", href: "davinci-subtitles-transcription.html" },
{ text: "Fusion", href: "davinci-fusion.html" },
{ text: "Fairlight", href: "davinci-fairlight.html" },
{ text: "Path Mapping", href: "davinci-path-mapping.html" },
{ text: "Additional", href: "davinci-additional.html" }
];
function generateNavigation() {
const currentPage = window.location.pathname.split('/').pop();
const sidebar = document.getElementById('navigation');
sidebar.innerHTML = '';
navItems.forEach(({ text, href }) => {
const isActive = href === currentPage;
const element = document.createElement(isActive ? 'div' : 'a');
element.className = 'navigation-item' + (isActive ? ' active' : '');
element.textContent = text;
if (!isActive) element.href = href;
sidebar.appendChild(element);
});
}
generateNavigation();