forked from ihoey/Playing-reward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
32 lines (28 loc) · 852 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
const bd = document.querySelector('body')
const qbox = bd.querySelector('#QRBox')
const mbox = bd.querySelector('#MainBox')
const dbox = bd.querySelector('#donateBox')
const qqr = 'images/QQPayQR.png'
const aqr = 'images/AliPayQR.png'
const wqr = 'images/WeChanQR.png'
const showQR = (QR) => {
if (QR) mbox.style.backgroundImage = `url(${ QR })`
bd.classList.add('blur')
qbox.classList.add('fadeIn')
mbox.classList.add('showQR')
}
dbox.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)
})
mbox.addEventListener('click', () => {
mbox.classList.remove('showQR')
mbox.classList.add('hideQR')
setTimeout(a => {
qbox.classList.remove('fadeIn')
mbox.classList.remove('hideQR')
bd.classList.remove('blur')
}, 600)
})