diff --git a/src/components/containers/CommentWrapper/styles.module.scss b/src/components/containers/CommentWrapper/styles.module.scss index b44c96d0..1e6d7755 100644 --- a/src/components/containers/CommentWrapper/styles.module.scss +++ b/src/components/containers/CommentWrapper/styles.module.scss @@ -34,7 +34,7 @@ left: 0; right: 0; bottom: 0; - animation: highlight 1s 0.25s forwards; + animation: highlight 1s 0.5s forwards; background: transparentize($wisegreen, 0.7); border-radius: $radius; } diff --git a/src/utils/hooks/useScrollToTop.ts b/src/utils/hooks/useScrollToTop.ts index 5a721152..6daee407 100644 --- a/src/utils/hooks/useScrollToTop.ts +++ b/src/utils/hooks/useScrollToTop.ts @@ -11,6 +11,9 @@ export const useScrollToTop = (deps?: any[]) => { } const bounds = targetElement.getBoundingClientRect(); - window.scrollTo(0, bounds.y - 100); + window.scrollTo({ + top: bounds.top - 100, + behavior: 'smooth', + }); }, deps || []); };