Skip to content

Commit 8280adb

Browse files
authored
fix(toc): resume fade up animation in desktop mode (#2085)
1 parent 4180992 commit 8280adb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

_includes/toc.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% if enable_toc %}
44
<div class="toc-border-cover z-3"></div>
5-
<section id="toc-wrapper" class="position-sticky ps-0 pe-4">
5+
<section id="toc-wrapper" class="invisible position-sticky ps-0 pe-4">
66
<h2 class="panel-heading ps-3 pb-2 mb-0">{{- site.data.locales[include.lang].panel.toc -}}</h2>
77
<nav id="toc"></nav>
88
</section>

_javascript/modules/components/toc/toc-desktop.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ export class TocDesktop {
1515
}
1616

1717
static init() {
18-
if (document.getElementById('toc-wrapper')) {
18+
const $tocWrapper = document.getElementById('toc-wrapper');
19+
20+
if ($tocWrapper) {
1921
tocbot.init(this.options);
22+
$tocWrapper.classList.remove('invisible');
2023
}
2124
}
2225
}

_sass/pages/_post.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,11 @@ header {
234234
@keyframes fade-up {
235235
from {
236236
opacity: 0;
237-
position: relative;
238-
top: 2rem;
237+
margin-top: 4rem;
239238
}
240239

241240
to {
242241
opacity: 1;
243-
position: relative;
244-
top: 0;
245242
}
246243
}
247244

0 commit comments

Comments
 (0)