Browse Source
Add sidebar animation when collapsing
pull/5794/head
Nihaal Sangha
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
5 deletions
-
docs/_static/sidebar.js
-
docs/_static/style.css
|
|
@ -64,19 +64,17 @@ class Sidebar { |
|
|
|
collapseSection(icon) { |
|
|
|
icon.classList.remove('expanded'); |
|
|
|
icon.classList.add('collapsed'); |
|
|
|
icon.innerText = 'chevron_right'; |
|
|
|
let children = icon.nextElementSibling.nextElementSibling; |
|
|
|
// <arrow><heading>
|
|
|
|
// --> <square><children>
|
|
|
|
children.style.display = "none"; |
|
|
|
setTimeout(() => children.style.display = "none", 75) |
|
|
|
} |
|
|
|
|
|
|
|
expandSection(icon) { |
|
|
|
icon.classList.remove('collapse'); |
|
|
|
icon.classList.add('expanded'); |
|
|
|
icon.innerText = 'expand_more'; |
|
|
|
let children = icon.nextElementSibling.nextElementSibling; |
|
|
|
children.style.display = "block"; |
|
|
|
setTimeout(() => children.style.display = "block", 75) |
|
|
|
} |
|
|
|
|
|
|
|
setActiveLink(section) { |
|
|
@ -127,4 +125,3 @@ document.addEventListener('DOMContentLoaded', () => { |
|
|
|
sidebar.resize(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -361,6 +361,13 @@ aside h3 { |
|
|
|
user-select: none; |
|
|
|
position: relative; |
|
|
|
line-height: 0.5em; |
|
|
|
transition: transform 0.4s; |
|
|
|
transform: rotate(0deg); |
|
|
|
} |
|
|
|
|
|
|
|
.expanded { |
|
|
|
transition: transform 0.4s; |
|
|
|
transform: rotate(-90deg); |
|
|
|
} |
|
|
|
|
|
|
|
.ref-internal-padding { |
|
|
|