benjeto-jekyll-theme 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +132 -0
- data/_data/texts.yml +100 -0
- data/_includes/appbox.html +7 -0
- data/_includes/audio.html +26 -0
- data/_includes/category.html +9 -0
- data/_includes/custom_head.html +0 -0
- data/_includes/exlink.html +5 -0
- data/_includes/footer.html +21 -0
- data/_includes/head.html +104 -0
- data/_includes/image.html +16 -0
- data/_includes/lang-select.html +19 -0
- data/_includes/menu.html +97 -0
- data/_includes/miniprof.html +29 -0
- data/_includes/nicovideo.html +8 -0
- data/_includes/postbox-custom.html +18 -0
- data/_includes/postbox-feed.html +31 -0
- data/_includes/tags.html +8 -0
- data/_includes/video.html +23 -0
- data/_includes/youtube.html +8 -0
- data/_layouts/base.html +34 -0
- data/_layouts/default.html +13 -0
- data/_layouts/home.html +133 -0
- data/_layouts/post.html +50 -0
- data/_sass/benjeto/base.scss +639 -0
- data/_sass/benjeto/css/app-box.scss +33 -0
- data/_sass/benjeto/css/figure.scss +57 -0
- data/_sass/benjeto/css/highlight.scss +62 -0
- data/_sass/benjeto/css/home-tab.scss +54 -0
- data/_sass/benjeto/css/menu.scss +64 -0
- data/_sass/benjeto/css/paginate.scss +35 -0
- data/_sass/benjeto/css/section-box.scss +36 -0
- data/_sass/benjeto/custom.scss +0 -0
- data/_sass/benjeto/dark.scss +45 -0
- data/_sass/benjeto/light.scss +26 -0
- data/assets/icon/clip.svg +1 -0
- data/assets/icon/close.svg +1 -0
- data/assets/icon/love.svg +2 -0
- data/assets/icon/message.svg +2 -0
- data/assets/icon/share.svg +1 -0
- data/assets/icon.png +0 -0
- data/assets/js/lang-redirect.js +16 -0
- data/assets/js/menu.js +61 -0
- data/assets/js/share.js +92 -0
- data/assets/style.scss +46 -0
- metadata +158 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
.highlight {
|
2
|
+
.c { color: #5c85b5; font-style: italic } // Comment
|
3
|
+
.err { color: #ff4d4d; background-color: #ffcccc } // Error
|
4
|
+
.k { font-weight: bold; color: #007acc } // Keyword
|
5
|
+
.o { font-weight: bold; color: #007acc } // Operator
|
6
|
+
.cm { color: #5c85b5; font-style: italic } // Comment.Multiline
|
7
|
+
.cp { color: #7a7a7a; font-weight: bold } // Comment.Preproc
|
8
|
+
.c1 { color: #5c85b5; font-style: italic } // Comment.Single
|
9
|
+
.cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special
|
10
|
+
.gd { color: #000; background-color: #ffcccc } // Generic.Deleted
|
11
|
+
.gd .x { color: #000; background-color: #ff9999 } // Generic.Deleted.Specific
|
12
|
+
.ge { font-style: italic } // Generic.Emph
|
13
|
+
.gr { color: #a00 } // Generic.Error
|
14
|
+
.gh { color: #5c85b5 } // Generic.Heading
|
15
|
+
.gi { color: #000; background-color: #ccffcc } // Generic.Inserted
|
16
|
+
.gi .x { color: #000; background-color: #99ff99 } // Generic.Inserted.Specific
|
17
|
+
.go { color: #888 } // Generic.Output
|
18
|
+
.gp { color: #666 } // Generic.Prompt
|
19
|
+
.gs { font-weight: bold } // Generic.Strong
|
20
|
+
.gu { color: #aaa } // Generic.Subheading
|
21
|
+
.gt { color: #a00 } // Generic.Traceback
|
22
|
+
.kc { font-weight: bold; color: #007acc } // Keyword.Constant
|
23
|
+
.kd { font-weight: bold; color: #007acc } // Keyword.Declaration
|
24
|
+
.kp { font-weight: bold; color: #007acc } // Keyword.Pseudo
|
25
|
+
.kr { font-weight: bold; color: #007acc } // Keyword.Reserved
|
26
|
+
.kt { color: #3c78b5; font-weight: bold } // Keyword.Type
|
27
|
+
.m { color: #099 } // Literal.Number
|
28
|
+
.s { color: #d14 } // Literal.String
|
29
|
+
.na { color: #008080 } // Name.Attribute
|
30
|
+
.nb { color: #0086B3 } // Name.Builtin
|
31
|
+
.nc { color: #3c78b5; font-weight: bold } // Name.Class
|
32
|
+
.no { color: #008080 } // Name.Constant
|
33
|
+
.ni { color: #a010a0 } // Name.Entity
|
34
|
+
.ne { color: #900; font-weight: bold } // Name.Exception
|
35
|
+
.nf { color: #900; font-weight: bold } // Name.Function
|
36
|
+
.nn { color: #555 } // Name.Namespace
|
37
|
+
.nt { color: #5050ff } // Name.Tag
|
38
|
+
.nv { color: #008080 } // Name.Variable
|
39
|
+
.ow { font-weight: bold; color: #007acc } // Operator.Word
|
40
|
+
.w { color: #bbb } // Text.Whitespace
|
41
|
+
.mf { color: #099 } // Literal.Number.Float
|
42
|
+
.mh { color: #099 } // Literal.Number.Hex
|
43
|
+
.mi { color: #099 } // Literal.Number.Integer
|
44
|
+
.mo { color: #099 } // Literal.Number.Oct
|
45
|
+
.sb { color: #d14 } // Literal.String.Backtick
|
46
|
+
.sc { color: #d14 } // Literal.String.Char
|
47
|
+
.sd { color: #d14 } // Literal.String.Doc
|
48
|
+
.s2 { color: #d14 } // Literal.String.Double
|
49
|
+
.se { color: #d14 } // Literal.String.Escape
|
50
|
+
.sh { color: #d14 } // Literal.String.Heredoc
|
51
|
+
.si { color: #d14 } // Literal.String.Interpol
|
52
|
+
.sx { color: #d14 } // Literal.String.Other
|
53
|
+
.sr { color: #009926 } // Literal.String.Regex
|
54
|
+
.s1 { color: #d14 } // Literal.String.Single
|
55
|
+
.ss { color: #990073 } // Literal.String.Symbol
|
56
|
+
.bp { color: #999 } // Name.Builtin.Pseudo
|
57
|
+
.vc { color: #008080 } // Name.Variable.Class
|
58
|
+
.vg { color: #008080 } // Name.Variable.Global
|
59
|
+
.vi { color: #008080 } // Name.Variable.Instance
|
60
|
+
.il { color: #099 } // Literal.Number.Integer.Long
|
61
|
+
}
|
62
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
nav.home-tab {
|
2
|
+
display: flex;
|
3
|
+
padding: 8px 0;
|
4
|
+
margin-inline-start: -16px;
|
5
|
+
width: calc(100% + 32px);
|
6
|
+
overflow-x: auto;
|
7
|
+
scrollbar-width: none;
|
8
|
+
ul {
|
9
|
+
display: flex;
|
10
|
+
list-style: none;
|
11
|
+
padding: 0;
|
12
|
+
width: 100%;
|
13
|
+
margin: 0 16px;
|
14
|
+
border-bottom: 2px solid var(--boxbg);
|
15
|
+
li {
|
16
|
+
margin-bottom: -2px;
|
17
|
+
border-bottom: 2px solid var(--boxbg);
|
18
|
+
a {
|
19
|
+
display: block;
|
20
|
+
padding: 8px 12px;
|
21
|
+
text-decoration: none;
|
22
|
+
color: var(--gray);
|
23
|
+
transition: background 0.2s;
|
24
|
+
&:hover, &:focus {
|
25
|
+
background: var(--boxbg);
|
26
|
+
color: var(--text);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
&.current {
|
30
|
+
border-bottom: 2px solid var(--border);
|
31
|
+
a {
|
32
|
+
color: var(--text);
|
33
|
+
font-weight: 600;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
&::-webkit-scrollbar {
|
39
|
+
display: none;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
div.tab-description {
|
43
|
+
display: flex;
|
44
|
+
flex-wrap: wrap;
|
45
|
+
align-items: center;
|
46
|
+
margin: 8px 0;
|
47
|
+
padding: 0 8px;
|
48
|
+
p {
|
49
|
+
margin: 0 8px 0 4px;
|
50
|
+
}
|
51
|
+
.menu-btn {
|
52
|
+
margin-inline-start: auto;
|
53
|
+
}
|
54
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
.menu {
|
2
|
+
display: none;
|
3
|
+
position: fixed;
|
4
|
+
top: 50%;
|
5
|
+
left: 50%;
|
6
|
+
transform: translate(-50%, -50%);
|
7
|
+
background: var(--page);
|
8
|
+
border-radius: 16px;
|
9
|
+
padding: 16px 24px 12px;
|
10
|
+
box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.4);
|
11
|
+
z-index: 2;
|
12
|
+
width: 500px;
|
13
|
+
max-width: 90%;
|
14
|
+
}
|
15
|
+
|
16
|
+
.menu ul {
|
17
|
+
list-style: none;
|
18
|
+
margin: 8px 0 2px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.menu li {
|
22
|
+
border-top: 1px solid var(--border);
|
23
|
+
}
|
24
|
+
|
25
|
+
.menu a {
|
26
|
+
padding: 8px 0;
|
27
|
+
display: block;
|
28
|
+
}
|
29
|
+
|
30
|
+
.menu .menuline {
|
31
|
+
display: flex;
|
32
|
+
flex-direction: row-reverse;
|
33
|
+
justify-content: space-between;
|
34
|
+
align-items: center;
|
35
|
+
}
|
36
|
+
|
37
|
+
.menu .close-btn {
|
38
|
+
background: none;
|
39
|
+
border: none;
|
40
|
+
border-radius: 32px;
|
41
|
+
padding: 0;
|
42
|
+
font-size: 1em;
|
43
|
+
transition: background 0.15s;
|
44
|
+
&:hover {
|
45
|
+
background: var(--boxbg);
|
46
|
+
}
|
47
|
+
img {
|
48
|
+
width: 1em;
|
49
|
+
height: 1em;
|
50
|
+
margin: 0.5em;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
#overlay {
|
55
|
+
display: none;
|
56
|
+
position: fixed;
|
57
|
+
top: 0;
|
58
|
+
left: 0;
|
59
|
+
width: 100%;
|
60
|
+
height: 100%;
|
61
|
+
background: rgba(0, 0, 0, 0.3);
|
62
|
+
z-index: 1;
|
63
|
+
}
|
64
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
section.paginate {
|
2
|
+
display: flex;
|
3
|
+
justify-content: center;
|
4
|
+
flex-wrap: wrap;
|
5
|
+
margin: 16px 0;
|
6
|
+
width: 100%;
|
7
|
+
a, span {
|
8
|
+
display: inline-block;
|
9
|
+
border: 1px solid var(--border);
|
10
|
+
padding: 8px 16px;
|
11
|
+
margin: 0;
|
12
|
+
text-align: center;
|
13
|
+
min-width: 64px;
|
14
|
+
}
|
15
|
+
a {
|
16
|
+
transition: color 0.2s, background 0.2s;
|
17
|
+
&:hover, &:focus {
|
18
|
+
background: var(--boxbglight);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
:first-child {
|
22
|
+
border-start-start-radius: 8px;
|
23
|
+
border-end-start-radius: 8px;
|
24
|
+
}
|
25
|
+
:last-child {
|
26
|
+
border-start-end-radius: 8px;
|
27
|
+
border-end-end-radius: 8px;
|
28
|
+
}
|
29
|
+
:first-child {
|
30
|
+
margin-inline-end: -1px;
|
31
|
+
}
|
32
|
+
:last-child {
|
33
|
+
margin-inline-start: -1px;
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
div.section-box {
|
2
|
+
margin: 16px 0;
|
3
|
+
border: 1px solid var(--border);
|
4
|
+
border-radius: 8px;
|
5
|
+
ul {
|
6
|
+
list-style: none;
|
7
|
+
padding: 0;
|
8
|
+
margin: 0;
|
9
|
+
}
|
10
|
+
li {
|
11
|
+
padding: 8px 12px;
|
12
|
+
border-top: 1px solid var(--border);
|
13
|
+
ul {
|
14
|
+
display: flex;
|
15
|
+
align-items: center;
|
16
|
+
flex-wrap: wrap;
|
17
|
+
width: 100%;
|
18
|
+
list-style: none;
|
19
|
+
padding: 0;
|
20
|
+
margin: 0;
|
21
|
+
li {
|
22
|
+
flex-grow: 1;
|
23
|
+
padding: 0;
|
24
|
+
padding-inline-end: 12px;
|
25
|
+
border: none;
|
26
|
+
&:not(:first-child) {
|
27
|
+
padding-inline-start: 12px;
|
28
|
+
border-inline-start: 1px solid var(--border);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
&:first-child {
|
33
|
+
border-top: none;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
File without changes
|
@@ -0,0 +1,45 @@
|
|
1
|
+
:root {
|
2
|
+
color-scheme:dark;
|
3
|
+
--bg: #000;
|
4
|
+
--page: #1a1c28;
|
5
|
+
--text: #eee;
|
6
|
+
--gray: #a3a3a3;
|
7
|
+
--head: #f5f5f5;
|
8
|
+
--link: #00b2ff;
|
9
|
+
--linkhover: #a0d0ff;
|
10
|
+
--boxbg: #2a3550;
|
11
|
+
--boxbglight: #222a38;
|
12
|
+
--border: #457;
|
13
|
+
}
|
14
|
+
@media (prefers-contrast: more) {
|
15
|
+
:root {
|
16
|
+
--bg: #000;
|
17
|
+
--page: #101320;
|
18
|
+
--text: #fff;
|
19
|
+
--gray: #b5b5b5;
|
20
|
+
--head: #fff;
|
21
|
+
--link: #30c0ff;
|
22
|
+
--linkhover: #aadaff;
|
23
|
+
--boxbg: #2e3a58;
|
24
|
+
--boxbglight: #282e3c;
|
25
|
+
--border: #679;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
.menu-btn:hover, .menu-btn:focus {
|
29
|
+
filter: brightness(0.7);
|
30
|
+
}
|
31
|
+
.menu {
|
32
|
+
box-shadow: 0px 0px 32px rgba(0, 0, 0, 0.6);
|
33
|
+
}
|
34
|
+
header.home ul.exlink li {
|
35
|
+
a:hover, a:focus {
|
36
|
+
filter: brightness(0.75);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
#overlay {
|
40
|
+
background: rgba(127, 127, 127, 0.5);
|
41
|
+
}
|
42
|
+
.icon {
|
43
|
+
filter: invert(1);
|
44
|
+
}
|
45
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
:root {
|
2
|
+
--bg: #f8f8fc;
|
3
|
+
--page: #fff;
|
4
|
+
--text: #222;
|
5
|
+
--gray: #666;
|
6
|
+
--head: #0a0a0a;
|
7
|
+
--link: #0050ea;
|
8
|
+
--linkhover: #0020a0;
|
9
|
+
--boxbg: #daeaff;
|
10
|
+
--boxbglight: #f0f5ff;
|
11
|
+
--border: #a5caff;
|
12
|
+
}
|
13
|
+
@media (prefers-contrast: more) {
|
14
|
+
:root {
|
15
|
+
--bg: #fafaff;
|
16
|
+
--text: #000;
|
17
|
+
--gray: #555;
|
18
|
+
--head: #000;
|
19
|
+
--link: #0000ff;
|
20
|
+
--linkhover: #000090;
|
21
|
+
--boxbg: #d0e0ff;
|
22
|
+
--boxbglight: #e5f0fa;
|
23
|
+
--border: #50a0ff;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M6.387 6.249h7.652a1.913 1.913 0 0 1 1.912 1.913v11.477a1.913 1.913 0 0 1-1.912 1.913H6.387a1.913 1.913 0 0 1-1.913-1.913V8.162a1.913 1.913 0 0 1 1.913-1.913Z" style="stroke-width:1.91283"/><path d="M17.536 3.493h-10a1 1 0 1 1 0-2h10a3 3 0 0 1 3 3v14a1 1 0 1 1-2 0v-14a1 1 0 0 0-1-1z" fill="#000" stroke="none"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><line x1="10" y1="10" x2="90" y2="90" stroke="black" stroke-width="15"/><line x1="90" y1="10" x2="10" y2="90" stroke="black" stroke-width="15"/></svg>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41 1 4.5 2.5C13.09 4 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
2
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.984 4.336h16.032c1.102 0 2.004.862 2.004 1.916v11.496c0 1.054-.902 1.916-2.004 1.916H3.984c-1.102 0-2.004-.862-2.004-1.916V6.252c0-1.054.902-1.916 2.004-1.916z" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M18.813 8.34 12 12.753 5.187 8.34" stroke="#000" stroke-width="1.748" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
2
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M25.719 52.522c-8.094 0-12.141 3.638-12.141 10.914v13.032c0 7.277 4.047 10.915 12.14 10.915h48.563c8.094 0 12.141-3.638 12.141-10.915V63.436c0-7.276-4.047-10.914-12.14-10.914" fill="none" stroke="#000" stroke-width="4.76" style="stroke-width:8.46464;stroke-dasharray:none"/><path stroke="#000" stroke-width="5" stroke-linecap="round" d="M50 11.136v48.37" style="stroke-width:8.46464;stroke-dasharray:none"/><path fill="none" stroke="#000" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" d="M25.815 35.32 50 11.136 74.185 35.32" style="stroke-width:8.46464"/></svg>
|
data/assets/icon.png
ADDED
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
document.addEventListener('DOMContentLoaded', function() {
|
4
|
+
const languages = {{ site.languages | jsonify }};
|
5
|
+
const defaultLang = "{{ site.lang | default: site.languages[0] }}";
|
6
|
+
|
7
|
+
const userLang = navigator.language || navigator.userLanguage;
|
8
|
+
const langCode = userLang.split('-')[0]; // "en-US" -> "en"
|
9
|
+
|
10
|
+
if (languages.includes(langCode)) {
|
11
|
+
window.location.replace(`/${langCode}${window.location.pathname}`);
|
12
|
+
} else {
|
13
|
+
window.location.replace(`/${defaultLang}${window.location.pathname}`);
|
14
|
+
}
|
15
|
+
});
|
16
|
+
|
data/assets/js/menu.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
document.addEventListener("DOMContentLoaded", function() {
|
2
|
+
var closeButtons = document.querySelectorAll("button.close-btn");
|
3
|
+
var menuButtons = document.querySelectorAll(".menues");
|
4
|
+
var overlay = document.getElementById("overlay");
|
5
|
+
|
6
|
+
|
7
|
+
menuButtons.forEach(function(menuButton) {
|
8
|
+
menuButton.style.display = "block";
|
9
|
+
menuButton.addEventListener("click", function(event) {
|
10
|
+
event.stopPropagation();
|
11
|
+
var menuId = menuButton.getAttribute("data-menu");
|
12
|
+
var menu = document.getElementById(menuId);
|
13
|
+
|
14
|
+
menu.style.display = "block";
|
15
|
+
overlay.style.display = "block";
|
16
|
+
|
17
|
+
setTimeout(function() {
|
18
|
+
var closeItem = menu.querySelector(".close-btn");
|
19
|
+
if (closeItem) {
|
20
|
+
closeItem.focus();
|
21
|
+
}
|
22
|
+
}, 100);
|
23
|
+
});
|
24
|
+
});
|
25
|
+
|
26
|
+
function hideMenus() {
|
27
|
+
var menus = document.querySelectorAll(".menu");
|
28
|
+
menus.forEach(function(menu) {
|
29
|
+
menu.style.display = "none";
|
30
|
+
});
|
31
|
+
overlay.style.display = "none";
|
32
|
+
}
|
33
|
+
|
34
|
+
overlay.addEventListener("click", function() {
|
35
|
+
hideMenus();
|
36
|
+
});
|
37
|
+
|
38
|
+
closeButtons.forEach(function(closeButton) {
|
39
|
+
closeButton.addEventListener("click", function() {
|
40
|
+
hideMenus();
|
41
|
+
});
|
42
|
+
});
|
43
|
+
|
44
|
+
document.addEventListener("keydown", function(event) {
|
45
|
+
if (event.key === "Escape") {
|
46
|
+
hideMenus();
|
47
|
+
}
|
48
|
+
});
|
49
|
+
|
50
|
+
function isDescendant(parent, child) {
|
51
|
+
for (var i = 0; i < parent.length; i++) {
|
52
|
+
var node = child.parentNode;
|
53
|
+
while (node != null) {
|
54
|
+
if (parent[i] === node) {
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
node = node.parentNode;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return false;
|
61
|
+
}});
|
data/assets/js/share.js
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
{%- assign texts = site.data.texts -%}
|
4
|
+
document.addEventListener('DOMContentLoaded', function () {
|
5
|
+
{%- if site.languages.size > 1 and site.plugins contains "jekyll-polyglot" %}
|
6
|
+
var shareText = {
|
7
|
+
{%- for lang in site.languages %}
|
8
|
+
{%- if site.data[lang].texts.share and lang != site.default_lang %}
|
9
|
+
"{{ lang }}" : "{{ site.data[lang].texts.share }}",
|
10
|
+
{%- endif %}
|
11
|
+
{%- endfor %}
|
12
|
+
{{ site.default_lang }}: "{{ site.data.texts.share }}"
|
13
|
+
};
|
14
|
+
var copiedText = {
|
15
|
+
{%- for lang in site.languages %}
|
16
|
+
{%- if site.data[lang].texts.share %}
|
17
|
+
"{{ lang }}" : "{{ site.data[lang].texts.copied }}",
|
18
|
+
{%- endif %}
|
19
|
+
{%- endfor %}
|
20
|
+
{{ site.default_lang }}: "{{ site.data.texts.copied }}"
|
21
|
+
};
|
22
|
+
{%- endif %}
|
23
|
+
const shareButtons = document.querySelectorAll('.shareBtn');
|
24
|
+
|
25
|
+
shareButtons.forEach(button => {
|
26
|
+
const img = button.querySelector('img');
|
27
|
+
const shareMsg = button.querySelector('.shareMsg');
|
28
|
+
const url = window.location.protocol + window.location.host + button.getAttribute('data-url');
|
29
|
+
|
30
|
+
if (navigator.share) {
|
31
|
+
button.style.display = 'inline-block';
|
32
|
+
img.src = '{{ "/assets/icon/share.svg" | relative_url }}';
|
33
|
+
|
34
|
+
{%- if site.languages.size > 1 and site.plugins contains "jekyll-polyglot" %}
|
35
|
+
const lang = document.documentElement.lang;
|
36
|
+
if (lang in shareText) {
|
37
|
+
img.alt = shareText[(lang)];
|
38
|
+
} else {
|
39
|
+
img.alt = shareText["{{ site.default_lang }}"];
|
40
|
+
}
|
41
|
+
{%- else %}
|
42
|
+
img.alt = '{{ texts.share }}';
|
43
|
+
{%- endif %}
|
44
|
+
|
45
|
+
button.addEventListener('click', async function () {
|
46
|
+
event.preventDefault();
|
47
|
+
event.stopPropagation();
|
48
|
+
|
49
|
+
const title = button.getAttribute('data-title');
|
50
|
+
|
51
|
+
try {
|
52
|
+
await navigator.share({
|
53
|
+
title: title,
|
54
|
+
url: url
|
55
|
+
});
|
56
|
+
} catch (error) {
|
57
|
+
console.error('Error sharing:', error);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
} else {
|
61
|
+
button.style.display = 'inline-block';
|
62
|
+
|
63
|
+
button.addEventListener('click', function () {
|
64
|
+
event.preventDefault();
|
65
|
+
event.stopPropagation();
|
66
|
+
|
67
|
+
navigator.clipboard.writeText(url).then(() => {
|
68
|
+
button.classList.add('disabled');
|
69
|
+
|
70
|
+
{%- if site.languages.size > 1 and site.plugins contains "jekyll-polyglot" %}
|
71
|
+
const lang = document.documentElement.lang;
|
72
|
+
if (lang in copiedText) {
|
73
|
+
shareMsg.textContent = copiedText[(lang)];
|
74
|
+
} else {
|
75
|
+
shareMsg.textContent = copiedText["{{ site.default_lang }}"];
|
76
|
+
}
|
77
|
+
{%- else %}
|
78
|
+
shareMsg.textContent = '{{ texts.copied }}';
|
79
|
+
{%- endif %}
|
80
|
+
|
81
|
+
setTimeout(() => {
|
82
|
+
shareMsg.textContent = "";
|
83
|
+
button.classList.remove('disabled');
|
84
|
+
}, 1000);
|
85
|
+
}).catch(err => {
|
86
|
+
console.error('Error copying URL:', err);
|
87
|
+
});
|
88
|
+
});
|
89
|
+
}
|
90
|
+
});
|
91
|
+
});
|
92
|
+
|
data/assets/style.scss
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
{%- assign profile = site.data.profile -%}
|
4
|
+
{%- assign settings = site.data.settings -%}
|
5
|
+
|
6
|
+
{% if settings.style.highlight == true %}
|
7
|
+
@import "benjeto/css/highlight.scss";
|
8
|
+
{% endif %}
|
9
|
+
|
10
|
+
// System styles
|
11
|
+
@import
|
12
|
+
"benjeto/base.scss",
|
13
|
+
{% if settings.style.menu == true %}
|
14
|
+
"benjeto/css/menu.scss",
|
15
|
+
{% endif %}
|
16
|
+
{% if settings.style.figure == true %}
|
17
|
+
"benjeto/css/figure.scss",
|
18
|
+
{% endif %}
|
19
|
+
{% if settings.style.home_tab == true %}
|
20
|
+
"benjeto/css/home-tab.scss",
|
21
|
+
{% endif %}
|
22
|
+
{% if settings.style.paginate == true %}
|
23
|
+
"benjeto/css/paginate.scss",
|
24
|
+
{% endif %}
|
25
|
+
{% if settings.style.app_box == true %}
|
26
|
+
"benjeto/css/app-box.scss",
|
27
|
+
{% endif %}
|
28
|
+
{% if settings.style.section_box == true %}
|
29
|
+
"benjeto/css/section-box.scss",
|
30
|
+
{% endif %}
|
31
|
+
"benjeto/custom.scss"
|
32
|
+
;
|
33
|
+
|
34
|
+
// Dark mode
|
35
|
+
{% if settings.style.darkmode == "true" %}
|
36
|
+
@import "benjeto/dark.scss";
|
37
|
+
{% else %}
|
38
|
+
@import "benjeto/light.scss";
|
39
|
+
{% if settings.style.darkmode == "allow" %}
|
40
|
+
@media(prefers-color-scheme:dark) {
|
41
|
+
@import "benjeto/light.scss";
|
42
|
+
@import "benjeto/dark.scss";
|
43
|
+
}
|
44
|
+
{% endif %}
|
45
|
+
{% endif %}
|
46
|
+
|