1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

added smooth scrolling for comments

This commit is contained in:
Fedor Katurov 2021-10-06 12:23:53 +07:00
parent 0de8168297
commit e96ab08210
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
animation: highlight 1s 0.25s forwards; animation: highlight 1s 0.5s forwards;
background: transparentize($wisegreen, 0.7); background: transparentize($wisegreen, 0.7);
border-radius: $radius; border-radius: $radius;
} }

View file

@ -11,6 +11,9 @@ export const useScrollToTop = (deps?: any[]) => {
} }
const bounds = targetElement.getBoundingClientRect(); const bounds = targetElement.getBoundingClientRect();
window.scrollTo(0, bounds.y - 100); window.scrollTo({
top: bounds.top - 100,
behavior: 'smooth',
});
}, deps || []); }, deps || []);
}; };