jekyll-theme-unity 0.1.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 +56 -0
- data/_config.yml +135 -0
- data/_includes/assets/Google-Analytics.html +12 -0
- data/_includes/assets/anchor-headings.html +164 -0
- data/_includes/assets/btt.html +5 -0
- data/_includes/assets/code-header.html +6 -0
- data/_includes/assets/noscript.html +3 -0
- data/_includes/assets/site-banner.html +9 -0
- data/_includes/assets/site-top-bar.html +10 -0
- data/_includes/assets/toc.html +174 -0
- data/_includes/assets/youtube-embed.html +6 -0
- data/_includes/footer.html +39 -0
- data/_includes/head.html +21 -0
- data/_includes/header.html +49 -0
- data/_layouts/default.html +23 -0
- data/_layouts/page.html +5 -0
- data/_layouts/post.html +52 -0
- data/_layouts/post_home.html +105 -0
- data/_sass/Material/baseline.scss +18 -0
- data/_sass/Material/colors.scss +130 -0
- data/_sass/Material/elevation.scss +62 -0
- data/_sass/Material/motion.scss +180 -0
- data/_sass/Material/palette.scss +118 -0
- data/_sass/Material/shape.scss +109 -0
- data/_sass/Material/state.scss +35 -0
- data/_sass/Material/typography.scss +505 -0
- data/_sass/custom/layout.scss +1 -0
- data/_sass/custom/styles_variables.scss +70 -0
- data/_sass/custom/variables.scss +1 -0
- data/_sass/jekyll-theme-unity.scss +1 -0
- data/_sass/layout/base.scss +525 -0
- data/_sass/layout/highlight-dark.scss +357 -0
- data/_sass/layout/highlight-light.scss +202 -0
- data/_sass/layout/layout.scss +581 -0
- data/_sass/layout/styles_variables.scss +156 -0
- data/_sass/variables.scss +170 -0
- data/assets/css/style.scss +10 -0
- data/assets/image/404.svg +34 -0
- data/assets/image/Unity.png +0 -0
- data/assets/image/bg-banner.png +0 -0
- data/assets/image/favicons/android-chrome-192x192.png +0 -0
- data/assets/image/favicons/android-chrome-512x512.png +0 -0
- data/assets/image/favicons/apple-touch-icon-120x120.png +0 -0
- data/assets/image/favicons/apple-touch-icon-152x152.png +0 -0
- data/assets/image/favicons/apple-touch-icon-180x180.png +0 -0
- data/assets/image/favicons/apple-touch-icon-60x60.png +0 -0
- data/assets/image/favicons/apple-touch-icon-76x76.png +0 -0
- data/assets/image/favicons/apple-touch-icon.png +0 -0
- data/assets/image/favicons/browserconfig.xml +12 -0
- data/assets/image/favicons/favicon-16x16.png +0 -0
- data/assets/image/favicons/favicon-32x32.png +0 -0
- data/assets/image/favicons/favicon.ico +0 -0
- data/assets/image/favicons/mstile-150x150.png +0 -0
- data/assets/image/favicons/mstile-310x150.png +0 -0
- data/assets/image/favicons/mstile-310x310.png +0 -0
- data/assets/image/favicons/mstile-70x70.png +0 -0
- data/assets/image/favicons/safari-pinned-tab.svg +22 -0
- data/assets/image/favicons/site.webmanifest +17 -0
- data/assets/image/mobile.png +0 -0
- data/assets/js/main.js +228 -0
- data/bin/run +196 -0
- metadata +195 -0
@@ -0,0 +1,170 @@
|
|
1
|
+
$content-width: 800px !default;
|
2
|
+
$mobile-width: 600px !default;
|
3
|
+
$pc-width: 800px !default;
|
4
|
+
$medium-width: 442px !default;
|
5
|
+
$defualt-width: 1000px !default;
|
6
|
+
|
7
|
+
@mixin link($color, $hover-color, $hover-bgcolor) {
|
8
|
+
color: $color;
|
9
|
+
text-decoration: none;
|
10
|
+
@include duration-550;
|
11
|
+
@include easing-standard;
|
12
|
+
|
13
|
+
&:hover {
|
14
|
+
color: $hover-color;
|
15
|
+
background: $hover-bgcolor;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
@mixin btn {
|
19
|
+
@include duration-550;
|
20
|
+
@include easing-standard;
|
21
|
+
display: flex;
|
22
|
+
flex-direction: column;
|
23
|
+
justify-content: center;
|
24
|
+
align-items: center;
|
25
|
+
gap: 8px;
|
26
|
+
padding: 12px 50px;
|
27
|
+
left: 40px;
|
28
|
+
top: 64px;
|
29
|
+
border-radius: 100px;
|
30
|
+
}
|
31
|
+
|
32
|
+
@mixin prompt($bg-color, $color, $icon, $icon-color, $icon-font-family) {
|
33
|
+
@include shape-large;
|
34
|
+
background-color: $bg-color;
|
35
|
+
color: $color;
|
36
|
+
padding: 0.8rem 1.2rem;
|
37
|
+
&::before {
|
38
|
+
content: $icon;
|
39
|
+
font-family: $icon-font-family;
|
40
|
+
color: $color;
|
41
|
+
font-size: 34px;
|
42
|
+
line-height: 1;
|
43
|
+
padding-right: 10px;
|
44
|
+
padding-bottom: 13px;
|
45
|
+
font-variation-settings:
|
46
|
+
'FILL' 1,
|
47
|
+
'wght' 400,
|
48
|
+
'GRAD' 0,
|
49
|
+
'opsz' 48
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
@mixin horizontal-scroll {
|
54
|
+
&::-webkit-scrollbar {
|
55
|
+
height: 16px;
|
56
|
+
}
|
57
|
+
|
58
|
+
&::-webkit-scrollbar-track {
|
59
|
+
background-color: transparent;
|
60
|
+
}
|
61
|
+
|
62
|
+
&::-webkit-scrollbar-thumb {
|
63
|
+
background: rgba(128, 134, 139, 0.2);
|
64
|
+
background-clip: padding-box;
|
65
|
+
border: 4px solid transparent;
|
66
|
+
border-radius: 10px;
|
67
|
+
box-sizing: border-box;
|
68
|
+
|
69
|
+
&:hover {
|
70
|
+
background: rgba(128, 134, 139, 0.4);
|
71
|
+
box-sizing: border-box;
|
72
|
+
background-clip: padding-box;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
@mixin elevation1($bg-color) {
|
78
|
+
background: linear-gradient(0deg, rgba(208, 188, 255, 0.05), rgba(208, 188, 255, 0.05)), $bg-color;
|
79
|
+
}
|
80
|
+
@mixin elevation2($bg-color) {
|
81
|
+
background: linear-gradient(0deg, rgba(208, 188, 255, 0.08), rgba(208, 188, 255, 0.08)), $bg-color;
|
82
|
+
}
|
83
|
+
@mixin elevation3($bg-color) {
|
84
|
+
background: linear-gradient(0deg, rgba(208, 188, 255, 0.11), rgba(208, 188, 255, 0.11)), $bg-color;
|
85
|
+
}
|
86
|
+
@mixin elevation4($bg-color) {
|
87
|
+
background: linear-gradient(0deg, rgba(208, 188, 255, 0.12), rgba(208, 188, 255, 0.12)), $bg-color;
|
88
|
+
}
|
89
|
+
@mixin elevation5($bg-color) {
|
90
|
+
background: linear-gradient(0deg, rgba(208, 188, 255, 0.14), rgba(208, 188, 255, 0.14)), $bg-color;
|
91
|
+
}
|
92
|
+
|
93
|
+
@keyframes Drawer-Entrance {
|
94
|
+
from {
|
95
|
+
transform: translateX(-1000rem);
|
96
|
+
opacity: 0;
|
97
|
+
}
|
98
|
+
to {
|
99
|
+
transform: translateX(0rem);
|
100
|
+
opacity: 1;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
@keyframes Drawer-exit {
|
104
|
+
from {
|
105
|
+
transform: translateX(0rem);
|
106
|
+
opacity: 1;
|
107
|
+
}
|
108
|
+
to {
|
109
|
+
transform: translateX(-1000rem);
|
110
|
+
opacity: 0;
|
111
|
+
|
112
|
+
}
|
113
|
+
}
|
114
|
+
@keyframes opacitychange {
|
115
|
+
from {
|
116
|
+
opacity: 0;
|
117
|
+
}
|
118
|
+
to {
|
119
|
+
opacity: 1;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
@keyframes opacityrestore {
|
123
|
+
from {
|
124
|
+
opacity: 1;
|
125
|
+
}
|
126
|
+
to {
|
127
|
+
opacity: 0;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
@keyframes activeanimation {
|
131
|
+
from {
|
132
|
+
opacity: 0;
|
133
|
+
transform: scaleX(0.32);
|
134
|
+
}
|
135
|
+
to {
|
136
|
+
opacity: 1;
|
137
|
+
transform: scaleX(1);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
@keyframes wrapper-animation {
|
141
|
+
from {
|
142
|
+
opacity: 0;
|
143
|
+
transform: translateY(3rem);
|
144
|
+
}
|
145
|
+
to {
|
146
|
+
opacity: 1;
|
147
|
+
transform: translateY(0rem);
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
@keyframes TOC-Entrance {
|
152
|
+
from {
|
153
|
+
transform: translateY(-1rem);
|
154
|
+
opacity: 0;
|
155
|
+
}
|
156
|
+
to {
|
157
|
+
transform: translateY(0rem);
|
158
|
+
opacity: 1;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
@keyframes TOC-Exit {
|
163
|
+
from {
|
164
|
+
transform: translateY(0rem);
|
165
|
+
opacity: 1;
|
166
|
+
}
|
167
|
+
to {
|
168
|
+
transform: translateY(-1rem);
|
169
|
+
}
|
170
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
4
|
+
<svg version="1.1" id="404" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5
|
+
width="100%" viewBox="0 0 512 512">
|
6
|
+
<path
|
7
|
+
d="M 183.7 34.8 C 199.9 25.2 216.7 19.7 235.5 19.8 C 251.1 19.8 265.9 21.5 280.5 27.2 C 287.7 29.9 296 29.6 303.4 32 C 317.4 36.5 331.2 41.9 345 47.2 C 346.4 47.7 348.2 49.7 348.2 51 C 348.1 57 352.4 60.2 355.8 63.9 C 378.4 88.9 387.1 118.3 384.4 151.8 C 382.1 179.1 370 202.3 356.4 225.2 C 349.5 236.7 344.3 249.2 337.7 260.9 C 327.8 278.2 317 295.1 307.2 312.5 C 301.5 322.6 295.9 333 292.4 344 C 288 357.7 289.6 371.8 294.5 385.5 C 298.6 396.9 295.5 403.3 283.4 404 C 270.3 404.8 262.6 397.2 256.2 387.3 C 253.2 382.7 252.1 378.1 252.6 372.7 C 255.7 341.4 263.6 311.6 278.3 283.6 C 282.2 276.4 282.8 267.4 284.7 259.1 C 290.5 233.1 301.9 209.9 319 189.5 C 323.6 184 328.6 178.9 333 173.3 C 334.4 171.6 335.4 168.9 335.2 166.7 C 333.8 143.4 330.4 120.4 322 98.4 C 320.7 95.2 318.4 92 315.8 89.7 C 304.7 79.7 291.2 73.7 277.1 69.6 C 264.2 65.7 250.9 63.4 237.7 60.8 C 235.3 60.4 232 61.3 230 62.8 C 211 76.9 202.1 96.9 196.9 119.2 C 192 140.5 192.4 162.1 190.9 183.7 C 190.3 192.6 190 201.7 185.5 209.9 C 182.4 215.6 177.6 219.2 171.5 221.2 C 167.6 222.5 164 222.7 160.8 218.7 C 159.5 217 156.2 216 153.8 216.1 C 148.6 216.4 145.7 214.2 143.1 209.8 C 131.1 189.2 126.9 166.9 129.9 143.5 C 132.6 122.1 136.6 100.8 144.7 80.6 C 152.5 61.2 165.6 46.1 183.7 34.8 M 326.9 246.9 C 330.3 242.1 333.7 237.2 337.1 232.4 C 336.6 232.1 336.2 231.8 335.7 231.5 C 329.7 234.9 328.2 241.1 325.8 247.1 C 326 247.2 326.1 247.2 326.9 246.9 M 301.1 65.2 C 301.2 65.2 301.3 65.3 301.4 65.3 C 301.4 65.1 301.3 64.9 300.9 64.1 C 288.4 56.3 275.6 49.5 260 52.2 C 273.7 56.5 287.3 60.8 301.1 65.2 M 160.1 166 C 160.9 170 161.5 174.1 162.8 177.8 C 163.2 178.9 166.1 179.8 167.4 179.4 C 168.5 179 169.6 176.7 169.7 175.2 C 170 167.9 169.6 160.6 170 153.4 C 171.5 127.1 180.2 103.4 195.4 82 C 199.2 76.7 202.4 71 205.9 65.5 C 205.5 65.2 205.2 64.9 204.9 64.7 C 202.2 67.1 198.9 69.1 196.9 71.9 C 190.5 81.2 183.8 90.4 178.5 100.3 C 167.7 120.5 162.4 142.5 160.1 166 M 151.9 129.1 C 151.7 131 151.4 132.9 151.1 135.5 C 155.6 122 159.8 109.4 164 96.8 C 156.9 106.2 154.9 117.5 151.9 129.1 M 371.2 128.6 C 370.1 122.7 369 116.9 367.9 111 C 367.4 111.1 366.9 111.2 366.3 111.4 C 365.5 117.6 368.2 123 371.2 128.6 M 350.4 180.8 C 350.5 179.2 350.6 177.5 350.7 175.9 C 350 175.8 349.3 175.7 348.6 175.6 C 348 179.6 347.4 183.6 346.9 187.6 C 347.5 187.7 348.2 187.8 348.9 187.9 C 349.3 185.8 349.8 183.6 350.4 180.8 M 346.3 141.9 C 346.5 145.2 346.8 148.6 347 151.9 C 347.8 151.7 348.5 151.6 349.3 151.4 C 348.4 148.2 347.5 144.9 346.3 141.9 z"/>
|
8
|
+
<path
|
9
|
+
d="M 247.7 426.7 C 252.1 423.5 256.4 420.7 260.2 417.4 C 267.8 410.8 280.9 409.7 290.4 416.7 C 300.7 424.2 308.5 433.6 308.1 447.9 C 307.8 460.9 301.8 470 291 476.3 C 287.7 478.3 285.4 480.3 284.1 484.2 C 282.6 488.9 280.4 493.5 274.2 494 C 266.4 494.6 258.9 494 255.4 486.1 C 252.6 479.9 248.3 475.3 243.5 471 C 234.6 463 234.1 435.2 247.7 426.7 M 264.1 446.1 C 267.9 449.8 268.9 444.3 271.7 443.4 C 269.6 441.8 267.3 440.3 265.2 440.6 C 262.6 441 262.1 443.3 264.1 446.1 M 277 423.6 C 276.3 423.9 275.6 424.1 274 424.7 C 277 426.5 279.2 427.8 281.5 429.1 C 281.7 428.8 282 428.4 282.3 428 C 280.7 426.6 279.1 425.2 277 423.6 M 287.5 434 C 287.5 434 287.4 433.9 287.4 433.9 C 287.4 433.9 287.4 434 287.5 434 z"/>
|
10
|
+
<path opacity="0.000000"
|
11
|
+
d="M 160.1 165.6 C 162.4 142.5 167.7 120.5 178.5 100.3 C 183.8 90.4 190.5 81.2 196.9 71.9 C 198.9 69.1 202.2 67.1 204.9 64.7 C 205.2 64.9 205.5 65.2 205.9 65.5 C 202.4 71 199.2 76.7 195.4 82 C 180.2 103.4 171.5 127.1 170 153.4 C 169.6 160.6 170 167.9 169.7 175.2 C 169.6 176.7 168.5 179 167.4 179.4 C 166.1 179.8 163.2 178.9 162.8 177.8 C 161.5 174.1 160.9 170 160.1 165.6 z"/>
|
12
|
+
<path opacity="0.000000"
|
13
|
+
d="M 300.9 65.1 C 287.3 60.8 273.7 56.5 260 52.2 C 275.6 49.5 288.4 56.3 301 64.5 C 301.1 64.9 300.9 65.1 300.9 65.1 z"/>
|
14
|
+
<path opacity="0.000000"
|
15
|
+
d="M 151.9 128.8 C 154.9 117.5 156.9 106.2 164 96.8 C 159.8 109.4 155.6 122 151.1 135.5 C 151.4 132.9 151.7 131 151.9 128.8 z"/>
|
16
|
+
<path opacity="0.000000"
|
17
|
+
d="M 325.9 246.9 C 328.2 241.1 329.7 234.9 335.7 231.5 C 336.2 231.8 336.6 232.1 337.1 232.4 C 333.7 237.2 330.3 242.1 326.5 247 C 326.1 247.1 325.9 246.9 325.9 246.9 z"/>
|
18
|
+
<path opacity="0.000000"
|
19
|
+
d="M 371.1 128.5 C 368.2 123 365.5 117.6 366.3 111.4 C 366.9 111.2 367.4 111.1 367.9 111 C 369 116.9 370.1 122.7 371.1 128.5 z"/>
|
20
|
+
<path opacity="0.000000"
|
21
|
+
d="M 350.3 181.1 C 349.8 183.6 349.3 185.8 348.9 187.9 C 348.2 187.8 347.5 187.7 346.9 187.6 C 347.4 183.6 348 179.6 348.6 175.6 C 349.3 175.7 350 175.8 350.7 175.9 C 350.6 177.5 350.5 179.2 350.3 181.1 z"/>
|
22
|
+
<path opacity="0.000000"
|
23
|
+
d="M 346.4 141.8 C 347.5 144.9 348.4 148.2 349.3 151.4 C 348.5 151.6 347.8 151.7 347 151.9 C 346.8 148.6 346.5 145.2 346.4 141.8 z"/>
|
24
|
+
<path opacity="0.000000"
|
25
|
+
d="M 301.2 64.8 C 301.3 64.9 301.4 65.1 301.4 65.3 C 301.3 65.3 301.2 65.2 301 65.1 C 300.9 65.1 301.1 64.9 301.2 64.8 z"/>
|
26
|
+
<path opacity="0.000000"
|
27
|
+
d="M 326.2 247.2 C 326.1 247.2 326 247.2 325.9 247 C 325.9 246.9 326.1 247.1 326.2 247.2 z"/>
|
28
|
+
<path opacity="0.000000"
|
29
|
+
d="M 264 445.8 C 262.1 443.3 262.6 441 265.2 440.6 C 267.3 440.3 269.6 441.8 271.7 443.4 C 268.9 444.3 267.9 449.8 264 445.8 z"/>
|
30
|
+
<path opacity="0.000000"
|
31
|
+
d="M 277.2 423.7 C 279.1 425.2 280.7 426.6 282.3 428 C 282 428.4 281.7 428.8 281.5 429.1 C 279.2 427.8 277 426.5 274 424.7 C 275.6 424.1 276.3 423.9 277.2 423.7 z"/>
|
32
|
+
<path opacity="0.000000"
|
33
|
+
d="M 287.5 434 C 287.4 434 287.4 433.9 287.4 433.9 C 287.4 433.9 287.5 434 287.5 434 z"/>
|
34
|
+
</svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<browserconfig>
|
3
|
+
<msapplication>
|
4
|
+
<tile>
|
5
|
+
<square70x70logo src="/mstile-70x70.png"/>
|
6
|
+
<square150x150logo src="/mstile-150x150.png"/>
|
7
|
+
<square310x310logo src="/mstile-310x310.png"/>
|
8
|
+
<wide310x150logo src="/mstile-310x150.png"/>
|
9
|
+
<TileColor>#adc6ff</TileColor>
|
10
|
+
</tile>
|
11
|
+
</msapplication>
|
12
|
+
</browserconfig>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
5
|
+
width="1378.000000pt" height="1378.000000pt" viewBox="0 0 1378.000000 1378.000000"
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
7
|
+
<metadata>
|
8
|
+
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
9
|
+
</metadata>
|
10
|
+
<g transform="translate(0.000000,1378.000000) scale(0.100000,-0.100000)"
|
11
|
+
fill="#000000" stroke="none">
|
12
|
+
<path d="M6713 13228 c3 -7 25 -62 50 -123 25 -60 57 -155 71 -210 59 -228 56
|
13
|
+
-95 56 -2615 0 -1561 -3 -2343 -11 -2400 -25 -202 -76 -377 -163 -555 -261
|
14
|
+
-533 -771 -889 -1368 -954 -128 -14 -3713 -15 -3846 -1 -414 44 -780 222
|
15
|
+
-1068 521 -186 194 -307 396 -395 659 l-38 115 -1 -2498 c0 -1691 3 -2529 11
|
16
|
+
-2595 79 -731 507 -1378 1154 -1744 214 -122 445 -203 734 -261 106 -21 108
|
17
|
+
-21 2554 -24 l2447 -3 0 2085 c0 1410 3 2117 11 2183 31 282 125 546 278 774
|
18
|
+
259 388 637 640 1107 740 l109 23 1920 3 c1711 2 1932 1 2030 -13 646 -94
|
19
|
+
1166 -519 1386 -1134 l38 -106 -2 3065 c-3 3386 3 3093 -63 3355 -203 809
|
20
|
+
-841 1452 -1642 1655 -279 70 -31 64 -2836 67 -2038 3 -2527 1 -2523 -9z"/>
|
21
|
+
</g>
|
22
|
+
</svg>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"icons": [
|
3
|
+
{
|
4
|
+
"src": "/android-chrome-192x192.png",
|
5
|
+
"sizes": "192x192",
|
6
|
+
"type": "image/png"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"src": "/android-chrome-512x512.png",
|
10
|
+
"sizes": "512x512",
|
11
|
+
"type": "image/png"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"theme_color": "#adc6ff",
|
15
|
+
"background_color": "#adc6ff",
|
16
|
+
"display": "standalone"
|
17
|
+
}
|
Binary file
|
data/assets/js/main.js
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
const nav_side_bar = document.querySelector("#nav-side-bar");
|
2
|
+
const nav_scrim = document.querySelector("#nav-scrim");
|
3
|
+
const active_page = window.location.pathname;
|
4
|
+
const nav_links = document.querySelectorAll(".nav-links");
|
5
|
+
const wrapper_body = document.querySelectorAll("#wrapper");
|
6
|
+
const toc = document.querySelectorAll("#toc");
|
7
|
+
const BackToTop = document.querySelector("#back-to-top");
|
8
|
+
const body = document.querySelector("body");
|
9
|
+
const modeToggle = document.querySelector(".nav-theme-toggle");
|
10
|
+
const modeToggle_text = document.querySelector("#mode_text");
|
11
|
+
const modeToggle_icon = document.querySelector("#nav-theme-toggle-icon");
|
12
|
+
const codeBlocks = document.querySelectorAll("td.rouge-code ");
|
13
|
+
const copyCodeButtons = document.querySelectorAll("#code-copy-btn");
|
14
|
+
let codetable = document.querySelectorAll("table.rouge-table");
|
15
|
+
let value = window.innerWidth;
|
16
|
+
let darkMode = localStorage.getItem("darkMode");
|
17
|
+
|
18
|
+
document.querySelector("#top-bar-checkbtn").onclick = function () {
|
19
|
+
new Animation("site-animations-show", "site-animations-hide");
|
20
|
+
nav_scrim.style.display = "block";
|
21
|
+
disableScroll();
|
22
|
+
};
|
23
|
+
document.querySelector("#nav-side-bar-closebtn").onclick = function () {
|
24
|
+
new Animation("site-animations-hide", "site-animations-show");
|
25
|
+
nav_scrim.style.display = "none";
|
26
|
+
enableScroll();
|
27
|
+
setTimeout(() => {
|
28
|
+
nav_side_bar.classList.remove("site-animations-hide");
|
29
|
+
}, 60);
|
30
|
+
};
|
31
|
+
nav_scrim.onclick = function () {
|
32
|
+
new Animation("site-animations-hide", "site-animations-show");
|
33
|
+
nav_scrim.style.display = "none";
|
34
|
+
enableScroll();
|
35
|
+
setTimeout(() => {
|
36
|
+
nav_side_bar.classList.remove("site-animations-hide");
|
37
|
+
}, 60);
|
38
|
+
};
|
39
|
+
class Animation {
|
40
|
+
constructor(add, remove) {
|
41
|
+
nav_side_bar.classList.remove(remove);
|
42
|
+
nav_side_bar.classList.add(add);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
function disableScroll() {
|
47
|
+
// Get the current page scroll position
|
48
|
+
scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
49
|
+
(scrollLeft = window.pageXOffset || document.documentElement.scrollLeft),
|
50
|
+
// if any scroll is attempted,
|
51
|
+
// set this to the previous value
|
52
|
+
(window.onscroll = function () {
|
53
|
+
window.scrollTo(scrollLeft, scrollTop);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
|
57
|
+
function enableScroll() {
|
58
|
+
window.onscroll = function () {};
|
59
|
+
}
|
60
|
+
|
61
|
+
nav_links.forEach((link) => {
|
62
|
+
link.classList.remove("nav-links-active");
|
63
|
+
if (link.href.includes(`${active_page}`)) {
|
64
|
+
link.classList.add("nav-links-active");
|
65
|
+
} else {
|
66
|
+
if (window.location.pathname.includes("/Post/")) {
|
67
|
+
if (link.href.includes("Post")) {
|
68
|
+
link.classList.add("nav-links-active");
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
});
|
73
|
+
function checkvalue() {
|
74
|
+
if (value == 90) {
|
75
|
+
nav_scrim.style.display = "none";
|
76
|
+
enableScroll();
|
77
|
+
}
|
78
|
+
}
|
79
|
+
window.addEventListener("DOMContentLoaded", () => {
|
80
|
+
const observer = new IntersectionObserver((entries) => {
|
81
|
+
if (document.querySelector("#toc")) {
|
82
|
+
entries.forEach((entry) => {
|
83
|
+
const id = entry.target.getAttribute("id");
|
84
|
+
if (entry.isIntersecting === true) {
|
85
|
+
document.querySelector(`main li a[href="#${id}"]`).parentElement.classList.add("active");
|
86
|
+
document
|
87
|
+
.querySelector(`main li a[href="#${id}"]`)
|
88
|
+
.parentElement.classList.remove("decative");
|
89
|
+
} else {
|
90
|
+
document
|
91
|
+
.querySelector(`main li a[href="#${id}"]`)
|
92
|
+
.parentElement.classList.remove("active");
|
93
|
+
document
|
94
|
+
.querySelector(`main li a[href="#${id}"]`)
|
95
|
+
.parentElement.classList.add("decative");
|
96
|
+
}
|
97
|
+
});
|
98
|
+
}
|
99
|
+
});
|
100
|
+
|
101
|
+
// Track all sections that have an `id` applied
|
102
|
+
document.querySelectorAll("h1[id], h2[id], h3[id]").forEach((h1, h2, h3) => {
|
103
|
+
observer.observe(h1, h2, h3);
|
104
|
+
});
|
105
|
+
});
|
106
|
+
|
107
|
+
window.addEventListener("scroll", scrollFunction);
|
108
|
+
|
109
|
+
function scrollFunction() {
|
110
|
+
if (document.querySelector("#back-to-top")) {
|
111
|
+
if (window.pageYOffset > 200) {
|
112
|
+
// Show BackToTop
|
113
|
+
if (!BackToTop.classList.contains("BTT-Entrance")) {
|
114
|
+
BackToTop.classList.remove("BTT-Exit");
|
115
|
+
BackToTop.classList.add("BTT-Entrance");
|
116
|
+
BackToTop.style.display = "flex";
|
117
|
+
}
|
118
|
+
} else {
|
119
|
+
// Hide BackToTop
|
120
|
+
if (BackToTop.classList.contains("BTT-Entrance")) {
|
121
|
+
BackToTop.classList.remove("BTT-Entrance");
|
122
|
+
BackToTop.classList.add("BTT-Exit");
|
123
|
+
setTimeout(function () {
|
124
|
+
BackToTop.style.display = "none";
|
125
|
+
}, 250);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
if (document.querySelector("#back-to-top")) {
|
131
|
+
BackToTop.addEventListener("click", smoothScrollBackToTop);
|
132
|
+
}
|
133
|
+
|
134
|
+
function smoothScrollBackToTop() {
|
135
|
+
window.scrollTo(0, 0);
|
136
|
+
}
|
137
|
+
|
138
|
+
function easeInOutCubic(t, b, c, d) {
|
139
|
+
t /= d / 2;
|
140
|
+
if (t < 1) return (c / 2) * t * t * t + b;
|
141
|
+
t -= 2;
|
142
|
+
return (c / 2) * (t * t * t + 2) + b;
|
143
|
+
}
|
144
|
+
|
145
|
+
const enableDarkMode = () => {
|
146
|
+
// 1. Add the class to the body
|
147
|
+
document.body.classList.add("dark");
|
148
|
+
// 2. Update darkMode in localStorage
|
149
|
+
localStorage.setItem("darkMode", "enabled");
|
150
|
+
modeToggle_icon.textContent = "light_mode";
|
151
|
+
modeToggle_text.textContent = "Switch to light Mode";
|
152
|
+
modeToggle.classList.add("active");
|
153
|
+
};
|
154
|
+
|
155
|
+
const disableDarkMode = () => {
|
156
|
+
// 1. Remove the class from the body
|
157
|
+
document.body.classList.remove("dark");
|
158
|
+
modeToggle.classList.remove("active");
|
159
|
+
modeToggle_icon.textContent = "dark_mode";
|
160
|
+
modeToggle_text.textContent = "Switch to dark Mode";
|
161
|
+
// 2. Update darkMode in localStorage
|
162
|
+
localStorage.setItem("darkMode", null);
|
163
|
+
};
|
164
|
+
|
165
|
+
// If the user already visited and enabled darkMode
|
166
|
+
// start things off with it on
|
167
|
+
if (darkMode === "enabled") {
|
168
|
+
enableDarkMode();
|
169
|
+
}
|
170
|
+
|
171
|
+
modeToggle.addEventListener("click", () => {
|
172
|
+
// get their darkMode setting
|
173
|
+
darkMode = localStorage.getItem("darkMode");
|
174
|
+
|
175
|
+
// if it not current enabled, enable it
|
176
|
+
if (darkMode !== "enabled") {
|
177
|
+
enableDarkMode();
|
178
|
+
// if it has been enabled, turn it off
|
179
|
+
} else {
|
180
|
+
disableDarkMode();
|
181
|
+
}
|
182
|
+
});
|
183
|
+
|
184
|
+
// copyCodeButtons.forEach((copyCodeButton, index) => {
|
185
|
+
// const code = codeBlocks[index].innerText;
|
186
|
+
|
187
|
+
// copyCodeButton.addEventListener("click", () => {
|
188
|
+
// // Copy the code to the user's clipboard
|
189
|
+
// window.navigator.clipboard.writeText(code);
|
190
|
+
|
191
|
+
// // Update the button text visually
|
192
|
+
// const { innerText: originalText } = copyCodeButton;
|
193
|
+
// copyCodeButton.innerText = "content_paste";
|
194
|
+
|
195
|
+
// // After 2 seconds, reset the button to its initial UI
|
196
|
+
// setTimeout(() => {
|
197
|
+
// copyCodeButton.innerText = originalText;
|
198
|
+
// }, 2000);
|
199
|
+
// });
|
200
|
+
// });
|
201
|
+
|
202
|
+
codeBlocks.forEach(function (codeBlock) {
|
203
|
+
var copyButton = document.createElement('div');
|
204
|
+
copyButton.className = 'code-header';
|
205
|
+
copyButton.ariaLabel = 'Copy code to clipboard';
|
206
|
+
copyButton.id = 'code-header';
|
207
|
+
|
208
|
+
var copyButton_link = document.createElement('span');
|
209
|
+
copyButton_link.className = 'material-symbols-rounded';
|
210
|
+
copyButton_link.innerText = 'content_copy';
|
211
|
+
|
212
|
+
copyButton.append(copyButton_link);
|
213
|
+
|
214
|
+
codeBlock.append(copyButton);
|
215
|
+
|
216
|
+
copyButton.addEventListener('click', function () {
|
217
|
+
let wordToRemove = "$";
|
218
|
+
var code = codeBlock.querySelector('pre').innerText.replace(wordToRemove, '');
|
219
|
+
window.navigator.clipboard.writeText(code);
|
220
|
+
|
221
|
+
copyButton_link.innerText = 'content_paste';
|
222
|
+
var fourSeconds = 4000;
|
223
|
+
|
224
|
+
setTimeout(function () {
|
225
|
+
copyButton_link.innerText = 'content_copy';
|
226
|
+
}, fourSeconds);
|
227
|
+
});
|
228
|
+
});
|