redesign b&w
This commit is contained in:
parent
1719a1bcbb
commit
48bfd23600
9 changed files with 130 additions and 41 deletions
|
|
@ -141,6 +141,34 @@ function slugify(str) {
|
|||
return removeAccents(str.toLowerCase());
|
||||
}
|
||||
|
||||
function showSubscribeField(event) {
|
||||
event.preventDefault();
|
||||
const button = event.target;
|
||||
const li = button.parentNode;
|
||||
const form = li.querySelector("#subscribe-form");
|
||||
const input = form.querySelector("input");
|
||||
|
||||
form.classList.remove("hidden");
|
||||
button.classList.add("hidden");
|
||||
input.focus();
|
||||
}
|
||||
|
||||
function subscribe(event) {
|
||||
event.preventDefault();
|
||||
const email = document.querySelector("#subscribe-form input");
|
||||
|
||||
if (email.value.toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
||||
const header = {
|
||||
method: "POST",
|
||||
body: email.value,
|
||||
};
|
||||
|
||||
fetch("/subscribe.json");
|
||||
} else {
|
||||
email.value = "E-mail invalide. Recommencez.";
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
ragadjust("h1, h2, h3, h4, h5", ["all"]);
|
||||
window.window.scrollTo({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue