Skip to content

Commit

Permalink
fix(toc): resume fade up animation in desktop mode (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 authored Dec 3, 2024
1 parent 4180992 commit 8280adb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _includes/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion _javascript/modules/components/toc/toc-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
}
5 changes: 1 addition & 4 deletions _sass/pages/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 8280adb

Please sign in to comment.