-
Notifications
You must be signed in to change notification settings - Fork 0
/
3talk.html
317 lines (282 loc) · 10.4 KB
/
3talk.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
---
title: Talks
layout: page_no_side
description: Say Whatever I Want
header-img: "img/talk-bg.jpg"
permalink: /talk/
---
<style>
.hexo-talk-tab {
padding: 5px;
}
.hexo-talk-active {
display: none;
}
.hexo-talk-item {
padding-top: 20px;
padding-bottom: 10px;
position: relative;
clear: both;
min-height: 100px;
border-bottom: 1px #ddd solid;
}
@media screen and (max-width: 600px) {
.hexo-talk-item {
width: 100%;
}
}
.hexo-talk-info {
padding-left: 70px;
}
.hexo-talk-title {
font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB",STHeiti,"Microsoft YaHei","Microsoft JhengHei","Source Han Sans SC","Noto Sans CJK SC","Source Han Sans CN","Noto Sans SC","Source Han Sans TC","Noto Sans CJK TC","WenQuanYi Micro Hei",SimSun,sans-serif;
color: #404040;
}
.hexo-talk-meta {
font-family: 'Lora', 'Times New Roman', serif;
font-size: 87%;
font-style: italic;
color: #808080;
padding-right: 10px;
}
.hexo-talk-button {
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Arial", "PingFang SC", "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "Microsoft JhengHei", "Source Han Sans SC", "Noto Sans CJK SC", "Source Han Sans CN", "Noto Sans SC", "Source Han Sans TC", "Noto Sans CJK TC", "WenQuanYi Micro Hei", SimSun, sans-serif;
color: #404040;
line-height: 1.7;
text-transform: uppercase;
font-size: 13px;
font-weight: 800;
letter-spacing: 1px;
padding: 10px;
background-color: white;
border: 1px solid #dddddd;
text-decoration: none;
}
.hexo-talk-button:focus,
.hexo-talk-button:hover {
text-decoration: none;
color: white;
background-color: #0085a1;
border: 1px solid #0085a1;
}
.hexo-talk-hide {
display: none;
}
.hexo-talk-show {
display: block;
}
.page-action-calendar {
width: 60px;
height: 60px;
background-color: #0085a1;
border: 1px solid #0085a1;
border-radius: 5px;
float: left;
margin-right: 5px;
}
.page-action-calendar .sub-month {
background-color: #404040;
color: #fff;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
font-size: 9px !important;
text-align: center;
height: 20px;
line-height: 20px;
margin: -1px -1px 0px -1px;
}
.page-action-calendar .sub-day {
font-size: 30px;
line-height: 36px;
text-align: center;
color: #fff;
}
</style>
<div style="display: none;">
<a class="hexo-talk-tab" id="hexo-talk-tab1" rel="external"></a>
<a class="hexo-talk-tab" id="hexo-talk-tab2" rel="external"></a>
<a class="hexo-talk-tab" id="hexo-talk-tab3" href="javascript:;" rel="external"></a>
</div>
<!-- 已读 start -->
<div id="hexo-talk-item1">
<!-- 已读000开始 -->
{% for talk in site.data.talks2 %}
<div class="hexo-talk-item">
<div class="page-action-calendar">
<div class="sub-month">{{ talk.talkdate | date: "%b %Y" }}</div>
<div class="sub-day">{{ talk.talkdate | date: "%-d" }}</div>
</div>
<div class="hexo-talk-info">
<div class="hexo-talk-title"><a style="text-decoration: none">{{ talk.mytalk }}</a></div>
<div class="hexo-talk-meta">Posted by Winchell.Wang on {{ talk.talkdate | date: "%B %-d, %Y" }}</div>
</div>
</div>
{% endfor %}
<!-- 已读000结束 -->
<!-- 分页 开始 -->
<div>
<a class="hexo-talk-firstpage" href="javascript:;"></a>
<a class="hexo-talk-previouspage" href="javascript:;"></a>
<span class="hexo-talk-pagenum"></span>
<a class="hexo-talk-nextpage" href="javascript:;"></a>
<a class="hexo-talk-lastpage" href="javascript:;"></a>
</div>
<!-- 分页 结束 -->
<!-- 已读 start -->
<div id="hexo-talk-item2">
<!-- 已读000开始 -->
{% for talk in site.data.talks2 %}
<div class="hexo-talk-item">
<div class="page-action-calendar">
<div class="sub-month">{{ talk.talkdate | date: "%b %Y" }}</div>
<div class="sub-day">{{ talk.talkdate | date: "%-d" }}</div>
</div>
<div class="hexo-talk-info">
<div class="hexo-talk-title"><a style="text-decoration: none">{{ talk.mytalk }}</a></div>
<div class="hexo-talk-meta">Posted by Winchell.Wang on {{ talk.talkdate | date: "%B %-d, %Y" }}</div>
</div>
</div>
{% endfor %}
<!-- 已读000结束 -->
<!-- 分页 开始 -->
<div>
<a class="hexo-talk-firstpage" href="javascript:;"></a>
<a class="hexo-talk-previouspage" href="javascript:;"></a>
<span class="hexo-talk-pagenum"></span>
<a class="hexo-talk-nextpage" href="javascript:;"></a>
<a class="hexo-talk-lastpage" href="javascript:;"></a>
</div>
<!-- 分页 结束 -->
<!-- 我的说说 start -->
<div id="hexo-talk-item3">
<!-- 说说000开始 -->
{% for talk in site.data.talks %}
<div class="hexo-talk-item">
<div class="page-action-calendar">
<div class="sub-month">{{ talk.talkdate | date: "%b %Y" }}</div>
<div class="sub-day">{{ talk.talkdate | date: "%-d" }}</div>
</div>
<div class="hexo-talk-info">
<div class="hexo-talk-title"><a style="text-decoration: none">{{ talk.mytalk }}</a></div>
<div class="hexo-talk-meta">Posted by Winchell.Wang on {{ talk.talkdate | date: "%B %-d, %Y" }}</div>
</div>
</div>
{% endfor %}
<!-- 说说000结束 -->
<!-- 分页 开始 -->
<div style="margin-top: 10px; text-align: center;">
<a class="hexo-talk-firstpage" href="javascript:;" style="display: none"></a>
<a class="hexo-talk-button hexo-talk-previouspage" href="javascript:;" style="float: left">← Newer Talks</a>
<span class="hexo-talk-pagenum" style="line-height: 2.8">2 / 3</span>
<a class="hexo-talk-button hexo-talk-nextpage" href="javascript:;" style="float: right">Older Talks →</a>
<a class="hexo-talk-lastpage" href="javascript:;" style="display: none"></a>
</div>
<!-- 分页 结束 -->
</div>
</div>
<div align='center' style="line-height: 4">
Winchell.Wang has
<script language="JavaScript">
var numitem3 = document.getElementById('hexo-talk-item3').getElementsByClassName('hexo-talk-item').length;
document.write(numitem3)
</script> talks.
</div>
</div>
<!-- Main Content end-->
<!-- 标签切换脚本 -->
<script>
Element.prototype.siblings = function () {
var siblingElement = [];
var sibs = this.parentNode.children;
for (var i = 0; i < sibs.length; i++) {
if (sibs[i] !== this) {
siblingElement.push(sibs[i]);
}
}
return siblingElement;
};
function tabClick() {
//修改标签样式
this.classList.add('hexo-talk-active');
var sibs = this.siblings();
for (var j = 0; j < sibs.length; j++) {
sibs[j].classList.remove('hexo-talk-active');
}
//显示对应板块
var itemId = this.id.replace('tab', 'item');
var target = document.getElementById(itemId);
target.classList.remove('hexo-talk-hide');
target.classList.add('hexo-talk-show');
sibs = document.getElementById(itemId).siblings();
for (var k = 0; k < sibs.length; k++) {
sibs[k].classList.remove('hexo-talk-show');
sibs[k].classList.add('hexo-talk-hide');
}
}
var tabs = document.getElementsByClassName("hexo-talk-tab");
for (var i = 0; i < tabs.length; i++) {
tabs[i].onclick = tabClick;
tabs[i].onclick.apply(tabs[i]);
}
tabs[2].click();
var firstpages = document.getElementsByClassName("hexo-talk-firstpage");
var previouspages = document.getElementsByClassName("hexo-talk-previouspage");
var nextpages = document.getElementsByClassName("hexo-talk-nextpage");
var lastpages = document.getElementsByClassName("hexo-talk-lastpage");
var pagenums = document.getElementsByClassName("hexo-talk-pagenum");
function makePageNum(num, arr) {
return (num + 1) + ' / ' + (Math.ceil(arr.length / 5 === 0 ? 1 : Math.ceil(arr.length / 5)));
}
function firstBtn() {
var sibs = this.parentNode.siblings();
displayPage(sibs, 0);
this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText = makePageNum(0, sibs);
}
function previousBtn() {
var sibs = this.parentNode.siblings();
var currNum = this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText;
currNum = currNum.substr(0, currNum.indexOf('/') - 1);
currNum = parseInt(currNum, 5) - 1;
if (currNum > 0) {
currNum--;
}
displayPage(sibs, currNum);
this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText = makePageNum(currNum, sibs);
}
function nextBtn() {
var sibs = this.parentNode.siblings();
var currNum = this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText;
currNum = currNum.substr(0, currNum.indexOf('/') - 1);
currNum = parseInt(currNum, 5) - 1;
if (currNum < Math.ceil(sibs.length / 5) - 1) {
currNum++;
}
displayPage(sibs, currNum);
this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText = makePageNum(currNum, sibs);
}
function lastBtn() {
var sibs = this.parentNode.siblings();
displayPage(sibs, Math.ceil(sibs.length / 5) - 1);
this.parentNode.getElementsByClassName('hexo-talk-pagenum')[0].innerText = makePageNum(Math.ceil(sibs.length / 5) - 1 === -1 ? 0 : Math.ceil(sibs.length / 5) - 1, sibs);
}
function displayPage(arr, num) {
for (var i = 0; i < arr.length; i++) {
if (Math.floor(i / 5) === num) {
arr[i].classList.remove('hexo-talk-hide');
} else {
arr[i].classList.add('hexo-talk-hide');
}
}
}
for (var i = 0; i < firstpages.length; i++) {
//add listener
firstpages[i].onclick = firstBtn;
previouspages[i].onclick = previousBtn;
nextpages[i].onclick = nextBtn;
lastpages[i].onclick = lastBtn;
//set page num
var size = pagenums[i].parentNode.siblings().length;
pagenums[i].innerText = '1 / ' + (Math.ceil(size / 5) === 0 ? 1 : Math.ceil(size / 5));
firstpages[i].click();
}
</script>