// I suck at JS okay, don't judge. I know this is horrendous. Heavy copy/paste junk. // Code is commented more than it needs to be because I'm still learning and the comments are basically post-it notes to help me remember. // Ajax is entirely pointless for this site, but I did it to learn. // Find all our buttons const button1 = document.getElementById('button1'); const button2 = document.getElementById('button2'); const button3 = document.getElementById('button3'); // Create variables that will get populated by loadContent() later var page1 = "pages/about.html"; var page2 = "pages/about.html"; var page3 = "pages/about.html"; const spinner = ''; // Very bad function to get rid of the "active" class wherever it is atm function resetButtons() { button1.className = "nav-button"; button2.className = "nav-button"; button3.className = "nav-button"; } function setContent(navbutt, payload) { document.getElementById("page").innerHTML = spinner; resetButtons(); navbutt.className += " active"; } function initialContent() { // Slap on all the event listeners button1.addEventListener('click', function() { setContent(button1, page1); }, false); button2.addEventListener('click', function() { setContent(button2, page2); }, false); button3.addEventListener('click', function() { setContent(button3, page3); }, false); }