-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathindex.html
160 lines (143 loc) · 5.05 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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>GIS兵器库</title>
<script src="config_blog.js"></script>
<script src="config_demo.js"></script>
<script src="config_source.js"></script>
<script src="config_download.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
position: relative;
background: #f5f5f5;
margin: 0;
padding: 0;
min-width: 800px;
}
.content {
position: absolute;
margin-top: 200px;
margin-left: calc(50% - 400px);
}
.contentTitle {
width: 800px;
height: 60px;
margin-bottom: 50px;
font-size: 36px;
font-weight: 1000;
text-align: center;
}
.contentUrl {
width: 800px;
height: 60px;
font-size: 18px;
font-weight: 500;
text-align: left;
}
#backUrlContent{
display: none;
}
#helfUrl{
display: none;
}
.contentUrl a{
color: #019BDD;
}
</style>
</head>
<body>
<div class="content">
<div class="contentTitle">
<span>微信公众号:GIS兵器库</span>
</div>
<div class="contentUrl" id="helfUrl">
<span>正在跳转到:</span>
<a id="toUrl" href=""></a>
</div>
<div class="contentUrl" id="backUrlContent">
<span>可能您的所处的网络无法正常访问github,您可以尝试访问下面的 github 镜像地址:</span><br/>
<span>镜像一:</span><a id="backUpUrl"></a><br/>
<span>镜像二:</span><a id="backUpUrl2"></a>
</div>
</div>
</body>
<script>
init();
//初始化
function init() {
var urlArg = getUrlArgObject();
if (urlArg && urlArg.blog) {
loadUrl(urlArg.blog, blogList)
} else if (urlArg && urlArg.demo) {
loadUrl(urlArg.demo, demoList)
} else if (urlArg && urlArg.source) {
loadUrl(urlArg.source, sourceList)
} else if (urlArg && urlArg.download) {
loadUrl(urlArg.download, downloadList)
} else {
// window.location.href = 'https://blog.csdn.net/gisarmory'
window.location.href = 'http://gisarmory.xyz/blog/main.html'
}
}
function loadUrl(urlId, dataList) {
for (var i = 0; i < dataList.length; i++) {
var dataObj = dataList[i];
if (dataObj.id == urlId) {
var href = ''
if (dataObj.href) {
href = dataObj.href;
} else if (dataObj.url) {
href = dataObj.url;
}
//延迟跳转
setTimeout(function(){
window.location.href = href
}, 800);
//延迟显示提示
setTimeout(function(){
//正在跳转地址
document.getElementById('toUrl').innerHTML = href
document.getElementById('toUrl').href = href
document.getElementById('helfUrl').style.display = 'block'
}, 2000);
//延迟github镜像提示
setTimeout(function(){
var hrefArr = href.split('https://github.com')
if(hrefArr.length > 1){
//镜像1
var backUrl = 'https://github.com.cnpmjs.org' + hrefArr[1]
document.getElementById('backUpUrl').innerHTML = backUrl
document.getElementById('backUpUrl').href = backUrl
//镜像2
backUrl = 'https://hub.fastgit.org' + hrefArr[1]
document.getElementById('backUpUrl2').innerHTML = backUrl
document.getElementById('backUpUrl2').href = backUrl
document.getElementById('backUrlContent').style.display = 'block'
}else{
document.getElementById('backUrlContent').style.display = 'none'
}
}, 8000);
}
}
}
//返回的是对象形式的参数
function getUrlArgObject() {
var args = new Object();
var query = location.search.substring(1); //获取查询串
var pairs = query.split(","); //在逗号处断开
for (var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('='); //查找name=value
if (pos == -1) { //如果没有找到就跳过
continue;
}
var argname = pairs[i].substring(0, pos); //提取name
var value = pairs[i].substring(pos + 1); //提取value
args[argname] = unescape(value); //存为属性
}
return args; //返回对象
}
</script>
</html>