category.php : don't show year if no article

This commit is contained in:
isUnknown 2024-04-06 11:55:51 +02:00
parent 3804d13cb6
commit b0fb0b101d
8 changed files with 50 additions and 35 deletions

View file

@ -10,7 +10,7 @@ function toggleTab(data, tab) {
setTimeout(() => {
data.isOpen = false;
data.activeTab = "";
}, 300);
}, 500);
} else {
data.activeTab = tab;
data.isOpen = true;
@ -35,7 +35,7 @@ function setWindowHeightFactor() {
const windowHeight = window.innerHeight;
const min = 650;
const delta = windowHeight - min;
const factor = roundToNearestHalf(delta / 150);
const factor = roundToNearestHalf(delta / 300) + 1;
const head = document.querySelector("head");
const style = document.createElement("style");
@ -44,7 +44,8 @@ function setWindowHeightFactor() {
}
function roundToNearestHalf(num) {
return Math.round(num * 2) / 2;
const round = Math.round(num * 2) / 2;
return Math.max(round, 0);
}
setWindowHeightFactor();