-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update category and global permalink for posts
- Loading branch information
1 parent
228b5f5
commit 498feb9
Showing
16 changed files
with
122 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const categories = document.getElementById('categories') | ||
const categoriesBtn = document.getElementById('categories-btn') | ||
const arrayCategories = Array.from(categories.children) | ||
const arrayCategoriesBtn = Array.from(categoriesBtn.children) | ||
|
||
arrayCategories[0].classList.add("flex") | ||
arrayCategories[0].classList.remove("hidden") | ||
arrayCategoriesBtn[0].classList.add("border-[1px]", "border-slate-300") | ||
let prevActiveElement = arrayCategories[0] | ||
let prevActiveBtnElement = arrayCategoriesBtn[0] | ||
|
||
arrayCategoriesBtn.forEach((btn) => { | ||
btn.addEventListener("click", () => { | ||
id = btn.getAttribute('data-category') | ||
const targetElement = arrayCategories.find(elm => elm.id === id); | ||
|
||
prevActiveBtnElement.classList.remove("border-[1px]", "border-slate-300") | ||
prevActiveElement.classList.remove("flex") | ||
prevActiveElement.classList.add("hidden") | ||
|
||
prevActiveElement = targetElement | ||
prevActiveBtnElement = btn | ||
|
||
btn.classList.add("border-[1px]", "border-slate-300") | ||
targetElement.classList.add("flex") | ||
targetElement.classList.remove("hidden") | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.