Skip to content

Commit

Permalink
🔀 Merge pull request #1 from haseakito/feature/layout
Browse files Browse the repository at this point in the history
🔀 Feature/layout
  • Loading branch information
haseakito authored Jul 30, 2023
2 parents 2e58048 + f25347c commit 1dc1c4a
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 137 deletions.
27 changes: 0 additions & 27 deletions app/globals.css

This file was deleted.

17 changes: 14 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { Header } from '@/components/Header'
import { Footer } from '@/components/Footer'
import { Provider } from '@/components/Provider'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: 'Welcome',
description: 'Welcome to my official website',
}

export default function RootLayout({
Expand All @@ -16,7 +19,15 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<Provider>
<div className='h-full'>
<Header />
<main>{children}</main>
<Footer />
</div>
</Provider>
</body>
</html>
)
}
110 changes: 3 additions & 107 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,112 +2,8 @@ import Image from 'next/image'

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Get started by editing&nbsp;
<code className="font-mono font-bold">app/page.tsx</code>
</p>
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
<a
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{' '}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className="mb-32 grid text-center lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Docs{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Learn{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Templates{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Explore the Next.js 13 playground.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Deploy{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
<div>

</div>
)
}
14 changes: 14 additions & 0 deletions app/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
/* Your default theme */
--background: white;
--foreground: black;
}

[data-theme='dark'] {
--background: black;
--foreground: white;
}
41 changes: 41 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react'
import { FaTwitter, FaInstagram, FaLinkedinIn, FaGithub } from 'react-icons/fa'

export function Footer() {

const FooterData = [
{
icon: <FaGithub />,
link: 'https://github.com/haseakito'
},
{
icon: <FaLinkedinIn />,
link: 'https://www.linkedin.com/in/haseakito'
},
{
icon: <FaTwitter />,
link: ''
},
{
icon: <FaInstagram />,
link: ''
}
]

return (
<footer>
<div className='text-center sm:flex sm:justify-between border-t-[1px] p-4 px-10'>
<p className='text-xs font-semibold hover:opacity-80 duration-300 dark:text-gray-400'>@2023 AKITO HASEGAWA. All Rights Reserved.</p>
<div className='flex justify-center py-2 sm:py-0'>
{ FooterData.map((value, key) => {
return (
<a key={ key } href={ value.link }>
<p className='px-6 hover:scale-110 duration-300 text-gray-500 hover:text-gray-900 dark:hover:text-white'>{ value.icon }</p>
</a>
)
})}
</div>
</div>
</footer>
)
}
147 changes: 147 additions & 0 deletions components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
'use client'

import Link from 'next/link'
import React, { useState } from 'react'
import { useTheme } from 'next-themes'
import { MdMenu, MdClose } from 'react-icons/md'
import { FaSun, FaMoon } from 'react-icons/fa'

export function Header() {

// Hooks handling the light and dark mode
const { theme, setTheme } = useTheme()

// Boolean state handling the navigation bar
const [ menuOpen, setMenuOpen ] = useState(false)

const HeaderData = [
{
title : "About",
link : "/about"
},
{
title : "Products",
link : "/products"
},
{
title : "Stacks",
link : "/stacks"
},
{
title : "Blog",
link : "/blog"
},
]

console.log(theme)

return (
<header>
<div className='flex justify-between p-5'>
{
theme == 'light' ?
<button
onClick={() => setTheme('dark')}
>
<FaMoon
size={ 30 }
/>
</button>
:
<button
onClick={() => setTheme('light')}
>
<FaSun
size={ 30 }
/>
</button>
}
<ul className='hidden lg:flex'>
{ HeaderData.map((value, key) => (
<li
key={ key }
className='group relative inline-block'
>
<Link
href={ value.link }
>
<div
className='block py-3 mx-4 font-bold rounded bg-primary-700 lg:bg-transparent lg:text-primary-700 dark:text-white hover:opacity-80'
>
{ value.title }
</div>
<span className='h-1 absolute -bottom-0 left-1/2 w-0 bg-black dark:bg-white transition-all duration-500 group-hover:w-1/3'></span>
<span className='h-1 absolute -bottom-0 right-1/2 w-0 bg-black dark:bg-white transition-all duration-500 group-hover:w-1/3'></span>
</Link>
</li>
))}
<li>
<button className='relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden text-sm font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-purple-600 to-blue-500 group-hover:from-purple-600 group-hover:to-blue-500 hover:text-white dark:text-white focus:ring-4 focus:outline-none focus:ring-blue-300 dark:focus:ring-blue-800'>
<span className='relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0'>
Contact
</span>
</button>
</li>
</ul>
<div className='block lg:hidden'>
<button
className='hover:shadow-sm rounded focus:ring-2 ring-gray-200 opacity-90 hover:opacity-100'
onClick={() => setMenuOpen(true)}
>
<MdMenu
size={ 40 }
color='black'
/>
</button>
</div>
</div>
<div className={
menuOpen ?
'lg:hidden fixed z-50 inset-0 duration-700 bg-gray-100 px-4 py-5'
:
'lg:hidden fixed z-50 inset-0 translate-y-full duration-700 bg-gray-100 px-4 py-5'
}>
<div className='flex justify-end p-4'>
<button
className='hover:shadow-sm rounded focus:ring-2 ring-gray-200 opacity-90 hover:opacity-100'
onClick={() => setMenuOpen(false)}
>
<MdClose
size={ 40 }
/>
</button>
</div>
<div className='flex justify-center py-4'>
<ul>
{ HeaderData.map((value, key) => (
<li
key={ key }
>
<Link
href={ value.link }
onClick={() => setMenuOpen(!menuOpen)}
>
<div
className='text-4xl font-bold py-10 px-20 rounded hover:bg-gray-50 opacity-90 hover:opacity-100 hover:scale-110 duration-300'
>
{ value.title }
</div>
</Link>
</li>
))}
<li>
<Link
href='/contact'
onClick={() => setMenuOpen(!menuOpen)}
>
<div className='text-4xl font-bold py-10 px-20 rounded-lg hover:bg-gray-50 opacity-90 hover:opacity-100 hover:scale-110 duration-300'>
Contact
</div>
</Link>
</li>
</ul>
</div>
</div>
</header>
)
}
Loading

0 comments on commit 1dc1c4a

Please sign in to comment.