-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
80 lines (59 loc) · 2.3 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
document.addEventListener("DOMContentLoaded", function () {
var emailLink = document.getElementById('email-link');
var user = 'sirssapling';
var domain = '@gmail.com';
var subject = 'Hello%20There';
var body = 'I%20would%20like%20to%20connect%20with%20you.';
emailLink.href = `mailto:${user}@${domain}?subject=${subject}&body=${body}`;
});
document.addEventListener("DOMContentLoaded", function () {
var link = document.getElementById("project-link-button");
link.href = "https://github.com/Esapling/Shopping-Website-Database-Project";
});
// navbar-link-scroll-down
document.addEventListener("DOMContentLoaded", function () //ensure dom is loaded
{
var button_ = document.getElementById("cv-button");
path_ = "https://docs.google.com/document/d/1AhWERJgiGLpSdl0xCX1blWXbOJZkUGmL/edit?usp=sharing&ouid=110354566317262535635&rtpof=true&sd=true"
if (button_) {
button_.addEventListener("click", function () {
button_.href = path_;
});
}
});
document.addEventListener("DOMContentLoaded", function () {
var header = document.querySelector(".m-header");
var lastKnownScrollPosition = window.scrollY;
if (header) {
window.addEventListener("scroll", function () {
if (window.scrollY > lastKnownScrollPosition) {
header.classList.add('header-scroll-down');
}
else {
header.classList.remove('header-scroll-down');
}
lastKnownScrollPosition = window.scrollY; // Update the last scroll position
});
}
});
document.addEventListener("DOMContentLoaded", function () {
var hamburgerMenu = document.getElementById('hamburger-menu');
var mobileMenu = document.getElementById('menu-list');
if(hamburgerMenu)
{
hamburgerMenu.addEventListener('click', function(){
mobileMenu.classList.toggle('menu-list-open');
hamburgerMenu.classList.toggle('hamburger-open');
});
}
});
window.addEventListener("load", function () {
window.scrollTo(0, 0);
});
// var logoIndex = document.getElementsByClassName("logo");
// logoIndex.addEventListener()
// logo-hidden {
// opacity: 0;
// visibility: hidden;
// transition: opacity 0.3s ease, visibility 0.3s ease;
// }