window.addEventListener('load', function(){



const lightboxCard = document.createElement('div');
lightboxCard.id = "lightboxCard"
document.body.appendChild(lightboxCard);

const images = document.querySelectorAll('.projectCards');
images.forEach(image => {
    image.addEventListener('click', evt => {
        lightboxCard.classList.add('active')
        const lightboxImg = document.createElement('img');
        lightboxImg.id = "lightboxImg";
        lightboxImg.src = image.src;
        while(lightboxCard.firstChild){
            lightboxCard.removeChild(lightboxCard.firstChild)
        }
        lightboxCard.appendChild(lightboxImg);
    })
})

lightboxCard.addEventListener('click', evt => {
    lightboxCard.classList.remove('active');
})

})