Skip to content

Commit

Permalink
Merge pull request #17 from SCAI-UTA/robert-dev-branch
Browse files Browse the repository at this point in the history
Syncing updates from robert-dev-branch
  • Loading branch information
thatscrazzyy authored Jan 4, 2025
2 parents 387e991 + 4b07e1b commit d362fb6
Show file tree
Hide file tree
Showing 8 changed files with 998 additions and 2,517 deletions.
2 changes: 1 addition & 1 deletion components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Footer = () => (
SCAI
</h4>
<p className="font-normal text-[14px] text-white opacity-50">
Copyright © 2021 - 2022 SCAI. All rights reserved.
Copyright © 2021 - 2025 SCAI. All rights reserved.
</p>

<div className="flex gap-4">
Expand Down
142 changes: 122 additions & 20 deletions components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,133 @@
'use client';

import { useState, useEffect } from 'react';
import { motion } from 'framer-motion';
import styles from '../styles';
import { navVariants } from '../utils/motion';

const Navbar = () => (
<motion.nav
variants={navVariants}
initial="hidden"
whileInView="show"
className={`${styles.xPaddings} py-8 relative`}
>
<div className="absolute w-[50%] inset-0 gradient-01" />
<div className={`${styles.innerWidth} mx-auto flex items-center justify-between gap-8`}>
<div className="flex items-center gap-4">
<img src="/scai.jpeg" alt="logo" className="w-[80px] h-[auto] rounded-lg shadow-md" />

<img src="/search.svg" alt="search" className="w-[24px] h-[24px] object-contain" />
const Navbar = () => {
const [showSearch, setShowSearch] = useState(false);
const [showMenu, setShowMenu] = useState(false);

const toggleSearch = () => {
setShowSearch(!showSearch);
};

const toggleMenu = () => {
setShowMenu(!showMenu);
};

// Close dropdown menu when clicking outside
useEffect(() => {
const handleOutsideClick = (event) => {
if (
!event.target.closest('.dropdown-menu') &&
!event.target.closest('.menu-btn')
) {
setShowMenu(false);
}
};

document.addEventListener('click', handleOutsideClick);
return () => {
document.removeEventListener('click', handleOutsideClick);
};
}, []);

return (
<motion.nav
variants={navVariants}
initial="hidden"
whileInView="show"
className={`${styles.xPaddings} py-8 relative`}
>
<div className="absolute w-[50%] inset-0 gradient-01" />

<div className={`${styles.innerWidth} mx-auto flex items-center justify-between gap-8`}>
{/* Left Section: Logo and Search */}
<div className="flex items-center gap-4">
<img
src="/scai.jpeg"
alt="logo"
className="w-[80px] h-auto rounded-lg shadow-md"
/>

{/* Search Icon */}
<button
onClick={toggleSearch}
className="p-2 focus:outline-none"
aria-label="Toggle Search"
>
<img
src="/search.svg"
alt="search"
className="w-[24px] h-[24px] object-contain"
/>
</button>
</div>

{/* Brand Name */}
<h2 className="font-extrabold text-[24px] text-white leading-[30px]">
SCAI
</h2>

{/* Menu Icon */}
<button
onClick={toggleMenu}
className="p-2 focus:outline-none menu-btn"
aria-label="Toggle Menu"
>
<img
src="/menu.svg"
alt="menu"
className="w-[24px] h-[24px] object-contain"
/>
</button>
</div>

<h2 className="font-extrabold text-[24px] text-white leading-[30px]">
{/* Your brand name */}
</h2>
{/* Search Input */}
{showSearch && (
<div className="mt-4 mx-auto flex justify-center">
<input
type="text"
placeholder="Search SCAI"
className="w-full max-w-md p-2 border border-gray-300 rounded-md bg-white text-black shadow-md focus:ring-2 focus:ring-blue-500"
autoFocus
/>
</div>
)}

<img src="/menu.svg" alt="menu" className="w-[24px] h-[24px] object-contain" />
</div>
</motion.nav>
);
{/* Dropdown Menu */}
{showMenu && (
<div
className="absolute top-[100%] right-0 mt-2 bg-white text-black rounded-lg shadow-lg py-2 w-[200px] z-50 dropdown-menu"
>
<a href="#about" className="block px-4 py-2 hover:bg-gray-200">
About
</a>
<a href="#projects" className="block px-4 py-2 hover:bg-gray-200">
Projects
</a>
<a href="#howaiworks" className="block px-4 py-2 hover:bg-gray-200">
How AI Works
</a>
<a href="#about" className="block px-4 py-2 hover:bg-gray-200">
What's New @ SCAI
</a>
<a href="#projects" className="block px-4 py-2 hover:bg-gray-200">
Global Impact
</a>
<a href="#howaiworks" className="block px-4 py-2 hover:bg-gray-200">
Insights
</a>
<a href="#howaiworks" className="block px-4 py-2 hover:bg-gray-200">
SCAI President Address
</a>
</div>
)}
</motion.nav>
);
};

export default Navbar;

20 changes: 15 additions & 5 deletions constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,29 @@ export const insights = [
];

export const socials = [
// {
// name: 'twitter',
// url: '/twitter.svg',
// link: 'https://twitter.com/VigneshGupta9',
// }, # Add SCAI UTA X page when it is established here.
{
name: 'twitter',
url: '/twitter.svg',
link: 'https://twitter.com/VigneshGupta9',
name: 'discord',
url: '/disc.jpeg',
link: 'https://discord.com/invite/ZZrgf9XsD4',
},
{
name: 'linkedin',
url: '/linkedin.svg',
link: 'https://www.linkedin.com/in/vigneshgupta/',
link: 'https://www.linkedin.com/company/scai-uta/',
},
{
name: 'instagram',
url: '/instagram.svg',
link: 'https://www.instagram.com/_viggi.g_/',
link: 'https://www.instagram.com/scai_uta/',
},
{
name: 'github',
url: '/github.png',
link: 'https://github.com/SCAI-UTA',
},
];
Loading

0 comments on commit d362fb6

Please sign in to comment.