improvements around

This commit is contained in:
timurgordon
2022-02-26 06:01:07 +03:00
parent 2499b69823
commit 8a543b2d5f
7 changed files with 24 additions and 18 deletions

View File

@@ -1,13 +1,3 @@
<script>
window.onload = function(){
let activeCategory = window.location.pathname.split("/")[2]
if (typeof activeCategory === "undefined") { activeLink = document.getElementById("all") }
else { activeLink = document.getElementById(activeCategory)}
activeLink.className = activeLink.className.replace("text-black font-normal", "text-black font-semibold");
}
</script>
<div class="mx-8 md:mx-4 flex flex-col">
<div class="lg:pt-24 flex flex-col mb-12 md:mr-24">
@@ -34,4 +24,15 @@
{% endfor %}
</div>
</div>
</div>
<script>
function setActiveCategory() {
let activeCategory = window.location.pathname.split("/")[2]
if (typeof activeCategory === "undefined") { activeLink = document.getElementById("all") }
else { activeLink = document.getElementById(activeCategory)}
activeLink.className = activeLink.className.replace("text-black font-normal", "text-black font-semibold");
}
setActiveCategory()
</script>