site/content/assets/js/resume.js

25 lines
761 B
JavaScript
Executable file

/*
RESUME
*/
// Make elements visible as the user scrolls down the page by applying a class
window.addEventListener('scroll', function () {
const contents = document.querySelectorAll('.fade-in-up-section');
contents.forEach(content => {
const contentPosition = content.getBoundingClientRect().top;
const screenPosition = window.innerHeight / 1.2;
if (contentPosition < screenPosition) {
content.classList.add('visible');
}
});
});
// Get the name of the company from URL
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('name')) {
const paramValue = urlParams.get('name');
document.getElementById('companyName').innerHTML = ` ${paramValue}`;
}