Skip to content

Commit 8c7282c

Browse files
Enhance App layout with mobile menu toggle and improve Fullscreen button positioning; adjust Projects grid for better responsiveness
1 parent 80fe589 commit 8c7282c

File tree

3 files changed

+59
-75
lines changed

3 files changed

+59
-75
lines changed

src/App.tsx

+57-73
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,80 @@
1-
// src/App.tsx
21
import React, { useState } from "react";
32
import Terminal from "./components/Terminal";
43
import About from "./components/About";
54
import Skills from "./components/Skill";
65
import Projects from "./components/Projects";
76
import Contact from "./components/Contact";
87
import FullScreenToggle from "./components/Fullscreen";
8+
import { BiMenu, BiX } from "react-icons/bi";
99

1010
const App: React.FC = () => {
1111
const [activeWindow, setActiveWindow] = useState<string>("terminal");
12+
const [menuOpen, setMenuOpen] = useState<boolean>(false);
1213

1314
return (
14-
<div className="">
15-
<div className="bg-gray-900 min-h-screen text-gray-200 font-mono">
16-
{/* Top Bar */}
17-
<div className="bg-gray-800 p-2 flex items-center">
18-
<div className="flex space-x-2">
19-
<div className="w-3 h-3 rounded-full bg-red-500"></div>
20-
<div className="w-3 h-3 rounded-full bg-yellow-500"></div>
21-
<div className="w-3 h-3 rounded-full bg-green-500"></div>
22-
</div>
23-
<FullScreenToggle />
24-
<div className="flex mx-auto space-x-4">
25-
<button
26-
className={`px-4 cursor-pointer py-1 rounded ${
27-
activeWindow === "terminal"
28-
? "bg-gray-700"
29-
: "bg-gray-800 hover:bg-gray-700"
30-
}`}
31-
onClick={() => setActiveWindow("terminal")}
32-
>
33-
Terminal
34-
</button>
35-
<button
36-
className={`px-4 cursor-pointer py-1 rounded ${
37-
activeWindow === "about"
38-
? "bg-gray-700"
39-
: "bg-gray-800 hover:bg-gray-700"
40-
}`}
41-
onClick={() => setActiveWindow("about")}
42-
>
43-
About
44-
</button>
45-
<button
46-
className={`px-4 cursor-pointer py-1 rounded ${
47-
activeWindow === "skills"
48-
? "bg-gray-700"
49-
: "bg-gray-800 hover:bg-gray-700"
50-
}`}
51-
onClick={() => setActiveWindow("skills")}
52-
>
53-
Skills
54-
</button>
55-
<button
56-
className={`px-4 cursor-pointer py-1 rounded ${
57-
activeWindow === "projects"
58-
? "bg-gray-700"
59-
: "bg-gray-800 hover:bg-gray-700"
60-
}`}
61-
onClick={() => setActiveWindow("projects")}
62-
>
63-
Projects
64-
</button>
65-
<button
66-
className={`px-4 cursor-pointer py-1 rounded ${
67-
activeWindow === "contact"
68-
? "bg-gray-700"
69-
: "bg-gray-800 hover:bg-gray-700"
70-
}`}
71-
onClick={() => setActiveWindow("contact")}
72-
>
73-
Contact
74-
</button>
75-
</div>
15+
<div className="bg-gray-900 min-h-screen text-gray-200 font-mono">
16+
{/* Top Bar */}
17+
<div className="bg-gray-800 p-2 flex items-center justify-between">
18+
{/* Left Side: Mac-style buttons */}
19+
<div className="flex space-x-2">
20+
<div className="w-3 h-3 rounded-full bg-red-500"></div>
21+
<div className="w-3 h-3 rounded-full bg-yellow-500"></div>
22+
<div className="w-3 h-3 rounded-full bg-green-500"></div>
23+
</div>
24+
25+
{/* Fullscreen Toggle (Center) */}
26+
<FullScreenToggle />
27+
28+
{/* Mobile Menu Toggle Button */}
29+
<button
30+
className="md:hidden p-2 text-gray-300 hover:text-white"
31+
onClick={() => setMenuOpen(!menuOpen)}
32+
>
33+
{menuOpen ? <BiX size={24} /> : <BiMenu size={24} />}
34+
</button>
35+
36+
{/* Navbar Links */}
37+
<div
38+
className={`absolute md:static top-12 left-0 w-full md:w-auto bg-gray-800 md:bg-transparent p-4 md:p-0 md:flex md:space-x-4 transition-all duration-300 ${
39+
menuOpen ? "block" : "hidden md:block"
40+
}`}
41+
>
42+
{["terminal", "about", "skills", "projects", "contact"].map(
43+
(item) => (
44+
<button
45+
key={item}
46+
className={`block w-full md:w-auto px-4 py-2 md:py-1 rounded text-center ${
47+
activeWindow === item
48+
? "bg-gray-700"
49+
: "bg-gray-800 hover:bg-gray-700"
50+
}`}
51+
onClick={() => {
52+
setActiveWindow(item);
53+
setMenuOpen(false);
54+
}}
55+
>
56+
{item.charAt(0).toUpperCase() + item.slice(1)}
57+
</button>
58+
)
59+
)}
60+
{/* Download CV Button */}
7661
<a
7762
href="/cv.pdf"
7863
download
79-
style={{ textDecoration: "none" }}
80-
className="bg-blue-600 hover:bg-blue-700 text-white! px-3 py-1 rounded transition"
64+
className="block text-center md:inline-block bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded transition"
8165
>
8266
Download CV
8367
</a>
8468
</div>
69+
</div>
8570

86-
{/* Main Content */}
87-
<div className="container mx-auto p-6">
88-
{activeWindow === "terminal" && <Terminal />}
89-
{activeWindow === "about" && <About />}
90-
{activeWindow === "skills" && <Skills />}
91-
{activeWindow === "projects" && <Projects />}
92-
{activeWindow === "contact" && <Contact />}
93-
</div>
71+
{/* Main Content */}
72+
<div className="container mx-auto p-6">
73+
{activeWindow === "terminal" && <Terminal />}
74+
{activeWindow === "about" && <About />}
75+
{activeWindow === "skills" && <Skills />}
76+
{activeWindow === "projects" && <Projects />}
77+
{activeWindow === "contact" && <Contact />}
9478
</div>
9579
</div>
9680
);

src/components/Fullscreen.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const FullScreenToggle = () => {
2828
return (
2929
<button
3030
onClick={toggleFullScreen}
31-
className=" cursor-pointer px-4 py-2 bg-gray-800 text-white rounded-lg hover:bg-gray-700 transition flex items-center gap-2 fixed rotate-40 top-20 right-39"
31+
className=" cursor-pointer px-4 py-2 bg-gray-800 text-white rounded-lg hover:bg-gray-700 transition flex items-center gap-2 fixed rotate-90 top-40 -right-10 xl:right-20 z-0 md:z-50"
3232
>
3333
{isFullScreen ? <IoContract /> : <IoExpand />}
3434
{isFullScreen ? "Exit Fullscreen" : "Enter Fullscreen"}

src/components/Projects.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const Projects: React.FC = () => {
109109
<div className="bg-gray-800 rounded-lg p-6 shadow-lg overflow-y-auto max-h-[80vh]">
110110
<h2 className="text-3xl font-bold mb-6 text-blue-400">📝 My Projects</h2>
111111

112-
<div className="grid grid-cols-1 md:grid-cols-4 gap-6">
112+
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 xl:grid-cols-4 gap-6">
113113
{projects.map((project, index) => (
114114
<ProjectCard key={index} {...project} />
115115
))}

0 commit comments

Comments
 (0)