-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathscript.js
36 lines (28 loc) · 932 Bytes
/
script.js
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
const bd = document.querySelector("body");
const QRBox = bd.querySelector("#QRBox");
const MainBox = bd.querySelector("#MainBox");
const donateBox = bd.querySelector("#donateBox");
const qqr = "images/QQPayQR.png";
const aqr = "images/AliPayQR.png";
const wqr = "images/WeChatQR.png";
const showQR = (QR) => {
if (QR) MainBox.style.backgroundImage = `url(${QR})`;
bd.classList.add("blur");
QRBox.classList.add("fadeIn");
MainBox.classList.add("showQR");
};
donateBox.addEventListener("click", (e) => {
let el = e.target;
if (el.id === "QQPay") showQR(qqr);
else if (el.id === "AliPay") showQR(aqr);
else if (el.id === "WeChat") showQR(wqr);
});
MainBox.addEventListener("click", () => {
MainBox.classList.remove("showQR");
MainBox.classList.add("hideQR");
setTimeout((a) => {
QRBox.classList.remove("fadeIn");
MainBox.classList.remove("hideQR");
bd.classList.remove("blur");
}, 600);
});