|
|
window.HELP_IMPROVE_VIDEOJS = false; |
|
|
|
|
|
|
|
|
function toggleMoreWorks() { |
|
|
const dropdown = document.getElementById('moreWorksDropdown'); |
|
|
const button = document.querySelector('.more-works-btn'); |
|
|
|
|
|
if (dropdown.classList.contains('show')) { |
|
|
dropdown.classList.remove('show'); |
|
|
button.classList.remove('active'); |
|
|
} else { |
|
|
dropdown.classList.add('show'); |
|
|
button.classList.add('active'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
document.addEventListener('click', function(event) { |
|
|
const container = document.querySelector('.more-works-container'); |
|
|
const dropdown = document.getElementById('moreWorksDropdown'); |
|
|
const button = document.querySelector('.more-works-btn'); |
|
|
|
|
|
if (container && !container.contains(event.target)) { |
|
|
dropdown.classList.remove('show'); |
|
|
button.classList.remove('active'); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
document.addEventListener('keydown', function(event) { |
|
|
if (event.key === 'Escape') { |
|
|
const dropdown = document.getElementById('moreWorksDropdown'); |
|
|
const button = document.querySelector('.more-works-btn'); |
|
|
dropdown.classList.remove('show'); |
|
|
button.classList.remove('active'); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
function copyBibTeX() { |
|
|
const bibtexElement = document.getElementById('bibtex-code'); |
|
|
const button = document.querySelector('.copy-bibtex-btn'); |
|
|
const copyText = button.querySelector('.copy-text'); |
|
|
|
|
|
if (bibtexElement) { |
|
|
navigator.clipboard.writeText(bibtexElement.textContent).then(function() { |
|
|
|
|
|
button.classList.add('copied'); |
|
|
copyText.textContent = 'Cop'; |
|
|
|
|
|
setTimeout(function() { |
|
|
button.classList.remove('copied'); |
|
|
copyText.textContent = 'Copy'; |
|
|
}, 2000); |
|
|
}).catch(function(err) { |
|
|
console.error('Failed to copy: ', err); |
|
|
|
|
|
const textArea = document.createElement('textarea'); |
|
|
textArea.value = bibtexElement.textContent; |
|
|
document.body.appendChild(textArea); |
|
|
textArea.select(); |
|
|
document.execCommand('copy'); |
|
|
document.body.removeChild(textArea); |
|
|
|
|
|
button.classList.add('copied'); |
|
|
copyText.textContent = 'Cop'; |
|
|
setTimeout(function() { |
|
|
button.classList.remove('copied'); |
|
|
copyText.textContent = 'Copy'; |
|
|
}, 2000); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function scrollToTop() { |
|
|
window.scrollTo({ |
|
|
top: 0, |
|
|
behavior: 'smooth' |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
window.addEventListener('scroll', function() { |
|
|
const scrollButton = document.querySelector('.scroll-to-top'); |
|
|
if (window.pageYOffset > 300) { |
|
|
scrollButton.classList.add('visible'); |
|
|
} else { |
|
|
scrollButton.classList.remove('visible'); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
function setupVideoCarouselAutoplay() { |
|
|
const carouselVideos = document.querySelectorAll('.results-carousel video'); |
|
|
|
|
|
if (carouselVideos.length === 0) return; |
|
|
|
|
|
const observer = new IntersectionObserver((entries) => { |
|
|
entries.forEach(entry => { |
|
|
const video = entry.target; |
|
|
if (entry.isIntersecting) { |
|
|
|
|
|
video.play().catch(e => { |
|
|
|
|
|
console.log('Autoplay prevented:', e); |
|
|
}); |
|
|
} else { |
|
|
|
|
|
video.pause(); |
|
|
} |
|
|
}); |
|
|
}, { |
|
|
threshold: 0.5 |
|
|
}); |
|
|
|
|
|
carouselVideos.forEach(video => { |
|
|
observer.observe(video); |
|
|
}); |
|
|
} |
|
|
|
|
|
$(document).ready(function() { |
|
|
|
|
|
|
|
|
var options = { |
|
|
slidesToScroll: 1, |
|
|
slidesToShow: 1, |
|
|
loop: true, |
|
|
infinite: true, |
|
|
autoplay: true, |
|
|
autoplaySpeed: 5000, |
|
|
} |
|
|
|
|
|
|
|
|
var carousels = bulmaCarousel.attach('.carousel', options); |
|
|
|
|
|
bulmaSlider.attach(); |
|
|
|
|
|
|
|
|
setupVideoCarouselAutoplay(); |
|
|
|
|
|
}) |
|
|
|