jekyll-theme-satellite 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +113 -0
- data/_includes/category.html +23 -0
- data/_includes/footer.html +10 -0
- data/_includes/head.html +33 -0
- data/_includes/pagination.html +3 -3
- data/_includes/search.html +1 -1
- data/_includes/search_event.html +217 -0
- data/_includes/sidebar.html +8 -1
- data/_layouts/default.html +10 -105
- data/_layouts/page.html +86 -0
- data/_sass/navigation.scss +0 -1
- data/_sass/pagination.scss +2 -4
- data/_sass/post.scss +1 -3
- data/_sass/search.scss +3 -3
- data/_sass/sidebar.scss +16 -7
- data/_sass/toc.scss +6 -0
- data/assets/css/404.scss +47 -0
- data/assets/css/fonts.scss +29 -0
- data/assets/css/style.scss +23 -25
- data/assets/js/{stars.js → background.js} +2 -2
- data/assets/js/common.js +179 -0
- data/assets/js/fontfaceobserver.js +12 -0
- data/assets/js/post.js +197 -0
- data/assets/js/search.js +168 -0
- data/assets/js/subject.js +132 -0
- metadata +58 -5
- data/_config.yml +0 -82
- data/assets/js/main.js +0 -709
data/_layouts/page.html
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
{%- assign page_tree = page.path | remove_first: "_pages/" | split: "/" -%}
|
4
|
+
{%- assign page_level = page_tree.size -%}
|
5
|
+
{% if page_tree.last == "index.md" %}
|
6
|
+
{%- assign page_type = "category" -%}
|
7
|
+
{% else %}
|
8
|
+
{%- assign page_type = "post" -%}
|
9
|
+
{% endif %}
|
10
|
+
<head>
|
11
|
+
{% include head.html %}
|
12
|
+
<link rel="preload" href="{{ site.profile_img }}" as="image">
|
13
|
+
<link rel="stylesheet" href="{{ '/assets/css/style.css' }}">
|
14
|
+
{% if page_type == "post" %}
|
15
|
+
{% if site.goatcounter_code %}
|
16
|
+
<script data-goatcounter="https://{{ site.goatcounter_code }}.goatcounter.com/count"
|
17
|
+
async src="//gc.zgo.at/count.js"></script>
|
18
|
+
{% endif %}
|
19
|
+
|
20
|
+
<meta name="giscus_repo" content="{{ site.giscus_repo }}">
|
21
|
+
<meta name="giscus_repoId" content="{{ site.giscus_repoId }}">
|
22
|
+
<meta name="giscus_category" content="{{ site.giscus_category }}">
|
23
|
+
<meta name="giscus_categoryId" content="{{ site.giscus_categoryId }}">
|
24
|
+
|
25
|
+
{% if page.thumbnail %}
|
26
|
+
<style>
|
27
|
+
.thumbnail {
|
28
|
+
background-image: url("{{ page.thumbnail }}");
|
29
|
+
}
|
30
|
+
</style>
|
31
|
+
{% else %}
|
32
|
+
<style>
|
33
|
+
.thumbnail {
|
34
|
+
aspect-ratio: auto !important;
|
35
|
+
}
|
36
|
+
.transbox {
|
37
|
+
transform: none;
|
38
|
+
position: relative;
|
39
|
+
margin: auto;
|
40
|
+
left: 0;
|
41
|
+
top: 0;
|
42
|
+
}
|
43
|
+
</style>
|
44
|
+
{% endif %}
|
45
|
+
{% endif %}
|
46
|
+
</head>
|
47
|
+
<body>
|
48
|
+
<script type="text/javascript">
|
49
|
+
let currentTheme = localStorage.getItem('theme');
|
50
|
+
|
51
|
+
document.body.classList[currentTheme === 'dark' ? 'add' : 'remove']('dark-theme');
|
52
|
+
</script>
|
53
|
+
<canvas id="stars" width="100%" height="100%"></canvas>
|
54
|
+
{% include sidebar.html %}
|
55
|
+
<div id="post">
|
56
|
+
<div class="inner-header">
|
57
|
+
<span class="dot" style="background-color: #F86158;"></span>
|
58
|
+
<span class="dot" style="background-color: #FBBF2D;"></span>
|
59
|
+
<span class="dot" style="background-color: #2ACB45;"></span>
|
60
|
+
</div>
|
61
|
+
<div class="inner-content">
|
62
|
+
{% include category.html %}
|
63
|
+
{% if page_type == "category" %}
|
64
|
+
{% include loading.html %}
|
65
|
+
{% include pagination.html %}
|
66
|
+
{% else %}
|
67
|
+
{% include post.html %}
|
68
|
+
{% endif %}
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
{% include search.html %}
|
72
|
+
</body>
|
73
|
+
{% include footer.html %}
|
74
|
+
{% if page_type == "category" %}
|
75
|
+
<script src="{{ '/assets/js/subject.js' }}"></script>
|
76
|
+
{% else %}
|
77
|
+
<script src="{{ '/assets/js/tocbot.min.js' }}"></script>
|
78
|
+
<script src="{{ '/assets/js/sweet-scroll.min.js' }}"></script>
|
79
|
+
<script src="{{ '/assets/js/highlight.min.js' }}"></script>
|
80
|
+
<link id="highlight-default" rel="stylesheet" href="{{ '/assets/css/highlight-default.min.css' }}">
|
81
|
+
<link id="highlight-dark" rel="stylesheet" href="{{ '/assets/css/highlight-dark.min.css' }}">
|
82
|
+
<script src="{{ '/assets/js/post.js' }}"></script>
|
83
|
+
{% endif %}
|
84
|
+
{% include search_event.html %}
|
85
|
+
<script src="{{ '/assets/js/common.js' }}"></script>
|
86
|
+
</html>
|
data/_sass/navigation.scss
CHANGED
data/_sass/pagination.scss
CHANGED
@@ -31,7 +31,6 @@
|
|
31
31
|
margin: 0 0.5rem;
|
32
32
|
margin-bottom: 1.5rem;
|
33
33
|
font-weight: 600;
|
34
|
-
font-family: 'Lato', sans-serif;
|
35
34
|
border-bottom: 1px solid lightgrey;
|
36
35
|
text-decoration: underline dimgrey;
|
37
36
|
text-underline-offset: 12px;
|
@@ -72,8 +71,7 @@
|
|
72
71
|
|
73
72
|
a { text-decoration: none; }
|
74
73
|
|
75
|
-
.title_post{
|
76
|
-
font-family: 'Lato', sans-serif;
|
74
|
+
.title_post {
|
77
75
|
font-weight: 600;
|
78
76
|
font-size: 1rem;
|
79
77
|
line-height: 2rem;
|
@@ -112,7 +110,7 @@
|
|
112
110
|
text-align: center;
|
113
111
|
|
114
112
|
img {
|
115
|
-
width: 50
|
113
|
+
width: 50% !important;
|
116
114
|
aspect-ratio: 2/1;
|
117
115
|
}
|
118
116
|
|
data/_sass/post.scss
CHANGED
@@ -64,11 +64,11 @@
|
|
64
64
|
}
|
65
65
|
|
66
66
|
.post-title {
|
67
|
-
font-family: 'Lato', sans-serif;
|
68
67
|
font-size: 1.25rem;
|
69
68
|
word-spacing: 4px;
|
70
69
|
font-weight: 600;
|
71
70
|
word-wrap: break-word;
|
71
|
+
font-family: Cambria, sans-serif;
|
72
72
|
}
|
73
73
|
|
74
74
|
.post-info {
|
@@ -181,7 +181,6 @@ main {
|
|
181
181
|
padding: 1rem;
|
182
182
|
margin: auto;
|
183
183
|
font-size: 1rem;
|
184
|
-
font-family: 'Nunito Sans', sans-serif;
|
185
184
|
line-height: 200%;
|
186
185
|
position: relative;
|
187
186
|
overflow-wrap: break-word;
|
@@ -190,7 +189,6 @@ main {
|
|
190
189
|
* { margin: auto; }
|
191
190
|
|
192
191
|
h1, h2, h3 {
|
193
|
-
font-family: "Helvetica";
|
194
192
|
margin-bottom: -1.5rem;
|
195
193
|
padding-top: 2rem;
|
196
194
|
}
|
data/_sass/search.scss
CHANGED
@@ -82,13 +82,13 @@
|
|
82
82
|
margin: auto;
|
83
83
|
margin-top: 2rem;
|
84
84
|
|
85
|
-
|
85
|
+
mark {
|
86
86
|
margin-bottom: 1rem;
|
87
87
|
color: #fff;
|
88
88
|
opacity: 0.8;
|
89
89
|
font-size: 1.5rem;
|
90
90
|
font-weight: 200;
|
91
|
-
|
91
|
+
display: block;
|
92
92
|
}
|
93
93
|
|
94
94
|
input {
|
@@ -211,7 +211,7 @@
|
|
211
211
|
.search-box {
|
212
212
|
margin-top: 4rem;
|
213
213
|
|
214
|
-
|
214
|
+
mark {
|
215
215
|
font-size: 2.5rem;
|
216
216
|
margin-bottom: 2rem;
|
217
217
|
}
|
data/_sass/sidebar.scss
CHANGED
@@ -150,6 +150,8 @@
|
|
150
150
|
border: none;
|
151
151
|
border-radius: 50%;
|
152
152
|
margin-left: 1rem;
|
153
|
+
position: relative;
|
154
|
+
vertical-align: top;
|
153
155
|
cursor: pointer;
|
154
156
|
|
155
157
|
&:hover {
|
@@ -173,18 +175,26 @@
|
|
173
175
|
fill: #3A241A !important;
|
174
176
|
width: 24px;
|
175
177
|
position: relative;
|
178
|
+
transition: all .3s;
|
179
|
+
}
|
180
|
+
|
181
|
+
.ico-dark, .ico-light {
|
182
|
+
position: absolute;
|
183
|
+
top: 50%;
|
184
|
+
left: 50%;
|
185
|
+
transform: translate(-50%, -50%);
|
176
186
|
}
|
177
187
|
|
178
188
|
.ico-dark {
|
179
|
-
|
189
|
+
transform: translate(-50%, -50%) scale(1);
|
180
190
|
|
181
|
-
&.active{
|
191
|
+
&.active{ transform: translate(-50%, -50%) scale(0); }
|
182
192
|
}
|
183
193
|
|
184
194
|
.ico-light {
|
185
|
-
|
195
|
+
transform: translate(-50%, -50%) scale(0);
|
186
196
|
|
187
|
-
&.active{
|
197
|
+
&.active{ transform: translate(-50%, -50%) scale(1); }
|
188
198
|
}
|
189
199
|
}
|
190
200
|
|
@@ -243,7 +253,6 @@
|
|
243
253
|
|
244
254
|
.highlight {
|
245
255
|
font-weight: 600;
|
246
|
-
font-family: 'Righteous', sans-serif;
|
247
256
|
background-image: -webkit-linear-gradient(left, #a95770 25%, #ff4d7c 32.5%, #97d0ec 50%, #ff4d7c 67.5%, #a95770 75%);
|
248
257
|
background-image: linear-gradient(90deg, #a95770 25%, #ff4d7c 32.5%, #97d0ec 50%, #ff4d7c 67.5%, #a95770 75%);
|
249
258
|
background-position: right center;
|
@@ -254,10 +263,10 @@
|
|
254
263
|
|
255
264
|
&:hover {
|
256
265
|
color: #ef9671;
|
257
|
-
animation:
|
266
|
+
animation: slidetext 2s ease-in infinite;
|
258
267
|
}
|
259
268
|
|
260
|
-
@keyframes
|
269
|
+
@keyframes slidetext {
|
261
270
|
100% {
|
262
271
|
background-position: left center;
|
263
272
|
}
|
data/_sass/toc.scss
CHANGED
data/assets/css/404.scss
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
|
4
|
+
body {
|
5
|
+
margin: 0;
|
6
|
+
background:
|
7
|
+
repeating-linear-gradient(
|
8
|
+
to right, transparent,
|
9
|
+
transparent 100px,
|
10
|
+
white 100px,
|
11
|
+
white 112px
|
12
|
+
),
|
13
|
+
repeating-linear-gradient(
|
14
|
+
to bottom, transparent,
|
15
|
+
transparent 100px,
|
16
|
+
white 100px,
|
17
|
+
white 112px
|
18
|
+
),
|
19
|
+
linear-gradient(45deg, pink, skyblue);
|
20
|
+
}
|
21
|
+
|
22
|
+
.blank-page {
|
23
|
+
display: table-cell;
|
24
|
+
z-index: 0;
|
25
|
+
background: #fff;
|
26
|
+
margin: 1rem auto;
|
27
|
+
width: 100vw;
|
28
|
+
height: 45vh;
|
29
|
+
vertical-align: middle;
|
30
|
+
|
31
|
+
.go-home {
|
32
|
+
text-decoration: none;
|
33
|
+
margin-left: 5vw;
|
34
|
+
font-size: 1.25rem;
|
35
|
+
}
|
36
|
+
|
37
|
+
.not-found-msg { text-align: center; }
|
38
|
+
|
39
|
+
.sour-face {
|
40
|
+
margin: 3rem auto;
|
41
|
+
font-size: 5rem;
|
42
|
+
line-height: 1;
|
43
|
+
letter-spacing: -1px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
.container { display: none; }
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
|
4
|
+
@font-face {
|
5
|
+
font-family: 'Nunito Sans';
|
6
|
+
font-style: normal;
|
7
|
+
font-weight: 400;
|
8
|
+
font-display: optional;
|
9
|
+
src: local('Nunito Sans'),
|
10
|
+
url(/assets/fonts/NunitoSans-Regular.ttf) format("truetype");
|
11
|
+
}
|
12
|
+
|
13
|
+
@font-face {
|
14
|
+
font-family: 'Righteous';
|
15
|
+
font-style: normal;
|
16
|
+
font-weight: 600;
|
17
|
+
font-display: optional;
|
18
|
+
src: local('Righteous'),
|
19
|
+
url(/assets/fonts/Righteous-Regular.ttf) format("truetype");
|
20
|
+
}
|
21
|
+
|
22
|
+
@font-face {
|
23
|
+
font-family: 'Lato';
|
24
|
+
font-style: normal;
|
25
|
+
font-weight: 400;
|
26
|
+
font-display: optional;
|
27
|
+
src: local('Lato'),
|
28
|
+
url(/assets/fonts/Lato-Regular.ttf) format("truetype");
|
29
|
+
}
|
data/assets/css/style.scss
CHANGED
@@ -1,33 +1,23 @@
|
|
1
1
|
---
|
2
2
|
---
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
font-weight: 400;
|
8
|
-
font-display: swap;
|
9
|
-
src: url(/assets/fonts/NunitoSans-Regular.ttf);
|
4
|
+
html, body {
|
5
|
+
margin: 0;
|
6
|
+
padding: 0;
|
10
7
|
}
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
font-display: swap;
|
17
|
-
src: url(/assets/fonts/Righteous-Regular.ttf);
|
18
|
-
}
|
9
|
+
.fonts-loaded {
|
10
|
+
a, span, p {
|
11
|
+
font-family: "Nunito Sans", 'Lucida Sans', sans-serif;
|
12
|
+
}
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
font-weight: 400;
|
24
|
-
font-display: swap;
|
25
|
-
src: url(/assets/fonts/Lato-Regular.ttf);
|
26
|
-
}
|
14
|
+
h1, h2, h3 {
|
15
|
+
font-family: "Lato", Helvetica, sans-serif;
|
16
|
+
}
|
27
17
|
|
28
|
-
|
29
|
-
|
30
|
-
|
18
|
+
mark {
|
19
|
+
font-family: 'Righteous', sans-serif;
|
20
|
+
}
|
31
21
|
}
|
32
22
|
|
33
23
|
a {
|
@@ -36,11 +26,19 @@ a {
|
|
36
26
|
|
37
27
|
a, span, p, h1, h2, h3, i {
|
38
28
|
color: #3A241A;
|
39
|
-
font-family: "Nunito Sans", sans-serif;
|
40
29
|
}
|
41
30
|
|
42
|
-
|
31
|
+
a, span, p {
|
32
|
+
font-family: 'Lucida Sans', sans-serif;
|
33
|
+
}
|
34
|
+
|
35
|
+
h1, h2, h3, mark {
|
43
36
|
margin: 0;
|
37
|
+
font-family: Helvetica, sans-serif;
|
38
|
+
}
|
39
|
+
|
40
|
+
mark {
|
41
|
+
background-color: transparent;
|
44
42
|
}
|
45
43
|
|
46
44
|
svg {
|
@@ -324,7 +324,7 @@ function init() {
|
|
324
324
|
|
325
325
|
// Motion mode
|
326
326
|
if ('ontouchstart' in document.documentElement && window.DeviceOrientationEvent) {
|
327
|
-
console.log('Using device orientation');
|
327
|
+
// console.log('Using device orientation');
|
328
328
|
window.addEventListener('deviceorientation', function(e) {
|
329
329
|
mouse.x = (canvas.clientWidth / 2) - ((e.gamma / 90) * (canvas.clientWidth / 2) * 2);
|
330
330
|
mouse.y = (canvas.clientHeight / 2) - ((e.beta / 90) * (canvas.clientHeight / 2) * 2);
|
@@ -332,7 +332,7 @@ function init() {
|
|
332
332
|
}
|
333
333
|
else {
|
334
334
|
// Mouse move listener
|
335
|
-
console.log('Using mouse movement');
|
335
|
+
// console.log('Using mouse movement');
|
336
336
|
document.body.addEventListener('mousemove', function(e) {
|
337
337
|
mouse.x = e.clientX;
|
338
338
|
mouse.y = e.clientY;
|
data/assets/js/common.js
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
document.addEventListener('DOMContentLoaded', function(){
|
2
|
+
// Init theme
|
3
|
+
let currentTheme = localStorage.getItem('theme');
|
4
|
+
let isDarkMode = false;
|
5
|
+
|
6
|
+
if (currentTheme === 'dark'){
|
7
|
+
isDarkMode = true;
|
8
|
+
const themeIcons = document.querySelectorAll(".ico-dark, .ico-light");
|
9
|
+
|
10
|
+
themeIcons.forEach((ico) => {
|
11
|
+
ico.classList.add('active');
|
12
|
+
});
|
13
|
+
/*
|
14
|
+
const moonIcons = document.querySelectorAll(".ico-dark");
|
15
|
+
const sunIcons = document.querySelectorAll(".ico-light");
|
16
|
+
|
17
|
+
moonIcons.forEach((ico) => {
|
18
|
+
ico.classList.add('active');
|
19
|
+
});
|
20
|
+
|
21
|
+
sunIcons.forEach((ico) => {
|
22
|
+
ico.classList.add('active');
|
23
|
+
});
|
24
|
+
*/
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
isDarkMode = false;
|
28
|
+
}
|
29
|
+
|
30
|
+
// navigation (mobile)
|
31
|
+
var siteNav = document.querySelector('#navigation');
|
32
|
+
var siteContact = document.querySelector('#contact');
|
33
|
+
var menuButton = document.querySelector("#btn-nav");
|
34
|
+
|
35
|
+
menuButton.addEventListener('click', function() {
|
36
|
+
if (menuButton.classList.toggle('nav-open')) {
|
37
|
+
siteNav.classList.add('nav-open');
|
38
|
+
siteContact.classList.add('contact-open');
|
39
|
+
} else {
|
40
|
+
siteNav.classList.remove('nav-open');
|
41
|
+
siteContact.classList.remove('contact-open');
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
// kept nav opened
|
46
|
+
var firstNavs = document.querySelectorAll('#nav-first');
|
47
|
+
var page_path = window.location.pathname.replace(/%20/g, " ");
|
48
|
+
var page_tree = page_path.split('/');
|
49
|
+
|
50
|
+
Array.prototype.forEach.call(firstNavs, function (nav_first) {
|
51
|
+
if (page_tree[1] === nav_first.ariaLabel){
|
52
|
+
nav_first.classList.add('active');
|
53
|
+
|
54
|
+
var secondNavs = nav_first.querySelectorAll('#nav-second');
|
55
|
+
|
56
|
+
Array.prototype.forEach.call(secondNavs, function (nav_second) {
|
57
|
+
if (page_tree[2] === nav_second.ariaLabel){
|
58
|
+
nav_second.classList.toggle('active');
|
59
|
+
|
60
|
+
var thirdNavs = nav_second.querySelectorAll('#nav-third');
|
61
|
+
|
62
|
+
Array.prototype.forEach.call(thirdNavs, function (nav_third) {
|
63
|
+
if (page_tree[3] === nav_third.ariaLabel){
|
64
|
+
nav_third.classList.toggle('active');
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
});
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
// navigation (toogle sub-category)
|
73
|
+
document.addEventListener('click', function(e){
|
74
|
+
var target = e.target;
|
75
|
+
|
76
|
+
while (target && !(target.classList && target.classList.contains('nav-list-expander'))) {
|
77
|
+
target = target.parentNode;
|
78
|
+
}
|
79
|
+
|
80
|
+
if (target) {
|
81
|
+
e.preventDefault();
|
82
|
+
var nav_item = target.parentNode;
|
83
|
+
target.ariaPressed = nav_item.parentNode.classList.toggle('active');
|
84
|
+
}
|
85
|
+
});
|
86
|
+
|
87
|
+
document.querySelectorAll('.nav-item').forEach((nav_item) => {
|
88
|
+
if (nav_item.parentNode.classList.contains('active')){
|
89
|
+
nav_item.classList.add('selected');
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
nav_item.classList.remove('selected');
|
93
|
+
}
|
94
|
+
});
|
95
|
+
|
96
|
+
// Change Datk/Light Theme
|
97
|
+
const themeButton = document.querySelectorAll("#btn-brightness");
|
98
|
+
|
99
|
+
themeButton.forEach((btn) => {
|
100
|
+
btn.addEventListener('click', function() {
|
101
|
+
const moonIcons = document.querySelectorAll(".ico-dark");
|
102
|
+
const sunIcons = document.querySelectorAll(".ico-light");
|
103
|
+
|
104
|
+
moonIcons.forEach((ico) => {
|
105
|
+
ico.classList.toggle('active');
|
106
|
+
});
|
107
|
+
|
108
|
+
sunIcons.forEach((ico) => {
|
109
|
+
ico.classList.toggle('active');
|
110
|
+
});
|
111
|
+
|
112
|
+
document.body.classList.toggle('dark-theme');
|
113
|
+
|
114
|
+
if (isDarkMode){
|
115
|
+
localStorage.setItem('theme', 'default');
|
116
|
+
// Disable highlighter dark color theme
|
117
|
+
document.getElementById("highlight-default").disabled=false;
|
118
|
+
document.getElementById("highlight-dark").disabled=true;
|
119
|
+
changeGiscusTheme('light');
|
120
|
+
isDarkMode = false;
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
localStorage.setItem('theme', 'dark');
|
124
|
+
// Disable highlighter default color theme
|
125
|
+
document.getElementById("highlight-default").disabled=true;
|
126
|
+
document.getElementById("highlight-dark").disabled=false;
|
127
|
+
changeGiscusTheme('noborder_gray');
|
128
|
+
isDarkMode = true;
|
129
|
+
}
|
130
|
+
});
|
131
|
+
});
|
132
|
+
|
133
|
+
function changeGiscusTheme(theme) {
|
134
|
+
const iframe = document.querySelector('iframe.giscus-frame');
|
135
|
+
if (!iframe) return;
|
136
|
+
|
137
|
+
const message = {
|
138
|
+
setConfig: {
|
139
|
+
theme: theme
|
140
|
+
}
|
141
|
+
};
|
142
|
+
|
143
|
+
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
144
|
+
}
|
145
|
+
|
146
|
+
// search box
|
147
|
+
const searchButton = document.querySelectorAll("#btn-search");
|
148
|
+
const cancelButton = document.querySelector('#btn-clear');
|
149
|
+
const searchPage = document.querySelector("#search");
|
150
|
+
|
151
|
+
if (searchButton) {
|
152
|
+
searchButton.forEach((btn) => {
|
153
|
+
btn.addEventListener('click', function() {
|
154
|
+
searchPage.classList.add('active');
|
155
|
+
$('#search-input').focus();
|
156
|
+
});
|
157
|
+
});
|
158
|
+
}
|
159
|
+
|
160
|
+
if (searchPage) {
|
161
|
+
searchPage.addEventListener('click', function(event) {
|
162
|
+
const searchBar = document.querySelector(".search-box");
|
163
|
+
var target = event.target;
|
164
|
+
|
165
|
+
if (searchBar.contains(target))
|
166
|
+
return;
|
167
|
+
|
168
|
+
searchPage.classList.remove('active');
|
169
|
+
});
|
170
|
+
}
|
171
|
+
|
172
|
+
if (cancelButton) {
|
173
|
+
cancelButton.addEventListener('click', function() {
|
174
|
+
$('.result-item').remove();
|
175
|
+
$('#search-input').val("");
|
176
|
+
$('#btn-clear').hide();
|
177
|
+
});
|
178
|
+
}
|
179
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/* Font Face Observer v2.3.0 - © Bram Stein. License: BSD-3-Clause */(function(){'use strict';var f,g=[];function l(a){g.push(a);1==g.length&&f()}function m(){for(;g.length;)g[0](),g.shift()}f=function(){setTimeout(m)};function n(a){this.a=p;this.b=void 0;this.f=[];var b=this;try{a(function(a){q(b,a)},function(a){r(b,a)})}catch(c){r(b,c)}}var p=2;function t(a){return new n(function(b,c){c(a)})}function u(a){return new n(function(b){b(a)})}function q(a,b){if(a.a==p){if(b==a)throw new TypeError;var c=!1;try{var d=b&&b.then;if(null!=b&&"object"==typeof b&&"function"==typeof d){d.call(b,function(b){c||q(a,b);c=!0},function(b){c||r(a,b);c=!0});return}}catch(e){c||r(a,e);return}a.a=0;a.b=b;v(a)}}
|
2
|
+
function r(a,b){if(a.a==p){if(b==a)throw new TypeError;a.a=1;a.b=b;v(a)}}function v(a){l(function(){if(a.a!=p)for(;a.f.length;){var b=a.f.shift(),c=b[0],d=b[1],e=b[2],b=b[3];try{0==a.a?"function"==typeof c?e(c.call(void 0,a.b)):e(a.b):1==a.a&&("function"==typeof d?e(d.call(void 0,a.b)):b(a.b))}catch(h){b(h)}}})}n.prototype.g=function(a){return this.c(void 0,a)};n.prototype.c=function(a,b){var c=this;return new n(function(d,e){c.f.push([a,b,d,e]);v(c)})};
|
3
|
+
function w(a){return new n(function(b,c){function d(c){return function(d){h[c]=d;e+=1;e==a.length&&b(h)}}var e=0,h=[];0==a.length&&b(h);for(var k=0;k<a.length;k+=1)u(a[k]).c(d(k),c)})}function x(a){return new n(function(b,c){for(var d=0;d<a.length;d+=1)u(a[d]).c(b,c)})};window.Promise||(window.Promise=n,window.Promise.resolve=u,window.Promise.reject=t,window.Promise.race=x,window.Promise.all=w,window.Promise.prototype.then=n.prototype.c,window.Promise.prototype["catch"]=n.prototype.g);}());
|
4
|
+
|
5
|
+
(function(){function p(a,c){document.addEventListener?a.addEventListener("scroll",c,!1):a.attachEvent("scroll",c)}function u(a){document.body?a():document.addEventListener?document.addEventListener("DOMContentLoaded",function b(){document.removeEventListener("DOMContentLoaded",b);a()}):document.attachEvent("onreadystatechange",function g(){if("interactive"==document.readyState||"complete"==document.readyState)document.detachEvent("onreadystatechange",g),a()})};function w(a){this.g=document.createElement("div");this.g.setAttribute("aria-hidden","true");this.g.appendChild(document.createTextNode(a));this.h=document.createElement("span");this.i=document.createElement("span");this.m=document.createElement("span");this.j=document.createElement("span");this.l=-1;this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";
|
6
|
+
this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;";this.h.appendChild(this.m);this.i.appendChild(this.j);this.g.appendChild(this.h);this.g.appendChild(this.i)}
|
7
|
+
function x(a,c){a.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+c+";"}function B(a){var c=a.g.offsetWidth,b=c+100;a.j.style.width=b+"px";a.i.scrollLeft=b;a.h.scrollLeft=a.h.scrollWidth+100;return a.l!==c?(a.l=c,!0):!1}function C(a,c){function b(){var e=g;B(e)&&null!==e.g.parentNode&&c(e.l)}var g=a;p(a.h,b);p(a.i,b);B(a)};function D(a,c,b){c=c||{};b=b||window;this.family=a;this.style=c.style||"normal";this.weight=c.weight||"normal";this.stretch=c.stretch||"normal";this.context=b}var E=null,F=null,G=null,H=null;function I(a){null===F&&(M(a)&&/Apple/.test(window.navigator.vendor)?(a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),F=!!a&&603>parseInt(a[1],10)):F=!1);return F}function M(a){null===H&&(H=!!a.document.fonts);return H}
|
8
|
+
function N(a,c){var b=a.style,g=a.weight;if(null===G){var e=document.createElement("div");try{e.style.font="condensed 100px sans-serif"}catch(q){}G=""!==e.style.font}return[b,g,G?a.stretch:"","100px",c].join(" ")}
|
9
|
+
D.prototype.load=function(a,c){var b=this,g=a||"BESbswy",e=0,q=c||3E3,J=(new Date).getTime();return new Promise(function(K,L){if(M(b.context)&&!I(b.context)){var O=new Promise(function(r,t){function h(){(new Date).getTime()-J>=q?t(Error(""+q+"ms timeout exceeded")):b.context.document.fonts.load(N(b,'"'+b.family+'"'),g).then(function(n){1<=n.length?r():setTimeout(h,25)},t)}h()}),P=new Promise(function(r,t){e=setTimeout(function(){t(Error(""+q+"ms timeout exceeded"))},q)});Promise.race([P,O]).then(function(){clearTimeout(e);
|
10
|
+
K(b)},L)}else u(function(){function r(){var d;if(d=-1!=k&&-1!=l||-1!=k&&-1!=m||-1!=l&&-1!=m)(d=k!=l&&k!=m&&l!=m)||(null===E&&(d=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),E=!!d&&(536>parseInt(d[1],10)||536===parseInt(d[1],10)&&11>=parseInt(d[2],10))),d=E&&(k==y&&l==y&&m==y||k==z&&l==z&&m==z||k==A&&l==A&&m==A)),d=!d;d&&(null!==f.parentNode&&f.parentNode.removeChild(f),clearTimeout(e),K(b))}function t(){if((new Date).getTime()-J>=q)null!==f.parentNode&&f.parentNode.removeChild(f),
|
11
|
+
L(Error(""+q+"ms timeout exceeded"));else{var d=b.context.document.hidden;if(!0===d||void 0===d)k=h.g.offsetWidth,l=n.g.offsetWidth,m=v.g.offsetWidth,r();e=setTimeout(t,50)}}var h=new w(g),n=new w(g),v=new w(g),k=-1,l=-1,m=-1,y=-1,z=-1,A=-1,f=document.createElement("div");f.dir="ltr";x(h,N(b,"sans-serif"));x(n,N(b,"serif"));x(v,N(b,"monospace"));f.appendChild(h.g);f.appendChild(n.g);f.appendChild(v.g);b.context.document.body.appendChild(f);y=h.g.offsetWidth;z=n.g.offsetWidth;A=v.g.offsetWidth;t();
|
12
|
+
C(h,function(d){k=d;r()});x(h,N(b,'"'+b.family+'",sans-serif'));C(n,function(d){l=d;r()});x(n,N(b,'"'+b.family+'",serif'));C(v,function(d){m=d;r()});x(v,N(b,'"'+b.family+'",monospace'))})})};"object"===typeof module?module.exports=D:(window.FontFaceObserver=D,window.FontFaceObserver.prototype.load=D.prototype.load);}());
|