// nav bar scroll effect const scrollLimit = 150; window.onscroll = () => { // check if scrolled past limit if so add scrolled class to change background of nav if (document.body.scrollTop >= scrollLimit || document.documentElement.scrollTop >= scrollLimit) { document.querySelector("nav").classList.add("scrolled"); } else { document.querySelector("nav").classList.remove("scrolled"); } }; document.querySelector("#goBackToTop").addEventListener("click", () => { window.scrollTo(0, 0); }); /** * getProjectData function * Gets the project data from the backend route and appends the data on to the timeline. */ function getProjectData() { fetch("/api/projectData").then(res => { res.json().then(json => { if (res.ok) { json.forEach(item => { if (item["isMainProject"] === 1) { document.querySelector("#mainProj").innerHTML = `
${item["information"]}
${item["information"]}