css build

This commit is contained in:
isUnknown 2025-02-07 10:49:53 +01:00
parent d5d0b29fb0
commit 014858fe82
2 changed files with 13 additions and 9 deletions

20
assets/dist/script.js vendored
View file

@ -74,8 +74,7 @@ function fixFootNotes() {
footnote.classList.add("footnote"); footnote.classList.add("footnote");
if (href.includes("sym")) { if (href.includes("sym")) {
footnote.id = footnote.hash.replace("sym", "anc").replace("#", ""); footnote.id = footnote.hash.replace("sym", "anc").replace("#", "");
} } else if (href.includes("anc")) {
if (href.includes("anc")) {
footnote.id = footnote.hash.replace("anc", "sym").replace("#", ""); footnote.id = footnote.hash.replace("anc", "sym").replace("#", "");
} }
}); });
@ -93,15 +92,20 @@ function slugify(str) {
} }
function subscribe(event) { function subscribe(event) {
event.preventDefault(); event.preventDefault();
var email = document.querySelector("#subscribe-form input"); var emailInput = document.querySelector("#subscribe-form input");
if (email.value.toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) { if (emailInput.value.toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
var header = { var header = {
method: "POST", method: "POST",
body: email.value body: JSON.stringify(emailInput.value)
}; };
fetch("/subscribe.json"); fetch("/subscribe.json", header).then(function (res) {
return res.json();
}).then(function (data) {
var formNode = emailInput.parentNode.parentNode;
formNode.outerHTML = "<p>" + data.message + "</p>";
});
} else { } else {
email.value = "E-mail invalide. Recommencez."; emailInput.value = "E-mail invalide. Recommencez.";
} }
} }
var panelNav = document.querySelector(".panel"); var panelNav = document.querySelector(".panel");
@ -114,7 +118,7 @@ function closeNav() {
document.body.classList.remove("no-scroll"); document.body.classList.remove("no-scroll");
} }
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
ragadjust("h1, h2, h3, h4, h5", ["all"]); ragadjust("h1, h2, h4, h5", ["all"]);
window.window.scrollTo({ window.window.scrollTo({
top: 0 top: 0
}); });

File diff suppressed because one or more lines are too long