-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
527 lines (431 loc) · 16.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
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<!DOCTYPE html>
<html lang="">
<head><meta name="generator" content="Hexo 3.8.0">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>
Ying Jun's blog
</title>
<meta name="description" content="">
<meta name="author" content="YingJun">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
<link rel="icon" type="image/x-icon" href="">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/1.0.25-csp/vue.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
</head>
<body id="replica-app">
<nav class="navbar-wrapper">
<div class="navbar">
<div class="container clearfix">
<a href="/" class="navbar-logo"><i class="fa fa-github"></i></a>
<div class="navbar-search float-left desktop-only">
<div class="navbar-search-form">
<label for="gsc-i-id1">This website</label>
<div id="google-search">
<gcse:search></gcse:search>
</div>
</div>
</div>
<ul class="navbar-nav float-left">
<li><a href="/archives">Archives</a></li>
<li><a href="/categories">Categories</a></li>
<li><a href="/tags">Tags</a></li>
</ul>
<ul class="navbar-nav user-nav float-right desktop-only">
<li class="user-nav-notification">
<a><span class="user-nav-unread"></span><i class="fa fa-bell"></i></a>
</li>
<li>
<a><i class="fa fa-plus"></i> <i class="fa fa-caret-down"></i></a>
</li>
<li class="user-nav-logo">
<a><img src="https://octodex.github.com/images/baracktocat.jpg"> <i class="fa fa-caret-down"></i></a>
</li>
</ul>
</div>
</div>
</nav>
<div class="main-container">
<div class="container-lg">
<div class="blog-intro">
<div class="blog-intro-user">
<img class="avatar" src="https://octodex.github.com/images/baracktocat.jpg">
<div class="user-name">
<div class="blog-title">Ying Jun's blog</div>
<div class="blog-author">应俊</div>
<ul class="user-detail mobile-only">
<li>
<i class="fa fa-map-marker"></i>
China
</li>
<li>
<i class="fa fa-envelope-o"></i>
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>
<i class="fa fa-link"></i>
<a href="https://yj920.github.io">https://yj920.github.io</a>
</li>
</ul>
</div>
<div class="blog-description">
发现更大的世界 遇见更好的自己
</div>
</div>
<ul class="user-detail desktop-only">
<li>
<i class="fa fa-map-marker"></i>
China
</li>
<li>
<i class="fa fa-envelope-o"></i>
<a href="mailto:[email protected]">[email protected]</a>
</li>
<li>
<i class="fa fa-link"></i>
<a href="https://yj920.github.io">https://yj920.github.io</a>
</li>
</ul>
<div class="social-media desktop-only">
<h4>Social Media</h4>
<ul>
<li class="social-media-item"><a href="https://github.com/yj920" target="_blank"><i class="fa fa-github"></i></a></li>
</ul>
</div>
</div>
<div class="blog-detail">
<nav class="blog-detail-nav desktop-only">
<ul class="clearfix">
<li class="selected">
<a href="/">Overview</a></li>
<li class="">
<a href="/archives">Posts <span class="counter">9</span></a>
</li>
<li class="">
<a href="/categories">Categories <span class="counter">5</span></a></li>
<li class="">
<a href="/tags">Tags <span class="counter">7</span></a></li>
</ul>
</nav>
<div class="body-secondary">
<p class="right-title">Recent post</p>
<ul class="recent-post clearfix">
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/03/01/PHP基础语法/">PHP基础语法</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
The Best Language基础语法 这是今天课堂上的实验文档
2-1HTML
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/PHP/"><i class="fa fa-folder-open"></i> PHP</a>
</span>
<span><i class="fa fa-tag"></i> 1 </span>
</p>
</div>
</li>
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/02/23/Sass控制语句/">Sass控制语句</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
@if @if 语句有这么几种
@if{语句}
@if{语句}@else
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/Sass/"><i class="fa fa-folder-open"></i> Sass</a>
</span>
<span><i class="fa fa-tag"></i> 2 </span>
</p>
</div>
</li>
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/02/23/Sass代码复用/">Sass代码复用</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
继承 在Sass中使用 @extend 来实现样式的继承
1 2 3
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/Sass/"><i class="fa fa-folder-open"></i> Sass</a>
</span>
<span><i class="fa fa-tag"></i> 1 </span>
</p>
</div>
</li>
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/02/22/Sass基本运算/">Sass基本运算</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
CSS目前只有cls()函数可以进行运算,Sass可以像程序一样进行计算,但是与程序相比还是有些不
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/Sass/"><i class="fa fa-folder-open"></i> Sass</a>
</span>
<span><i class="fa fa-tag"></i> 1 </span>
</p>
</div>
</li>
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/02/21/Sass基础语法/">Sass基础语法</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
变量 声明变量 像这样声明变量 $color:red; ,以 $ 符号开头,例如:
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/Sass/"><i class="fa fa-folder-open"></i> Sass</a>
</span>
<span><i class="fa fa-tag"></i> 2 </span>
</p>
</div>
</li>
<li class="recent-post-item">
<div class="clearfix">
<h5 class="post-title text-ellipsis">
<i class="fa fa-bars"></i>
<a href="/2019/02/17/Sass介绍与使用/">Sass的介绍与使用</a>
</h5>
<p class="post-description text-ellipsis desktop-only">
Sass介绍
Sass官网
Sass 是一门高于 CSS 的元语言,它能
</p>
<p class="post-info desktop-only">
<span>
<a class="category-link" href="/categories/Sass/"><i class="fa fa-folder-open"></i> Sass</a>
</span>
<span><i class="fa fa-tag"></i> 2 </span>
</p>
</div>
</li>
</ul>
<div class="calendar-container" id="calendar">
<div class="calendar">
<h3>
{{posts.length}} contributions in the last year
</h3>
<div class="calendar-graph-container">
<div class="calendar-graph">
<svg width="676" height="104" @mouseout="mouseoverDate=null">
<g transform="translate(16, 20)">
<g v-for="week in calendar" :transform="week.transform">
<rect v-for="day in week.days" :x="day.x" :y="day.y" :fill="day.fill" @click="selectedDate=day.date" @mouseover="mouseoverDate=day.date" :class="{active:selectedDate===day.date}" data-count="{{day.posts.length}}" data-date="{{day.date}}" class="day" width="10" height="10"/>
</g>
<text v-for="month in monthLabels" :x="month.x" y="-5" class="month">{{month.text}}
</text>
<text text-anchor="start" class="wday" dx="-14" dy="8" style="display: none;">S
</text>
<text text-anchor="start" class="wday" dx="-14" dy="20">Mon</text>
<text text-anchor="start" class="wday" dx="-14" dy="32" style="display: none;">T
</text>
<text text-anchor="start" class="wday" dx="-14" dy="44">Wed</text>
<text text-anchor="start" class="wday" dx="-14" dy="57" style="display: none;">T
</text>
<text text-anchor="start" class="wday" dx="-14" dy="69">Fri</text>
<text text-anchor="start" class="wday" dx="-14" dy="81" style="display: none;">S
</text>
</g>
</svg>
<div class="svg-tip svg-tip-one-line" v-bind:style="{ top: svgtip.top, left: svgtip.left, display: svgtip.display}">
<strong>{{svgtip.text}}</strong> on
{{moment(mouseoverDate).format('MMM DD, YYYY')}}
</div>
</div>
<div class="calendar-footer clearfix">
<span>
<a href="#">Learn how we count contributions.</a>
</span>
<div class="calendar-legend">
<span>Less</span>
<ul class="legend">
<li style="background-color: #eee"></li>
<li style="background-color: #d6e685"></li>
<li style="background-color: #8cc665"></li>
<li style="background-color: #44a340"></li>
<li style="background-color: #1e6823"></li>
</ul>
<span>More</span>
</div>
</div>
</div>
</div>
<h3>Contribution activity</h3>
<div class="contribution-list">
<ul>
<li v-for="post in posts | filterBy selectedDate in 'date'">
<a href="{{post.url}}">{{post.title}}
</a>
<span>{{post.date}}</span>
</li>
</ul>
</div>
</div>
<script>
var posts = [{"date":"2019-01-30","title":"Markdown基本语法","url":"https://yj920.github.io/2019/01/30/markdown/"},{"date":"2019-02-01","title":"jQuery介绍与使用","url":"https://yj920.github.io/2019/02/01/jQuery介绍与使用/"},{"date":"2019-02-08","title":"Less入门","url":"https://yj920.github.io/2019/02/08/Less入门/"},{"date":"2019-02-17","title":"Sass的介绍与使用","url":"https://yj920.github.io/2019/02/17/Sass介绍与使用/"},{"date":"2019-02-21","title":"Sass基础语法","url":"https://yj920.github.io/2019/02/21/Sass基础语法/"},{"date":"2019-02-22","title":"Sass基本运算","url":"https://yj920.github.io/2019/02/22/Sass基本运算/"},{"date":"2019-02-23","title":"Sass控制语句","url":"https://yj920.github.io/2019/02/23/Sass控制语句/"},{"date":"2019-02-23","title":"Sass代码复用","url":"https://yj920.github.io/2019/02/23/Sass代码复用/"},{"date":"2019-03-01","title":"PHP基础语法","url":"https://yj920.github.io/2019/03/01/PHP基础语法/"}];
var today = moment().format('YYYY-MM-DD');
var oneYearAgo = moment(today).subtract(1, 'years');
posts = posts.filter(function(post) {
return new Date(post.date) > oneYearAgo;
});
var monthLabels = [];
var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var calendar = getCalendar(posts);
var dateRange = {
start: moment(oneYearAgo).format('MMM D, YYYY'),
end: moment().format('MMM D, YYYY')
}
var app = new Vue({
el: '#calendar',
data: {
posts: posts,
selectedDate: null,
calendar: calendar,
dateRange: dateRange,
mouseoverDate: null,
moment: moment,
monthLabels: monthLabels
},
created: function() {
this.selectedDate = 'none';
},
methods: {},
computed: {
svgtip: function() {
var date = this.mouseoverDate;
var display = date ? 'block' : 'none';
if (date) {
var coordinator = getIndexByDate(date);
var x = coordinator[0];
var y = coordinator[1];
var len = this.calendar[x].days[y].posts.length;
var text = len ? len + ' contributions' : 'No contributions';
var left = coordinator[0] * 12 - 37 + 'px';
coordinator[1] = coordinator[0] ? coordinator[1] : coordinator[1] + oneYearAgo.day();
var top = coordinator[1] * 12 + 12 - 32 + 'px';
}
return {
text: text,
left: left,
top: top,
display: display
}
}
}
});
function getCalendar(posts) {
// raw calendar
var maxCount = 0;
var tmr = new Date();
tmr.setDate(tmr.getDate() + 1);
var tmrStr = tmr.toISOString().slice(0, 10);
var date = new Date();
date.setYear(date.getFullYear() - 1); // start date is a year ago;
var calendar = [];
while (date.toISOString().slice(0, 10) !== tmrStr) {
var day = date.getDay();
if (day === 0 || calendar.length === 0) {
var x = calendar.length * 13;
calendar.push({
transform: 'translate(' + x + ',0)',
days: []
})
}
calendar[calendar.length - 1].days.push({
x: 14 - calendar.length,
y: day * 12,
date: date.toISOString().slice(0, 10),
posts: []
});
if (day === 0 && date.getDate() < 8) {
monthLabels.push({
x: 14 - calendar.length + x,
text: monthName[date.getMonth() - 1]
})
}
date.setDate(date.getDate() + 1);
}
// handle post info
posts.forEach(function(post) {
var x = getIndexByDate(post.date)[0];
var y = getIndexByDate(post.date)[1];
calendar[x].days[y].posts.push({
title: post.title,
url: post.url
});
var len = calendar[x].days[y].posts.length;
maxCount = Math.max(len, maxCount);
})
// handle fill color
calendar.forEach(function(week) {
week.days.forEach(function(day) {
day.fill = getColorByLength(day.posts.length, maxCount);
})
})
return calendar;
}
function getIndexByDate(date) {
date = moment(date);
var firstColumnLen = 7 - oneYearAgo.day();
var days = date.diff(oneYearAgo, 'days');
var x = days > firstColumnLen - 1 ? Math.ceil((days - firstColumnLen + 1) / 7) : 0;
var y = days > firstColumnLen - 1 ? date.day() : date.day() - oneYearAgo.day();
return [x, y];
}
function getColorByLength(len, max) {
var colors = ['#eee', '#d6e685', '#8cc665', '#44a340', '#1e6823'];
var colorsLen = colors.length - 1;
var color = len ? colors[0] : colors[1];
var interval = max / colorsLen;
if (max < colorsLen) {
color = colors[len];
} else {
color = colors[Math.ceil(len / interval)];
}
return color;
}
</script>
</div>
</div>
</div>
</div>
<div class="footer-wrapper container">
<footer class="footer clearfix">
<div class="clearfix">
<a href="https://yj920.github.io" class="footer-logo">
<i class="fa fa-github"></i>
</a>
<ul class="footer-social-link">
<li>© 2018 YingJun</li>
<li><a href="https://yj920.github.io">Home</a></li>
<li><a href="https://github.com/yj920">Github</a></li>
</ul>
</div>
</footer>
</div>
<script src="/js/main.js"></script>
</body>
</html>