Skip to content

Commit

Permalink
Optimize sidebar panel animation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Nov 1, 2020
1 parent 817ef09 commit d19109a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/js/next-boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ NexT.boot.registerEvents = function() {
element.addEventListener('click', () => {
if (element.matches('.sidebar-toc-active .sidebar-nav-toc, .sidebar-overview-active .sidebar-nav-overview')) return;
const sidebar = document.querySelector('.sidebar-inner');
const panel = document.querySelectorAll('.sidebar-panel');
const panel = document.querySelector('.sidebar-panel-container');
const activeClassName = ['sidebar-toc-active', 'sidebar-overview-active'];

window.anime({
duration,
targets : panel[1 - index],
targets : panel,
easing : 'linear',
opacity : 0,
translateY: [0, -20],
Expand All @@ -62,7 +62,7 @@ NexT.boot.registerEvents = function() {
sidebar.classList.replace(activeClassName[1 - index], activeClassName[index]);
window.anime({
duration,
targets : panel[index],
targets : panel,
easing : 'linear',
opacity : [0, 1],
translateY: [-20, 0]
Expand Down

0 comments on commit d19109a

Please sign in to comment.