-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
31 lines (27 loc) · 1021 Bytes
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function openLightbox(img) {
const lightbox = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
lightbox.style.display = 'flex'; // Show the lightbox
lightboxImg.src = img.src; // Set the lightbox image to the clicked image
}
function closeLightbox() {
const lightbox = document.getElementById('lightbox');
lightbox.style.display = 'none'; // Hide the lightbox
}
function toggleFullScreen() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(err => {
console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
});
} else {
document.exitFullscreen();
}
}
function toggleInfo() {
const infoBox = document.getElementById('info-box');
if (infoBox.style.display === 'block') {
infoBox.style.display = 'none'; // Hide the info box
} else {
infoBox.style.display = 'block'; // Show the info box
}
}