-
Notifications
You must be signed in to change notification settings - Fork 1
/
github-md-sg.html
71 lines (66 loc) · 2.28 KB
/
github-md-sg.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
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<title>GitHub Markdown CSS demo</title>
<meta name="color-scheme" content="light dark">
<link rel="stylesheet" href="https://zelihole.github.io/GitHub Markdown CSS demo_files/github-markdown.css">
<script>
var fnTextPopup = function (arr, options) {
// arr参数是必须的
if (!arr || !arr.length) {
return;
}
// 主逻辑
var index = 0;
document.documentElement.addEventListener('click', function (event) {
var x = event.pageX, y = event.pageY;
var eleText = document.createElement('span');
eleText.className = 'text-popup';
this.appendChild(eleText);
if (arr[index]) {
eleText.innerHTML = arr[index];
} else {
index = 0;
eleText.innerHTML = arr[0];
}
// 动画结束后删除自己
eleText.addEventListener('animationend', function () {
eleText.parentNode.removeChild(eleText);
});
// 位置
eleText.style.left = (x - eleText.clientWidth / 2) + 'px';
eleText.style.top = (y - eleText.clientHeight) + 'px';
// index递增
index++;
});
};
fnTextPopup(['富强', '民主', '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善']);
</script>
<style>
body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #0d1117;
}
}
</style>
<link rel="stylesheet" href="https://zelihole.github.io/GitHub Markdown CSS demo_files/gh-fork-ribbon.min.css">
<style>
.github-fork-ribbon:before {
background-color: #121612;
}
</style>
</head>
<body>
<article class="markdown-body">
<h1>将你的内容搁这里</h1>
<p>test123</p>
</article>
<a class="github-fork-ribbon" href="https://github.com/zelihole/zelihole.github.io/" data-ribbon="Fork me on GitHub" title="Fuck me on GitHub">Fork me on GitHub</a>
</body></html>