forked from alex3236/pay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
badge.html
136 lines (132 loc) · 6.59 KB
/
badge.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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="author" content="Alex3236">
<meta name="description" content="Badge generator for sponsor page">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>徽章生成器</title>
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/indrimuska/[email protected]/dist/jquery-editable-select.min.css"
rel="stylesheet">
<style>
#loading{position:fixed;display:flex;justify-content:center;align-items:center;width:100%;height:100%;top:0;left:0;opacity:1;background-color:#fff;z-index:99}#loader{z-index:100;border:10px solid #f3f3f3;border-radius:50%;border-top:10px solid #3498db;width:70px;height:70px;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
</style>
</head>
<body>
<div id="loading">
<div id="loader"></div>
</div>
<div class="container">
<div class="alert alert-primary" role="alert">
<strong>【颜色】</strong>选一个或使用十六进制代码(无需前缀)<br>
<strong>【Logo】</strong>选一个或使用 <a rel="noopener" target="_blank"
href="https://github.com/simple-icons/simple-icons/blob/develop/slugs.md">simple-icons</a> 甚至 Base64 图片
</div>
<form oninput="updateBadge()" onselect="updateBadge()">
<div class="row mb-2">
<div class="col">
<label class="form-label" for="fg-color">Logo 颜色</label>
<select class="form-select" id="fg-color" value="white">
<option>brightgreen</option>
<option>green</option>
<option>yellowgreen</option>
<option>yellow</option>
<option>orange</option>
<option>red</option>
<option>blue</option>
<option>lightgrey</option>
<option>success</option>
<option>important</option>
<option>critical</option>
<option>informational</option>
<option>inactive</option>
<option>blueviolet</option>
<option>white</option>
</select>
</div>
<div class="col">
<label class="form-label" for="bg-color">背景色</label>
<select class="form-select" id="bg-color" value="blue">
<option>brightgreen</option>
<option>green</option>
<option>yellowgreen</option>
<option>yellow</option>
<option>orange</option>
<option>red</option>
<option>blue</option>
<option>lightgrey</option>
<option>success</option>
<option>important</option>
<option>critical</option>
<option>informational</option>
<option>inactive</option>
<option>blueviolet</option>
<option>white</option>
</select>
</div>
</div>
<div class="mb-2 row">
<div class="col">
<label class="form-label" for="logo">Logo</label>
<select class="form-select" id="logo" value="alipay">
<option>alipay</option>
<option>wechat</option>
<option>tencentqq</option>
<option>buymeacoffee</option>
</select>
</div>
<div class="col">
<label class="form-label" for="style">徽章样式</label>
<select class="form-select" id="style">
<option value="flat-square">扁平方块</option>
<option value="flat">扁平</option>
<option value="plastic">塑料</option>
<option value="for-the-badge">FTB</option>
</select>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="text">徽章文字</label>
<input class="form-control" id="text" type="text" value="Sponsor me!" />
</div>
</form>
<div class="mb-3">
<div class="input-group input-group-sm">
<span class="input-group-text">效果预览</span>
<code class="form-control" id="preview"></code>
</div>
</div>
<div class="mb-2">
<div class="input-group input-group-sm">
<label for="markdown" class="input-group-text">Markdown</label>
<input disabled type="text" class="form-control" id="markdown">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button"
onClick="copy(this, document.getElementById('markdown').value)">复制</button>
</div>
</div>
</div>
<div class="mb-2">
<div class="input-group input-group-sm">
<label for="html" class="input-group-text">HTML</label>
<input disabled type="text" class="form-control" id="html" value="awa">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button"
onClick="copy(this, document.getElementById('html').value)">复制</button>
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/indrimuska/[email protected]/dist/jquery-editable-select.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
<script src="js/badge.js"></script>
<script>
$('#loading').fadeOut(500, () => {
$('#loading').remove();
});
</script>
</body>
</html>