Skip to content

[CW2-9] Add navbar / hamburger menu to mobile #8

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

Merged
merged 6 commits into from
Jun 4, 2024
Merged
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
6 changes: 3 additions & 3 deletions components/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const About = () => {
<section className="py-8 xl:px-24 sm:px-10 px-5" id="about">
<div className="text-center my-10">
<p className="text-[#3977F8] font-game text-xl">01</p>
<h1 className="font-bold text-6xl">ABOUT</h1>
<h2 className="font-bold text-6xl">ABOUT</h2>
</div>
<div className="flex justify-center items-center">
<div className="lg:grid grid-cols-6 flex-1 max-w-[90rem]">
Expand All @@ -14,7 +14,7 @@ const About = () => {
<div className="flex items-center justify-center">
<Image src="/assets/csesoc_icon.svg" alt="CSESoc Icon" width={150} height={150} />
</div>
<h1 className="mt-10 text-3xl font-extrabold">CSESoc</h1>
<h2 className="mt-10 text-3xl font-extrabold">CSESoc</h2>
<p className="text-[#727B8C] font-medium">unsw-computer-science-soc</p>
<button className="bg-[#444F6F] w-full my-5 py-2 rounded">Follow</button>
<p>
Expand All @@ -40,7 +40,7 @@ const About = () => {
</div>
{/* RIGHT SIDE */}
<div className="col-span-4 lg:mt-0 mt-10">
<div className="rounded border border-[#595F6D] p-5 2xl:h-80 xl:h-64 lg:h-48 sm:h-36 h-32 h-full">
<div className="rounded border border-[#595F6D] p-5 2xl:h-80 xl:h-64 lg:h-48 sm:h-36 h-full">
<p className="text-xs">
csesoc/README<span className="text-[#7A8192]">.md</span>
</p>
Expand Down
57 changes: 35 additions & 22 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
import Image from 'next/image';
import Link from 'next/link';
import { socialLinks } from '../public/data/data';

const Footer = () => {
return (
<section>
<div className="sm:flex justify-between">
<div className="flex items-center">
<img src="assets/csesoc_logo_white.svg" alt="CSESoc Logo" />
<Link href="/flag/ollie_is_hiding.png" target="_blank" className="sm:hidden block">
<img
src="/flag/ollie_is_hiding.png"
alt="Ollie"
draggable="false"
width={60}
height={60}
className="ml-10"
/>
</Link>
<img
src="/flag/ollie_is_hiding.png"
alt="Ollie"
draggable="false"
width={60}
height={60}
className="ml-10 sm:block hidden"
/>
<div className="sm:flex justify-between pb-10">
<div className="flex flex-col gap-10">
<div className="flex items-center">
<Link href="/" className="flex">
<Image src="assets/csesoc_logo_white.svg" width={231} height={53} alt="CSESoc Logo" />
<Image
src="/flag/ollie_is_hiding.png"
alt="Ollie"
draggable="false"
width={60}
height={60}
className="ml-10"
/>
</Link>
</div>
<div className="grid grid-cols-8 gap-4">
{socialLinks.map((item, index) => {
return (
<a key={index} className="" href={item.href}>
<Image
className="h-4 fill-white min-w-full hover:scale-125 transition-all"
src={item.src}
alt={item.alt}
height={0}
width={0}
/>
</a>
);
})}
</div>
</div>
<div className="flex flex-col max-w-[14rem] sm:mt-0 mt-10 font-light">
<p className="mb-6">B03 CSE Building K17, UNSW [email protected]</p>
<p>© 2021 — CSESoc UNSW</p>
</div>
</div>
<img
<Image
src="assets/sponsors_backdrop.svg"
alt="Sponsors backdrop"
height={0}
width={0}
className="absolute bottom-0 left-0 w-screen -z-10"
/>
</section>
Expand Down
56 changes: 56 additions & 0 deletions components/Hamburger.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';
import { AnimatePresence, motion, useCycle } from 'framer-motion';
import Link from 'next/link';

export default function Hamburger() {
const [isOpen, toggleOpen] = useCycle(false, true);

return (
<button
onClick={() => {
toggleOpen();
}}
>
<svg
className="w-10 h-10"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 6h16M4 12h16m-7 6h7"
/>
</svg>
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -10 }}
transition={{ duration: 0.2 }}
className="absolute top-16 right-0 bg-[#3977F9] p-4 shadow-lg w-40 rounded-2xl"
>
<ul>
<li className="py-2 text-lg">
<Link href={'./about'}>About Us</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./events'}>Events</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./resources'}>Resources</Link>
</li>
<li className="py-2 text-lg">
<Link href={'./sponsors'}>Sponsors</Link>
</li>
</ul>
</motion.div>
)}
</AnimatePresence>
</button>
);
}
2 changes: 1 addition & 1 deletion components/Landing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Landing = () => {
<div>
<div className="font-semibold">
<p>{'<h1>'}</p>
<h1 className="font-black 2xl:text-8xl lg:text-6xl text-4xl">Hello World!</h1>
<h2 className="font-black 2xl:text-8xl lg:text-6xl text-4xl">Hello World!</h2>
<p>{'</h1>'}</p>
</div>
<div className="font-semibold mt-10">
Expand Down
8 changes: 6 additions & 2 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Image from 'next/image';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import Hamburger from './Hamburger';

const Navbar = () => {
const [path, setPath] = useState<string>('');
Expand All @@ -24,11 +25,11 @@ const Navbar = () => {
</Link>
<div>
<div className="md:flex xl:gap-36 lg:gap-20 md:gap-10 text-right font-bold hidden">
<Link href="about us">
<Link href="about">
<p className="text-[0.6rem] text-[#C4C5C8]">01</p>
<div>{'//'} about us</div>
</Link>
<Link href="events">
<Link href="#events">
<p className="text-[0.6rem] text-[#C4C5C8]">02</p>
<div>{'//'} events</div>
</Link>
Expand All @@ -41,6 +42,9 @@ const Navbar = () => {
<div>{'//'} sponsors</div>
</Link>
</div>
<div className="md:hidden xl:hidden lg:hidden text-right font-bold block">
<Hamburger />
</div>
</div>
</nav>
);
Expand Down
26 changes: 22 additions & 4 deletions components/ResourcesAndContacts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ResourcesAndContacts = () => {

<div className="text-center my-10">
<p className="text-[#3977F8] font-game text-xl">03</p>
<h1 className="font-bold text-6xl">RESOURCES & CONTACTS</h1>
<h2 className="font-bold text-6xl">RESOURCES & CONTACTS</h2>
</div>

<div className="py-8 bg-no-repeat bg-center">
Expand Down Expand Up @@ -122,23 +122,41 @@ const ResourcesAndContacts = () => {
<div className="md:mt-10 mt-5">
<div className="grid grid-cols-3 1 gap-x-9 gap-y-5 mb-10">
<a href="https://bit.ly/CSESocDiscord" target="_blank" className={socialsBoxStyling}>
<Image src="assets/discord_logo.svg" alt="" width={25} height={25} className="mr-1" />
<Image
src="assets/discord_logo.svg"
alt="discord logo"
width={25}
height={25}
className="mr-1"
/>
<p className="text-xl font-bold m-2">DISCORD</p>
</a>
<a
href="https://www.facebook.com/csesoc/"
target="_blank"
className={socialsBoxStyling}
>
<Image src="assets/fb_logo.svg" alt="" width={25} height={25} className="mr-1" />
<Image
src="assets/fb_logo.svg"
alt="facebook logo"
width={25}
height={25}
className="mr-1"
/>
<p className="text-xl font-bold m-2">FACEBOOK</p>
</a>
<a
href="https://www.facebook.com/groups/csesoc"
target="_blank"
className={socialsBoxStyling}
>
<Image src="assets/group_icon.svg" alt="" width={25} height={25} className="mr-1" />
<Image
src="assets/group_icon.svg"
alt="facebook group"
width={25}
height={25}
className="mr-1"
/>
<p className="text-xl font-bold m-2">FACEBOOK GROUP</p>
</a>
</div>
Expand Down
5 changes: 4 additions & 1 deletion components/Sponsors/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from 'next/link';

Check warning on line 1 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

'Link' is defined but never used
import React from 'react';

const Sponsors = () => {
Expand All @@ -8,7 +8,10 @@
'xl:p-16 p-10 flex justify-center items-center xl:col-span-3 sm:col-span-5 col-span-10 xl:row-start-2 xl:row-end-3 sm:row-start-4 sm:row-end-5 sm:h-auto h-36';

return (
<section className="flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20">
<section
className="flex flex-col min-h-screen py-8 xl:px-24 sm:px-10 px-8 relative mt-20"
id="sponsors"
>
<div className="text-center">
<p className="text-[#3977F8] font-game text-xl">04</p>
<h2 className="font-bold text-6xl">SUPPORT CSESOC</h2>
Expand All @@ -34,21 +37,21 @@
</div>
<div className={`${firstRowBoxesStyling} bg-[rgba(0, 71, 255, 0.33)]`}>
<img src="assets/atlassian_logo.svg" alt="Atlassian logo" />
</div>

Check warning on line 40 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<div className={`${firstRowBoxesStyling} bg-[rgba(82, 130, 255, 0.47)]`}>
<img src="assets/google_logo.svg" alt="Google logo" />
</div>

Check warning on line 43 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<div className={`${secondRowBoxesStyling} bg-[rgba(48, 93, 255, 0.2)]`}>
<img src="assets/freelancer_logo.svg" alt="Freelancer logo" />
</div>

Check warning on line 46 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<div className={`${secondRowBoxesStyling} bg-[rgba(122, 137, 236, 0.27)]`}>
<img src="assets/microsoft_logo.svg" alt="Microsoft logo" />
</div>

Check warning on line 49 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</div>
</div>
<div className="sm:flex justify-between">
<div className="flex items-center">
<img src="assets/csesoc_logo_white.svg" alt="CSESoc Logo" />

Check warning on line 54 in components/Sponsors/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<Link href="/flag/ollie_is_hiding.png" target="_blank" className="sm:hidden block">
<img
src="/flag/ollie_is_hiding.png"
Expand Down
33 changes: 15 additions & 18 deletions components/Sponsors/sponsorlinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,48 @@
//import '/styles/sponsorLinks.module.css';
const logostyle = 'h-14';
const logodiv = 'block gap-y-8 h-14';
const background =
'radial-gradient(50% 50% at 50% 50%, rgba(235, 1, 255, 0.6) 0%, rgba(121, 73, 255, 0.6) 48.96%, rgba(57, 119, 248, 0.6) 100%)';
const background = 'rgba(57, 119, 248, 0.6)';
// const outer = 'rounded-[4rem] w-[90rem] flex flex-col pl-14 py-14 gap-16';

function SponsorLinks() {
return (
<div className="flex justify-center items-center my-20">
<div className="w-100 flex flex-col gap-16">
<div
style={{ backgroundImage: `${background}` }}
className="flex rounded-[1rem] pl-14 py-14 gap-16 items-center"
style={{ backgroundColor: `${background}` }}
className="flex flex-wrap rounded-[1rem] pl-14 py-14 gap-16 items-center"
>
<h2 className="text-4xl font-black">Diamond Sponsors</h2>
{diamondLinks.map((item, index) => {
return (
<a key={index} className={`${logodiv}`} href={item.href}>
<img className={`${logostyle}`} src={item.svg} alt={item.alt} />

Check warning on line 20 in components/Sponsors/sponsorlinks.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</a>
);
})}
</div>
<div
style={{ backgroundImage: `${background}` }}
className="flex rounded-[1rem] px-14 py-14"
style={{ backgroundColor: `${background}` }}
className="flex flex-wrap rounded-[1rem] px-14 py-14 gap-16 items-center"
>
<h2 className="text-4xl font-black pr-16">Gold Sponsors</h2>
<div className="grid grid-cols-5 gap-16 items-center">
{goldLinks.map((item, index) => {
return (
<a key={index} className="" href={item.href}>
<img className="h-6" src={item.svg} alt={item.alt} />
</a>
);
})}
</div>
<h2 className="text-4xl font-black">Gold Sponsors</h2>
{goldLinks.map((item, index) => {
return (
<a key={index} className="" href={item.href}>
<img className="h-6" src={item.svg} alt={item.alt} />

Check warning on line 33 in components/Sponsors/sponsorlinks.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</a>
);
})}
</div>
<div
style={{ backgroundImage: `${background}` }}
className="grid grid-cols-5 rounded-[1rem] pl-14 py-14 gap-16 items-center"
style={{ backgroundColor: `${background}` }}
className="flex flex-wrap rounded-[1rem] px-14 py-14 gap-16 items-center"
>
<h2 className="text-4xl font-black">Silver Sponsors</h2>
{silverLinks.map((item, index) => {
return (
<a key={index} className="h-14" href={item.href}>
<img className="h-8" src={item.svg} alt={item.alt} />

Check warning on line 46 in components/Sponsors/sponsorlinks.tsx

View workflow job for this annotation

GitHub Actions / build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</a>
);
})}
Expand Down
13 changes: 0 additions & 13 deletions components/Sponsors/subpage.tsx

This file was deleted.

33 changes: 33 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint-config-next": "13.4.19",
"framer-motion": "^11.1.2",
"next": "13.4.19",
"postcss": "8.4.29",
"react": "18.2.0",
Expand Down
Loading
Loading