hexo/themes/blank/layout/partial/_modify/rewards/rewardjs.ejs

38 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-05-09 10:56:56 +08:00
<script>
jQuery(document).ready(function () {
var QRBox = $('#QRBox');
var MainBox = $('#MainBox');
var AliPayQR = '<%= theme.reward.AliPayQR %>';
var WeChanQR = '<%= theme.reward.WeChatQR %>';
function showQR(QR) {
if (QR) {
MainBox.css('background-image', 'url(' + QR + ')');
}
$('#donateBox').addClass('blur');
QRBox.fadeIn(300, function (argument) {
MainBox.addClass('showQR');
});
}
$('#donateBox>li').click(function (event) {
var thisID = $(this).attr('id');
if (thisID === 'AliPay') {
showQR(AliPayQR);
} else if (thisID === 'WeChat') {
showQR(WeChanQR);
}
});
MainBox.click(function (event) {
MainBox.removeClass('showQR').addClass('hideQR');
setTimeout(function (a) {
QRBox.fadeOut(300, function (argument) {
MainBox.removeClass('hideQR');
});
$('#DonateText,#donateBox,#github').removeClass('blur');
}, 600);
});
});
</script>