fix(toc): resume fade up animation in desktop mode (#2085)

This commit is contained in:
Cotes Chung 2024-12-03 22:41:28 +08:00 committed by GitHub
parent 4180992272
commit 8280adb901
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

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

View file

@ -15,8 +15,11 @@ export class TocDesktop {
}
static init() {
if (document.getElementById('toc-wrapper')) {
const $tocWrapper = document.getElementById('toc-wrapper');
if ($tocWrapper) {
tocbot.init(this.options);
$tocWrapper.classList.remove('invisible');
}
}
}

View file

@ -234,14 +234,11 @@ header {
@keyframes fade-up {
from {
opacity: 0;
position: relative;
top: 2rem;
margin-top: 4rem;
}
to {
opacity: 1;
position: relative;
top: 0;
}
}