Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvldrp9 committed Jan 11, 2025
1 parent 90d3d8d commit f50887b
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 89 deletions.
7 changes: 7 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AI/ML Professional Portfolio</title>
<meta name="description" content="Professional portfolio showcasing AI and machine learning projects, certifications, and expertise">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<!-- Open Graph / Social Media Meta Tags -->
<meta property="og:title" content="AI/ML Professional Portfolio">
<meta property="og:description" content="Professional portfolio showcasing AI and machine learning projects, certifications, and expertise">
<meta property="og:type" content="website">
</head>
<body>
<div id="root"></div>
Expand Down
22 changes: 13 additions & 9 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import BlogDetail from "@/pages/blog-detail";
import Contact from "@/pages/contact";
import NotFound from "@/pages/not-found";

// Get base URL from environment variable or default to '/'
// Remove trailing slash if present and ensure leading slash
const base = import.meta.env.VITE_BASE_URL?.replace(/\/$/, '') || '';

function Router() {
const [location] = useLocation();

Expand All @@ -26,43 +30,43 @@ function Router() {
<Navbar />
<main className="flex-1">
<AnimatePresence mode="wait">
<Switch location={location} key={location}>
<Route path="/">
<Switch>
<Route path={`${base}/`}>
<PageTransition>
<Home />
</PageTransition>
</Route>
<Route path="/education">
<Route path={`${base}/education`}>
<PageTransition>
<Education />
</PageTransition>
</Route>
<Route path="/projects">
<Route path={`${base}/projects`}>
<PageTransition>
<Projects />
</PageTransition>
</Route>
<Route path="/projects/:id">
<Route path={`${base}/projects/:id`}>
<PageTransition>
<ProjectDetail />
</PageTransition>
</Route>
<Route path="/certifications">
<Route path={`${base}/certifications`}>
<PageTransition>
<Certifications />
</PageTransition>
</Route>
<Route path="/blog">
<Route path={`${base}/blog`}>
<PageTransition>
<Blog />
</PageTransition>
</Route>
<Route path="/blog/:id">
<Route path={`${base}/blog/:id`}>
<PageTransition>
<BlogDetail />
</PageTransition>
</Route>
<Route path="/contact">
<Route path={`${base}/contact`}>
<PageTransition>
<Contact />
</PageTransition>
Expand Down
81 changes: 43 additions & 38 deletions client/src/components/layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
SheetTrigger,
} from "@/components/ui/sheet";

// Get base URL from environment variable or default to empty string
const base = import.meta.env.VITE_BASE_URL?.replace(/\/$/, '') || '';

export default function Navbar() {
const [location] = useLocation();
const [isOpen, setIsOpen] = useState(false);
Expand All @@ -21,65 +24,66 @@ export default function Navbar() {
<nav className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<div className="container mx-auto px-4">
<div className="flex h-16 items-center justify-between">
{/* Logo with half button spacing margin */}
<div className="flex-shrink-0 ml-4"> {/* Using ml-4 for half spacing */}
<Link href="/">
<motion.a
className="flex items-center space-x-3"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
>
<motion.div
className="rounded-lg bg-accent/10 p-2 text-accent"
whileHover={{
scale: 1.1,
rotate: 5,
backgroundColor: "rgb(0, 188, 212)",
color: "#102235",
}}
transition={{ type: "spring", stiffness: 400, damping: 10 }}
{/* Logo */}
<div className="flex-shrink-0 ml-4">
<Link href={`${base}/`}>
<Button variant="link" className="p-0">
<motion.div
className="flex items-center space-x-3"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
>
<div className="relative">
<Brain className="h-6 w-6" />
<Cpu className="absolute -bottom-1 -right-1 h-4 w-4 text-foreground" />
</div>
<motion.div
className="rounded-lg bg-accent/10 p-2 text-accent"
whileHover={{
scale: 1.1,
rotate: 5,
backgroundColor: "rgb(0, 188, 212)",
color: "#102235",
}}
transition={{ type: "spring", stiffness: 400, damping: 10 }}
>
<div className="relative">
<Brain className="h-6 w-6" />
<Cpu className="absolute -bottom-1 -right-1 h-4 w-4 text-foreground" />
</div>
</motion.div>
<span className="text-xl font-bold bg-gradient-to-r from-accent via-foreground to-foreground/90 bg-clip-text text-transparent">
AI Engineer
</span>
</motion.div>
<span className="text-xl font-bold bg-gradient-to-r from-accent via-foreground to-foreground/90 bg-clip-text text-transparent">
AI Engineer
</span>
</motion.a>
</Button>
</Link>
</div>

{/* Desktop Navigation - Right aligned with half spacing for contact */}
{/* Desktop Navigation */}
<div className="hidden md:flex md:items-center md:ml-auto">
<div className="flex items-center space-x-8">
{NAVIGATION_ITEMS.map((item, index) => (
<Link
key={item.path}
href={item.path}
href={`${base}${item.path}`}
className={cn(
"relative text-sm font-medium transition-colors hover:text-foreground",
location === item.path
location === `${base}${item.path}`
? "text-foreground"
: "text-muted-foreground",
// Half right margin for Contact button
index === NAVIGATION_ITEMS.length - 1 ? "mr-4" : "" // Using mr-4 for half spacing
index === NAVIGATION_ITEMS.length - 1 ? "mr-4" : ""
)}
>
<motion.a
<motion.div
whileHover={{ y: -2 }}
whileTap={{ y: 0 }}
>
{item.label}
{location === item.path && (
{location === `${base}${item.path}` && (
<motion.div
className="absolute -bottom-[1px] left-0 right-0 h-0.5 bg-accent"
layoutId="navbar-indicator"
transition={{ type: "spring", bounce: 0.25 }}
/>
)}
</motion.a>
</motion.div>
</Link>
))}
</div>
Expand All @@ -99,18 +103,19 @@ export default function Navbar() {
</SheetHeader>
<div className="flex flex-col gap-4 mt-8">
{NAVIGATION_ITEMS.map((item) => (
<Link key={item.path} href={item.path}>
<a
<Link key={item.path} href={`${base}${item.path}`}>
<Button
variant="ghost"
className={cn(
"text-lg font-medium transition-colors hover:text-foreground px-4 py-2 rounded-md",
location === item.path
"w-full justify-start text-lg font-medium",
location === `${base}${item.path}`
? "bg-accent/10 text-foreground"
: "text-muted-foreground"
)}
onClick={() => setIsOpen(false)}
>
{item.label}
</a>
</Button>
</Link>
))}
</div>
Expand Down
Loading

0 comments on commit f50887b

Please sign in to comment.