Skip to content

Navbar completly fixed #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_SUPABASE_URL=https://twsbyjhyntfbcadywdkl.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InR3c2J5amh5bnRmYmNhZHl3ZGtsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mjg4ODM1NTYsImV4cCI6MjA0NDQ1OTU1Nn0.2rTbjf9CLJObMq3hHuYG_dY03mywwTHEzBt0Jz8iflI
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=youplay
NEXT_PUBLIC_CLOUDINARY_API_KEY=151273272649153
63 changes: 37 additions & 26 deletions src/app/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';
import React, { useState, useEffect } from 'react';
import Image from 'next/image';

import Logo from '../public/Logo.png';
import '@/styles.css';
import { ModeToggle } from './button-mode';
Expand Down Expand Up @@ -31,23 +30,23 @@ const Navbar = () => {

const navItems = [
{ label: 'Home', id: '/' },
{ label: 'Team', id: '#' },
{ label: 'Team', id: 'team' },
{ label: 'Projects', id: 'projects' },
{ label: 'Events', id: '#' },
{ label: 'Notice', id: '#' },
{ label: 'Events', id: 'events' },
{ label: 'Notice', id: 'notice' },
];

return (
<div className={`navbar sticky top-0 start-0 w-full bg-opacity-30 backdrop-blur-md ${isDarkMode ? 'bg-gray-900' : 'bg-gray-200'} text-white`}>
<div className="navbar-start flex items-center justify-between w-full">
<Image src={Logo} alt='Logo' height={50} width={50} />
<div className="navbar-start flex items-center justify-between w-full p-4">
<Image src={Logo} alt="Logo" height={50} width={50} />
<div className="navbar-center hidden lg:flex space-x-4">
<ul className="menu menu-horizontal flex text-sm">
<ul className="menu flex text-sm">
{navItems.map((item) => (
<li key={item.label}>
<a
href={`${item.id}`}
className="block text-lg leading-5 text-gray-200 transition-colors duration-300 p-2 rounded font-extralight"
href={item.id}
className="block text-lg leading-5 text-gray-200 transition-colors duration-300 p-2 rounded font-extralight hover:bg-gray-700"
>
{item.label}
</a>
Expand All @@ -56,32 +55,44 @@ const Navbar = () => {
</ul>
</div>
<div className="navbar-end flex items-center gap-5">
<a className="btn bg-transparent px-5 text-orange-400 border-orange-400 rounded-3xl hover:bg-orange-400 hover:text-white hover:border-none">Log In</a>
<a className="btn border-transparent bg-orange-400 px-5 text-white rounded-full hover:bg-transparent hover:text-orange-400 hover:border-orange-400">Sign Up</a>

<a className="btn bg-transparent px-5 text-orange-400 border-orange-400 rounded-3xl hover:bg-orange-400 hover:text-white hover:border-none">
Log In
</a>
<a className="btn border-transparent bg-orange-400 px-5 text-white rounded-full hover:bg-transparent hover:text-orange-400 hover:border-orange-400">
Sign Up
</a>
<ModeToggle />
</div>

<div className="navbar-center lg:hidden">
<button className="btn btn-ghost" onClick={toggleDropdown}>
<svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16m-7 6h7" />
</svg>
</button>
{isOpen && (
<ul className="menu dropdown-content mt-3 p-2 pt-28 shadow bg-gray-800 rounded-box w-52">
{navItems.map((item) => (
<li key={item.label}>
<a
href={`${item.id}`}
className="block text-lg leading-6 text-gray-200 transition-colors duration-300 p-2 rounded font-extralight"
onClick={() => setIsOpen(false)}
>
{item.label}
</a>
</li>
))}
</ul>
<div className="absolute top-16 left-0 right-0 bg-gray-800 p-4">
<ul className="flex flex-col space-y-2 text-white text-sm">
{navItems.map((item) => (
<li key={item.label}>
<a
href={item.id}
className="block text-lg leading-6 text-gray-200 transition-colors duration-300 p-2 rounded font-extralight hover:bg-gray-700"
onClick={() => setIsOpen(false)}
>
{item.label}
</a>
</li>
))}
</ul>
<div className="flex flex-col mt-4 space-y-2">
<a className="btn bg-transparent px-7 text-orange-400 border-orange-400 rounded-3xl hover:bg-orange-400 hover:text-white hover:border-none">
Log In
</a>
<a className="btn border-transparent bg-orange-400 px-7 text-white rounded-full hover:bg-transparent hover:text-orange-400 hover:border-orange-400">
Sign Up
</a>
</div>
</div>
)}
</div>
</div>
Expand Down