Skip to content

Commit

Permalink
Scrolldown icon is clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-ao committed Sep 17, 2024
1 parent 5ff1c80 commit 88aea9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/components/home/ScrollDownIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ const ScrollDownIcon = () => {
};
}, []); // Tom dependency array betyr at effekten kjøres ved mount og cleanup ved unmount

const handleClick = (targetId: string) => {
const targetElement = document.getElementById(targetId);
targetElement?.scrollIntoView({ behavior: "smooth" });
};

return (
<div
className={clsx(
'flex justify-center items-center h-[10px] sticky bottom-10',
'flex justify-center items-center h-[10px] sticky bottom-10 cursor-pointer w-16 m-auto p-5 group',
!isVisible && 'hidden',
)}
onClick={() => handleClick('home-text')}
>
<span className="border-solid border-white border-r-[5px] border-b-[5px] p-[6px] animate-bounceArrow"></span>
<span className="border-solid border-white group-hover:border-gray-500 transition border-r-[5px] border-b-[5px] p-[6px] animate-bounceArrow"></span>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const HomePage = () => (
<ScrollDownIcon />
</div>
<h1 className="my-4 mt-10 text-2xl md:hidden">Online Fondet</h1>
<div className="w-3/4 mb-10 text-lg text-justify">{homeText}</div>
<div id="home-text" className="w-3/4 py-20 text-lg text-justify">{homeText}</div>
<PerformanceDisplay />
<div className="hidden w-full mb-10 md:block">
<div className="w-full mt-40 mb-10 text-lg text-center">
Expand Down

0 comments on commit 88aea9d

Please sign in to comment.