Skip to content

Commit aaf0be8

Browse files
committed
优化 Release 加速按钮在手机(小屏幕)上的显示效果
1 parent 93d79f3 commit aaf0be8

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Github 增强 - 高速下载
3-
// @version 1.5.1
3+
// @version 1.5.2
44
// @author X.I.U
55
// @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁)
66
// @match *://github.com/*
@@ -123,11 +123,17 @@
123123
// Release
124124
function addRelease() {
125125
let html = document.getElementsByClassName('Box Box--condensed');if (!html) return
126+
let divDisplay;
127+
if (document.documentElement.clientWidth > 1000) {
128+
divDisplay = 'display: flex;';
129+
} else {
130+
divDisplay = 'display: block;';
131+
}
126132
Array.from(html).forEach(function (current) {
127133
current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) {
128134
let href = _this.href.split('github.com'),
129135
url = [],
130-
_html = `<div style="display: flex;justify-content: flex-end;">`;
136+
_html = `<div style="${divDisplay}justify-content: flex-end;">`;
131137

132138
for (let i=0;i<download_url.length;i++){
133139
if (download_url[i][0] === 'https://download.fastgit.org') {
@@ -151,7 +157,7 @@
151157
current.querySelectorAll('.d-block.Box-body > a').forEach(function (_this) {
152158
let href = _this.href.split('github.com'),
153159
url = [],
154-
_html = `<div style="display: flex;justify-content: flex-end;flex-grow: 1;">`;
160+
_html = `<div style="${divDisplay}justify-content: flex-end;flex-grow: 1;">`;
155161

156162
for (let i=0;i<download_url.length;i++){
157163
if (download_url[i][0] === 'https://download.fastgit.org') {

0 commit comments

Comments
 (0)