css build
This commit is contained in:
parent
d5d0b29fb0
commit
014858fe82
2 changed files with 13 additions and 9 deletions
20
assets/dist/script.js
vendored
20
assets/dist/script.js
vendored
|
|
@ -74,8 +74,7 @@ function fixFootNotes() {
|
|||
footnote.classList.add("footnote");
|
||||
if (href.includes("sym")) {
|
||||
footnote.id = footnote.hash.replace("sym", "anc").replace("#", "");
|
||||
}
|
||||
if (href.includes("anc")) {
|
||||
} else if (href.includes("anc")) {
|
||||
footnote.id = footnote.hash.replace("anc", "sym").replace("#", "");
|
||||
}
|
||||
});
|
||||
|
|
@ -93,15 +92,20 @@ function slugify(str) {
|
|||
}
|
||||
function subscribe(event) {
|
||||
event.preventDefault();
|
||||
var email = document.querySelector("#subscribe-form input");
|
||||
if (email.value.toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
||||
var emailInput = document.querySelector("#subscribe-form input");
|
||||
if (emailInput.value.toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
||||
var header = {
|
||||
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 {
|
||||
email.value = "E-mail invalide. Recommencez.";
|
||||
emailInput.value = "E-mail invalide. Recommencez.";
|
||||
}
|
||||
}
|
||||
var panelNav = document.querySelector(".panel");
|
||||
|
|
@ -114,7 +118,7 @@ function closeNav() {
|
|||
document.body.classList.remove("no-scroll");
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
ragadjust("h1, h2, h3, h4, h5", ["all"]);
|
||||
ragadjust("h1, h2, h4, h5", ["all"]);
|
||||
window.window.scrollTo({
|
||||
top: 0
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue