-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
145 lines (131 loc) · 4.06 KB
/
Copy pathindex.html
File metadata and controls
145 lines (131 loc) · 4.06 KB
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="zh-Hans">
<style>
html, body {
width: 100%;
margin: 0;
}
html {
height: 100%;
}
body {
min-height: 100%;
padding: 20px;
box-sizing: border-box;
}
p {
word-break: break-all;
}
@media (max-width: 500px) {
h1 {
margin-top: 80px;
}
}
.flex {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.block {
display: block;
position: relative;
}
.url {
font-size: 18px;
padding: 10px 10px 10px 5px;
position: relative;
width: 300px;
border: none;
border-bottom: 1px solid #bfbfbf;
}
input:focus {
outline: none;
}
.bar {
content: '';
height: 2px;
width: 100%;
bottom: 0;
position: absolute;
background: #000000;
transition: 0.2s ease transform;
-moz-transition: 0.2s ease transform;
-webkit-transition: 0.2s ease transform;
transform: scaleX(0);
}
.url:focus ~ .bar {
transform: scaleX(1);
}
.btn {
line-height: 38px;
background-color: #000000;
color: #fff;
white-space: nowrap;
text-align: center;
font-size: 14px;
border: none;
border-radius: 2px;
cursor: pointer;
padding: 5px;
width: 160px;
margin: 30px 0;
}
.tips, .example {
color: #7b7b7b;
position: relative;
align-self: flex-start;
margin-left: 7.5em;
}
.tips > p:first-child::before {
position: absolute;
left: -3em;
content: 'PS:';
color: #7b7b7b
}
.example > p:first-child::before {
position: absolute;
left: -5.5em;
content: '输入示例:';
color: #7b7b7b
}
</style>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script>
function toSubmit(e) {
e.preventDefault()
window.open('/' + document.getElementsByName('q')[0].value);
return false
}
</script>
<title>GitHub 文件加速</title>
</head>
<body class="flex">
<a style="position: absolute;top: 0;right: 0;" href="https://github.com/garywhat/github_cdn"><img width="149" height="149" referrerPolicy="no-referrer"
src="https://inews.gtimg.com/newsapp_ls/0/12025455907/0"
alt="Fork me on GitHub"
data-recalc-dims="1"></a>
<h1 style="margin-bottom: 50px">GitHub 文件加速</h1>
<form action="./" method="get" style="padding-bottom: 40px" target="_blank" class="flex" onsubmit="toSubmit(event)">
<label class="block" style="width: fit-content">
<input class="block url" name="q" type="text" placeholder="键入Github文件链接"
pattern="^((https|http):\/\/)?(github\.com\/.+?\/.+?\/(?:releases|archive|blob)|(raw\.githubusercontent\.com))\/.+$" required>
<div class="bar"></div>
</label>
<input class="block btn" type="submit" value="下载">
<div class="tips"><p>GitHub文件链接带不带协议头都可以,支持release、archive以及文件,右键复制出来的链接都是符合标准的。</p>
<p>release、archive使用cf加速,文件会跳转至JsDelivr</p>
<p>注意,不支持项目文件夹</p></div>
<div class="example">
<p>分支源码:https://github.com/coolsnowwolf/lede/archive/master.zip</p>
<p>release源码:https://github.com/coolsnowwolf/lede/archive/20200408.tar.gz</p>
<p>release文件:https://github.com/coolsnowwolf/lede/releases/download/20200408/openwrt-R20.4.8-x64-combined-squashfs.1.rar</p>
<p>分支文件:https://github.com/coolsnowwolf/lede/blob/master/tools/flex/Makefile</p>
</div>
</form>
<p style="position: sticky;top: calc(100% - 2.5em);">项目基于Cloudflare Workers,开源于GitHub</p>
</body>
</html>