feat: implement premium blog search and filter UI with improved layout and dynamic post loading.
This commit is contained in:
@@ -131,6 +131,7 @@ var theme = {
|
||||
if(grids != null) {
|
||||
grids.forEach(g => {
|
||||
var itemgrid = g.querySelector('.isotope');
|
||||
if (itemgrid == null) return;
|
||||
var filtersElem = g.querySelector('.isotope-filter');
|
||||
var buttonGroups = g.querySelectorAll('.isotope-filter');
|
||||
var iso = new Isotope(itemgrid, {
|
||||
@@ -216,9 +217,11 @@ var theme = {
|
||||
if (top >= offset && top < offset + height) {
|
||||
navLinks.forEach(links => {
|
||||
links.classList.remove('active');
|
||||
document.querySelector(`.nav-link.scroll[href*=${id}]`).classList.add('active');
|
||||
//[att*=val] Represents an element with the att attribute whose value contains at least one instance of the substring "val". If "val" is the empty string then the selector does not represent anything.
|
||||
});
|
||||
let activeLink = document.querySelector(`.nav-link.scroll[href*="${id}"]`);
|
||||
if (activeLink) {
|
||||
activeLink.classList.add('active');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -237,11 +240,14 @@ var theme = {
|
||||
e.preventDefault();
|
||||
this.blur();
|
||||
const href = this.getAttribute("href");
|
||||
const offsetTop = document.querySelector(href).offsetTop;
|
||||
scroll({
|
||||
top: offsetTop,
|
||||
behavior: "smooth"
|
||||
});
|
||||
const target = document.querySelector(href);
|
||||
if (target) {
|
||||
const offsetTop = target.offsetTop;
|
||||
scroll({
|
||||
top: offsetTop,
|
||||
behavior: "smooth"
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user