1
1
'use client' ;
2
2
3
- import { Globe , Rss , HelpCircle , Star , Building2Icon , Construction , CloudDrizzleIcon , HandMetalIcon } from "lucide-react" ;
3
+ import { Building2Icon , Construction , CloudDrizzleIcon , HandMetalIcon , Settings } from "lucide-react" ;
4
4
import { usePathname } from "next/navigation" ;
5
5
import Link from "next/link" ;
6
6
import { useState } from "react" ;
7
- import FreeformUploadData from "../Projects/(classifications)/FreeForm" ;
8
7
import TutorialPopup from "@/content/Dialogue/helpButton" ;
9
8
10
9
const menuItems = [
11
10
{ icon : Building2Icon , label : "Structures" , href : "/" } ,
12
11
{ icon : Construction , label : "Mining" , href : "/#" } ,
13
12
{ icon : CloudDrizzleIcon , label : "Weather" , href : "/#" } ,
14
- {
15
- icon : HandMetalIcon ,
16
- label : "Topography" ,
17
- href : "/#" ,
18
- } ,
13
+ { icon : HandMetalIcon , label : "Topography" , href : "/#" } ,
19
14
] ;
20
15
21
16
export default function VerticalToolbar ( ) {
22
- const pathname = usePathname ( ) ;
17
+ const pathname = usePathname ( ) ;
23
18
const [ hovered , setHovered ] = useState < string | null > ( null ) ;
19
+ const [ isMenuOpen , setIsMenuOpen ] = useState ( false ) ;
24
20
25
21
return (
26
- < div className = "fixed left-4 top-1/4 transform -translate-y-1/2 z-50" >
27
- < nav className = "bg-[#1E3A4C] rounded-xl shadow-lg backdrop-blur-md bg-opacity-80 p-2" >
28
- < ul className = "flex flex-col space-y-4" >
29
- { menuItems . map ( ( { icon : Icon , label, href } ) => (
30
- < li key = { label } >
31
- < Link legacyBehavior href = { href } >
32
- < a
33
- onMouseEnter = { ( ) => setHovered ( label ) }
34
- onMouseLeave = { ( ) => setHovered ( null ) }
35
- className = { `flex items-center space-x-2 px-4 py-3 rounded-full transition-all duration-300
36
- ${ pathname === href
37
- ? "bg-white text-[#1E3A4C] shadow-md"
38
- : "text-white hover:bg-white/10" } `}
39
- aria-label = { label }
40
- >
41
- < Icon className = "w-6 h-6" />
42
- { ( pathname === href || hovered === label ) && (
43
- < span className = "text-sm font-medium" > { label } </ span >
44
- ) }
45
- </ a >
46
- </ Link >
47
- </ li >
48
- ) ) }
49
- </ ul >
50
- < div className = "mt-4" >
51
- < center >
52
- < TutorialPopup />
53
- </ center >
54
- </ div >
55
- </ nav >
22
+ < div className = "z-50" >
23
+ { /* Desktop Toolbar */ }
24
+ < div className = "hidden md:block fixed left-4 top-1/4 transform -translate-y-1/2" >
25
+ < nav className = "bg-[#1E3A4C] rounded-xl shadow-lg backdrop-blur-md bg-opacity-80 p-2" >
26
+ < ul className = "flex flex-col space-y-4" >
27
+ { menuItems . map ( ( { icon : Icon , label, href } ) => (
28
+ < li key = { label } >
29
+ < Link legacyBehavior href = { href } >
30
+ < a
31
+ onMouseEnter = { ( ) => setHovered ( label ) }
32
+ onMouseLeave = { ( ) => setHovered ( null ) }
33
+ className = { `flex items-center space-x-2 px-4 py-3 rounded-full transition-all duration-300
34
+ ${ pathname === href
35
+ ? "bg-white text-[#1E3A4C] shadow-md"
36
+ : "text-white hover:bg-white/10" } `}
37
+ aria-label = { label }
38
+ >
39
+ < Icon className = "w-6 h-6" />
40
+ { ( pathname === href || hovered === label ) && (
41
+ < span className = "text-sm font-medium" > { label } </ span >
42
+ ) }
43
+ </ a >
44
+ </ Link >
45
+ </ li >
46
+ ) ) }
47
+ </ ul >
48
+ < div className = "mt-4" >
49
+ < center >
50
+ < TutorialPopup />
51
+ </ center >
52
+ </ div >
53
+ </ nav >
54
+ </ div >
55
+
56
+ { /* Mobile Toolbar with Gear Icon */ }
57
+ < div className = "block md:hidden fixed left-4 bottom-4" >
58
+ < button
59
+ onClick = { ( ) => setIsMenuOpen ( ! isMenuOpen ) }
60
+ className = "bg-[#1E3A4C] p-4 rounded-full shadow-lg text-white focus:outline-none"
61
+ aria-label = "Open menu"
62
+ >
63
+ < Settings className = "w-6 h-6" />
64
+ </ button >
65
+
66
+ { isMenuOpen && (
67
+ < div className = "absolute left-0 bottom-16 bg-[#1E3A4C] rounded-xl shadow-lg backdrop-blur-md bg-opacity-80 p-2" >
68
+ < ul className = "flex flex-col space-y-4" >
69
+ { menuItems . map ( ( { icon : Icon , label, href } ) => (
70
+ < li key = { label } >
71
+ < Link legacyBehavior href = { href } >
72
+ < a
73
+ onClick = { ( ) => setIsMenuOpen ( false ) } // Close menu after selection
74
+ className = { `flex items-center space-x-2 px-4 py-3 rounded-full transition-all duration-300
75
+ ${ pathname === href
76
+ ? "bg-white text-[#1E3A4C] shadow-md"
77
+ : "text-white hover:bg-white/10" } `}
78
+ aria-label = { label }
79
+ >
80
+ < Icon className = "w-6 h-6" />
81
+ < span className = "text-sm font-medium" > { label } </ span >
82
+ </ a >
83
+ </ Link >
84
+ </ li >
85
+ ) ) }
86
+ </ ul >
87
+ </ div >
88
+ ) }
89
+ </ div >
56
90
</ div >
57
91
) ;
58
- }
92
+ } ;
0 commit comments