-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
66 lines (54 loc) · 2.03 KB
/
script.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//RESUME
document.addEventListener("DOMContentLoaded", function () {
const pdfContainer = document.getElementById("RESUME_LINK");
pdfContainer.addEventListener("click", function () {
const resumeUrl = "Resume_DeepPatel.pdf";
//Open PDF in new window
window.open(resumeUrl, "_blank");
});
});
const pdfContainer = document.querySelector(".resume-section");
//MODALS
const galleryImages = document.querySelectorAll(".gallery img");
const galleryModal = document.getElementById("myModal");
const galleryModalImage = document.getElementById("modalImage");
const galleryCloseBtn = galleryModal.querySelector(".close");
const images = document.querySelectorAll(".img-modal");
const gallery = document.querySelector(".gallery");
const modal = document.getElementById("myModal");
const modalImage = document.getElementById("modalImage");
const closeBtn = document.querySelector(".close");
//Fantasy Rescue Modal
galleryImages.forEach(function (image) {
image.addEventListener("click", function () {
galleryModal.style.display = "block";
galleryModalImage.src = this.src;
});
});
galleryCloseBtn.addEventListener("click", function () {
galleryModal.style.display = "none";
});
galleryModal.addEventListener("click", function (e) {
if (e.target === galleryModal) {
galleryModal.style.display = "none";
}
});
//AI Modal
const imgModalImages = document.querySelectorAll(".img-modal");
const imgModalModal = document.getElementById("myModal");
const imgModalModalImage = document.getElementById("modalImg");
const imgModalCloseBtn = imgModalModal.querySelector(".close");
imgModalImages.forEach(function (image) {
image.addEventListener("click", function () {
imgModalModal.style.display = "block";
imgModalModalImage.src = this.src;
});
});
imgModalCloseBtn.addEventListener("click", function () {
imgModalModal.style.display = "none";
});
imgModalModal.addEventListener("click", function (e) {
if (e.target === imgModalModal) {
imgModalModal.style.display = "none";
}
});