-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
338 lines (324 loc) · 13.8 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base target="_blank" />
<link rel="icon" href="http://guide.zhaohaodong.com/navigate_128px_1192156_easyicon.net.png">
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script type="application/javascript" src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script type="application/javascript" src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>开发导航</title>
<style>
table.lamp {
width: 100%;
}
table.lamp th, td {
padding:10px;
}
table.lamp td {
width: 25%;
}
table.lamp a {
color: #0099cc
}
table.lamp a:hover {
color: #336699
}
.div-block {
margin-left: 10%;
margin-right: 10%
}
a:focus{text-decoration: none}
</style>
</head>
<body>
<div id="model" hidden>
<div class="panel-heading" id="panel-heading">
<h4 class="panel-title">
<!-- 若想打开一个面板时其他面板折叠起来,则可以在下面的a标签中添加:data-parent="#accordion" -->
<a id="menu" data-toggle="collapse" href="#collapse">
</a>
</h4>
</div>
<div id="collapse" class="panel-collapse collapse in">
<div class="panel-body">
<table id="menu-table" class="lamp">
</table>
</div>
</div>
</div>
<div class="panel-group div-block" id="accordion">
<div id="panel" class="panel panel-default">
</div>
</div>
<script>
var jsonData = {
"module": [
{
"id": "dev-tools",
"name": "开发常用",
"menu": [
{
"id": "github",
"name": "GitHub",
"url": "https://github.com/",
"desc": ""
},
{
"id": "yuque",
"name": "语雀",
"url": "https://www.yuque.com/dashboard",
"desc": "十万阿里人都在用的笔记与文档知识库"
},
{
"id": "jsoneditor",
"name": "JSON在线编辑",
"url": "http://www.kjson.com/jsoneditor/",
"desc": ""
},
{
"id": "codeif",
"name": "CodeIf",
"url": "https://codeif.xinke.org.cn/",
"desc": "变量命名助手"
},
{
"id": "mvnrepository",
"name": "Maven Repository",
"url": "https://mvnrepository.com/",
"desc": "Maven 仓库"
},
{
"id" : "BootCDN",
"name": "BootCDN",
"url": "https://www.bootcdn.cn/",
"desc": "稳定、快速、免费的前端开源项目 CDN 加速服务"
},
{
"id" : "bootschool",
"name": "BootSchool",
"url": "https://www.bootschool.net/",
"desc": "前端插件大全"
},
{
"id" : "webjars",
"name": "webjars",
"url": "https://www.webjars.org/",
"desc": "静态资源的Maven依赖"
},
{
"id" : "aliyunCode",
"name": "阿里云Code",
"url": "https://code.aliyun.com/",
"desc": "阿里云代码托管服务"
},
{
"id" : "dockerHub",
"name": "Docker Hub",
"url": "https://hub.docker.com/",
"desc": "Docker镜像仓库"
}
]
},
{
"id" : "blog",
"name" : "博客论坛",
"menu" : [
{
"id": "developer-aliyun",
"name": "阿里云开发者社区",
"url": "https://developer.aliyun.com/",
"desc": ""
},
{
"id": "v2ex",
"name": "V2EX",
"url": "https://www.v2ex.com/",
"desc": ""
},
{
"id": "meituan",
"name": "美团技术团队",
"url": "https://tech.meituan.com/",
"desc": ""
},
{
"id": "StackOverflow",
"name": "Stack Overflow",
"url": "https://stackoverflow.com/questions",
"desc": ""
},
{
"id": "oschina",
"name": "开源中国",
"url": "https://www.oschina.net/",
"desc": ""
},
{
"id": "linuxcn",
"name": "Linux中国",
"url": "https://linux.cn/",
"desc": ""
},
{
"id": "dzone",
"name": "dzone",
"url": "https://dzone.com/",
"desc": ""
}
]
},
{
"id": "server",
"name": "服务器相关",
"menu": [
{
"id": "qiniu",
"name": "七牛云",
"url": "https://portal.qiniu.com",
"desc": "内容存储解决方案"
},
{
"id": "ecs",
"name": "阿里云ECS工作台",
"url": "https://ecs.console.aliyun.com/#/home",
"desc": ""
},
{
"id": "ali-domain",
"name": "阿里云域名控制台",
"url": "https://dc.console.aliyun.com/next/index#/domain/list/all-domain",
"desc": ""
},
{
"id": "tencent-cloud",
"name": "腾讯云CVM工作台",
"url": "https://console.cloud.tencent.com/cvm/instance/index",
"desc": ""
}
]
},
{
"id": "study",
"name": "能力提升",
"menu": [
{
"id": "shiyanlou",
"name": "实验楼",
"url": "https://www.shiyanlou.com/",
"desc": ""
},
{
"id": "leetcode",
"name": "LeetCode",
"url": "https://leetcode-cn.com/",
"desc": "刷算法题"
}
]
},
{
"id": "resources",
"name": "资源",
"menu": [
{
"id": "chongbuluo",
"name": "快搜",
"url": "https://search.chongbuluo.com/",
"desc": ""
},
{
"id": "pexels",
"name": "Pexels",
"url": "https://www.pexels.com/zh-cn/",
"desc": "免费的图片资源网站"
},
{
"id": "pixabay",
"name": "pixabay",
"url": "https://pixabay.com/",
"desc": "免费的图片资源网站"
},
{
"id": "easyIcon",
"name": "EasyIcon",
"url": "https://www.easyicon.net/",
"desc": "免费的图标网站"
},
{
"id": "iconfont",
"name": "阿里巴巴矢量图标库",
"url": "https://www.iconfont.cn/",
"desc": ""
}
]
},
{
"id": "other",
"name": "其他",
"menu": [
{
"id": "greasyfork",
"name": "Greasy Fork",
"url": "https://greasyfork.org/zh-CN",
"desc": "这是一个提供用户脚本的网站"
}
]
}
]
};
$(function () {
jsonData.module.forEach(function(module) {
var heading = $('#panel-heading').clone();
// 设置模块名称
heading.find("a").html(module.name);
// 设置id
heading.find("a").attr("href", "#" + module.id);
// 设置heading ID
heading.attr("id", "_" + module.id);
$('#panel').append(heading);
var panel = $('#collapse').clone();
// 设置id
panel.attr("id", module.id);
var menus = module.menu;
if (menus == null || menus.length === 0) {
return true;
}
panel.find('table').append(fillTable(menus, 4));
$('#panel').append(panel);
});
/* 需使前面初始化好页面结构后再执行以下语句 */
$("[data-toggle='tooltip']").tooltip();
});
function fillTable(menus, num) {
var table = "";
var loopCount = Math.ceil(menus.length / num);
var m = 0;
for (var i = 1; i <= loopCount; i++) {
var trArray = [];
for (var n = 0; n < num; n++) {
trArray.push(menus[m]);
m++;
}
table = table + fillTr(trArray);
trArray = [];
}
return table;
}
function fillTr(menus) {
var tds = "";
menus.forEach(function(menu) {
tds = tds + (fillTd(menu));
});
return "<tr>" + tds + "</tr>";
}
function fillTd(menu) {
if (menu == null) {
return "<td></td>";
}
return "<td><a class='btn' data-toggle='tooltip' data-trigger='hover' title='" + menu.desc + "' href='" + menu.url + "'>" + menu.name + "</a></td>";
}
</script>
</body>
</html>