-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
48 lines (40 loc) · 1.47 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$("a.scrollLink").on("click", function (event) {
event.preventDefault();
var hash = this.hash;
var position = $(".sectionWrapper").scrollTop() + $(hash).offset().top - 30; //$(".navbar").outerHeight()
$(".sectionWrapper").animate(
{
scrollTop: position,
},
400
);
});
$(".sectionWrapper").scroll(function () {
event.stopPropagation();
var navHeight = $(".navbar").outerHeight();
if (0 >= $("#sectionContact").offset().top - navHeight) {
$("#navbarBackground").css("background-color", "transparent");
} else if (0 >= $("#sectionTeam").offset().top - navHeight) {
$("#navbarBackground").css("background-color", "#1f1f1f");
} else if (0 >= $("#sectionProjects").offset().top - navHeight) {
$("#navbarBackground").css("background-color", "#2a2a2a");
} else if (0 >= $("#sectionAbout").offset().top - navHeight) {
$("#navbarBackground").css("background-color", "#1f1f1f");
} else {
$("#navbarBackground").css("background-color", "transparent");
}
});
$(document).on("click", function (event) {
$("#responsiveMenuContainer").css("opacity", 0);
});
$(".responsiveMenu").on("click", function (event) {
const container = $("#responsiveMenuContainer");
if (container[0].style.opacity === "1") {
container.css("opacity", 0);
} else {
container.css("opacity", 1);
}
event.stopPropagation();
});
document.getElementById("copyright").innerHTML =
"Copyright © " + new Date().getFullYear() + " Geodatin. All rights reserved.";