Skip to content

Commit

Permalink
smooth scrolling added to hero button
Browse files Browse the repository at this point in the history
  • Loading branch information
onurcagan committed Jan 6, 2023
1 parent 0a51b1a commit e4bf07f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html lang="en" className="bg-black">
<Html lang="en" className="bg-black scroll-smooth">
<Head />
<body>
<Main />
Expand Down
4 changes: 2 additions & 2 deletions src/helper/HeroClickHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export function handleClick(btn: string, router: NextRouter) {
let navbar = document.getElementById('navbar')
navbar!.style.opacity = '0'
navbar!.style.visibility = 'hidden'
router.push('#work')
router.push('#work', undefined, { scroll: false })
}

if (router.pathname === '/contact') {
let navbar = document.getElementById('navbar')
navbar!.style.opacity = '0'
navbar!.style.visibility = 'hidden'
router.push('#contact')
router.push('#contact', undefined, { scroll: false })
}

if (btn === 'Book') {
Expand Down

1 comment on commit e4bf07f

@vercel
Copy link

@vercel vercel bot commented on e4bf07f Jan 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.