ghproxy/index.html

181 lines
4.5 KiB
HTML
Raw Normal View History

2021-01-03 23:25:48 +08:00
<!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: #00bfb3;
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: #00bfb3;
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;
2021-01-07 21:52:31 +08:00
}
2021-01-11 19:06:57 +08:00
.tips p, .example p {
margin-left: 1em;
}
2021-01-03 23:25:48 +08:00
2021-01-11 19:06:57 +08:00
.example {
margin-top: -3em;
2021-01-03 23:25:48 +08:00
}
</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>
2021-01-11 19:06:57 +08:00
<link rel="icon" href="/favicon.ico">
2021-01-08 18:05:32 +08:00
<title>GitHub 文件加速PHP版本</title>
2021-01-03 23:25:48 +08:00
</head>
<body class="flex">
<a
style="position: absolute; top: 0; right: 0"
href="https://github.com/tlanyan/ghproxy"
2021-01-07 21:52:31 +08:00
target="_blank"><img
2021-01-03 23:25:48 +08:00
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>
2021-01-07 21:52:31 +08:00
<h1 style="margin-bottom: 10px">
2021-01-03 23:25:48 +08:00
<img
src="https://ae01.alicdn.com/kf/H2fc84859291347418b11091fe0e508b8v.png"
style="width: 1.5em; margin-right: 0.2em; vertical-align: bottom"
2021-01-07 21:52:31 +08:00
/>GitHub 文件加速PHP版本
2021-01-03 23:25:48 +08:00
</h1>
2021-01-07 21:52:31 +08:00
<p style="margin-bottom: 40px;">本站仅供演示,如需可靠使用,请自行部署</p>
2021-01-03 23:25:48 +08:00
<form
action="./"
method="get"
target="_blank"
class="flex"
onsubmit="toSubmit(event)"
>
<label class="block" style="width: fit-content">
<input
class="block url"
name="q"
type="text"
2021-01-07 21:52:31 +08:00
placeholder="请输入Github文件链接"
2021-01-03 23:25:48 +08:00
pattern="^((https|http):\/\/)?(github\.com\/.+?\/.+?\/(?:releases|archive|blob)|(raw\.githubusercontent\.com))\/.+$"
required
/>
<div class="bar"></div>
</label>
<input class="block btn" type="submit" value="下载" />
2021-01-07 21:52:31 +08:00
2021-01-03 23:25:48 +08:00
<div class="example">
2021-01-11 19:06:57 +08:00
<h2>输入示例:</h2>
2021-01-08 18:05:32 +08:00
<p>分支源码https://github.com/tlanyan/ghproxy/archive/main.zip</p>
2021-01-03 23:25:48 +08:00
<p>
2021-01-08 18:05:32 +08:00
release源码https://github.com/tlanyan/yii2/archive/2.0.4.zip
2021-01-03 23:25:48 +08:00
</p>
<p>
2021-01-08 18:05:32 +08:00
release文件https://github.com/tlanyan/yii2/archive/2.0.4.zip
2021-01-03 23:25:48 +08:00
</p>
2021-01-08 18:05:32 +08:00
<p>分支文件https://github.com/tlanyan/ghproxy/blob/main/index.html</p>
2021-01-09 14:41:12 +08:00
<p>API请求https://api.github.com/repos/reactphp/http/releases/latest</p>
2021-01-03 23:25:48 +08:00
</div>
2021-01-07 21:52:31 +08:00
<div class="tips">
2021-01-11 19:06:57 +08:00
<h2>注意事项:</h2>
2021-01-07 21:52:31 +08:00
<p>
右键复制出来的链接都是符合标准的。
</p>
<p>release、archive直接反代加速文件会跳转至JsDelivr或cnpmjs.org加速下载</p>
<p><strong>注意:不支持项目文件夹</strong></p>
</div>
2021-01-03 23:25:48 +08:00
</form>
2021-01-11 19:11:09 +08:00
<p>
2021-01-11 19:06:57 +08:00
本项目为 <a href="https://github.com/hunshcn/gh-proxy" target="_blank">gh-proxy</a> 的PHP版本<a href="https://tlanyan.me" target="_blank">tlanyan</a> 基于 <a href="https://github.com/reactphp" target="_blank">ReactPHP</a> 开发
2021-01-03 23:25:48 +08:00
</p>
</body>
</html>