2023-08-30 19:06:48 +07:00
|
|
|
"use client";
|
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
|
import {
|
|
|
|
|
faHome,
|
|
|
|
|
faUser,
|
|
|
|
|
faFolderOpen,
|
|
|
|
|
faEnvelope,
|
|
|
|
|
} from "@fortawesome/free-solid-svg-icons";
|
|
|
|
|
|
2023-09-02 11:12:47 +07:00
|
|
|
|
|
|
|
|
const Sidebar = () => {
|
2023-08-30 19:06:48 +07:00
|
|
|
const handleMoveToSection = (index) => {
|
2023-09-02 11:12:47 +07:00
|
|
|
fullpage_api.moveTo(index);
|
|
|
|
|
fullpage_api.getActiveSection();
|
2023-08-30 19:06:48 +07:00
|
|
|
};
|
|
|
|
|
|
2023-09-02 11:12:47 +07:00
|
|
|
const containIsActive = (index) => {
|
|
|
|
|
if (fullpage_api.getActiveSection().index === index) {
|
|
|
|
|
return "bg-gray-500";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
};
|
2023-08-30 19:06:48 +07:00
|
|
|
return (
|
2023-09-05 21:39:08 +07:00
|
|
|
<div className="hidden md:flex fixed z-40 bg-gray-700 h-[50vh] w-14 flex-col justify-between items-center p-4 left-0 top-1/4 rounded-e-3xl">
|
2023-09-02 21:23:37 +07:00
|
|
|
<ul
|
|
|
|
|
id="sidebar"
|
2023-09-05 21:39:08 +07:00
|
|
|
className="flex flex-col justify-center items-center h-full space-y-16 text-gray-50">
|
2023-09-02 21:23:37 +07:00
|
|
|
<li data-menuanchor="home" className="active">
|
2023-08-30 19:06:48 +07:00
|
|
|
<button onClick={() => handleMoveToSection(1)}>
|
|
|
|
|
<FontAwesomeIcon icon={faHome} className="text-xl" />
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
2023-09-02 21:23:37 +07:00
|
|
|
<li data-menuanchor="about">
|
2023-08-31 06:59:47 +07:00
|
|
|
<button onClick={() => handleMoveToSection(2)}>
|
2023-08-30 19:06:48 +07:00
|
|
|
<FontAwesomeIcon icon={faUser} className="text-xl" />
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
2023-09-02 21:23:37 +07:00
|
|
|
<li data-menuanchor="projects">
|
2023-08-30 19:06:48 +07:00
|
|
|
<button onClick={() => handleMoveToSection(3)}>
|
|
|
|
|
<FontAwesomeIcon
|
|
|
|
|
icon={faFolderOpen}
|
|
|
|
|
className="text-xl"
|
|
|
|
|
/>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
2023-09-02 21:23:37 +07:00
|
|
|
<li data-menuanchor="contact">
|
2023-08-31 06:59:47 +07:00
|
|
|
<button onClick={() => handleMoveToSection(4)}>
|
2023-08-30 19:06:48 +07:00
|
|
|
<FontAwesomeIcon
|
|
|
|
|
icon={faEnvelope}
|
|
|
|
|
className="text-xl"
|
|
|
|
|
/>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Sidebar;
|