Migrate back to Git LFS
This commit is contained in:
parent
6b34b62aa2
commit
4b6498ede3
237 changed files with 36953 additions and 0 deletions
8
website/res/js/collapsible.js
Normal file
8
website/res/js/collapsible.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
const collapsibleInit = () => {
|
||||
document.querySelectorAll(".collapsible-header").forEach((header) => {
|
||||
header.addEventListener("click", () => {
|
||||
header.classList.toggle("active");
|
||||
header.nextElementSibling.classList.toggle("active");
|
||||
});
|
||||
});
|
||||
};
|
5
website/res/js/main.js
Normal file
5
website/res/js/main.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
(() => {
|
||||
menuInit();
|
||||
collapsibleInit();
|
||||
updatedInit();
|
||||
})();
|
17
website/res/js/menu.js
Normal file
17
website/res/js/menu.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const menuInit = () => {
|
||||
const mobileMenuToggle = document.querySelector(".mobile-menu-toggle");
|
||||
const navbarLinks = document.querySelector(".navbar-links");
|
||||
|
||||
mobileMenuToggle.addEventListener("click", () => {
|
||||
mobileMenuToggle.classList.toggle("active");
|
||||
navbarLinks.classList.toggle("active");
|
||||
});
|
||||
|
||||
const navLinks = document.querySelectorAll(".navbar-links a");
|
||||
navLinks.forEach((link) => {
|
||||
link.addEventListener("click", () => {
|
||||
mobileMenuToggle.classList.remove("active");
|
||||
navbarLinks.classList.remove("active");
|
||||
});
|
||||
});
|
||||
};
|
39
website/res/js/updated.js
Normal file
39
website/res/js/updated.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
const updatedInit = () => {
|
||||
const lastUpdatedElement = document.getElementById("lastUpdated");
|
||||
const updatedLink = document.createElement("a");
|
||||
updatedLink.href =
|
||||
"https://codeberg.org/nadimkobeissi/appliedcryptography/commits/branch/main";
|
||||
fetch(
|
||||
"https://codeberg.org/api/v1/repos/nadimkobeissi/appliedcryptography/commits?limit=1&sha=main",
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
const latestCommitDate = new Date(data[0].commit.author.date);
|
||||
const options = {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
hour12: true,
|
||||
};
|
||||
const formattedDate = latestCommitDate.toLocaleString(
|
||||
undefined,
|
||||
options,
|
||||
);
|
||||
updatedLink.innerText = formattedDate;
|
||||
lastUpdatedElement.innerHTML = "";
|
||||
lastUpdatedElement.appendChild(updatedLink);
|
||||
const period = document.createElement("span");
|
||||
period.innerText = ".";
|
||||
lastUpdatedElement.appendChild(period);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching commit data:", error);
|
||||
updatedLink.innerText = "View history";
|
||||
lastUpdatedElement.innerHTML = "";
|
||||
lastUpdatedElement.appendChild(updatedLink);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue