jekyll-theme-chirpy 5.0.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/_config.yml +38 -13
  4. data/_data/assets/cross_origin.yml +62 -0
  5. data/_data/assets/self_host.yml +51 -0
  6. data/_data/authors.yml +17 -0
  7. data/_data/locales/en.yml +12 -20
  8. data/_data/locales/es-ES.yml +79 -0
  9. data/_data/locales/fr-FR.yml +79 -0
  10. data/_data/locales/id-ID.yml +4 -16
  11. data/_data/locales/ko-KR.yml +4 -16
  12. data/_data/locales/my-MM.yml +79 -0
  13. data/_data/locales/pt-BR.yml +79 -0
  14. data/_data/locales/ru-RU.yml +79 -0
  15. data/_data/locales/uk-UA.yml +79 -0
  16. data/_data/locales/vi-VN.yml +77 -0
  17. data/_data/locales/zh-CN.yml +4 -16
  18. data/_data/share.yml +1 -1
  19. data/_includes/assets-origin.html +12 -0
  20. data/_includes/comments/giscus.html +56 -0
  21. data/_includes/comments/utterances.html +2 -2
  22. data/_includes/datetime.html +21 -0
  23. data/_includes/footer.html +5 -6
  24. data/_includes/head.html +62 -21
  25. data/_includes/js-selector.html +47 -11
  26. data/_includes/jsdelivr-combine.html +32 -0
  27. data/_includes/mermaid.html +3 -3
  28. data/_includes/mode-toggle.html +4 -3
  29. data/_includes/post-nav.html +4 -4
  30. data/_includes/post-paginator.html +2 -2
  31. data/_includes/post-sharing.html +3 -2
  32. data/_includes/refactor-content.html +62 -10
  33. data/_includes/related-posts.html +1 -4
  34. data/_includes/search-loader.html +1 -1
  35. data/_includes/sidebar.html +8 -8
  36. data/_includes/toc.html +1 -1
  37. data/_includes/topbar.html +3 -4
  38. data/_layouts/archives.html +15 -6
  39. data/_layouts/categories.html +25 -4
  40. data/_layouts/category.html +1 -3
  41. data/_layouts/default.html +23 -8
  42. data/_layouts/home.html +4 -8
  43. data/_layouts/page.html +11 -11
  44. data/_layouts/post.html +52 -44
  45. data/_layouts/tag.html +1 -3
  46. data/_layouts/tags.html +3 -1
  47. data/_sass/addon/commons.scss +241 -305
  48. data/_sass/addon/module.scss +33 -17
  49. data/_sass/addon/syntax.scss +38 -25
  50. data/_sass/addon/variables.scss +9 -9
  51. data/_sass/colors/dark-syntax.scss +1 -0
  52. data/_sass/colors/dark-typography.scss +10 -1
  53. data/_sass/colors/light-syntax.scss +6 -1
  54. data/_sass/colors/light-typography.scss +14 -1
  55. data/_sass/jekyll-theme-chirpy.scss +1 -1
  56. data/_sass/layout/post.scss +4 -7
  57. data/_tabs/about.md +2 -2
  58. data/assets/404.html +0 -17
  59. data/assets/js/data/search.json +6 -5
  60. data/assets/js/data/swcache.js +11 -20
  61. data/assets/js/dist/categories.min.js +2 -2
  62. data/assets/js/dist/commons.min.js +2 -2
  63. data/assets/js/dist/home.min.js +2 -2
  64. data/assets/js/dist/misc.min.js +6 -0
  65. data/assets/js/dist/page.min.js +2 -2
  66. data/assets/js/dist/post.min.js +2 -2
  67. data/assets/js/dist/pvreport.min.js +2 -2
  68. data/assets/js/pwa/app.js +55 -4
  69. data/assets/js/pwa/sw.js +42 -40
  70. data/assets/js/pwa/unregister.js +12 -0
  71. metadata +20 -7
  72. data/_includes/css-selector.html +0 -15
  73. data/_includes/no-zero-date.html +0 -13
  74. data/_includes/timeago.html +0 -26
@@ -13,19 +13,21 @@
13
13
  %section {
14
14
  #core-wrapper & {
15
15
  margin-top: 2.5rem;
16
- margin-bottom: 2rem;
16
+ margin-bottom: 1.25rem;
17
+
18
+ &:focus {
19
+ outline: none; /* avoid outline in Safari */
20
+ }
17
21
  }
18
22
  }
19
23
 
20
24
  %anchor {
21
25
  .anchor {
22
- font-size: 1rem;
23
- margin-left: 0.5rem;
26
+ font-size: 80%;
24
27
  }
25
28
 
26
29
  @media (hover: hover) {
27
30
  .anchor {
28
- border-bottom: none !important;
29
31
  visibility: hidden;
30
32
  opacity: 0;
31
33
  transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
@@ -41,15 +43,6 @@
41
43
  }
42
44
  }
43
45
 
44
- %anchor-relative {
45
- @extend %anchor;
46
-
47
- .anchor {
48
- position: relative;
49
- bottom: 1px;
50
- }
51
- }
52
-
53
46
  %tag-hover {
54
47
  background: var(--tag-hover);
55
48
  transition: background 0.35s ease-in-out;
@@ -95,10 +88,15 @@
95
88
  font-style: normal;
96
89
  }
97
90
 
98
- /* ---------- scss mixin --------- */
99
-
100
- @mixin no-text-decoration {
101
- text-decoration: none;
91
+ %img-caption {
92
+ + em {
93
+ display: block;
94
+ text-align: center;
95
+ font-style: normal;
96
+ font-size: 80%;
97
+ padding: 0;
98
+ color: #6d6c6c;
99
+ }
102
100
  }
103
101
 
104
102
  %sidebar-links {
@@ -106,6 +104,12 @@
106
104
  user-select: none;
107
105
  }
108
106
 
107
+ /* ---------- scss mixin --------- */
108
+
109
+ @mixin no-text-decoration {
110
+ text-decoration: none;
111
+ }
112
+
109
113
  @mixin ml-mr($value) {
110
114
  margin-left: $value;
111
115
  margin-right: $value;
@@ -133,3 +137,15 @@
133
137
  -ms-transform: translateX(-50%);
134
138
  transform: translateX(-50%);
135
139
  }
140
+
141
+ @mixin prompt($type, $fw-icon, $icon-weight: 900) {
142
+ &.prompt-#{$type} {
143
+ background-color: var(--prompt-#{$type}-bg);
144
+
145
+ &::before {
146
+ content: $fw-icon;
147
+ color: var(--prompt-#{$type}-icon-color);
148
+ font-weight: $icon-weight;
149
+ }
150
+ }
151
+ }
@@ -5,23 +5,27 @@
5
5
  @import "colors/light-syntax";
6
6
  @import "colors/dark-syntax";
7
7
 
8
- html:not([mode]),
9
- html[mode=light] {
10
- @include light-syntax;
11
- }
12
-
13
- html[mode=dark] {
14
- @include dark-syntax;
15
- }
8
+ html {
9
+ @media (prefers-color-scheme: light) {
10
+ &:not([data-mode]),
11
+ &[data-mode=light] {
12
+ @include light-syntax;
13
+ }
16
14
 
17
- @media (prefers-color-scheme: dark) {
18
- html:not([mode]),
19
- html[mode=dark] {
20
- @include dark-syntax;
15
+ &[data-mode=dark] {
16
+ @include dark-syntax;
17
+ }
21
18
  }
22
19
 
23
- html[mode=light] {
24
- @include light-syntax;
20
+ @media (prefers-color-scheme: dark) {
21
+ &:not([data-mode]),
22
+ &[data-mode=dark] {
23
+ @include dark-syntax;
24
+ }
25
+
26
+ &[data-mode=light] {
27
+ @include light-syntax;
28
+ }
25
29
  }
26
30
  }
27
31
 
@@ -95,7 +99,7 @@ $code-radius: 6px;
95
99
  user-select: none;
96
100
  }
97
101
 
98
- } //.highlight
102
+ } /* .highlight */
99
103
 
100
104
  code {
101
105
  -webkit-hyphens: none;
@@ -110,8 +114,15 @@ code {
110
114
  background-color: var(--inline-code-bg);
111
115
  }
112
116
 
117
+ &.filepath {
118
+ background-color: inherit;
119
+ color: var(--filepath-text-color);
120
+ font-weight: 600;
121
+ padding: 0;
122
+ }
123
+
113
124
  a > &.highlighter-rouge {
114
- padding-bottom: 0; // show link's underlinke
125
+ padding-bottom: 0; /* show link's underlinke */
115
126
  color: inherit;
116
127
  }
117
128
 
@@ -119,7 +130,7 @@ code {
119
130
  border-bottom: none;
120
131
  }
121
132
 
122
- blockquote &.highlighter-rouge {
133
+ blockquote & {
123
134
  color: inherit;
124
135
  }
125
136
 
@@ -131,8 +142,10 @@ code {
131
142
  td.rouge-code {
132
143
  @extend %code-snippet-padding;
133
144
 
134
- // Prevent some browser extends from
135
- // changing the URL string of code block.
145
+ /*
146
+ Prevent some browser extends from
147
+ changing the URL string of code block.
148
+ */
136
149
  a {
137
150
  color: inherit !important;
138
151
  border-bottom: none !important;
@@ -186,9 +199,9 @@ div {
186
199
  ($dot-size + $dot-margin) * 2 0 0 var(--code-header-muted-color);
187
200
  }
188
201
 
189
- // the label block
202
+ /* the label block */
190
203
  span {
191
- // label icon
204
+ /* label icon */
192
205
  i {
193
206
  font-size: 1rem;
194
207
  margin-right: 0.4rem;
@@ -201,19 +214,19 @@ div {
201
214
 
202
215
  @at-root [file] #{&} > i {
203
216
  position: relative;
204
- top: 1px; // center the file icon
217
+ top: 1px; /* center the file icon */
205
218
  }
206
219
 
207
- // label text
220
+ /* label text */
208
221
  &::after {
209
- content: attr(label-text);
222
+ content: attr(data-label-text);
210
223
  font-size: 0.85rem;
211
224
  font-weight: 600;
212
225
  color: var(--code-header-text-color);
213
226
  }
214
227
  }
215
228
 
216
- // clipboard
229
+ /* clipboard */
217
230
  button {
218
231
  @extend %cursor-pointer;
219
232
 
@@ -4,28 +4,28 @@
4
4
 
5
5
  /* sidebar */
6
6
 
7
- $sidebar-width: 260px !default; // the basic width
8
- $sidebar-width-small: 210px !default; // screen width: >= 850px, <= 1199px (iPad landscape)
9
- $sidebar-width-large: 350px !default; // screen width: >= 1650px
7
+ $sidebar-width: 260px !default; /* the basic width */
8
+ $sidebar-width-small: 210px !default; /* screen width: >= 850px, <= 1199px (iPad landscape) */
9
+ $sidebar-width-large: 350px !default; /* screen width: >= 1650px */
10
10
 
11
11
  /* tabs of sidebar */
12
12
 
13
- $tab-count: 5 !default; // backward compatible (version <= 4.0.2)
13
+ $tab-count: 5 !default; /* backward compatible (version <= 4.0.2) */
14
14
  $tab-height: 3rem !default;
15
15
  $tab-cursor-height: 1.6rem !default;
16
16
 
17
- $cursor-width: 2px !default; // the cursor width of the selected tab
17
+ $cursor-width: 2px !default; /* the cursor width of the selected tab */
18
18
 
19
19
  /* other framework sizes */
20
20
 
21
21
  $topbar-height: 3rem !default;
22
22
 
23
- $footer-height: 5rem !default;
24
- $footer-height-mobile: 6rem !default; // screen width: <= 576px
23
+ $search-max-width: 210px !default;
25
24
 
26
- $main-content-max-width: 1150px !default;
25
+ $footer-height: 5rem !default;
26
+ $footer-height-mobile: 6rem !default; /* screen width: <= 576px */
27
27
 
28
- $panel-max-width: 300px !default;
28
+ $main-content-max-width: 1250px !default;
29
29
 
30
30
  $bottom-min-height: 35rem !default;
31
31
 
@@ -78,6 +78,7 @@
78
78
  --code-header-muted-color: rgb(60 60 60);
79
79
  --code-header-icon-color: rgb(86 86 86);
80
80
  --clipboard-checked-color: #2bcc2b;
81
+ --filepath-text-color: #bdbdbd;
81
82
 
82
83
  .highlight {
83
84
  .gp { color: #818c96; }
@@ -69,6 +69,15 @@
69
69
  --kbd-wrap-color: #6a6a6a;
70
70
  --kbd-text-color: #d3d3d3;
71
71
  --kbd-bg-color: #242424;
72
+ --prompt-text-color: rgb(216 212 212 / 75%);
73
+ --prompt-tip-bg: rgba(77, 187, 95, 0.2);
74
+ --prompt-tip-icon-color: rgb(5 223 5 / 68%);
75
+ --prompt-info-bg: rgb(7 59 104 / 80%);
76
+ --prompt-info-icon-color: #0075d1;
77
+ --prompt-warning-bg: rgb(90 69 3 / 95%);
78
+ --prompt-warning-icon-color: rgb(255 165 0 / 80%);
79
+ --prompt-danger-bg: rgb(86 28 8 / 80%);
80
+ --prompt-danger-icon-color: #cd0202;
72
81
 
73
82
  /* tags */
74
83
  --tag-border: rgb(59, 79, 88);
@@ -145,4 +154,4 @@
145
154
  color-scheme: none;
146
155
  }
147
156
 
148
- } // dark-scheme
157
+ } /* dark-scheme */
@@ -76,4 +76,9 @@
76
76
  --code-header-icon-color: #d1d1d1;
77
77
  --clipboard-checked-color: #43c743;
78
78
 
79
- } // light-syntax
79
+ [class^=prompt-] {
80
+ --inline-code-bg: #fbfafa;
81
+ --highlighter-rouge-color: rgb(82 82 82);
82
+ }
83
+
84
+ } /* light-syntax */
@@ -68,6 +68,19 @@
68
68
  --kbd-wrap-color: #bdbdbd;
69
69
  --kbd-text-color: var(--text-color);
70
70
  --kbd-bg-color: white;
71
+ --prompt-text-color: rgb(46 46 46 / 77%);
72
+ --prompt-tip-bg: rgb(123 247 144 / 20%);
73
+ --prompt-tip-icon-color: #03b303;
74
+ --prompt-info-bg: #e1f5fe;
75
+ --prompt-info-icon-color: #0070cb;
76
+ --prompt-warning-bg: rgb(255 243 205);
77
+ --prompt-warning-icon-color: #ef9c03;
78
+ --prompt-danger-bg: rgb(248 215 218 / 56%);
79
+ --prompt-danger-icon-color: #df3c30;
80
+
81
+ [class^=prompt-] {
82
+ --link-underline-color: rgb(219 216 216);
83
+ }
71
84
 
72
85
  /* Categories */
73
86
  --categories-hover-bg: var(--btn-border-color);
@@ -78,4 +91,4 @@
78
91
  --timeline-node-bg: #c2c6cc;
79
92
  --timeline-year-dot-color: #ffffff;
80
93
 
81
- } // light-scheme
94
+ } /* light-scheme */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * The styles for Jekyll theme Chirpy
3
3
  *
4
- * Chirpy v5.0.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
4
+ * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
5
5
  * © 2019 Cotes Chung
6
6
  * MIT Licensed
7
7
  */
@@ -41,8 +41,7 @@ h1 + .post-meta {
41
41
  }
42
42
 
43
43
  img.preview-img {
44
- margin-top: 3.75rem;
45
- margin-bottom: 0;
44
+ margin: 0;
46
45
  border-radius: 6px;
47
46
 
48
47
  &.bg[data-loaded=true] {
@@ -55,7 +54,7 @@ img.preview-img {
55
54
  border-bottom: 1px double var(--main-border-color);
56
55
  font-size: 0.85rem;
57
56
 
58
- .post-meta a {
57
+ .post-meta a:not(:hover) {
59
58
  @extend %link-underline;
60
59
  }
61
60
  }
@@ -173,6 +172,8 @@ nav[data-toggle=toc] {
173
172
 
174
173
  em {
175
174
  @extend %normal-font-style;
175
+
176
+ color: var(--relate-post-date);
176
177
  }
177
178
 
178
179
  .card {
@@ -194,10 +195,6 @@ nav[data-toggle=toc] {
194
195
  }
195
196
  }
196
197
 
197
- .timeago {
198
- color: var(--relate-post-date);
199
- }
200
-
201
198
  p {
202
199
  font-size: 0.9rem;
203
200
  margin-bottom: 0.5rem;
data/_tabs/about.md CHANGED
@@ -4,5 +4,5 @@ icon: fas fa-info-circle
4
4
  order: 4
5
5
  ---
6
6
 
7
-
8
- > **Note**: Add Markdown syntax content to file `_tabs/about.md` and it will show up on this page.
7
+ > Add Markdown syntax content to file `_tabs/about.md`{: .filepath } and it will show up on this page.
8
+ {: .prompt-tip }
data/assets/404.html CHANGED
@@ -7,27 +7,10 @@ redirect_from:
7
7
  - /norobots/
8
8
  - /assets/
9
9
  - /posts/
10
-
11
- dynamic_title: true
12
10
  ---
13
11
 
14
12
  {% include lang.html %}
15
13
 
16
14
  <div class="lead">
17
-
18
- {%- capture _head_back -%}
19
- <a href="{{ '/' | relative_url }}">{{ site.data.locales[lang].not_found.head_back }}</a>
20
- {%- endcapture -%}
21
-
22
- {%- capture _archives_page -%}
23
- <a href="{{ 'archives' | relative_url }}">{{ site.data.locales[lang].not_found.archives_page }}</a>
24
- {%- endcapture -%}
25
-
26
15
  <p>{{site.data.locales[lang].not_found.statment }}</p>
27
-
28
- <p>{{ site.data.locales[lang].not_found.hint_template
29
- | replace: ':HEAD_BAK', _head_back
30
- | replace: ':ARCHIVES_PAGE', _archives_page }}
31
- </p>
32
-
33
16
  </div>
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  layout: compress
3
+ swcache: true
3
4
  ---
4
5
 
5
6
  [
6
7
  {% for post in site.posts %}
7
8
  {
8
- "title": "{{ post.title | escape }}",
9
- "url": "{{ post.url | relative_url }}",
10
- "categories": "{{ post.categories | join: ', '}}",
11
- "tags": "{{ post.tags | join: ', ' }}",
9
+ "title": {{ post.title | jsonify }},
10
+ "url": {{ post.url | relative_url | jsonify }},
11
+ "categories": {{ post.categories | join: ', ' | jsonify }},
12
+ "tags": {{ post.tags | join: ', ' | jsonify }},
12
13
  "date": "{{ post.date }}",
13
14
  {% include no-linenos.html content=post.content %}
14
- "snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
15
+ "snippet": {{ content | strip_html | strip_newlines | jsonify }}
15
16
  }{% unless forloop.last %},{% endunless %}
16
17
  {% endfor %}
17
18
  ]
@@ -9,13 +9,7 @@ const resource = [
9
9
  /* --- CSS --- */
10
10
  '{{ "/assets/css/style.css" | relative_url }}',
11
11
 
12
- /* --- JavaScripts --- */
13
- {% assign js_path = "/assets/js" | relative_url %}
14
- '{{ js_path }}/dist/home.min.js',
15
- '{{ js_path }}/dist/page.min.js',
16
- '{{ js_path }}/dist/post.min.js',
17
- '{{ js_path }}/dist/categories.min.js',
18
- '{{ js_path }}/data/search.json',
12
+ /* --- PWA --- */
19
13
  '{{ "/app.js" | relative_url }}',
20
14
  '{{ "/sw.js" | relative_url }}',
21
15
 
@@ -26,30 +20,27 @@ const resource = [
26
20
  '{{ tab.url | relative_url }}',
27
21
  {% endfor %}
28
22
 
29
- /* --- Favicons --- */
30
- {% assign favicon_path = "/assets/img/favicons" | relative_url %}
31
-
32
- '{{ favicon_path }}/android-chrome-192x192.png',
33
- '{{ favicon_path }}/android-chrome-512x512.png',
34
- '{{ favicon_path }}/apple-touch-icon.png',
35
- '{{ favicon_path }}/favicon-16x16.png',
36
- '{{ favicon_path }}/favicon-32x32.png',
37
- '{{ favicon_path }}/favicon.ico',
38
- '{{ favicon_path }}/mstile-150x150.png',
39
- '{{ favicon_path }}/site.webmanifest',
40
- '{{ favicon_path }}/browserconfig.xml'
23
+ /* --- Favicons & compressed JS --- */
24
+ {% assign cache_list = site.static_files | where: 'swcache', true %}
25
+ {% for file in cache_list %}
26
+ '{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
27
+ {% endfor %}
41
28
 
42
29
  ];
43
30
 
44
31
  /* The request url with below domain will be cached */
45
32
  const allowedDomains = [
46
- {% if site.google_analytics.id != '' %}
33
+ {% if site.google_analytics.id != empty and site.google_analytics.id %}
47
34
  'www.googletagmanager.com',
48
35
  'www.google-analytics.com',
49
36
  {% endif %}
50
37
 
51
38
  '{{ site.url | split: "//" | last }}',
52
39
 
40
+ {% if site.img_cdn contains '//' and site.img_cdn %}
41
+ '{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
42
+ {% endif %}
43
+
53
44
  'fonts.gstatic.com',
54
45
  'fonts.googleapis.com',
55
46
  'cdn.jsdelivr.net',
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v5.0.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
6
- $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),f={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},p=function(){let e=!1;return{on(){e||(u.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),s.removeClass("visible"),a.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){f.on(),p.on(),i.focus()}),t.click(function(){f.off(),p.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):p.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),a=$("#search-input"),l="topbar-up",r="topbar-down",n="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(r).addClass(l),s.removeClass(r),a.is(":focus")&&a.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(n))?"false"===e&&t.removeAttr(n):(t.removeClass(l).addClass(r),s.addClass(r))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const e=$(".collapse");e.on("hide.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${e} i.fas`).addClass("rotate"),$("#"+e).removeClass("hide-border-bottom"))}),e.on("show.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${e} i.fas`).removeClass("rotate"),$("#"+e).addClass("hide-border-bottom"))})});
6
+ $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,a=!1,r=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,a=a||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),a=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),a.addClass("unloaded"),e.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),o.removeClass("unloaded"),a.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function u(){return t.hasClass("loaded")}e.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?u()?c.removeClass("unloaded"):f.off():(f.on(),u()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),a=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;a?(t=$(window).scrollTop(),e=r<t,r=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),$(function(){const o=$(".collapse");o.on("hide.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$("#"+o).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$("#"+o).addClass("hide-border-bottom"))})});
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v5.0.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
6
- $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),l=$("#main"),a=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),a.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),a.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),s.removeClass("visible"),l.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):f.off():""!==i.val()&&(f.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):f.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),l=$("#search-input"),a="topbar-up",n="topbar-down",r="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(n).addClass(a),s.removeClass(n),l.is(":focus")&&l.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(r))?"false"===e&&t.removeAttr(r):(t.removeClass(a).addClass(n),s.addClass(n))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})});
6
+ $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,r=!1,a=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,r=r||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===a,lockOrientation:()=>a=!0,unLockOrientation:()=>a=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),r=$("#topbar-title"),a=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),r.addClass("unloaded"),e.addClass("unloaded"),a.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),a.removeClass("d-flex"),o.removeClass("unloaded"),r.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function f(){return t.hasClass("loaded")}e.click(function(){p.on(),u.on(),i.focus()}),t.click(function(){p.off(),u.off()}),i.focus(function(){a.addClass("input-focus")}),i.focusout(function(){a.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),r=!1,a=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;r?(t=$(window).scrollTop(),e=a<t,a=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}});
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v5.0.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
6
- $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(t=>{const e=$(t.target);let o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();o.blur(),flipMode()})}),$(function(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),s=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset(){return t}}}(),p={on(){t.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),n.removeClass("d-flex"),t.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let t=!1;return{on(){t||(u.block(),r.removeClass("unloaded"),s.addClass("unloaded"),t=!0)},off(){t&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),d.val(""),t=!1)},isVisible(){return t}}}();function h(){return o.hasClass("loaded")}e.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){n.addClass("input-focus")}),d.focusout(function(){n.removeClass("input-focus")}),d.on("keyup",function(t){8===t.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){var t=function(){const t="sidebar-display";let e=!1;const o=$("body");return{toggle(){!1===e?o.attr(t,""):o.removeAttr(t),e=!e}}}();$("#sidebar-trigger").click(t.toggle),$("#mask").click(t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const o=$("#topbar-wrapper"),a=$("#panel-wrapper"),s=$("#search-input"),l="topbar-up",n="topbar-down",r="toc-scrolling-up";let e,i=0;const d=o.outerHeight(),c=o.outerHeight();$(window).scroll(function(t){$("#topbar-title").is(":hidden")&&(e=!0)}),setInterval(function(){e&&(function(){var t,e=$(this).scrollTop();Math.abs(i-e)<=d||(e>i?e>c&&(o.removeClass(n).addClass(l),a.removeClass(n),s.is(":focus")&&s.blur()):e+$(window).height()<$(document).height()&&(void 0!==(t=o.attr(r))?"false"===t&&o.removeAttr(r):(o.removeClass(l).addClass(n),a.addClass(n))),i=e)}(),e=!1)},250)}),$(function(){const t=$("#topbar-title"),e=$("div.post>h1"),o=t.text().trim();let a=(0<e.length?e:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||e.is(":hidden")||t.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?t.text()!==a&&t.text(a):t.text()!==o&&t.text(o))}),t.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let o=$(".timeago").length,t=void 0;const s=$("meta[name=day-prompt]").attr("content"),l=$("meta[name=hour-prompt]").attr("content"),n=$("meta[name=minute-prompt]").attr("content"),r=$("meta[name=justnow-prompt]").attr("content");function e(){return $(".timeago").each(function(){var t,e;!1!==$(this)[0].hasAttribute("date")?(e=function(t,e){let o=new Date,a=new Date(t);return a.getFullYear()!==o.getFullYear()||a.getMonth()!==o.getMonth()?e:(t=Math.floor((o-a)/1e3),1<=(e=Math.floor(t/86400))?` ${e} `+s:1<=(e=Math.floor(t/3600))?` ${e} `+l:1<=(t=Math.floor(t/60))?` ${t} `+n:r)}($(this).attr("date"),t=$(this).text()))===t?$(this).removeAttr("date"):$(this).text(e):--o}),0===o&&void 0!==t&&clearInterval(t),o}0!==o&&0<e()&&(t=setInterval(e,6e4))});
6
+ $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
+ * © 2019 Cotes Chung
4
+ * MIT Licensed
5
+ */
6
+ $(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});