-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (43 loc) · 1.27 KB
/
Copy pathscript.js
File metadata and controls
50 lines (43 loc) · 1.27 KB
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
let header = document.querySelector("header");
window.addEventListener("scroll", () => {
header.classList.toggle("shadow", window.scrollY > 0);
});
// Filter
$(document).ready(function () {
$(".filter-item").click(function () {
const value = $(this).attr("data-filter");
if (value == "all") {
$(".post-box").show("1000");
} else {
$(".post-box")
.not("." + value)
.hide(1000);
$(".post-box")
.filter("." + value)
.show("1000");
}
});
$(".filter-item").click(function () {
$(this).addClass("active-filter").siblings().removeClass("active-filter");
});
});
// Scrollbar Styles
document.addEventListener("DOMContentLoaded", () => {
const style = document.createElement('style');
style.textContent = `
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: rgb(250, 160, 75);
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(250, 160, 75, 0.8);
}
`;
document.head.appendChild(style);
});