-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
50 lines (42 loc) · 1.17 KB
/
main.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
AOS.init();
var folder = "images/";
$.ajax({
url: folder,
success: function (data) {
$(data)
.find("a")
.attr("href", function (i, val) {
if (val.match(/\.(jpe?g|png|gif)$/)) {
$(".imgContainer").append(
"<div data-aos='zoom-in' data-aos-once='true'>" +
"<img src='" +
val +
"' loading='lazy' decoding='async' alt='IMG'" +
" />" +
"</div>"
);
}
});
},
});
$(window).on("load", function () {
$(".imgContainer img").on("click", function () {
$(".fullImg").css("display", "block");
$(document.body).css("overflow", "hidden");
$(".fullImg img").attr("src", this.src);
});
});
$(".fullImg h1").on("click", function () {
$(document.body).css("overflow", "auto");
$(document.body).css("overflow-x", "hidden");
$(".fullImg").css("display", "none");
});
$(".menuBtn").on("click", () => {
$(".menuBurger").toggleClass("open");
if ($(".menuBurger").hasClass("open")) {
$(document.body).css("position", "fixed");
} else {
$(document.body).css("position", "static");
}
$("nav ul, nav #book").toggleClass("hide");
});