How I built this portfolio
When I started learning, I was tempted to Wordpress or something similar. However, since I'm at the starting phase, I decided to jump in with HTML, CSS and a litte bit of JavaScript.
The JavaScript Challenge
I've never really used JavaScript so I leaned into online resources such as stackoverflow to create a burger menu which toggles the mobile menu. Here's a bit of the code:
const toggleButton = document.querySelector('.mobile-toggle');
const navMenu = document.querySelector('.site-nav');
toggleButton.addEventListener('click', () => {
navMenu.classList.toggle('is-open');
const isOpen = navMenu.classList.contains('is-open');
toggleButton.setAttribute('aria-expanded', isOpen);
});
This function simply toggles a CSS class, which keeps the JavaScript lightweight and the animation performance high.