rawfeed 0.2.11 → 0.3.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/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +12 -0
- data/_data/options.yml +47 -0
- data/_includes/layout/data.liquid +2 -0
- data/_layouts/contact.html +130 -50
- data/_layouts/default.html +13 -6
- data/_layouts/donation.html +113 -0
- data/_sass/base/_index.scss +4 -7
- data/_sass/components/_markdown.scss +1 -2
- data/_sass/layouts/_donation.scss +93 -0
- data/_sass/layouts/_index.scss +1 -0
- data/_sass/layouts/_post.scss +146 -0
- data/_sass/main.scss +10 -0
- data/_sass/theme/_dark.scss +5 -0
- data/_sass/theme/_light.scss +5 -0
- data/assets/images/icons/bitcoin.svg +6 -0
- data/assets/images/icons/card.svg +17 -0
- data/assets/images/icons/donation.svg +11 -0
- data/assets/images/icons/lightning_network.svg +11 -0
- data/assets/images/icons/paypal.svg +7 -0
- data/assets/images/icons/pix.svg +1 -0
- data/assets/images/icons/wos.png +0 -0
- data/assets/images/qrcode_btc_binance.jpg +0 -0
- data/assets/images/qrcode_inter.jpg +0 -0
- data/assets/images/qrcode_wos.jpg +0 -0
- data/assets/js/donation.js +30 -0
- data/assets/js/{fallback/page.js → page.js} +94 -167
- data/lib/rawfeed/version.rb +1 -1
- metadata +26 -41
- data/_includes/toc +0 -20
- data/assets/js/blog.coffee +0 -102
- data/assets/js/contact.coffee +0 -105
- data/assets/js/default.coffee +0 -172
- data/assets/js/discus.coffee +0 -30
- data/assets/js/fallback/README.md +0 -3
- data/assets/js/fallback/google_analytics.js +0 -15
- data/assets/js/home.coffee +0 -250
- data/assets/js/no_inframe.coffee +0 -9
- data/assets/js/page.coffee +0 -379
- data/assets/js/pixels.coffee +0 -2
- data/assets/js/resume.coffee +0 -9
- data/assets/js/tags.coffee +0 -2
- data/assets/js/theme_load.coffee +0 -6
- /data/assets/js/{fallback/blog.js → blog.js} +0 -0
- /data/assets/js/{fallback/contact.js → contact.js} +0 -0
- /data/assets/js/{fallback/default.js → default.js} +0 -0
- /data/assets/js/{fallback/discus.js → discus.js} +0 -0
- /data/assets/js/{fallback/home.js → home.js} +0 -0
- /data/assets/js/{fallback/no_inframe.js → no_inframe.js} +0 -0
- /data/assets/js/{fallback/pixels.js → pixels.js} +0 -0
- /data/assets/js/{fallback/resume.js → resume.js} +0 -0
- /data/assets/js/{fallback/tags.js → tags.js} +0 -0
- /data/assets/js/{fallback/theme_load.js → theme_load.js} +0 -0
data/_sass/layouts/_post.scss
CHANGED
|
@@ -94,3 +94,149 @@
|
|
|
94
94
|
font-size: 1.2rem;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
/* Automatic TOC */
|
|
99
|
+
.auto-toc {
|
|
100
|
+
position: fixed;
|
|
101
|
+
left: 0;
|
|
102
|
+
top: 15vh;
|
|
103
|
+
height: auto;
|
|
104
|
+
max-height: 70vh;
|
|
105
|
+
width: 24px;
|
|
106
|
+
background: transparent;
|
|
107
|
+
z-index: 10000;
|
|
108
|
+
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
// border-radius: 0 12px 12px 0;
|
|
113
|
+
border: 2px solid transparent !important;
|
|
114
|
+
padding: 20px 0;
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
width: 380px;
|
|
118
|
+
background: var(--bg-color);
|
|
119
|
+
box-shadow: 8px 0 25px rgba(0, 0, 0, 0.15);
|
|
120
|
+
border: 2px dotted var(--background-focus-border-color) !important;
|
|
121
|
+
border-left: none;
|
|
122
|
+
|
|
123
|
+
.auto-toc-bars {
|
|
124
|
+
opacity: 0;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.auto-toc-content {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
transform: translateX(0);
|
|
131
|
+
pointer-events: all;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.auto-toc-bars {
|
|
136
|
+
position: absolute;
|
|
137
|
+
left: 6px;
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: 4px;
|
|
141
|
+
transition: opacity 0.2s ease;
|
|
142
|
+
|
|
143
|
+
.toc-bar {
|
|
144
|
+
width: 12px;
|
|
145
|
+
height: 3px;
|
|
146
|
+
background: var(--primary-color);
|
|
147
|
+
border-radius: 2px;
|
|
148
|
+
opacity: 0.8;
|
|
149
|
+
|
|
150
|
+
&:nth-child(even) {
|
|
151
|
+
width: 8px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.auto-toc-content {
|
|
157
|
+
width: 100%;
|
|
158
|
+
height: 100%;
|
|
159
|
+
max-height: 70vh;
|
|
160
|
+
padding: 1.5rem;
|
|
161
|
+
opacity: 0;
|
|
162
|
+
transform: translateX(-20px);
|
|
163
|
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
background: var(--bg-color);
|
|
168
|
+
|
|
169
|
+
h2 {
|
|
170
|
+
font-size: 0.85rem;
|
|
171
|
+
text-transform: uppercase;
|
|
172
|
+
letter-spacing: 0.12em;
|
|
173
|
+
color: var(--text-muted-color);
|
|
174
|
+
margin-bottom: 1.2rem;
|
|
175
|
+
font-weight: 800;
|
|
176
|
+
border-bottom: 1px solid var(--border-color);
|
|
177
|
+
padding-bottom: 0.5rem;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.auto-toc-list {
|
|
181
|
+
flex: 1;
|
|
182
|
+
overflow-y: auto;
|
|
183
|
+
list-style: none;
|
|
184
|
+
padding: 0;
|
|
185
|
+
margin: 0;
|
|
186
|
+
padding-right: 10px;
|
|
187
|
+
|
|
188
|
+
&::-webkit-scrollbar {
|
|
189
|
+
width: 4px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&::-webkit-scrollbar-thumb {
|
|
193
|
+
background: var(--border-color);
|
|
194
|
+
border-radius: 2px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
ul {
|
|
198
|
+
list-style: none;
|
|
199
|
+
padding-left: 1rem;
|
|
200
|
+
margin: 0.4rem 0;
|
|
201
|
+
border-left: 1px solid var(--border-color);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
li {
|
|
205
|
+
margin: 0.5rem 0;
|
|
206
|
+
font-size: 0.88rem;
|
|
207
|
+
|
|
208
|
+
a {
|
|
209
|
+
color: var(--text-muted-color);
|
|
210
|
+
text-decoration: none;
|
|
211
|
+
transition: all 0.2s ease;
|
|
212
|
+
display: block;
|
|
213
|
+
line-height: 1.4;
|
|
214
|
+
|
|
215
|
+
&:hover {
|
|
216
|
+
color: var(--primary-color);
|
|
217
|
+
padding-left: 4px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.active {
|
|
221
|
+
color: var(--primary-color);
|
|
222
|
+
font-weight: 700;
|
|
223
|
+
border-left: 3px solid var(--primary-color);
|
|
224
|
+
padding-left: 12px;
|
|
225
|
+
margin-left: 0;
|
|
226
|
+
|
|
227
|
+
&::before {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Ensure post content doesn't get weird gaps if TOC is floating */
|
|
238
|
+
@media (max-width: 1200px) {
|
|
239
|
+
.auto-toc {
|
|
240
|
+
display: none !important;
|
|
241
|
+
}
|
|
242
|
+
}
|
data/_sass/main.scss
CHANGED
|
@@ -44,6 +44,11 @@ layout:
|
|
|
44
44
|
--table-td-border-color: #{theme.theme-color(table-td-border-color, light)};
|
|
45
45
|
--table-tr-odd-bg-color: #{theme.theme-color(table-tr-odd-bg-color, light)};
|
|
46
46
|
--table-tr-even-bg-color: #{theme.theme-color(table-tr-even-bg-color, light)};
|
|
47
|
+
--card-bg-color: #{theme.theme-color(card-bg-color, light)};
|
|
48
|
+
--card-border-color: #{theme.theme-color(card-border-color, light)};
|
|
49
|
+
--card-border-color-hover: #{theme.theme-color(card-border-color-hover, light)};
|
|
50
|
+
--card-box-shadow-color: #{theme.theme-color(card-box-shadow-color, light)};
|
|
51
|
+
--card-box-shadow-color-hover: #{theme.theme-color(card-box-shadow-color-hover, light)};
|
|
47
52
|
--terminal-color: #{theme.theme-color(terminal-color, light)};
|
|
48
53
|
--terminal-bg-color: #{theme.theme-color(terminal-bg-color, light)};
|
|
49
54
|
--terminal-border-color: #{theme.theme-color(terminal-border-color, light)};
|
|
@@ -111,6 +116,11 @@ layout:
|
|
|
111
116
|
--table-td-border-color: #{theme.theme-color(table-td-border-color, dark)};
|
|
112
117
|
--table-tr-odd-bg-color: #{theme.theme-color(table-tr-odd-bg-color, dark)};
|
|
113
118
|
--table-tr-even-bg-color: #{theme.theme-color(table-tr-even-bg-color, dark)};
|
|
119
|
+
--card-bg-color: #{theme.theme-color(card-bg-color, dark)};
|
|
120
|
+
--card-border-color: #{theme.theme-color(card-border-color, dark)};
|
|
121
|
+
--card-border-color-hover: #{theme.theme-color(card-border-color-hover, dark)};
|
|
122
|
+
--card-box-shadow-color: #{theme.theme-color(card-box-shadow-color, dark)};
|
|
123
|
+
--card-box-shadow-color-hover: #{theme.theme-color(card-box-shadow-color-hover, dark)};
|
|
114
124
|
--terminal-color: #{theme.theme-color(terminal-color, dark)};
|
|
115
125
|
--terminal-bg-color: #{theme.theme-color(terminal-bg-color, dark)};
|
|
116
126
|
--terminal-border-color: #{theme.theme-color(terminal-border-color, dark)};
|
data/_sass/theme/_dark.scss
CHANGED
|
@@ -31,6 +31,11 @@ $theme-colors: (
|
|
|
31
31
|
table-td-border-color: #585858,
|
|
32
32
|
table-tr-odd-bg-color: #313131,
|
|
33
33
|
table-tr-even-bg-color: #181818,
|
|
34
|
+
card-bg-color: #181818,
|
|
35
|
+
card-border-color: #373737,
|
|
36
|
+
card-border-color-hover: #585858,
|
|
37
|
+
card-box-shadow-color: rgba(0, 0, 0, 0.1),
|
|
38
|
+
card-box-shadow-color-hover: rgba(0, 0, 0, 0.2),
|
|
34
39
|
terminal-color: #97ff97,
|
|
35
40
|
terminal-bg-color: #000000,
|
|
36
41
|
terminal-border-color: #1a1a1a,
|
data/_sass/theme/_light.scss
CHANGED
|
@@ -23,6 +23,11 @@ $theme-colors: (
|
|
|
23
23
|
table-td-border-color: #949494,
|
|
24
24
|
table-tr-odd-bg-color: #f3f3f3,
|
|
25
25
|
table-tr-even-bg-color: #e7e7e7,
|
|
26
|
+
card-bg-color: #f3f3f3,
|
|
27
|
+
card-border-color: #dfdfdf,
|
|
28
|
+
card-border-color-hover: #e4e4e4,
|
|
29
|
+
card-box-shadow-color: rgba(0, 0, 0, 0.1),
|
|
30
|
+
card-box-shadow-color-hover: rgba(0, 0, 0, 0.2),
|
|
26
31
|
terminal-color: #131313,
|
|
27
32
|
terminal-bg-color: #ffffff,
|
|
28
33
|
terminal-border-color: #aaaaaa,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
|
|
2
|
+
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
3
|
+
<path d="M 378.255 373.391 c -6.01 24.107 -30.427 38.778 -54.537 32.767 c -24.1 -6.01 -38.771 -30.428 -32.758 -54.534 c 6.007 -24.11 30.424 -38.783 54.527 -32.772 C 369.596 324.862 384.266 349.282 378.255 373.391 L 378.255 373.391 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(247,147,26); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 -289.60744 -317.50471) " stroke-linecap="round"/>
|
|
4
|
+
<path d="M 354.448 356.094 c 0.896 -5.988 -3.663 -9.207 -9.897 -11.354 l 2.022 -8.111 l -4.937 -1.23 l -1.969 7.897 c -1.298 -0.323 -2.631 -0.629 -3.956 -0.931 l 1.983 -7.949 l -4.934 -1.23 l -2.024 8.108 c -1.074 -0.245 -2.129 -0.487 -3.153 -0.741 l 0.006 -0.025 l -6.809 -1.7 l -1.313 5.273 c 0 0 3.663 0.84 3.586 0.892 c 2 0.499 2.361 1.822 2.301 2.872 l -2.303 9.24 c 0.138 0.035 0.316 0.086 0.513 0.165 c -0.165 -0.041 -0.34 -0.086 -0.522 -0.129 l -3.229 12.944 c -0.245 0.608 -0.865 1.519 -2.263 1.173 c 0.049 0.072 -3.589 -0.896 -3.589 -0.896 l -2.451 5.652 l 6.425 1.602 c 1.195 0.3 2.367 0.613 3.52 0.908 l -2.043 8.204 l 4.932 1.23 l 2.024 -8.117 c 1.347 0.366 2.655 0.703 3.935 1.021 l -2.017 8.079 l 4.937 1.23 l 2.043 -8.189 c 8.419 1.593 14.75 0.951 17.415 -6.664 c 2.147 -6.131 -0.107 -9.668 -4.537 -11.974 C 351.37 362.599 353.799 360.477 354.448 356.094 L 354.448 356.094 z M 343.167 371.913 c -1.526 6.131 -11.849 2.817 -15.196 1.986 l 2.711 -10.869 C 334.029 363.865 344.762 365.519 343.167 371.913 L 343.167 371.913 z M 344.694 356.005 c -1.392 5.577 -9.984 2.744 -12.771 2.049 l 2.458 -9.858 C 337.168 348.891 346.144 350.188 344.694 356.005 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 -289.60744 -317.50471) " stroke-linecap="round"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
|
|
2
|
+
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
3
|
+
<path d="M 72.306 78.594 H 4.442 C 2.541 78.594 1 77.053 1 75.152 V 32.991 c 0 -1.901 1.541 -3.442 3.442 -3.442 h 67.864 c 1.901 0 3.442 1.541 3.442 3.442 v 42.161 C 75.748 77.053 74.207 78.594 72.306 78.594 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(87,179,254); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
4
|
+
<rect x="1" y="39.41" rx="0" ry="0" width="74.75" height="10.64" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(235,235,241); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) "/>
|
|
5
|
+
<rect x="52.66" y="58.09" rx="0" ry="0" width="14.88" height="10.64" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(254,204,89); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) "/>
|
|
6
|
+
<path d="M 86.136 22.856 l -66.899 -11.4 c -1.874 -0.319 -3.652 0.941 -3.972 2.815 l -2.603 15.278 h 59.644 c 1.901 0 3.442 1.541 3.442 3.442 v 37.847 l 2.149 0.366 c 1.874 0.319 3.652 -0.941 3.972 -2.815 l 7.082 -41.562 C 89.27 24.953 88.01 23.175 86.136 22.856 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(254,204,89); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
7
|
+
<path d="M 72.306 79.594 H 4.442 C 1.992 79.594 0 77.601 0 75.152 V 32.991 c 0 -2.449 1.993 -4.442 4.442 -4.442 h 67.864 c 2.449 0 4.442 1.993 4.442 4.442 v 42.161 C 76.748 77.601 74.755 79.594 72.306 79.594 z M 4.442 30.549 C 3.095 30.549 2 31.644 2 32.991 v 42.161 c 0 1.347 1.096 2.442 2.442 2.442 h 67.864 c 1.347 0 2.442 -1.096 2.442 -2.442 V 32.991 c 0 -1.347 -1.096 -2.442 -2.442 -2.442 H 4.442 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
8
|
+
<path d="M 75.748 51.049 H 1 c -0.552 0 -1 -0.447 -1 -1 V 39.406 c 0 -0.552 0.448 -1 1 -1 h 74.749 c 0.553 0 1 0.448 1 1 v 10.643 C 76.748 50.602 76.301 51.049 75.748 51.049 z M 2 49.049 h 72.749 v -8.643 H 2 V 49.049 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
9
|
+
<path d="M 67.539 69.737 H 52.657 c -0.553 0 -1 -0.447 -1 -1 V 58.093 c 0 -0.553 0.447 -1 1 -1 h 14.882 c 0.553 0 1 0.447 1 1 v 10.644 C 68.539 69.289 68.092 69.737 67.539 69.737 z M 53.657 67.737 h 12.882 v -8.644 H 53.657 V 67.737 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
10
|
+
<path d="M 41.53 59.093 H 9.209 c -0.552 0 -1 -0.447 -1 -1 c 0 -0.553 0.448 -1 1 -1 H 41.53 c 0.552 0 1 0.447 1 1 C 42.53 58.646 42.082 59.093 41.53 59.093 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
11
|
+
<path d="M 13.048 65.489 H 9.209 c -0.552 0 -1 -0.447 -1 -1 c 0 -0.553 0.448 -1 1 -1 h 3.839 c 0.552 0 1 0.447 1 1 C 14.048 65.042 13.6 65.489 13.048 65.489 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
12
|
+
<path d="M 22.542 65.489 h -3.839 c -0.552 0 -1 -0.447 -1 -1 c 0 -0.553 0.448 -1 1 -1 h 3.839 c 0.552 0 1 0.447 1 1 C 23.542 65.042 23.094 65.489 22.542 65.489 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
13
|
+
<path d="M 32.036 65.489 h -3.839 c -0.552 0 -1 -0.447 -1 -1 c 0 -0.553 0.448 -1 1 -1 h 3.839 c 0.552 0 1 0.447 1 1 C 33.036 65.042 32.588 65.489 32.036 65.489 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
14
|
+
<path d="M 41.53 65.489 h -3.839 c -0.552 0 -1 -0.447 -1 -1 c 0 -0.553 0.448 -1 1 -1 h 3.839 c 0.552 0 1 0.447 1 1 C 42.53 65.042 42.082 65.489 41.53 65.489 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
15
|
+
<path d="M 78.485 72.254 c -0.251 0 -0.504 -0.021 -0.756 -0.064 l -2.148 -0.366 c -0.48 -0.081 -0.832 -0.498 -0.832 -0.985 V 32.991 c 0 -1.347 -1.096 -2.442 -2.442 -2.442 H 12.661 c -0.294 0 -0.574 -0.13 -0.764 -0.355 s -0.271 -0.522 -0.222 -0.813 l 2.604 -15.278 c 0.412 -2.415 2.714 -4.046 5.126 -3.633 l 66.899 11.4 c 2.414 0.412 4.044 2.711 3.632 5.126 l -7.082 41.561 c -0.199 1.17 -0.842 2.191 -1.81 2.878 C 80.284 71.973 79.397 72.254 78.485 72.254 z M 76.748 69.994 l 1.316 0.225 c 1.333 0.225 2.592 -0.67 2.818 -1.998 l 7.082 -41.561 c 0.226 -1.328 -0.67 -2.592 -1.997 -2.818 l -66.899 -11.4 c -1.33 -0.227 -2.592 0.669 -2.818 1.997 l -2.404 14.11 h 58.459 c 2.449 0 4.442 1.993 4.442 4.442 V 69.994 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
|
|
2
|
+
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
3
|
+
<path d="M 88.704 60.915 c -2.591 -4.303 -6.553 -6.871 -10.598 -6.871 c -1.374 0 -2.718 0.291 -4.001 0.869 l -16.045 7.458 l 1.659 2.891 c 0.088 0.152 0.034 0.347 -0.117 0.435 c -7.864 4.527 -14.599 7.311 -20.656 8.515 c -0.151 0 -0.282 -0.108 -0.312 -0.257 c -0.017 -0.085 0 -0.168 0.047 -0.24 s 0.118 -0.119 0.203 -0.136 c 5.569 -1.113 11.774 -3.607 18.966 -7.625 l 1.158 -0.646 l -1.676 -2.922 c -2.346 -4.087 -4.932 -5.559 -8.657 -4.916 l -14.361 2.597 c -2.572 0.185 -4.84 -0.865 -6.848 -1.801 c -2.094 -0.975 -4.091 -1.891 -6.391 -1.689 l -3.053 0.271 v 27.971 l 6.421 -0.571 c 0.363 -0.033 0.74 -0.049 1.119 -0.049 c 3.118 0 6.145 1.125 9.084 2.219 c 2.86 1.062 5.561 2.064 8.269 2.064 c 0.309 0 0.617 -0.014 0.913 -0.04 c 6.065 -0.529 21.592 -10.258 38.032 -20.56 c 1.998 -1.253 4.002 -2.508 6.013 -3.763 C 88.982 63.428 89.354 61.99 88.704 60.915 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,219,212); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
4
|
+
<path d="M 15.54 89 H 3.528 c -1.391 0 -2.519 -1.128 -2.519 -2.519 V 54.192 c 0 -1.391 1.128 -2.519 2.519 -2.519 H 15.54 c 1.391 0 2.519 1.128 2.519 2.519 v 32.288 C 18.059 87.872 16.931 89 15.54 89 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(191,219,255); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
5
|
+
<path d="M 72.394 5.178 c -5.571 -5.571 -14.604 -5.571 -20.175 0 l -0.763 0.763 l -0.763 -0.763 c -5.571 -5.571 -14.604 -5.571 -20.175 0 c -5.571 5.571 -5.571 14.604 0.001 20.175 l 10.85 10.85 l 10.087 10.088 l 10.087 -10.087 l 10.85 -10.85 C 77.965 19.782 77.965 10.75 72.394 5.178 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,125,151); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
6
|
+
<path d="M 51.456 47.291 c -0.256 0 -0.512 -0.098 -0.707 -0.293 L 29.812 26.061 c -5.952 -5.952 -5.952 -15.637 0 -21.589 C 32.694 1.588 36.528 0 40.605 0 S 48.517 1.588 51.4 4.472 l 0.056 0.056 l 0.056 -0.056 C 54.395 1.588 58.229 0 62.307 0 c 4.077 0 7.91 1.588 10.794 4.472 l 0 0 l 0 0 c 5.952 5.952 5.952 15.637 0 21.589 L 52.163 46.998 C 51.968 47.193 51.712 47.291 51.456 47.291 z M 40.605 2 c -3.543 0 -6.875 1.38 -9.38 3.886 c -5.172 5.172 -5.172 13.588 0 18.761 l 20.23 20.23 l 20.23 -20.23 c 5.172 -5.173 5.172 -13.589 0 -18.761 l 0 0 C 69.181 3.38 65.85 2 62.307 2 c -3.544 0 -6.875 1.38 -9.381 3.886 l -0.763 0.763 c -0.391 0.391 -1.023 0.391 -1.414 0 l -0.763 -0.763 C 47.48 3.38 44.149 2 40.605 2 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
7
|
+
<path d="M 43.036 90 c -2.937 0 -5.844 -1.081 -8.666 -2.129 c -3.111 -1.156 -6.323 -2.35 -9.521 -2.068 l -7.79 0.691 V 56.157 l 4.222 -0.375 c 2.65 -0.231 4.867 0.798 7.011 1.797 c 2.025 0.943 3.941 1.844 6.142 1.654 l 14.064 -2.552 c 5.025 -0.854 7.791 2.064 9.468 4.721 l 15.39 -7.154 c 5.769 -2.59 12.243 0.01 16.131 6.464 c 1.011 1.678 0.448 3.906 -1.253 4.968 c -1.993 1.243 -3.979 2.487 -5.943 3.719 C 65.158 80.133 50.363 89.403 44.041 89.956 C 43.706 89.986 43.371 90 43.036 90 z M 25.834 83.76 c 3.214 0 6.268 1.135 9.232 2.236 c 3.07 1.142 5.97 2.218 8.799 1.968 c 5.843 -0.511 21.154 -10.104 37.363 -20.261 c 1.966 -1.231 3.952 -2.477 5.946 -3.721 c 0.78 -0.486 1.049 -1.491 0.599 -2.239 c -3.341 -5.544 -8.803 -7.828 -13.586 -5.676 L 57.16 63.982 l -0.456 -0.796 c -1.52 -2.648 -3.639 -5.256 -7.859 -4.535 l -14.151 2.563 c -2.825 0.233 -5.074 -0.812 -7.246 -1.823 c -1.992 -0.929 -3.879 -1.808 -5.989 -1.617 l -2.399 0.213 v 26.321 l 5.613 -0.498 C 25.062 83.776 25.449 83.76 25.834 83.76 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
8
|
+
<path d="M 39.091 75.237 c -0.467 0 -0.885 -0.328 -0.979 -0.804 c -0.108 -0.542 0.243 -1.068 0.785 -1.177 c 5.57 -1.113 11.833 -3.661 19.122 -7.779 l -1.314 -2.291 c -0.275 -0.479 -0.109 -1.091 0.369 -1.365 c 0.479 -0.273 1.091 -0.108 1.365 0.369 l 1.813 3.161 c 0.274 0.479 0.109 1.09 -0.368 1.364 c -7.853 4.521 -14.589 7.302 -20.596 8.502 C 39.222 75.231 39.156 75.237 39.091 75.237 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
9
|
+
<path d="M 15.54 90 H 3.528 c -1.941 0 -3.52 -1.579 -3.52 -3.52 V 54.192 c 0 -1.94 1.579 -3.52 3.52 -3.52 H 15.54 c 1.941 0 3.52 1.579 3.52 3.52 V 86.48 C 19.059 88.421 17.48 90 15.54 90 z M 3.528 52.673 c -0.838 0 -1.52 0.682 -1.52 1.52 V 86.48 c 0 0.838 0.682 1.52 1.52 1.52 H 15.54 c 0.838 0 1.52 -0.682 1.52 -1.52 V 54.192 c 0 -0.838 -0.682 -1.52 -1.52 -1.52 H 3.528 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="282" height="282" viewBox="0 0 282 282" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0)">
|
|
3
|
+
<circle cx="140.983" cy="141.003" r="141" fill="#7B1AF7"/>
|
|
4
|
+
<path d="M79.7609 144.047L173.761 63.0466C177.857 60.4235 181.761 63.0466 179.261 67.5466L149.261 126.547H202.761C202.761 126.547 211.261 126.547 202.761 133.547L110.261 215.047C103.761 220.547 99.261 217.547 103.761 209.047L132.761 151.547H79.7609C79.7609 151.547 71.2609 151.547 79.7609 144.047Z" fill="white"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0">
|
|
8
|
+
<rect width="282" height="282" fill="white"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
|
|
2
|
+
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
3
|
+
<path d="M 37.046 17.998 c -1.276 0.001 -2.363 0.93 -2.562 2.19 l -4.257 27 c 0.198 -1.261 1.285 -2.19 2.562 -2.19 h 12.475 c 12.555 0 23.208 -9.159 25.155 -21.57 c 0.145 -0.927 0.227 -1.862 0.246 -2.8 c -3.191 -1.673 -6.938 -2.63 -11.045 -2.63 L 37.046 17.998 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,28,100); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
4
|
+
<path d="M 70.663 20.629 c -0.019 0.938 -0.101 1.873 -0.246 2.8 c -1.947 12.411 -12.601 21.57 -25.155 21.57 H 32.789 c -1.276 0 -2.364 0.928 -2.562 2.19 l -3.914 24.811 L 23.86 87.564 c -0.183 1.148 0.6 2.227 1.748 2.41 C 25.718 89.991 25.829 90 25.94 90 h 13.54 c 1.276 -0.001 2.363 -0.93 2.562 -2.19 l 3.566 -22.621 c 0.2 -1.261 1.287 -2.19 2.564 -2.19 h 7.972 c 12.555 0 23.208 -9.159 25.155 -21.57 c 1.382 -8.809 -3.054 -16.824 -10.636 -20.799 L 70.663 20.629 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,112,224); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
5
|
+
<path d="M 21.663 0 c -1.276 0 -2.364 0.928 -2.562 2.188 L 8.476 69.564 c -0.201 1.279 0.787 2.436 2.082 2.436 h 15.756 l 3.912 -24.811 l 4.257 -27 c 0.2 -1.261 1.286 -2.189 2.562 -2.19 h 22.572 c 4.108 0 7.855 0.958 11.045 2.63 C 70.882 9.329 61.558 0 48.738 0 L 21.663 0 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,48,135); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="480px" height="480px" baseProfile="basic"><path fill="#4db6ac" d="M11.9,12h-0.68l8.04-8.04c2.62-2.61,6.86-2.61,9.48,0L36.78,12H36.1c-1.6,0-3.11,0.62-4.24,1.76 l-6.8,6.77c-0.59,0.59-1.53,0.59-2.12,0l-6.8-6.77C15.01,12.62,13.5,12,11.9,12z"/><path fill="#4db6ac" d="M36.1,36h0.68l-8.04,8.04c-2.62,2.61-6.86,2.61-9.48,0L11.22,36h0.68c1.6,0,3.11-0.62,4.24-1.76 l6.8-6.77c0.59-0.59,1.53-0.59,2.12,0l6.8,6.77C32.99,35.38,34.5,36,36.1,36z"/><path fill="#4db6ac" d="M44.04,28.74L38.78,34H36.1c-1.07,0-2.07-0.42-2.83-1.17l-6.8-6.78c-1.36-1.36-3.58-1.36-4.94,0 l-6.8,6.78C13.97,33.58,12.97,34,11.9,34H9.22l-5.26-5.26c-2.61-2.62-2.61-6.86,0-9.48L9.22,14h2.68c1.07,0,2.07,0.42,2.83,1.17 l6.8,6.78c0.68,0.68,1.58,1.02,2.47,1.02s1.79-0.34,2.47-1.02l6.8-6.78C34.03,14.42,35.03,14,36.1,14h2.68l5.26,5.26 C46.65,21.88,46.65,26.12,44.04,28.74z"/></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
{%- include layout/data.liquid -%}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
8
|
+
const donation = document.getElementById("donation");
|
|
9
|
+
if (!donation) return;
|
|
10
|
+
|
|
11
|
+
document.querySelectorAll(".donation__btn--copy").forEach(btn => {
|
|
12
|
+
btn.addEventListener("click", function () {
|
|
13
|
+
navigator.clipboard.writeText(this.dataset.copy).then(() => {
|
|
14
|
+
this.innerText = "{{ donation_.copy_button.clicked }}";
|
|
15
|
+
setTimeout(() => this.innerText = "{{ donation_.copy_button.text }}", 2000);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// QR MODAL
|
|
21
|
+
const qrModal = document.getElementById('qrModal');
|
|
22
|
+
const qrModalImg = document.getElementById('qrModalImg');
|
|
23
|
+
|
|
24
|
+
document.querySelectorAll(".clickable-qr").forEach(img => {
|
|
25
|
+
img.addEventListener("click", function () {
|
|
26
|
+
qrModalImg.src = this.dataset.qr;
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
---
|
|
3
3
|
|
|
4
|
+
{%- include layout/data.liquid -%}
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
document.addEventListener("DOMContentLoaded", () => {
|
|
6
8
|
|
|
@@ -218,37 +220,47 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
218
220
|
});
|
|
219
221
|
}
|
|
220
222
|
|
|
221
|
-
/* TOC
|
|
223
|
+
/* Automatic TOC
|
|
222
224
|
# ------------------------------------------------------------------------------------------------
|
|
223
225
|
*/
|
|
224
226
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
function initAutoTOC() {
|
|
228
|
+
const selector = '.post-content, .page-content';
|
|
229
|
+
const content = document.querySelector(selector);
|
|
230
|
+
if (!content) return;
|
|
231
|
+
|
|
232
|
+
const maxLevel = 3;
|
|
233
|
+
const headings = Array.from(content.querySelectorAll('h1, h2, h3'))
|
|
234
|
+
.filter(h => parseInt(h.tagName[1]) <= maxLevel);
|
|
235
|
+
|
|
236
|
+
if (headings.length === 0) return;
|
|
237
|
+
|
|
238
|
+
// Create TOC container
|
|
239
|
+
const tocContainer = document.createElement('nav');
|
|
240
|
+
tocContainer.id = 'auto-toc';
|
|
241
|
+
tocContainer.className = 'auto-toc';
|
|
242
|
+
|
|
243
|
+
// Create Bars (risquinhos) - Minimized State
|
|
244
|
+
const barsContainer = document.createElement('div');
|
|
245
|
+
barsContainer.className = 'auto-toc-bars';
|
|
246
|
+
for (let i = 0; i < 20; i++) {
|
|
247
|
+
const bar = document.createElement('div');
|
|
248
|
+
bar.className = 'toc-bar';
|
|
249
|
+
barsContainer.appendChild(bar);
|
|
250
|
+
}
|
|
251
|
+
tocContainer.appendChild(barsContainer);
|
|
234
252
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
toc.classList.add('toc-fixed');
|
|
239
|
-
} else {
|
|
240
|
-
toc.classList.remove('toc-fixed');
|
|
241
|
-
}
|
|
242
|
-
} else {
|
|
243
|
-
toc.classList.remove('toc-fixed');
|
|
244
|
-
}
|
|
245
|
-
}, { threshold: 0 });
|
|
253
|
+
// Create Content Wrapper - Expanded State
|
|
254
|
+
const contentWrapper = document.createElement('div');
|
|
255
|
+
contentWrapper.className = 'auto-toc-content';
|
|
246
256
|
|
|
247
|
-
|
|
257
|
+
const title = document.createElement('h2');
|
|
258
|
+
title.textContent = '{{ page_.toc.title }}';
|
|
259
|
+
contentWrapper.appendChild(title);
|
|
248
260
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
261
|
+
const tocList = document.createElement('ul');
|
|
262
|
+
tocList.className = 'auto-toc-list';
|
|
263
|
+
contentWrapper.appendChild(tocList);
|
|
252
264
|
|
|
253
265
|
const slugify = (text) => {
|
|
254
266
|
if (!text) return '';
|
|
@@ -259,165 +271,80 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
259
271
|
.replace(/--+/g, '-');
|
|
260
272
|
};
|
|
261
273
|
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
const maxLevel = parseInt(tocEl.dataset.tocMaxLevel || '3', 10);
|
|
265
|
-
const offset = parseInt(tocEl.dataset.tocScrollOffset || '20', 10);
|
|
266
|
-
|
|
267
|
-
const root = document.querySelector(selector);
|
|
268
|
-
|
|
269
|
-
if (!root) {
|
|
270
|
-
tocEl.querySelector('.toc-empty').textContent = `Content not found (${selector})`;
|
|
271
|
-
tocEl.querySelector('.toc-empty').style.display = 'block';
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
const headings = Array.from(
|
|
276
|
-
root.querySelectorAll(Array(maxLevel).fill(0).map((_, i) => `h${i + 1}`).join(','))
|
|
277
|
-
)
|
|
278
|
-
.filter((h) => !tocEl.contains(h))
|
|
279
|
-
.filter((h) => parseInt(h.tagName.substring(1)) <= maxLevel);
|
|
274
|
+
const idCounts = {};
|
|
275
|
+
const offset = 20;
|
|
280
276
|
|
|
281
|
-
|
|
277
|
+
const stack = [{ level: 0, ul: tocList }];
|
|
282
278
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (idCounts[id]) {
|
|
293
|
-
idCounts[id] += 1;
|
|
294
|
-
id = `${id}-${idCounts[id]}`;
|
|
295
|
-
} else {
|
|
296
|
-
idCounts[id] = 1;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
h.id = id;
|
|
279
|
+
headings.forEach((h, i) => {
|
|
280
|
+
if (!h.id) {
|
|
281
|
+
let id = slugify(h.textContent);
|
|
282
|
+
if (!id) id = 'section';
|
|
283
|
+
if (idCounts[id]) {
|
|
284
|
+
idCounts[id]++;
|
|
285
|
+
id = `${id}-${idCounts[id]}`;
|
|
286
|
+
} else {
|
|
287
|
+
idCounts[id] = 1;
|
|
300
288
|
}
|
|
289
|
+
h.id = id;
|
|
301
290
|
}
|
|
302
291
|
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
window.scrollTo({
|
|
315
|
-
top: h.getBoundingClientRect().top + window.scrollY - offset,
|
|
316
|
-
behavior: 'smooth'
|
|
317
|
-
});
|
|
318
|
-
history.replaceState(null, '', `#${h.id}`);
|
|
292
|
+
const level = parseInt(h.tagName[1]);
|
|
293
|
+
const li = document.createElement('li');
|
|
294
|
+
const a = document.createElement('a');
|
|
295
|
+
a.href = `#${h.id}`;
|
|
296
|
+
a.textContent = h.textContent.trim();
|
|
297
|
+
|
|
298
|
+
a.addEventListener('click', (e) => {
|
|
299
|
+
e.preventDefault();
|
|
300
|
+
window.scrollTo({
|
|
301
|
+
top: h.getBoundingClientRect().top + window.scrollY - offset,
|
|
302
|
+
behavior: 'smooth'
|
|
319
303
|
});
|
|
304
|
+
history.replaceState(null, '', `#${h.id}`);
|
|
305
|
+
});
|
|
320
306
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
while (stack.length > 1 && level <= stack[stack.length - 1].level) {
|
|
324
|
-
stack.pop();
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
const parent = stack[stack.length - 1].ul;
|
|
328
|
-
parent.appendChild(li);
|
|
307
|
+
li.appendChild(a);
|
|
329
308
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const nextLevel = parseInt(next.tagName.substring(1));
|
|
333
|
-
if (nextLevel > level) {
|
|
334
|
-
const newUl = document.createElement('ul');
|
|
335
|
-
li.appendChild(newUl);
|
|
336
|
-
stack.push({ level, ul: newUl });
|
|
337
|
-
}
|
|
338
|
-
}
|
|
309
|
+
while (stack.length > 1 && level <= stack[stack.length - 1].level) {
|
|
310
|
+
stack.pop();
|
|
339
311
|
}
|
|
340
312
|
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
const fromTop = window.scrollY + offset + 1;
|
|
344
|
-
let current = headings[0];
|
|
313
|
+
const parent = stack[stack.length - 1].ul;
|
|
314
|
+
parent.appendChild(li);
|
|
345
315
|
|
|
346
|
-
|
|
347
|
-
|
|
316
|
+
const next = headings[i + 1];
|
|
317
|
+
if (next) {
|
|
318
|
+
const nextLevel = parseInt(next.tagName[1]);
|
|
319
|
+
if (nextLevel > level) {
|
|
320
|
+
const newUl = document.createElement('ul');
|
|
321
|
+
li.appendChild(newUl);
|
|
322
|
+
stack.push({ level, ul: newUl });
|
|
348
323
|
}
|
|
324
|
+
}
|
|
325
|
+
});
|
|
349
326
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
};
|
|
327
|
+
tocContainer.appendChild(contentWrapper);
|
|
328
|
+
document.body.appendChild(tocContainer);
|
|
354
329
|
|
|
355
|
-
|
|
356
|
-
|
|
330
|
+
// Active link highlighting
|
|
331
|
+
const links = tocList.querySelectorAll('a');
|
|
332
|
+
const onScroll = () => {
|
|
333
|
+
const fromTop = window.scrollY + offset + 1;
|
|
334
|
+
let current = headings[0];
|
|
335
|
+
for (const h of headings) {
|
|
336
|
+
if (h.offsetTop <= fromTop) current = h;
|
|
337
|
+
}
|
|
338
|
+
for (const l of links) {
|
|
339
|
+
l.classList.toggle('active', l.getAttribute('href') === `#${current.id}`);
|
|
340
|
+
}
|
|
357
341
|
};
|
|
358
342
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const btnHiddenText = tocEl.dataset.btnHidden || 'Hide';
|
|
363
|
-
|
|
364
|
-
buildTOC(tocEl);
|
|
365
|
-
|
|
366
|
-
const toggle = tocEl.querySelector('.toc-toggle');
|
|
367
|
-
const wrapper = tocEl.querySelector('.toc-list-wrapper');
|
|
368
|
-
|
|
369
|
-
wrapper.style.display = 'none';
|
|
370
|
-
toggle.setAttribute('aria-expanded', 'false');
|
|
371
|
-
toggle.textContent = btnShowText;
|
|
372
|
-
|
|
373
|
-
toggle.addEventListener('click', () => {
|
|
374
|
-
const expanded = toggle.getAttribute('aria-expanded') === 'true';
|
|
375
|
-
wrapper.style.display = expanded ? 'none' : 'block';
|
|
376
|
-
toggle.setAttribute('aria-expanded', (!expanded).toString());
|
|
377
|
-
// Define o texto dinamicamente
|
|
378
|
-
toggle.textContent = expanded ? btnShowText : btnHiddenText;
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
const tocTop = tocEl.offsetTop;
|
|
382
|
-
|
|
383
|
-
const handleScrollFix = () => {
|
|
384
|
-
if (window.innerWidth <= minLayoutWidth) {
|
|
385
|
-
tocEl.classList.remove('fixed');
|
|
386
|
-
tocEl.style.position = '';
|
|
387
|
-
tocEl.style.top = '';
|
|
388
|
-
tocEl.style.zIndex = '';
|
|
389
|
-
tocEl.style.width = '';
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
343
|
+
window.addEventListener('scroll', onScroll, { passive: true });
|
|
344
|
+
onScroll();
|
|
345
|
+
}
|
|
392
346
|
|
|
393
|
-
|
|
347
|
+
initAutoTOC();
|
|
394
348
|
|
|
395
|
-
if (scrollTop >= tocTop) {
|
|
396
|
-
tocEl.classList.add('fixed');
|
|
397
|
-
tocEl.style.position = 'fixed';
|
|
398
|
-
tocEl.style.top = '0';
|
|
399
|
-
tocEl.style.zIndex = '9999';
|
|
400
|
-
} else {
|
|
401
|
-
tocEl.classList.remove('fixed');
|
|
402
|
-
tocEl.style.position = '';
|
|
403
|
-
tocEl.style.top = '';
|
|
404
|
-
tocEl.style.width = '';
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
// fechar TOC ao pressionar 'Esc'
|
|
409
|
-
document.addEventListener('keydown', (e) => {
|
|
410
|
-
if (e.key === 'Escape') {
|
|
411
|
-
wrapper.style.display = 'none';
|
|
412
|
-
toggle.setAttribute('aria-expanded', 'false');
|
|
413
|
-
toggle.textContent = btnShowText;
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
window.addEventListener('scroll', handleScrollFix, { passive: true });
|
|
418
|
-
window.addEventListener('resize', handleScrollFix);
|
|
419
|
-
handleScrollFix();
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
349
|
|
|
423
350
|
});
|
data/lib/rawfeed/version.rb
CHANGED