forked from muruoxi2018/Check_Font_Copyright
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
413 lines (377 loc) · 18 KB
/
index.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>我的字体可以商用吗?-查版权,免纠纷</title>
<link rel="stylesheet" href="./layui/css/layui.css">
<style>
body {
background-image: url(./img/bg.jpg);
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
}
.logo_gif {
width: 200px;
margin: 0 auto;
height: 200px;
min-height: 80px;
max-width: 244px;
display: block;
}
.logo_gif img {
margin-right: auto;
display: block;
height: 100%;
}
.xinwen,
.main,
.foot {
background-color: rgba(255, 255, 255, 0.8);
}
h2 {
font-size: 42px;
font-weight: 900;
margin: 20 auto;
display: inline-block;
color: #009688;
text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
transition: .3s ease;
line-height: 2;
}
h3 {
font-size: 28px;
font-weight: 700;
margin: 20 auto;
display: inline-block;
color: #FF5722;
text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
;
transition: .3s ease;
line-height: 1.5;
}
.layui-center {
text-align: center;
}
.foot {
padding: 30px 0;
line-height: 30px;
text-align: center;
font-weight: 300;
}
.margin-buttom20 {
margin-bottom: 20px;
}
/*替换一些layui的样式*/
.layui-colla-title {
background-color: transparent;
}
.layui-collapse {
border-width: 0px;
}
.layui-elem-quote {
background-color: rgba(255, 255, 255, 0.8);
}
</style>
</head>
<body>
<div class="layui-container">
<div class="layui-row layui-center margin-buttom20">
<h2 class="layui-anim layui-anim-scaleSpring">我的字体可以商用吗?</h2>
<h3>毁掉一个公司只要让他家设计师用这些字体就行了!</h3>
</div>
<blockquote class="layui-elem-quote">
<i class="layui-icon layui-icon-tips"></i>
本站检测结果仅供参考,数据来源于网络,站长人工整理而来。
<br />
<i class="layui-icon layui-icon-face-smile"></i>
如果某个字体查不到,那多半是无法用于商业的。
</blockquote>
<div class="layui-row xinwen">
<div class="layui-col-md9">
<div class="layui-collapse" lay-accordion>
<div class="layui-colla-item">
<h2 class="layui-colla-title">站点统计</h2>
<div class="layui-colla-content layui-show">
当前已收录字体:套,其中免费字体:套,等待审核:套
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">联系站长</h2>
<div class="layui-colla-content">
合作 / 提交字体,请发邮件到[email protected]与我沟通。
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">友情链接</h2>
<div class="layui-colla-content">
没见过把友链放在这里的吧,哈哈哈~
</div>
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="logo_gif">
<img src="./img/gif.jpg" alt="我的字体可以商用吗?" class="layui-anim layui-anim-scaleSpring">
</div>
</div>
</div>
<div class="layui-row main">
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this">当前已安装字体</li>
<li>字体商用检索</li>
<li>下载可商用字体</li>
<li>提交未收录字体</li>
</ul>
<div class="layui-tab-content" lay-filter="tab">
<div class="layui-tab-item layui-show">
<div id="fontList">
<table class="layui-table" lay-skin="line" lay-filter="all">
<thead>
<tr>
<th lay-data="{field:'cn_name',sort: true}">中文名称</th>
<th lay-data="{field:'en_name',sort: true}">英文名称</th>
<th lay-data="{field:'is_vip',sort: true}">授权方式</th>
<th lay-data="{field:'attachment'}">下载地址</th>
</tr>
</thead>
<tbody id="fontBody">
</tbody>
</table>
</div>
</div>
<div class="layui-tab-item">
<form class="layui-form layui-center">
<div class="layui-inline">
<input placeholder="搜索字体" name="font" autocomplete="off" value="" class="layui-input">
</div>
<button class="layui-btn" lay-submit lay-filter="search">
<i class="layui-icon layui-icon-search"></i>
</button>
</form>
<table class="layui-table" lay-skin="line" lay-filter="search" id="search">
<!-- <thead>
<tr>
<th>中文名称</th>
<th>英文名称</th>
<th>授权方式</th>
<th>下载地址</th>
</tr>
</thead>
<tbody id="searchBody">
</tbody> -->
</table>
</div>
<div class="layui-tab-item">
<table class="layui-table" lay-skin="line" lay-filter="free" id="free">
<!-- <thead>
<tr>
<th>中文名称</th>
<th>英文名称</th>
<th>授权方式</th>
<th>下载地址</th>
</tr>
</thead>
<tbody id="freeBody">
</tbody> -->
</table>
</div>
<div class="layui-tab-item">
<div class="layui-row layui-center">
<button type="button" class="layui-btn" id="upload">上传字体</button>
</div>
<hr class="layui-bg-green">
<form class="layui-form">
<div class="layui-form-item">
<label class="layui-form-label">中文名称</label>
<div class="layui-input-block">
<input type="text" name="cn_name" required lay-verify="required"
placeholder="请输入字体的中文名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">英文名称</label>
<div class="layui-input-block">
<input type="text" name="en_name" required lay-verify="required"
placeholder="请输入字体的英文名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">字体类型</label>
<div class="layui-input-block">
<input type="radio" name="is_vip" value="0" title="完全免费" checked>
<input type="radio" name="is_vip" value="1" title="商业付费">
<input type="radio" name="is_vip" value="2" title="完全付费">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">下载地址</label>
<div class="layui-input-block">
<input type="text" name="attachment" required lay-verify="required"
placeholder="请输入字体的下载地址" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="tijiao">提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="foot layui-center">
<div id="copyright">Copyright © 慕若曦 所有字体收集自网络,版权归字体商所有<br />本站提供API接口供使用,详情咨询[email protected]</div>
</div>
</div>
<script src="./layui/layui.js"></script>
<script>
let fonts = [];
layui.use(['layer', 'form', 'element', 'util', 'upload', 'table'], function () {
var layer = layui.layer
, form = layui.form
, element = layui.element
, util = layui.util
, $ = layui.$
, upload = layui.upload
, table = layui.table;
form.on('submit(tijiao)', function (data) {
$.ajax({
url: 'api.php?action=addFont',
type: 'post',
data: data.field,
success: function (data) {
layer.msg("提交成功")
}
});
return false;
});
form.on('submit(search)', function (data) {
table.render({
elem: '#search'
, url: '/api.php?action=searchFonts&font=' + data.field.font
, method: 'post'
, page: true
, cols: [[
{ field: 'cn_name', title: '中文名称', sort: true }
, { field: 'en_name', title: '英文名称', sort: true }
, { field: 'is_vip', title: '授权方式', sort: true }
, { field: 'attachment', title: '下载地址' }
]],
parseData: function (res) {
layui.each(res.message.fonts, function (n, f) {
res.message.fonts['is_vip'] = numtovip(f['is_vip'])
})
let ret = {
"code": res.code,
"msg": res.message,
"count": res.message.count,
"data": res.message.fonts
}
console.log(res.message.count)
return ret;
}
});
return false;
});
util.fixbar({
bar1: ''
, click: function (type) {
if (type === 'bar1') {
url = 'https://jq.qq.com/?_wv=1027&k=apteTFwC';
window.open(url, '_blank').location;
}
}
});
upload.render({
elem: '#upload',
url: 'api.php?action=uploadFont',
exts: 'zip',
accept: 'file',
done: function (res) {
if (res.code == 1) {
$("input[name='attachment']").attr('value', res.message.download);
layer.msg('上传成功')
}
else {
layer.msg(res.message)
}
}
})
$.ajax({
url: 'api.php?action=getAllFontsList',
type: 'post',
success: function (res) {
if (res.code == 1) {
console.log('字体检测开始!By:muruoxi')
fonts = layui.sort(res.message.fontslist, 'cn_name')
fonts = fonts.filter((item) => {
return CheckFont(item['en_name']);
});
PushFontsList(fonts, 'fontBody');
console.log('字体检测结束!QQ:1171867037')
table.init('all', {
limit: 10,
page: true
});
}
else {
layer.msg(res.message)
}
}
})
let free = true;
element.on('tab(tab)', function (data) {
if (data.index == 2 && free) {
$.ajax({
url: 'api.php?action=getFreeFontsList',
type: 'post',
success: function (res) {
if (res.code == 1) {
free = false;
PushFontsList(res.message.fontslist, 'freeBody');
}
else {
layer.msg(res.message)
}
}
})
}
});
});
function numtovip(f) {
return f==0?'<b class="layui-bg-green">完全免费</b>' : (f == 1 ? '<b class="layui-bg-red">商业付费</b>' : '<b class="layui-bg-black">完全付费</b>')
}
function PushFontsList(fontslist, id) {
let list = '';
layui.each(fontslist, function (num, font) {
font['is_vip'] = font['is_vip'] == 0 ? '<b class="layui-bg-green">完全免费</b>' : (font['is_vip'] == 1 ? '<b class="layui-bg-red">商业付费</b>' : '<b class="layui-bg-black">完全付费</b>');
list += '<tr><td>' + font['cn_name'] + '</td><td>' + font['en_name'] + '</td><td>' + font['is_vip'] + '</td><td><a href="' + font['attachment'] + '">点击下载</a></td></tr>';
document.getElementById(id).innerHTML = list;
});
}
function CheckFont(t) {
if (t == "") { return "" };
var f = "他们给我说这个东西越长就越精准我特别想试试ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrsyuvwxyz1234567890";
var s = document.createElement("span");
s.style.fontSize = '72px';
s.innerHTML = f;
var b = document.getElementsByTagName("body")[0];
b.appendChild(s);
s.style.fontFamily = f;
var w = s.offsetWidth;
var h = s.offsetHeight;
//尝试修复部分字体无法判断问题
//s.style.fontFamily = t + ',' + f;
s.style.fontFamily = "\"" + t + "\"" + ',' + f;
var r = ((s.offsetWidth != w) || (s.offsetHeight != h));
b.removeChild(s);
return r ? true : false;
}
</script>
</body>
</html>