add and configure gulp
This commit is contained in:
parent
58ecaf99b2
commit
1d135a1b7d
7 changed files with 5061 additions and 8 deletions
31
assets/js/script.js
Normal file
31
assets/js/script.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function openTab(data, tab) {
|
||||
data.activeTab === tab ? (data.activeTab = "") : (data.activeTab = tab);
|
||||
}
|
||||
|
||||
function scrollToElem(selector) {
|
||||
setTimeout(() => {
|
||||
const yOffset = -185;
|
||||
const elem = document.querySelector(selector);
|
||||
const top = elem.getBoundingClientRect().top;
|
||||
window.scrollTo({
|
||||
top: top + window.scrollY + yOffset,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
function toggleLogoState() {
|
||||
const scrollY = window.scrollY || window.pageYOffset;
|
||||
|
||||
if (scrollY > 10) {
|
||||
document.querySelector("#header").classList.add("minimized");
|
||||
} else {
|
||||
document.querySelector("#header").classList.remove("minimized");
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("scroll", () => {
|
||||
toggleLogoState();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue