-
Notifications
You must be signed in to change notification settings - Fork 0
/
打赏.html
145 lines (145 loc) · 3.75 KB
/
打赏.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title></title>
<style>
.m-reward {
padding: 10px;
margin-top: 20px;
width: 61pc;
height: 75pt;
border-left: 5px solid rgb(62, 189, 228);
background-color: #eee;
color: #5e5e5e;
}
.reward-btn {
margin-left: 20px;
width: 75pt;
border-radius: 5px;
background-color: rgb(62, 189, 228);
color: #fff;
text-align: center;
font-size: 14px;
line-height: 40px;
cursor: pointer;
margin-top: 30px;
}
.reward-btn:hover {
background-color: rgb(255, 102, 0);
}
.dashang {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 630px;
background-color: rgba(0, 0, 0, 0.5);
}
.dashang .ewm {
position: absolute;
width: 613px;
height: 500px;
padding: 5px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
}
.zhifubao,
.weixin {
float: left;
width: 300px;
height: 300px;
}
.zhifubao {
margin-right: 5px;
border: 2px solid rgb(29, 171, 253);
background: url('博客园上传图片的在线路径');
}
.weixin {
border: 2px solid rgb(13, 200, 25);
background: url('博客园上传图片的在线路径');
}
.zhifubao-text,
.weixin-text {
text-align: center;
font-size: 20px;
font-family: '黑体';
font-weight: 700;
float: left;
width: 300px;
height: 20px;
margin-bottom: 10px;
}
.zhifubao-text {
margin-right: 9px;
color: rgb(29, 171, 253);
}
.weixin-text {
color: rgb(13, 200, 25);
}
.think-you {
text-align: center;
padding: 10px;
font-size: 20px;
margin-bottom: 10px;
}
.think-you:last-child {
font-size: 20px;
font-weight: 700;
color: rgb(246, 58, 35);
margin-top: 10px;
}
.hidden {
display: none;
}
.show {
display: block;
}
</style>
</head>
<body>
<div id="reward">
<div class="m-reward">
<div class="m-desc">
如果文章对您的学习有启发,请随意打赏。您的支持将鼓励继续学习继续创作!
</div>
<div class="reward-btn">打赏支持</div>
</div>
<div class="dashang hidden">
<div class="ewm">
<div class="zhifubao"></div>
<div class="weixin"></div>
<p class="zhifubao-text">支付宝</p>
<p class="weixin-text">微信</p>
<p class="think-you">
如果这篇文章对您的学习有帮助,您随便打赏,我会更加努力写更优质的内容一起学习进步!
</p>
<p class="think-you">撸起袖子就是干!</p>
</div>
</div>
</div>
<script>
var reward = document.getElementById('reward');
var mySignature = document.getElementById('MySignature');
var ds = document.querySelector('.reward-btn');
var dsBox = document.querySelector('.dashang');
var dsEwm = document.querySelector('.ewm');
ds.onclick = function(e) {
dsBox.className = 'dashang show';
//阻止冒泡
e.stopPropagation();
};
dsEwm.onclick = function(e) {
//阻止冒泡
e.stopPropagation();
};
var body = document.body;
body.onclick = function(e) {
dsBox.className = 'dashang hidden';
};
mySignature.appendChild(reward);
</script>
</body>
</html>