Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume TOC fade up animation in desktop mode #2085

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading