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

@ -19,7 +19,7 @@ extra:
#### [The Internot](apage) #### [The Internot](apage)
Whats wrong with the [internet](apage) Whats wrong with the [internet](/apage)
<br> <br>

View File

@ -2,7 +2,7 @@
{% block content %} {% block content %}
<main class="p-16"> <main class="pt-16">
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script> <script>mermaid.initialize({startOnLoad:true});</script>
{{page.content | safe}} {{page.content | safe}}

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="mx-8 md:mx-4 flex flex-col">
<div class="lg:pt-24 flex flex-col mb-12 md:mr-24"> <div class="lg:pt-24 flex flex-col mb-12 md:mr-24">
@ -34,4 +24,15 @@
{% endfor %} {% endfor %}
</div> </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>

View File

@ -20,7 +20,7 @@
{% include "partials/socialLinks.html" %} {% include "partials/socialLinks.html" %}
</div> </div>
<div class="mt-6 md:mt-0 w-full"> <div class="mt-6 lg:mt-0 w-full">
{{ section.content | safe }} {{ section.content | safe }}
</div> </div>

View File

@ -26,6 +26,7 @@
} }
function toggleHamburger() { function toggleHamburger() {
console.log("toggling hamburger", hamburgerShown)
if (hamburgerShown) { if (hamburgerShown) {
hideHamburger(); hideHamburger();
hamburgerShown = false; hamburgerShown = false;
@ -43,6 +44,7 @@
function hideMenu(menuName) { function hideMenu(menuName) {
var menuId = menuName + (isMobile ? '-mobile-menu' : '-menu'); var menuId = menuName + (isMobile ? '-mobile-menu' : '-menu');
console.log(menuId)
document.getElementById(menuId).className = document.getElementById(menuId).className.replace("ease-out opacity-1 -translate-y-0", "hidden ease-in opacity-0 -translate-y-1"); document.getElementById(menuId).className = document.getElementById(menuId).className.replace("ease-out opacity-1 -translate-y-0", "hidden ease-in opacity-0 -translate-y-1");
} }
@ -58,7 +60,7 @@
document.getElementById('hamburger').className = "hidden absolute z-20 top-0 inset-x-0 transition transform origin-top-right md:hidden"; document.getElementById('hamburger').className = "hidden absolute z-20 top-0 inset-x-0 transition transform origin-top-right md:hidden";
document.getElementById('hamburger-btn').className = "inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"; document.getElementById('hamburger-btn').className = "inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out";
document.getElementById('close-hamburger-btn').className = "hidden md:hidden inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"; document.getElementById('close-hamburger-btn').className = "hidden md:hidden inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out";
hideMenu(); if (displayedMenu !== "") { hideMenu(displayedMenu); }
} }
window.onload = function(){ window.onload = function(){

View File

@ -1,4 +1,7 @@
{% extends "index.html" %} {% extends "index.html" %}
{% block content %} {% block content %}
{% endblock content %}
{{ terms }}
{% endblock content %}

View File

@ -18,12 +18,12 @@ Parameters:
{% set classes = classes ~ " lg:items-center" %} {% set classes = classes ~ " lg:items-center" %}
{% endif %} {% endif %}
{% set column_classes = "flex-1 lg:mx-8" %} {% set column_classes = "flex-1 md:mx-8" %}
{% if style %} {% if style %}
{% if "lean" in style %} {% if "lean" in style %}
{% set classes = "relative flex flex-col lg:flex-row items-baseline w-full" %} {% set classes = "relative flex flex-col md:flex-row items-baseline w-full" %}
{% set column_classes = "flex-1 m-4 md:m-0" %} {% set column_classes = "flex-1 m-4 md:m-0" %}
{% endif %} {% endif %}