AgPerry's picture
Add files using upload-large-folder tool
187ef74 verified
Raw History Blame Contribute Delete
1.39 kB
(() => {
"use strict";
const menuButton = document.querySelector(".menu-button");
const menu = document.querySelector("#main-menu");
if (menuButton && menu) {
menuButton.addEventListener("click", () => {
const open = menu.classList.toggle("open");
menuButton.setAttribute("aria-expanded", String(open));
});
}
document.querySelectorAll("[data-amount]").forEach((button) => {
button.addEventListener("click", () => {
const input = document.querySelector('input[name="amount"]');
if (input) {
input.value = button.dataset.amount || "10";
input.focus();
}
});
});
document.querySelectorAll(".filter-form select").forEach((select) => {
select.addEventListener("change", () => select.form?.requestSubmit());
});
document.querySelectorAll("[data-copy-link]").forEach((button) => {
button.addEventListener("click", async () => {
const localUrl = `${window.location.origin}/project/make-block-bloom/`;
try {
await navigator.clipboard.writeText(localUrl);
button.textContent = "Local link copied";
} catch (_error) {
button.textContent = "Copy unavailable";
}
});
});
document.querySelectorAll("[data-gallery]").forEach((button) => {
button.addEventListener("click", () => {
button.textContent = "1 archived photo";
});
});
})();