2020-05-16 17:58:00 +00:00
|
|
|
window.onload = function(){
|
|
|
|
// close on esc key
|
|
|
|
document.addEventListener('keydown', function(event){
|
|
|
|
if(event.keyCode === 27){
|
|
|
|
closeModal()
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close the Modal
|
|
|
|
function closeModal() {
|
|
|
|
document.getElementById("slide-container").style.display = "none"
|
|
|
|
elems = document.getElementsByClassName('slide')
|
|
|
|
for(let i=0; i<elems.length; i++){
|
|
|
|
elems[i].style.display = "none"
|
|
|
|
}
|
2020-05-17 12:33:58 +00:00
|
|
|
document.getElementsByTagName("header")[0].style.opacity = 1
|
2020-06-01 11:41:27 +00:00
|
|
|
document.getElementById("a-propos").style.opacity = 1
|
|
|
|
document.getElementById("telecharger").style.opacity = 1
|
2020-05-16 17:58:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function showSlide(id){
|
2020-05-17 13:31:20 +00:00
|
|
|
closeModal()
|
2020-05-16 17:58:00 +00:00
|
|
|
isOpen = true
|
|
|
|
document.getElementById('slide-container').style.display = "block"
|
|
|
|
document.getElementById(id).style.display = "block"
|
2020-05-17 13:31:20 +00:00
|
|
|
// change persistent elements' opacity
|
2020-05-17 12:33:58 +00:00
|
|
|
document.getElementsByTagName("header")[0].style.opacity = 0.2
|
2020-06-01 11:43:08 +00:00
|
|
|
document.getElementById("a-propos").style.opacity = 0.2
|
|
|
|
document.getElementById("telecharger").style.opacity = 0.2
|
2020-05-16 17:58:00 +00:00
|
|
|
goToTop()
|
|
|
|
}
|
|
|
|
|
|
|
|
// When the user clicks on an image, scroll to the top
|
|
|
|
function goToTop() {
|
|
|
|
document.body.scrollTop = 0 // safari
|
|
|
|
document.documentElement.scrollTop = 0 // Chrome, Firefox, IE and Opera
|
|
|
|
}
|