From 2a3a07e7caa77a8f0b1df971538208b14065826e Mon Sep 17 00:00:00 2001
From: Maximilian Schneider
Date: Thu, 29 Jul 2021 15:26:16 +0200
Subject: [PATCH] implement scrolling to modal
---
components/HeroSection.tsx | 11 ++++++++++-
components/ModalSection.tsx | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/components/HeroSection.tsx b/components/HeroSection.tsx
index 5ff2869..94c81e8 100644
--- a/components/HeroSection.tsx
+++ b/components/HeroSection.tsx
@@ -2,6 +2,15 @@ import GradientText from './GradientText'
import Button from './Button'
import Link from './Link'
+function scrollToId(id: string) {
+ const element = document.getElementById(id)
+ const y = element.getBoundingClientRect().top + window.scrollY
+ window.scroll({
+ top: y,
+ behavior: 'smooth',
+ })
+}
+
const HeroSection = () => {
return (
@@ -17,7 +26,7 @@ const HeroSection = () => {