Skip to content

Commit

Permalink
init repo
Browse files Browse the repository at this point in the history
  • Loading branch information
choya-lee committed Mar 26, 2022
1 parent aa8f46d commit 87eb596
Show file tree
Hide file tree
Showing 15 changed files with 536 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# Sponsor
Reward page
# Reward function
一个打赏的小功能

修改自 [donate-page](https://github.com/ihoey/Playing-reward)

博客版本请查看 `hexo` 分支 [点击跳转](https://github.com/ihoey/Playing-reward/tree/hexo)

#### 直接 `Fork`

#### 修改 html 内链接地址

#### 更换图片为你自己的打赏图片

#### 使用 iframe 嵌入页面的代码,高度至少 240px,宽度至少 310px!

```html
<iframe src="https://choya-lee.github.io/Sponsor/" style="overflow-x:hidden;overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;" frameborder="0" scrolling="no"></iframe>
```

如果觉得还可以的话,请star一下!

打赏一下的话就更好了~

![微信支付](images/WeChatQR.png)


Binary file added images/AliPayQR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/QQPayQR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/QQqianbao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/WeChatQR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions images/alipay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/favicon.ico
Binary file not shown.
10 changes: 10 additions & 0 deletions images/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions images/paypal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions images/wechat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="zh">

<head>
<meta charset="UTF-8">
<link rel="icon" href="images/favicon.ico">
<title>Sponsor</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
<!--禁止缩放-->
<link rel="stylesheet" href="style.css">
</head>

<body>
<a id="github" href="https://github.com/choya-lee/Sponsor" target="_blank" class="pos-f tr3" title="Github"></a>
<a href="https://choya-lee.github.io/" target="_blank" style="position: fixed;">
<div id="DonateText" class="tr3">Sponsor</div>
</a>
<ul id="donateBox" class="list pos-f tr3">
<li id="QQPay"></li>
<li id="AliPay">AliPay</li>
<li id="WeChat">WeChat</li>
</ul>
<div id="QRBox" class="pos-f left-100">
<div id="MainBox"></div>
</div>
<script async src="script.js"></script>
</body>

</html>
32 changes: 32 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/WeChatQR.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)
})
Loading

0 comments on commit 87eb596

Please sign in to comment.