-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
21 lines (19 loc) · 998 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import projectData from './project_data.json' assert {type: 'json'};
import populateWorkProjects from './modules/projects.js';
import { toogleMobileMenu, addEventListenersOnLinks } from './modules/mobileMenu.js';
window.addEventListener('DOMContentLoaded', () => {
// Implements Mobile Menu Actions
const hamburger = document.querySelector('.header-icon-nav');
const closeIcon = document.querySelector('.remove-menu');
const mobileLinkElements = [
document.querySelector('#mobile-work-link'),
document.querySelector('#mobile-about-link'),
document.querySelector('#mobile-contact-link'),
];
hamburger.addEventListener('click', toogleMobileMenu);
closeIcon.addEventListener('click', toogleMobileMenu);
addEventListenersOnLinks(...mobileLinkElements);
// Implements dynamic addition of projects from data in 'project_data.json'
const projectUlContainer = document.querySelector('#projects-list-container');
populateWorkProjects(projectUlContainer, projectData);
});