jekyll-theme-mdui 0.5.2.4 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +21 -21
- data/README.md +88 -89
- data/_includes/analytics/google.html +7 -7
- data/_includes/comment/comment.html +2 -2
- data/_includes/comment/disqus.html +72 -75
- data/_includes/comment/gitment.html +16 -16
- data/_includes/comment/livere.html +42 -26
- data/_includes/comment/valine.html +37 -18
- data/_includes/component/customCssJS.html +7 -7
- data/_includes/component/nprogress.html +24 -24
- data/_includes/component/sw.html +6 -6
- data/_includes/component/totop.html +13 -13
- data/_includes/content/category_list.html +86 -86
- data/_includes/content/category_post_list.html +108 -100
- data/_includes/content/component/highlight.html +11 -11
- data/_includes/content/component/imgboxed.html +304 -304
- data/_includes/content/component/lastupdate.html +35 -35
- data/_includes/content/component/lazyload.html +6 -6
- data/_includes/content/component/page_tags.html +17 -17
- data/_includes/content/component/qrcode.html +26 -26
- data/_includes/content/component/readtime.html +27 -27
- data/_includes/content/component/sns_share.html +42 -42
- data/_includes/content/component/toc.html +84 -84
- data/_includes/content/editor.html +1058 -1058
- data/_includes/content/friends.html +23 -23
- data/_includes/content/love.html +123 -0
- data/_includes/content/page_content.html +92 -87
- data/_includes/content/page_content_no_toc.html +69 -64
- data/_includes/content/paginator_button.html +24 -24
- data/_includes/content/paginator_post_list.html +103 -95
- data/_includes/content/tags_list.html +99 -99
- data/_includes/footer/footer.html +30 -30
- data/_includes/head.html +90 -87
- data/_includes/header/header.html +174 -174
- data/_includes/meng/aplayer.html +100 -100
- data/_includes/meng/background.html +34 -34
- data/_includes/meng/card.html +13 -13
- data/_includes/meng/console.html +10 -10
- data/_includes/meng/cplayer.html +61 -61
- data/_includes/meng/cursor.html +8 -8
- data/_includes/meng/head_card.html +67 -67
- data/_includes/meng/live2d.html +60 -60
- data/_includes/meng/title.html +23 -23
- data/_includes/submission/baidu.html +13 -13
- data/_layouts/category_content.html +3 -3
- data/_layouts/category_list.html +3 -3
- data/_layouts/compress.html +9 -9
- data/_layouts/default.html +49 -49
- data/_layouts/editor.html +4 -4
- data/_layouts/friends.html +3 -3
- data/_layouts/home.html +20 -20
- data/_layouts/love.html +4 -0
- data/_layouts/page.html +12 -12
- data/_layouts/post.html +12 -12
- data/_layouts/tags.html +4 -4
- data/assets/css/global.css +181 -181
- metadata +7 -6
@@ -1,36 +1,36 @@
|
|
1
|
-
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
-
{% assign lang = site.data.lang.en-US %}
|
3
|
-
{% else %}
|
4
|
-
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
-
{% endif %}
|
6
|
-
<style>
|
7
|
-
.k-lastupdate{
|
8
|
-
color: #000000;
|
9
|
-
background: #ffffc0;
|
10
|
-
border-left: 5px solid #fff000;
|
11
|
-
cursor: default;
|
12
|
-
text-transform: none;
|
13
|
-
text-overflow: ellipsis;
|
14
|
-
}
|
15
|
-
.k-lastupdate:hover{
|
16
|
-
background: #ffffc0;
|
17
|
-
}
|
18
|
-
.k-lastupdate:active{
|
19
|
-
background: #ffffc0 !important;
|
20
|
-
}
|
21
|
-
</style>
|
22
|
-
|
23
|
-
<a class="mdui-btn mdui-btn-block k-lastupdate" id="k-difference" href="javascript:;"></a>
|
24
|
-
<script>
|
25
|
-
var date1=Date.parse($('.k-page-date').attr('date'));
|
26
|
-
var date2=new Date();
|
27
|
-
var date3=date2.getTime()-date1;
|
28
|
-
|
29
|
-
var days=Math.floor(date3/(24*3600*1000));
|
30
|
-
|
31
|
-
if (days>= 100){
|
32
|
-
$('#k-difference').html("{{lang.lastupdate.one}} "+ days +" {{lang.lastupdate.two}}");
|
33
|
-
}else{
|
34
|
-
$('#k-difference').hide();
|
35
|
-
}
|
1
|
+
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
+
{% assign lang = site.data.lang.en-US %}
|
3
|
+
{% else %}
|
4
|
+
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
+
{% endif %}
|
6
|
+
<style>
|
7
|
+
.k-lastupdate{
|
8
|
+
color: #000000;
|
9
|
+
background: #ffffc0;
|
10
|
+
border-left: 5px solid #fff000;
|
11
|
+
cursor: default;
|
12
|
+
text-transform: none;
|
13
|
+
text-overflow: ellipsis;
|
14
|
+
}
|
15
|
+
.k-lastupdate:hover{
|
16
|
+
background: #ffffc0;
|
17
|
+
}
|
18
|
+
.k-lastupdate:active{
|
19
|
+
background: #ffffc0 !important;
|
20
|
+
}
|
21
|
+
</style>
|
22
|
+
|
23
|
+
<a class="mdui-btn mdui-btn-block k-lastupdate" id="k-difference" href="javascript:;"></a>
|
24
|
+
<script>
|
25
|
+
var date1=Date.parse($('.k-page-date').attr('date'));
|
26
|
+
var date2=new Date();
|
27
|
+
var date3=date2.getTime()-date1;
|
28
|
+
|
29
|
+
var days=Math.floor(date3/(24*3600*1000));
|
30
|
+
|
31
|
+
if (days>= 100){
|
32
|
+
$('#k-difference').html("{{lang.lastupdate.one}} "+ days +" {{lang.lastupdate.two}}");
|
33
|
+
}else{
|
34
|
+
$('#k-difference').hide();
|
35
|
+
}
|
36
36
|
</script>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<script src="https://cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.min.js"></script>
|
2
|
-
<script>
|
3
|
-
$(function() {
|
4
|
-
$("div.lazy").lazyload({
|
5
|
-
});
|
6
|
-
});
|
1
|
+
<script src="https://cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.min.js"></script>
|
2
|
+
<script>
|
3
|
+
$(function() {
|
4
|
+
$("div.lazy").lazyload({
|
5
|
+
});
|
6
|
+
});
|
7
7
|
</script>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
-
{% assign lang = site.data.lang.en-US %}
|
3
|
-
{% else %}
|
4
|
-
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
-
{% endif %}
|
6
|
-
{% for ta in site.pages %}
|
7
|
-
{% if ta.layout == "tags" %}
|
8
|
-
{% assign tag = ta.url %}
|
9
|
-
{% endif %}
|
10
|
-
{% endfor %}
|
11
|
-
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.post.tags }}', delay: 100}" mdui-menu="{target: '#k-page-tag',align:'right',covered:false}"><i class="mdui-icon material-icons">bookmark</i></button>
|
12
|
-
<ul class="mdui-menu" id="k-page-tag">
|
13
|
-
{% for t in page.tags %}
|
14
|
-
<li class="mdui-menu-item">
|
15
|
-
<a id="tag_{{t}}" class="mdui-text-center" href="{{tag | prepend: site.baseurl }}" class="mdui-ripple">{{t}}</a>
|
16
|
-
</li>
|
17
|
-
{% endfor %}
|
1
|
+
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
+
{% assign lang = site.data.lang.en-US %}
|
3
|
+
{% else %}
|
4
|
+
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
+
{% endif %}
|
6
|
+
{% for ta in site.pages %}
|
7
|
+
{% if ta.layout == "tags" %}
|
8
|
+
{% assign tag = ta.url %}
|
9
|
+
{% endif %}
|
10
|
+
{% endfor %}
|
11
|
+
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.post.tags }}', delay: 100}" mdui-menu="{target: '#k-page-tag',align:'right',covered:false}"><i class="mdui-icon material-icons">bookmark</i></button>
|
12
|
+
<ul class="mdui-menu" id="k-page-tag">
|
13
|
+
{% for t in page.tags %}
|
14
|
+
<li class="mdui-menu-item">
|
15
|
+
<a id="tag_{{t}}" class="mdui-text-center" href="{{tag | prepend: site.baseurl }}" class="mdui-ripple">{{t}}</a>
|
16
|
+
</li>
|
17
|
+
{% endfor %}
|
18
18
|
</ul>
|
@@ -1,26 +1,26 @@
|
|
1
|
-
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
-
{% assign lang = site.data.lang.en-US %}
|
3
|
-
{% else %}
|
4
|
-
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
-
{% endif %}
|
6
|
-
<style>
|
7
|
-
#k-qrcode{
|
8
|
-
padding-bottom: 0px;
|
9
|
-
width: 215px;
|
10
|
-
}
|
11
|
-
</style>
|
12
|
-
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.post.qrcode }}', delay: 100}" mdui-menu="{target: '#k-qrcode',align:'right',covered:false}"><i class="mdui-icon material-icons">devices other</i></button>
|
13
|
-
<ul class="mdui-menu mdui-menu-cascade" id="k-qrcode">
|
14
|
-
<li class="mdui-menu-item">
|
15
|
-
<a class="mdui-text-center" href="javascript:;" class="mdui-ripple">{{lang.post.qrcodeContent}}</a>
|
16
|
-
</li>
|
17
|
-
{% if site.data.site.lang == 'zh-CN' %}
|
18
|
-
<li class="mdui-menu-item">
|
19
|
-
<img class="mdui-center" src="https://api.imjad.cn/qrcode/?size=210&&text={{page.url | absolute_url |url_encode}}" alt="">
|
20
|
-
</li>
|
21
|
-
{% else %}
|
22
|
-
<li class="mdui-menu-item">
|
23
|
-
<img class="mdui-center" src="https://chart.googleapis.com/chart?chs=210x210&cht=qr&chl={{page.url | absolute_url |url_encode}}" alt="">
|
24
|
-
</li>
|
25
|
-
{% endif %}
|
26
|
-
</ul>
|
1
|
+
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
+
{% assign lang = site.data.lang.en-US %}
|
3
|
+
{% else %}
|
4
|
+
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
+
{% endif %}
|
6
|
+
<style>
|
7
|
+
#k-qrcode{
|
8
|
+
padding-bottom: 0px;
|
9
|
+
width: 215px;
|
10
|
+
}
|
11
|
+
</style>
|
12
|
+
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.post.qrcode }}', delay: 100}" mdui-menu="{target: '#k-qrcode',align:'right',covered:false}"><i class="mdui-icon material-icons">devices other</i></button>
|
13
|
+
<ul class="mdui-menu mdui-menu-cascade" id="k-qrcode">
|
14
|
+
<li class="mdui-menu-item">
|
15
|
+
<a class="mdui-text-center" href="javascript:;" class="mdui-ripple">{{lang.post.qrcodeContent}}</a>
|
16
|
+
</li>
|
17
|
+
{% if site.data.site.lang == 'zh-CN' %}
|
18
|
+
<li class="mdui-menu-item">
|
19
|
+
<img class="mdui-center" src="https://api.imjad.cn/qrcode/?size=210&&text={{page.url | absolute_url |url_encode}}" alt="">
|
20
|
+
</li>
|
21
|
+
{% else %}
|
22
|
+
<li class="mdui-menu-item">
|
23
|
+
<img class="mdui-center" src="https://chart.googleapis.com/chart?chs=210x210&cht=qr&chl={{page.url | absolute_url |url_encode}}" alt="">
|
24
|
+
</li>
|
25
|
+
{% endif %}
|
26
|
+
</ul>
|
@@ -1,27 +1,27 @@
|
|
1
|
-
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
-
{% assign lang = site.data.lang.en-US %}
|
3
|
-
{% else %}
|
4
|
-
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
-
{% endif %}
|
6
|
-
<style>
|
7
|
-
.k-readtime{
|
8
|
-
color: #000000;
|
9
|
-
background: #c0ffee;
|
10
|
-
border-left: 5px solid #00ffd8;
|
11
|
-
cursor: default;
|
12
|
-
text-transform: none;
|
13
|
-
text-overflow: ellipsis;
|
14
|
-
}
|
15
|
-
.k-readtime:hover{
|
16
|
-
background: #c0ffee;
|
17
|
-
}
|
18
|
-
.k-readtime:active{
|
19
|
-
background: #c0ffee !important;
|
20
|
-
}
|
21
|
-
</style>
|
22
|
-
{% assign words = content | strip_html | strip_newlines | size %}
|
23
|
-
{% if words < 360 %}
|
24
|
-
<a class="mdui-btn mdui-btn-block k-readtime" href="javascript:;">{{lang.readtime.one}} 1 {{lang.readtime.two}}</a>
|
25
|
-
{% else %}
|
26
|
-
<a class="mdui-btn mdui-btn-block k-readtime" href="javascript:;">{{lang.readtime.one}} {{ content | strip_html | strip_newlines | size | divided_by:360 | round}} {{lang.readtime.two}}</a>
|
27
|
-
{% endif %}
|
1
|
+
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
+
{% assign lang = site.data.lang.en-US %}
|
3
|
+
{% else %}
|
4
|
+
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
+
{% endif %}
|
6
|
+
<style>
|
7
|
+
.k-readtime{
|
8
|
+
color: #000000;
|
9
|
+
background: #c0ffee;
|
10
|
+
border-left: 5px solid #00ffd8;
|
11
|
+
cursor: default;
|
12
|
+
text-transform: none;
|
13
|
+
text-overflow: ellipsis;
|
14
|
+
}
|
15
|
+
.k-readtime:hover{
|
16
|
+
background: #c0ffee;
|
17
|
+
}
|
18
|
+
.k-readtime:active{
|
19
|
+
background: #c0ffee !important;
|
20
|
+
}
|
21
|
+
</style>
|
22
|
+
{% assign words = content | strip_html | strip_newlines | size %}
|
23
|
+
{% if words < 360 %}
|
24
|
+
<a class="mdui-btn mdui-btn-block k-readtime" href="javascript:;">{{lang.readtime.one}} 1 {{lang.readtime.two}}</a>
|
25
|
+
{% else %}
|
26
|
+
<a class="mdui-btn mdui-btn-block k-readtime" href="javascript:;">{{lang.readtime.one}} {{ content | strip_html | strip_newlines | size | divided_by:360 | round}} {{lang.readtime.two}}</a>
|
27
|
+
{% endif %}
|
@@ -1,43 +1,43 @@
|
|
1
|
-
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
-
{% assign lang = site.data.lang.en-US %}
|
3
|
-
{% else %}
|
4
|
-
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
-
{% endif %}
|
6
|
-
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.share.share }}', delay: 100}" mdui-menu="{target: '#k-sns_share',align:'right',covered:false}"><i class="mdui-icon material-icons"></i></button>
|
7
|
-
<ul class="mdui-menu" id="k-sns_share">
|
8
|
-
{% if site.data.site.sns_share.weibo == true %}
|
9
|
-
<li class="mdui-menu-item">
|
10
|
-
<a href="http://service.weibo.com/share/share.php?appkey=&title={{page.title}}&url={{page.url | absolute_url }}&pic=&searchPic=false&style=simple" target="_blank" class="mdui-ripple">{{lang.share.toWeibo }}</a>
|
11
|
-
</li>
|
12
|
-
{% endif %}
|
13
|
-
{% if site.data.site.sns_share.twitter == true %}
|
14
|
-
<li class="mdui-menu-item">
|
15
|
-
<a href="https://twitter.com/intent/tweet?text={{page.title}}&url={{page.url | absolute_url }}&via={{site.author}}" target="_blank" class="mdui-ripple">{{lang.share.toTwitter }}</a>
|
16
|
-
</li>
|
17
|
-
{% endif %}
|
18
|
-
{% if site.data.site.sns_share.facebook == true %}
|
19
|
-
<li class="mdui-menu-item">
|
20
|
-
<a href="https://www.facebook.com/sharer/sharer.php?u={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toFacebook }}</a>
|
21
|
-
</li>
|
22
|
-
{% endif %}
|
23
|
-
{% if site.data.site.sns_share.googleplus == true %}
|
24
|
-
<li class="mdui-menu-item">
|
25
|
-
<a href="https://plus.google.com/share?url={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toGoogleplus }}</a>
|
26
|
-
</li>
|
27
|
-
{% endif %}
|
28
|
-
{% if site.data.site.sns_share.linkedin == true %}
|
29
|
-
<li class="mdui-menu-item">
|
30
|
-
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{page.url | absolute_url }}&title={{page.title}}" target="_blank" class="mdui-ripple">{{lang.share.toLinkedin }}</a>
|
31
|
-
</li>
|
32
|
-
{% endif %}
|
33
|
-
{% if site.data.site.sns_share.qq == true %}
|
34
|
-
<li class="mdui-menu-item">
|
35
|
-
<a href="http://connect.qq.com/widget/shareqq/index.html?site={{site.title}}&title={{page.title}}&summary={{ page.excerpt | strip_html}}&pics={{site.data.site.head.favicon | absolute_url }}&url={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toQq }}</a>
|
36
|
-
</li>
|
37
|
-
{% endif %}
|
38
|
-
{% if site.data.site.sns_share.telegram == true %}
|
39
|
-
<li class="mdui-menu-item">
|
40
|
-
<a href="javascript:;" target="_blank" class="mdui-ripple">{{lang.share.toTelegram }}</a>
|
41
|
-
</li>
|
42
|
-
{% endif %}
|
1
|
+
{% if site.data.site.lang == null or site.data.site.lang == "" %}
|
2
|
+
{% assign lang = site.data.lang.en-US %}
|
3
|
+
{% else %}
|
4
|
+
{% assign lang = site.data.lang[site.data.site.lang] %}
|
5
|
+
{% endif %}
|
6
|
+
<button class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '{{lang.share.share }}', delay: 100}" mdui-menu="{target: '#k-sns_share',align:'right',covered:false}"><i class="mdui-icon material-icons"></i></button>
|
7
|
+
<ul class="mdui-menu" id="k-sns_share">
|
8
|
+
{% if site.data.site.sns_share.weibo == true %}
|
9
|
+
<li class="mdui-menu-item">
|
10
|
+
<a href="http://service.weibo.com/share/share.php?appkey=&title={{page.title}}&url={{page.url | absolute_url }}&pic=&searchPic=false&style=simple" target="_blank" class="mdui-ripple">{{lang.share.toWeibo }}</a>
|
11
|
+
</li>
|
12
|
+
{% endif %}
|
13
|
+
{% if site.data.site.sns_share.twitter == true %}
|
14
|
+
<li class="mdui-menu-item">
|
15
|
+
<a href="https://twitter.com/intent/tweet?text={{page.title}}&url={{page.url | absolute_url }}&via={{site.author}}" target="_blank" class="mdui-ripple">{{lang.share.toTwitter }}</a>
|
16
|
+
</li>
|
17
|
+
{% endif %}
|
18
|
+
{% if site.data.site.sns_share.facebook == true %}
|
19
|
+
<li class="mdui-menu-item">
|
20
|
+
<a href="https://www.facebook.com/sharer/sharer.php?u={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toFacebook }}</a>
|
21
|
+
</li>
|
22
|
+
{% endif %}
|
23
|
+
{% if site.data.site.sns_share.googleplus == true %}
|
24
|
+
<li class="mdui-menu-item">
|
25
|
+
<a href="https://plus.google.com/share?url={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toGoogleplus }}</a>
|
26
|
+
</li>
|
27
|
+
{% endif %}
|
28
|
+
{% if site.data.site.sns_share.linkedin == true %}
|
29
|
+
<li class="mdui-menu-item">
|
30
|
+
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{page.url | absolute_url }}&title={{page.title}}" target="_blank" class="mdui-ripple">{{lang.share.toLinkedin }}</a>
|
31
|
+
</li>
|
32
|
+
{% endif %}
|
33
|
+
{% if site.data.site.sns_share.qq == true %}
|
34
|
+
<li class="mdui-menu-item">
|
35
|
+
<a href="http://connect.qq.com/widget/shareqq/index.html?site={{site.title}}&title={{page.title}}&summary={{ page.excerpt | strip_html}}&pics={{site.data.site.head.favicon | absolute_url }}&url={{page.url | absolute_url }}" target="_blank" class="mdui-ripple">{{lang.share.toQq }}</a>
|
36
|
+
</li>
|
37
|
+
{% endif %}
|
38
|
+
{% if site.data.site.sns_share.telegram == true %}
|
39
|
+
<li class="mdui-menu-item">
|
40
|
+
<a href="javascript:;" target="_blank" class="mdui-ripple">{{lang.share.toTelegram }}</a>
|
41
|
+
</li>
|
42
|
+
{% endif %}
|
43
43
|
</ul>
|
@@ -1,84 +1,84 @@
|
|
1
|
-
<style>
|
2
|
-
#k-toc-card{
|
3
|
-
background-color: transparent;
|
4
|
-
width: 260px;
|
5
|
-
list-style: none;
|
6
|
-
padding: 0;
|
7
|
-
}
|
8
|
-
#k-toc-card ul{
|
9
|
-
list-style: none;
|
10
|
-
padding: 0px;
|
11
|
-
}
|
12
|
-
.pin-top {
|
13
|
-
margin-top: 245px;
|
14
|
-
}
|
15
|
-
.pinned {
|
16
|
-
position: fixed;
|
17
|
-
}
|
18
|
-
#k-toc-card li{
|
19
|
-
max-width: 300px;
|
20
|
-
min-width: 200px;
|
21
|
-
}
|
22
|
-
#k-toc-card a{
|
23
|
-
text-align: left;
|
24
|
-
color: black;
|
25
|
-
display: block;
|
26
|
-
width: 100%;
|
27
|
-
text-decoration: none;
|
28
|
-
position: relative;
|
29
|
-
min-width: 88px;
|
30
|
-
height: 36px;
|
31
|
-
box-sizing: border-box;
|
32
|
-
padding: 0 16px;
|
33
|
-
margin: 0;
|
34
|
-
overflow: hidden;
|
35
|
-
font-size: 14px;
|
36
|
-
font-weight: 500;
|
37
|
-
line-height: 36px;
|
38
|
-
text-transform: uppercase;
|
39
|
-
letter-spacing: .04em;
|
40
|
-
white-space: nowrap;
|
41
|
-
vertical-align: middle;
|
42
|
-
-ms-touch-action: manipulation;
|
43
|
-
touch-action: manipulation;
|
44
|
-
zoom: 1;
|
45
|
-
-webkit-user-select: none;
|
46
|
-
-moz-user-select: none;
|
47
|
-
-ms-user-select: none;
|
48
|
-
user-select: none;
|
49
|
-
background: transparent;
|
50
|
-
border: none;
|
51
|
-
border-radius: 2px;
|
52
|
-
outline: none;
|
53
|
-
transition: all .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s cubic-bezier(.4, 0, 1, 1);
|
54
|
-
will-change: box-shadow;
|
55
|
-
-webkit-user-drag: none;
|
56
|
-
}
|
57
|
-
#k-toc-card a:hover {
|
58
|
-
background-color: rgba(0, 0, 0, .1);
|
59
|
-
}
|
60
|
-
#toc ul .toc-active {
|
61
|
-
border-left: 3px solid #448aff;
|
62
|
-
background-color: rgba(0, 0, 0, .2);
|
63
|
-
}
|
64
|
-
</style>
|
65
|
-
<div id="k-toc-card" class="mdui-card mdui-shadow-0">
|
66
|
-
<div id="toc"></div>
|
67
|
-
</div>
|
68
|
-
<script>
|
69
|
-
Materialize={};Materialize.guid=(function(){function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return function(){return s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4()}})();(function($){$.fn.pushpin=function(options){var defaults={top:0,bottom:Infinity,offset:0};if(options==="remove"){this.each(function(){if(id=$(this).data("pushpin-id")){$(window).off("scroll."+id);$(this).removeData("pushpin-id").removeClass("pin-top pinned pin-bottom").removeAttr("style")}});return false}options=$.extend(defaults,options);$index=0;return this.each(function(){var $uniqueId=Materialize.guid(),$this=$(this),$original_offset=$(this).offset().top;function removePinClasses(object){object.removeClass("pin-top");object.removeClass("pinned");object.removeClass("pin-bottom")}function updateElements(objects,scrolled){objects.each(function(){if(options.top<=scrolled&&options.bottom>=scrolled&&!$(this).hasClass("pinned")){removePinClasses($(this));$(this).css("top",options.offset);$(this).addClass("pinned")}if(scrolled<options.top&&!$(this).hasClass("pin-top")){removePinClasses($(this));$(this).css("top",0);$(this).addClass("pin-top")}if(scrolled>options.bottom&&!$(this).hasClass("pin-bottom")){removePinClasses($(this));$(this).addClass("pin-bottom");$(this).css("top",options.bottom-$original_offset)}})}$(this).data("pushpin-id",$uniqueId);updateElements($this,$(window).scrollTop());$(window).on("scroll."+$uniqueId,function(){var $scrolled=$(window).scrollTop()+options.offset;updateElements($this,$scrolled)})})}}(jQuery));
|
70
|
-
!function(a){a.fn.smoothScroller=function(b){b=a.extend({},a.fn.smoothScroller.defaults,b);var c=a(this);return a(b.scrollEl).animate({scrollTop:c.offset().top-a(b.scrollEl).offset().top-b.offset},b.speed,b.ease,function(){var a=c.attr("id");a.length&&(history.pushState?history.pushState(null,null,"#"+a):document.location.hash=a),c.trigger("smoothScrollerComplete")}),this},a.fn.smoothScroller.defaults={speed:400,ease:"swing",scrollEl:"body,html",offset:0},a("body").on("click","[data-smoothscroller]",function(b){b.preventDefault();var c=a(this).attr("href");0===c.indexOf("#")&&a(c).smoothScroller()})}(jQuery),function(a){var b={};a.fn.toc=function(b){var c,d=this,e=a.extend({},jQuery.fn.toc.defaults,b),f=a(e.container),g=a(e.selectors,f),h=[],i=e.activeClass,j=function(b,c){if(e.smoothScrolling&&"function"==typeof e.smoothScrolling){b.preventDefault();var f=a(b.target).attr("href");e.smoothScrolling(f,e,c)}a("li",d).removeClass(i),a(b.target).parent().addClass(i)},k=function(){c&&clearTimeout(c),c=setTimeout(function(){for(var b,c=a(window).scrollTop(),f=Number.MAX_VALUE,g=0,j=0,k=h.length;k>j;j++){var l=Math.abs(h[j]-c);f>l&&(g=j,f=l)}a("li",d).removeClass(i),b=a("li:eq("+g+")",d).addClass(i),e.onHighlight(b)},50)};return e.highlightOnScroll&&(a(window).bind("scroll",k),k()),this.each(function(){var b=a(this),c=a(e.listType);g.each(function(d,f){var g=a(f);h.push(g.offset().top-e.highlightOffset);var i=e.anchorName(d,f,e.prefix);if(f.id!==i){a("<span/>").attr("id",i).insertBefore(g)}var l=a("<a/>").text(e.headerText(d,f,g)).attr("href","#"+i).bind("click",function(c){a(window).unbind("scroll",k),j(c,function(){a(window).bind("scroll",k)}),b.trigger("selected",a(this).attr("href"))}),m=a("<li/>").addClass(e.itemClass(d,f,g,e.prefix)).append(l);c.append(m)}),b.html(c)})},jQuery.fn.toc.defaults={container:"body",listType:"<ul/>",selectors:"h1,h2,h3",smoothScrolling:function(b,c,d){a(b).smoothScroller({offset:c.scrollToOffset}).on("smoothScrollerComplete",function(){d()})},scrollToOffset:0,prefix:"toc",activeClass:"toc-active",onHighlight:function(){},highlightOnScroll:!0,highlightOffset:100,anchorName:function(c,d,e){if(d.id.length)return d.id;var f=a(d).text().replace(/[^a-z0-9]/gi," ").replace(/\s+/g,"-").toLowerCase();if(b[f]){for(var g=2;b[f+g];)g++;f=f+"-"+g}return b[f]=!0,e+"-"+f},headerText:function(a,b,c){return c.text()},itemClass:function(a,b,c,d){return d+"-"+c[0].tagName.toLowerCase()}}}(jQuery);
|
71
|
-
</script>
|
72
|
-
<script>
|
73
|
-
$('#toc').toc({
|
74
|
-
'selectors': 'h2',
|
75
|
-
'prefix': 'toc',
|
76
|
-
'highlightOffset': 64
|
77
|
-
});
|
78
|
-
var tocTop = $('.mdui-card-header').offset().top;
|
79
|
-
$('#k-toc-card').pushpin({
|
80
|
-
top: tocTop,
|
81
|
-
bottom: 99999,
|
82
|
-
offset: 200
|
83
|
-
});
|
84
|
-
</script>
|
1
|
+
<style>
|
2
|
+
#k-toc-card{
|
3
|
+
background-color: transparent;
|
4
|
+
width: 260px;
|
5
|
+
list-style: none;
|
6
|
+
padding: 0;
|
7
|
+
}
|
8
|
+
#k-toc-card ul{
|
9
|
+
list-style: none;
|
10
|
+
padding: 0px;
|
11
|
+
}
|
12
|
+
.pin-top {
|
13
|
+
margin-top: 245px;
|
14
|
+
}
|
15
|
+
.pinned {
|
16
|
+
position: fixed;
|
17
|
+
}
|
18
|
+
#k-toc-card li{
|
19
|
+
max-width: 300px;
|
20
|
+
min-width: 200px;
|
21
|
+
}
|
22
|
+
#k-toc-card a{
|
23
|
+
text-align: left;
|
24
|
+
color: black;
|
25
|
+
display: block;
|
26
|
+
width: 100%;
|
27
|
+
text-decoration: none;
|
28
|
+
position: relative;
|
29
|
+
min-width: 88px;
|
30
|
+
height: 36px;
|
31
|
+
box-sizing: border-box;
|
32
|
+
padding: 0 16px;
|
33
|
+
margin: 0;
|
34
|
+
overflow: hidden;
|
35
|
+
font-size: 14px;
|
36
|
+
font-weight: 500;
|
37
|
+
line-height: 36px;
|
38
|
+
text-transform: uppercase;
|
39
|
+
letter-spacing: .04em;
|
40
|
+
white-space: nowrap;
|
41
|
+
vertical-align: middle;
|
42
|
+
-ms-touch-action: manipulation;
|
43
|
+
touch-action: manipulation;
|
44
|
+
zoom: 1;
|
45
|
+
-webkit-user-select: none;
|
46
|
+
-moz-user-select: none;
|
47
|
+
-ms-user-select: none;
|
48
|
+
user-select: none;
|
49
|
+
background: transparent;
|
50
|
+
border: none;
|
51
|
+
border-radius: 2px;
|
52
|
+
outline: none;
|
53
|
+
transition: all .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s cubic-bezier(.4, 0, 1, 1);
|
54
|
+
will-change: box-shadow;
|
55
|
+
-webkit-user-drag: none;
|
56
|
+
}
|
57
|
+
#k-toc-card a:hover {
|
58
|
+
background-color: rgba(0, 0, 0, .1);
|
59
|
+
}
|
60
|
+
#toc ul .toc-active {
|
61
|
+
border-left: 3px solid #448aff;
|
62
|
+
background-color: rgba(0, 0, 0, .2);
|
63
|
+
}
|
64
|
+
</style>
|
65
|
+
<div id="k-toc-card" class="mdui-card mdui-shadow-0">
|
66
|
+
<div id="toc"></div>
|
67
|
+
</div>
|
68
|
+
<script>
|
69
|
+
Materialize={};Materialize.guid=(function(){function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return function(){return s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4()}})();(function($){$.fn.pushpin=function(options){var defaults={top:0,bottom:Infinity,offset:0};if(options==="remove"){this.each(function(){if(id=$(this).data("pushpin-id")){$(window).off("scroll."+id);$(this).removeData("pushpin-id").removeClass("pin-top pinned pin-bottom").removeAttr("style")}});return false}options=$.extend(defaults,options);$index=0;return this.each(function(){var $uniqueId=Materialize.guid(),$this=$(this),$original_offset=$(this).offset().top;function removePinClasses(object){object.removeClass("pin-top");object.removeClass("pinned");object.removeClass("pin-bottom")}function updateElements(objects,scrolled){objects.each(function(){if(options.top<=scrolled&&options.bottom>=scrolled&&!$(this).hasClass("pinned")){removePinClasses($(this));$(this).css("top",options.offset);$(this).addClass("pinned")}if(scrolled<options.top&&!$(this).hasClass("pin-top")){removePinClasses($(this));$(this).css("top",0);$(this).addClass("pin-top")}if(scrolled>options.bottom&&!$(this).hasClass("pin-bottom")){removePinClasses($(this));$(this).addClass("pin-bottom");$(this).css("top",options.bottom-$original_offset)}})}$(this).data("pushpin-id",$uniqueId);updateElements($this,$(window).scrollTop());$(window).on("scroll."+$uniqueId,function(){var $scrolled=$(window).scrollTop()+options.offset;updateElements($this,$scrolled)})})}}(jQuery));
|
70
|
+
!function(a){a.fn.smoothScroller=function(b){b=a.extend({},a.fn.smoothScroller.defaults,b);var c=a(this);return a(b.scrollEl).animate({scrollTop:c.offset().top-a(b.scrollEl).offset().top-b.offset},b.speed,b.ease,function(){var a=c.attr("id");a.length&&(history.pushState?history.pushState(null,null,"#"+a):document.location.hash=a),c.trigger("smoothScrollerComplete")}),this},a.fn.smoothScroller.defaults={speed:400,ease:"swing",scrollEl:"body,html",offset:0},a("body").on("click","[data-smoothscroller]",function(b){b.preventDefault();var c=a(this).attr("href");0===c.indexOf("#")&&a(c).smoothScroller()})}(jQuery),function(a){var b={};a.fn.toc=function(b){var c,d=this,e=a.extend({},jQuery.fn.toc.defaults,b),f=a(e.container),g=a(e.selectors,f),h=[],i=e.activeClass,j=function(b,c){if(e.smoothScrolling&&"function"==typeof e.smoothScrolling){b.preventDefault();var f=a(b.target).attr("href");e.smoothScrolling(f,e,c)}a("li",d).removeClass(i),a(b.target).parent().addClass(i)},k=function(){c&&clearTimeout(c),c=setTimeout(function(){for(var b,c=a(window).scrollTop(),f=Number.MAX_VALUE,g=0,j=0,k=h.length;k>j;j++){var l=Math.abs(h[j]-c);f>l&&(g=j,f=l)}a("li",d).removeClass(i),b=a("li:eq("+g+")",d).addClass(i),e.onHighlight(b)},50)};return e.highlightOnScroll&&(a(window).bind("scroll",k),k()),this.each(function(){var b=a(this),c=a(e.listType);g.each(function(d,f){var g=a(f);h.push(g.offset().top-e.highlightOffset);var i=e.anchorName(d,f,e.prefix);if(f.id!==i){a("<span/>").attr("id",i).insertBefore(g)}var l=a("<a/>").text(e.headerText(d,f,g)).attr("href","#"+i).bind("click",function(c){a(window).unbind("scroll",k),j(c,function(){a(window).bind("scroll",k)}),b.trigger("selected",a(this).attr("href"))}),m=a("<li/>").addClass(e.itemClass(d,f,g,e.prefix)).append(l);c.append(m)}),b.html(c)})},jQuery.fn.toc.defaults={container:"body",listType:"<ul/>",selectors:"h1,h2,h3",smoothScrolling:function(b,c,d){a(b).smoothScroller({offset:c.scrollToOffset}).on("smoothScrollerComplete",function(){d()})},scrollToOffset:0,prefix:"toc",activeClass:"toc-active",onHighlight:function(){},highlightOnScroll:!0,highlightOffset:100,anchorName:function(c,d,e){if(d.id.length)return d.id;var f=a(d).text().replace(/[^a-z0-9]/gi," ").replace(/\s+/g,"-").toLowerCase();if(b[f]){for(var g=2;b[f+g];)g++;f=f+"-"+g}return b[f]=!0,e+"-"+f},headerText:function(a,b,c){return c.text()},itemClass:function(a,b,c,d){return d+"-"+c[0].tagName.toLowerCase()}}}(jQuery);
|
71
|
+
</script>
|
72
|
+
<script>
|
73
|
+
$('#toc').toc({
|
74
|
+
'selectors': 'h2',
|
75
|
+
'prefix': 'toc',
|
76
|
+
'highlightOffset': 64
|
77
|
+
});
|
78
|
+
var tocTop = $('.mdui-card-header').offset().top;
|
79
|
+
$('#k-toc-card').pushpin({
|
80
|
+
top: tocTop,
|
81
|
+
bottom: 99999,
|
82
|
+
offset: 200
|
83
|
+
});
|
84
|
+
</script>
|