Previous
Previous
U+2225
Next
Next
document.querySelectorAll('.grid-item').forEach(item => { let clickedOnce = false; item.addEventListener('click', function(e) { if (!clickedOnce) { // Prevent the default link behavior on first click e.preventDefault(); // Toggle visibility of the title const title = this.querySelector('.portfolio-text'); if (title) { title.style.opacity = '1'; } // Mark as clicked once clickedOnce = true; } else { // On second click, allow default behavior (navigation) window.location.href = this.href; } }); });