Skip to content

Commit

Permalink
chore: add scroll to top
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSingh-02 committed Oct 7, 2023
1 parent d4323df commit cd2d45c
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Footer,
Fifth,
MobileImageCard,

} from "@/components/index";
import style from "./page.module.css";
import { Russo_One } from "next/font/google";
Expand All @@ -32,6 +31,13 @@ export default function Home() {
});
};

const scrollToTop = () => {
window.scrollTo({
top: 0,
behavior: "smooth"
})
}

useEffect(() => {
getDiscordMemberCount("nsam6YzE8R");
}, []);
Expand Down Expand Up @@ -95,15 +101,14 @@ export default function Home() {
</div>
</div>
<div className=" h-[0px] bg-[#3366ff] flex justify-end">
<a href="#">
<Image
className="md:w-[70px] w-[40px] h-[40px] md:h-[70px] fixed right-[30px] bottom-[30px] md:bottom-[50px] md:right-[90px]"
src="/up-arrow.png"
alt="image here"
width={100}
height={100}
/>
</a>
<Image
className="md:w-[70px] w-[40px] h-[40px] md:h-[70px] fixed right-[30px] bottom-[30px] md:bottom-[50px] cursor-pointer "
src="/up-arrow.png"
alt="image here"
width={100}
height={100}
onClick={scrollToTop}
/>
</div>

<div id="section2">
Expand All @@ -112,7 +117,7 @@ export default function Home() {
<Third />
<Fourth />

<Fifth/>
<Fifth />
<Footer />
</>
);
Expand Down

0 comments on commit cd2d45c

Please sign in to comment.