This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
248 lines (203 loc) · 11.6 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue-blog</title>
<link href="vendor/highlight.js/styles/atom-one-dark.css" rel="stylesheet" />
<!-- <link href="css/styles/github.css" rel="stylesheet" /> -->
<link href="css/main.css" rel="stylesheet" />
<link rel="stylesheet" href="css/icomoon.css">
<!-- 引入Gitment评论系统 -->
<!-- <link rel="stylesheet" href="vendor/gitment/style/default.css"> -->
<!-- 引入 gitalk 评论系统 -->
<link rel="stylesheet" href="vendor/gitalk/gitalk.css">
<!-- 图片预览PhotoSwipe -->
<link rel="stylesheet" href="vendor/PhotoSwipe/photoswipe.css">
<link rel="stylesheet" href="vendor/PhotoSwipe/default-skin/default-skin.css">
</head>
<body>
<div id="app">
<div class="header" ref="indexHeader">
<span class="title" v-if="isSmTitle">{{ headerTitle || '' }}</span>
<span class="btn-back" v-if="detailPage" @click="back">
<i class="icon-back"></i>
</span>
</div>
<div class="header-bg">
<span class="title" :style="{ visibility: detailPage ? 'hidden' : 'visible' }" ref="indexTitle" v-if="!isSmTitle">{{ headerTitle || '' }}</span>
</div>
<transition name="slide-fade-left">
<div class="index" v-show="listPage">
<div class="main">
<div class="listPage container">
<div class="label-select">
<span class="icon"><i class="icon-label"></i></span>
<span class="label" v-for="label in allLabel" :style="{background: '#' + label.color}" @click="selectLabel(label.name)">{{ label.name }}</span>
</div>
<ul>
<li v-for="item in baseData">
<article class="blog-list-item">
<h3 class="title">
<a :href="'#/detail/' + item.number">{{ item.title }}</a>
</h3>
<div class="list-content">{{ item.body.substring(0, 200) }}{{ item.body.length > 200 ? '...' : ''}}<a :href="'#/detail/' + item.number" v-if="item.body.length > 200">阅读全文...</a></div>
<div class="label" v-if="item.labels.length">
<span v-for="label in item.labels" :style="{background: '#' + label.color}">{{ label.name }}</span>
</div>
</article>
</li>
</ul>
<!-- 页码逻辑,左边两个,右边两个,两个之后,如果还有超过两个,就显示...,可以在js中使用数组的方式来做,在数组前面添加或后面添加 -->
<nav class="page-nav" v-if="baseData.length">
<div class="inner">
<span v-if="currentPage != 1" @click="changePage(+currentPage - 1)">上一页</span>
<span :class="{ current: currentPage == 1 }" @click="changePage(currentPage == 1 ? false : 1)">1</span>
<span v-if="showPrevMore" class="more" @click="changePage((+currentPage - 5) < 1 ? 1 : (+currentPage - 5))">...</span>
<span v-for="pager in pagers" :class="{ current: currentPage == pager }" @click="changePage(currentPage == pager ? false : pager)">{{ pager }}</span>
<span v-if="showNextMore" class="more" @click="changePage((+currentPage + 5) > pageCount ? pageCount : (+currentPage + 5))">...</span>
<span href="#/" v-if="pageCount > 1" :class="{ current: currentPage == pageCount }" @click="changePage(currentPage == pageCount ? false : pageCount)">{{ pageCount }}</span>
<span class="" rel="next" href="#/" v-if="currentPage != pageCount" @click="changePage(+currentPage + 1)">下一页</span>
</div>
</nav>
</div>
</div>
<footer class="footer">
<div class="copyright">
<p>
<span>
Auven Zhang © 2017
</span>
<span>
博客内容遵循
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a>
</span>
</p>
</div>
</footer>
</div>
</transition>
<transition name="slide-fade-right">
<div class="article" v-show="detailPage">
<div class="main">
<div class="container">
<div class="detail">
<div class="title-wrap">
<div class="title" :style="{ visibility: isSmTitle ? 'hidden' : 'visible' }">{{ article ? article.title : '' }}</div>
<div class="post-meta">
<a class="post-author" :href="article ? article.user.html_url : ''">
<img :src="article ? article.user.avatar_url : ''">
<span>{{ article ? article.user.login : '' }}</span>
</a>
<span class="post-time">{{ article ? article.created_at.split(/T|Z/)[0] + ' ' + article.created_at.split(/T|Z/)[1]
: '' }}</span>
</div>
</div>
<div class="label" v-if="acticleLabel.length">
<span class="icon"><i class="icon-label"></i></span>
<span class="label-item" v-for="label in acticleLabel" :style="{background: '#' + label.color}">{{ label.name }}</span>
</div>
<div class="content" v-html="detailData" ref="detail"></div>
</div>
<!-- <div id="comments"></div> -->
<div id="gitalk-container"></div>
</div>
</div>
<footer class="footer">
<div class="copyright">
<p>
<span>
Auven Zhang © 2017
</span>
<span>
博客内容遵循
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a>
</span>
</p>
</div>
</footer>
</div>
</transition>
<transition name="fade">
<div class="loading" v-show="loading">
<!-- <div class="sk-folding-cube">
<div class="sk-cube1 sk-cube"></div>
<div class="sk-cube2 sk-cube"></div>
<div class="sk-cube4 sk-cube"></div>
<div class="sk-cube3 sk-cube"></div>
</div> -->
<div class="mikepad-loading">
<div class="binding"></div>
<div class="pad">
<div class="line line1"></div>
<div class="line line2"></div>
<div class="line line3"></div>
</div>
</div>
</div>
</transition>
</div>
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<script src="vendor/vue/vue.min.js"></script>
<script src="vendor/vue-router/vue-router.min.js"></script>
<script src="vendor/axios/axios.min.js"></script>
<script type="text/javascript" src="vendor/marked/marked.min.js"></script>
<script type="text/javascript" src="vendor/highlight.js/highlight.pack.js"></script>
<!-- <script src="vendor/gitment/gitment.browser.js"></script> -->
<script src="vendor/gitalk/gitalk.min.js"></script>
<script src="vendor/md5/md5.min.js"></script>
<script src="vendor/PhotoSwipe/photoswipe.min.js"></script>
<script src="vendor/PhotoSwipe/photoswipe-ui-default.min.js"></script>
<!-- markdown锚点插件anchorjs -->
<script src="vendor/anchorjs/anchor.min.js"></script>
<script type="text/javascript" src="config.js"></script>
<script src="js/api.js"></script>
<script src="js/index.js"></script>
</body>
</html>