This commit is contained in:
WJQSERVER 2024-10-16 21:51:24 +08:00
parent a386304d42
commit 1c18ccc363
2 changed files with 42 additions and 3 deletions

View file

@ -7,6 +7,8 @@
[DEMO](https://ghproxy.1888866.xyz) [DEMO](https://ghproxy.1888866.xyz)
[TG讨论群](https://t.me/ghproxy_go)
## 项目说明 ## 项目说明
### 项目特点 ### 项目特点

View file

@ -131,6 +131,28 @@
text-align: center; text-align: center;
line-height: 0.5; line-height: 0.5;
} }
#toast {
position: fixed;
top: 10%;
/* 垂直居中 */
left: 50%;
/* 水平居中 */
transform: translate(-50%, -50%);
/* 调整使其中心对齐 */
background-color: rgba(97, 97, 97, 0.7);
/* 半透明黑色背景 */
color: white;
/* 字体颜色 */
padding: 15px 20px;
/* 内边距 */
border-radius: 10px;
/* 圆角 */
font-size: 16px;
/* 字体大小 */
z-index: 1000;
/* 确保显示在其他元素上面 */
}
</style> </style>
</head> </head>
@ -143,7 +165,7 @@
<button class="btn rounded-button" id="formatButton">获取文件链接</button> <button class="btn rounded-button" id="formatButton">获取文件链接</button>
<div class="code" id="outputBlock"> <div class="code" id="outputBlock">
<button class="copy-button" id="copyButton" onclick="copyCode(this)">Copy</button> <button class="copy-button" id="copyButton">Copy</button>
<pre id="formattedLinkOutput"></pre> <pre id="formattedLinkOutput"></pre>
</div> </div>
<div class="tips"> <div class="tips">
@ -155,6 +177,10 @@
</div> </div>
</div> </div>
</div> </div>
<div id="toast" style="display:none;">
链接已复制到剪贴板
</div>
<script> <script>
function formatGithubLink() { function formatGithubLink() {
@ -186,9 +212,20 @@
window.getSelection().addRange(range); window.getSelection().addRange(range);
document.execCommand('copy'); document.execCommand('copy');
window.getSelection().removeAllRanges(); window.getSelection().removeAllRanges();
alert('链接已复制到剪贴板'); //alert('链接已复制到剪贴板');
showToast('链接已复制到剪贴板');
}); });
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.style.display = 'block';
setTimeout(() => {
toast.style.display = 'none';
}, 3000); // 3秒后隐藏
}
function fetchSizeLimit() { function fetchSizeLimit() {
fetch(window.location.origin + '/api/size_limit') fetch(window.location.origin + '/api/size_limit')
.then(response => response.json()) .then(response => response.json())
@ -249,7 +286,7 @@
Copyright &copy; 2024 WJQSERVER-STUDIO Copyright &copy; 2024 WJQSERVER-STUDIO
</p> </p>
<p> <p>
GitHub仓库地址<a href="https://github.com/WJQSERVER-STUDIO/ghproxy">https://github.com/WJQSERVER-STUDIO/ghproxy</a> GitHub仓库地址<a href="https://github.com/WJQSERVER-STUDIO/ghproxy">https://github.com/WJQSERVER-STUDIO/ghproxy</a> <br><a href="https://t.me/ghproxy_go">Telegram交流群</a>
</p> </p>
<div id="visitor-info" style="text-align: center; margin-top: 15px;"> <div id="visitor-info" style="text-align: center; margin-top: 15px;">
<p>您的IP地址: <span id="visitor-ip"></span></p> <p>您的IP地址: <span id="visitor-ip"></span></p>