fixed some things. and did some UI changes

This commit is contained in:
2025-09-24 10:18:04 +02:00
parent 5e5ab6c6cc
commit 508624febc
11 changed files with 150 additions and 133 deletions

18
js/post/download.js Normal file
View File

@@ -0,0 +1,18 @@
document.addEventListener("DOMContentLoaded", () => {
// current page URL
let url = window.location.href;
// replace `/html/` with `/markdown/`
url = url.replace("/html/", "/markdown/");
// replace `.html` with `.md`
url = url.replace(/\.html$/, ".md");
// assign to <a>
const a = document.getElementById("download-md");
a.href = url;
// suggest filename
const filename = url.split("/").pop(); // e.g. markdowntest.md
a.download = filename;
});

File diff suppressed because one or more lines are too long

View File

@@ -1,31 +0,0 @@
// Theme toggling script for PyPost
function toggleTheme() {
const darkStyles = document.getElementById('dark-styles');
const lightStyles = document.getElementById('light-styles');
const currentlyLight = !lightStyles.disabled;
document.body.classList.add('theme-transitioning');
if (currentlyLight) {
// Switch to dark
lightStyles.disabled = true;
darkStyles.disabled = false;
} else {
// Switch to light
lightStyles.disabled = false;
darkStyles.disabled = true;
}
setTimeout(() => {
document.body.classList.remove('theme-transitioning');
}, 400);
}
document.addEventListener('DOMContentLoaded', function() {
const darkStyles = document.getElementById('dark-styles');
const lightStyles = document.getElementById('light-styles');
// Always start in light mode
lightStyles.disabled = false;
darkStyles.disabled = true;
});