From c25e346b35d6054c117aff92bfa40db1ead1856d Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 1 Sep 2021 22:11:10 +0100 Subject: [PATCH] Smooth scrolling --- src/components/HomePageHeader.js | 6 +++++- src/styles/custom.scss | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/HomePageHeader.js b/src/components/HomePageHeader.js index 3ef8b7b3..2d95bc86 100644 --- a/src/components/HomePageHeader.js +++ b/src/components/HomePageHeader.js @@ -10,6 +10,10 @@ import IconBannerSource from '../../static/icons/banner_source.svg'; import IconBannerDocs from '../../static/icons/banner_docs.svg'; import IconDownArrow from '../../static/icons/interface_down.svg'; +const scrollToFeatures = () => { + document.querySelector('#go-down').scrollIntoView({ behavior: 'smooth' }); +}; + export default function HomepageHeader() { const { siteConfig } = useDocusaurusContext(); const [showMore, setShowMore] = useState(false); @@ -40,7 +44,7 @@ export default function HomepageHeader() { {(!showMore) && - + Feature List diff --git a/src/styles/custom.scss b/src/styles/custom.scss index fd6631c4..4c163dde 100644 --- a/src/styles/custom.scss +++ b/src/styles/custom.scss @@ -60,6 +60,10 @@ nav.navbar { } } +html { + scroll-behavior: smooth; +} + body { background: var(--background); }