-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
78 lines (72 loc) · 2.68 KB
/
Copy pathscript.js
File metadata and controls
78 lines (72 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// QuickNote landing page — light interactivity only (no tracking, no network).
// ── Configure your links here ────────────────────────────────────────────
// Replace these with your real URLs once you publish a release / donation page.
const LINKS = {
download: "#", // e.g. "https://github.com/you/quicknote/releases/latest"
donate: "donate.html", // dedicated donation page (USDT)
};
// Wire up every Download / Donate button on the page.
function applyLinks() {
const dl = LINKS.download;
const dn = LINKS.donate;
document
.querySelectorAll('[data-download], #downloadBtn')
.forEach((a) => setLink(a, dl));
document
.querySelectorAll('[data-donate], #donateBtn')
.forEach((a) => setLink(a, dn));
}
function setLink(a, url) {
if (!url || url === "#") return; // leave as a harmless anchor until configured
a.href = url;
if (/^https?:/i.test(url)) {
a.target = "_blank";
a.rel = "noopener noreferrer";
}
}
// ── Reveal-on-scroll ─────────────────────────────────────────────────────
function initReveal() {
const els = document.querySelectorAll(".reveal");
if (!("IntersectionObserver" in window)) {
els.forEach((el) => el.classList.add("in"));
return;
}
const io = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add("in");
io.unobserve(entry.target);
}
});
},
{ threshold: 0.12 },
);
els.forEach((el, i) => {
el.style.transitionDelay = `${Math.min(i * 60, 300)}ms`;
io.observe(el);
});
}
// ── Subtle parallax tilt on the app mockup ───────────────────────────────
function initTilt() {
const shot = document.querySelector(".shot-img");
if (!shot || window.matchMedia("(prefers-reduced-motion: reduce)").matches)
return;
const wrap = document.querySelector(".shot");
wrap.addEventListener("mousemove", (e) => {
const r = wrap.getBoundingClientRect();
const dx = (e.clientX - r.left) / r.width - 0.5;
const dy = (e.clientY - r.top) / r.height - 0.5;
shot.style.transform = `rotateX(${8 - dy * 6}deg) rotateY(${dx * 6}deg)`;
});
wrap.addEventListener("mouseleave", () => {
shot.style.transform = "rotateX(8deg)";
});
}
document.addEventListener("DOMContentLoaded", () => {
const y = document.getElementById("year");
if (y) y.textContent = new Date().getFullYear();
applyLinks();
initReveal();
initTilt();
});