Добавлена модалка «О проекте», версия 0.1.2; Jenkins берёт VERSION из коммита.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Sergey Antropoff
2026-07-27 23:11:27 +03:00
parent 22ea5468d4
commit 776f516239
13 changed files with 177 additions and 218 deletions
+36
View File
@@ -0,0 +1,36 @@
(() => {
const modal = document.getElementById("about-modal");
const toggle = document.getElementById("about-toggle");
if (!modal || !toggle) return;
function syncToggleLabels() {
const label = window.WrappedI18n?.t("about.open") || "About Wrapped";
toggle.setAttribute("title", label);
toggle.setAttribute("aria-label", label);
}
function openModal() {
modal.classList.remove("hidden");
document.body.classList.add("modal-open");
modal.querySelector("[data-about-close].btn")?.focus?.();
}
function closeModal() {
modal.classList.add("hidden");
document.body.classList.remove("modal-open");
toggle.focus?.();
}
toggle.addEventListener("click", openModal);
modal.addEventListener("click", (e) => {
if (e.target.closest("[data-about-close]")) closeModal();
});
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && !modal.classList.contains("hidden")) closeModal();
});
if (window.WrappedI18n?.onChange) {
window.WrappedI18n.onChange(syncToggleLabels);
}
syncToggleLabels();
})();