Add Pitopn digital shop with FastAPI, Postgres 17, and Docker Compose
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
(() => {
|
||||
const toast = document.getElementById("toast");
|
||||
let toastTimer;
|
||||
|
||||
const showToast = (message) => {
|
||||
if (!toast) return;
|
||||
toast.hidden = false;
|
||||
toast.textContent = message;
|
||||
clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(() => {
|
||||
toast.hidden = true;
|
||||
}, 2600);
|
||||
};
|
||||
|
||||
document.querySelectorAll("[data-buy]").forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const slug = button.getAttribute("data-buy");
|
||||
showToast(`«${slug}» — оплата скоро будет подключена`);
|
||||
});
|
||||
});
|
||||
|
||||
const reveals = document.querySelectorAll(".reveal");
|
||||
if ("IntersectionObserver" in window) {
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add("is-visible");
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: 0.15 }
|
||||
);
|
||||
reveals.forEach((el) => observer.observe(el));
|
||||
} else {
|
||||
reveals.forEach((el) => el.classList.add("is-visible"));
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user