- add boilerplate for landing page
This commit is contained in:
parent
c137f96bf2
commit
6d1ebed09c
18
components/content/index.tsx
Normal file
18
components/content/index.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import React from "react";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
|
const Content = ({
|
||||||
|
title = '',
|
||||||
|
heroImgSrc,
|
||||||
|
description = ''
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="p-4 flex flex-col">
|
||||||
|
<div className="pb-4 border-b-2 border-white">{title}</div>
|
||||||
|
{heroImgSrc && <div><Image src={heroImgSrc} alt=""/></div>}
|
||||||
|
<div>{description}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Content;
|
||||||
13
components/layout.tsx
Normal file
13
components/layout.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// import Navbar from './navbar'
|
||||||
|
// import Footer from './footer'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function Layout({ children }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* <Navbar /> */}
|
||||||
|
<main>{children}</main>
|
||||||
|
{/* <Footer /> */}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
42
lib/navigationContent.tsx
Normal file
42
lib/navigationContent.tsx
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Content from '../components/content'
|
||||||
|
import backgroundPic from '../public/unspash_image.jpg'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
name: 'INTRO',
|
||||||
|
url: '#intro',
|
||||||
|
content: <Content
|
||||||
|
title='Intro'
|
||||||
|
heroImgSrc={backgroundPic}
|
||||||
|
description={"Intro Section about okechi"}
|
||||||
|
/>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WORK',
|
||||||
|
url: '#work',
|
||||||
|
content: <Content
|
||||||
|
title='Work'
|
||||||
|
heroImgSrc={backgroundPic}
|
||||||
|
description={"Work Section about okechi"}
|
||||||
|
/>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ABOUT',
|
||||||
|
url: '#about',
|
||||||
|
content: <Content
|
||||||
|
title='About'
|
||||||
|
heroImgSrc={backgroundPic}
|
||||||
|
description={"About Section about okechi"}
|
||||||
|
/>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'CONTACT',
|
||||||
|
url: '#contact',
|
||||||
|
content: <Content
|
||||||
|
title='Contact'
|
||||||
|
heroImgSrc={backgroundPic}
|
||||||
|
description={"Contact Section about okechi"}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
];
|
||||||
14
package.json
14
package.json
@ -9,19 +9,23 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
||||||
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||||
|
"next": "latest",
|
||||||
"react": "latest",
|
"react": "latest",
|
||||||
"react-dom": "latest",
|
"react-dom": "latest",
|
||||||
"next": "latest"
|
"react-modal": "^3.16.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "latest",
|
|
||||||
"@types/react": "latest",
|
|
||||||
"@types/node": "latest",
|
"@types/node": "latest",
|
||||||
|
"@types/react": "latest",
|
||||||
"@types/react-dom": "latest",
|
"@types/react-dom": "latest",
|
||||||
"autoprefixer": "latest",
|
"autoprefixer": "latest",
|
||||||
|
"eslint": "latest",
|
||||||
|
"eslint-config-next": "latest",
|
||||||
"postcss": "latest",
|
"postcss": "latest",
|
||||||
"tailwindcss": "latest",
|
"tailwindcss": "latest",
|
||||||
"eslint": "latest",
|
"typescript": "latest"
|
||||||
"eslint-config-next": "latest"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,14 @@
|
|||||||
import '@/styles/globals.css'
|
import '@/styles/globals.css'
|
||||||
import type { AppProps } from 'next/app'
|
import type { AppProps } from 'next/app'
|
||||||
|
import Layout from '../components/layout';
|
||||||
|
import "@fortawesome/fontawesome-svg-core/styles.css";
|
||||||
|
import { config } from "@fortawesome/fontawesome-svg-core";
|
||||||
|
config.autoAddCss = false;
|
||||||
|
|
||||||
export default function App({ Component, pageProps }: AppProps) {
|
export default function App({ Component, pageProps }: AppProps) {
|
||||||
return <Component {...pageProps} />
|
return (
|
||||||
|
<Layout>
|
||||||
|
<Component {...pageProps} />
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,18 @@ import { Html, Head, Main, NextScript } from 'next/document'
|
|||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head />
|
<Head>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
type="text/css"
|
||||||
|
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
|
/>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-modal/3.14.3/react-modal.min.js"
|
||||||
|
integrity="sha512-MY2jfK3DBnVzdS2V8MXo5lRtr0mNRroUI9hoLVv2/yL3vrJTam3VzASuKQ96fLEpyYIT4a8o7YgtUs5lPjiLVQ=="
|
||||||
|
crossOrigin="anonymous"
|
||||||
|
referrerPolicy="no-referrer"
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
|
|||||||
163
pages/index.tsx
163
pages/index.tsx
@ -1,118 +1,69 @@
|
|||||||
|
import React, {useState} from 'react'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
import backgroundPic from '../public/unspash_image.jpg'
|
||||||
import { Inter } from 'next/font/google'
|
import { Inter } from 'next/font/google'
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { faGem } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import navigationContent from '../lib/navigationContent'
|
||||||
|
import Modal from 'react-modal';
|
||||||
const inter = Inter({ subsets: ['latin'] })
|
const inter = Inter({ subsets: ['latin'] })
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
const customStyles = {
|
||||||
|
overlay: {
|
||||||
|
backgroundColor: 'rgba(0, 0, 0, 0.6)'
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
top: '50%',
|
||||||
|
left: '50%',
|
||||||
|
right: 'auto',
|
||||||
|
bottom: 'auto',
|
||||||
|
marginRight: '-50%',
|
||||||
|
transform: 'translate(-50%, -50%)',
|
||||||
|
backgroundColor: 'gray'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const [showModal, setShowModal] = useState(false);
|
||||||
|
const [modalData, setModalData] = useState<{name: string, url: string, content?: any}>({
|
||||||
|
name: '',
|
||||||
|
url: '',
|
||||||
|
content: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const renderNav = (navData: Array<{name: string, url: string, content: (string | React.ElementType | null)}>) => {
|
||||||
|
return navData.map((data, idx) => (
|
||||||
|
<span
|
||||||
|
onClick={() => {
|
||||||
|
setShowModal(true)
|
||||||
|
setModalData(data);
|
||||||
|
}}
|
||||||
|
key={idx}
|
||||||
|
className='p-4 border-white text-white border-2 hover:cursor-pointer hover:bg-white hover:bg-opacity-10'
|
||||||
|
>
|
||||||
|
<a href={data.url}>{data.name}</a>
|
||||||
|
</span>
|
||||||
|
));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main
|
<div className='relative'>
|
||||||
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
|
<div className='absolute tablet:w-full h-full bg-cover'>
|
||||||
>
|
<Image src={backgroundPic} alt="record background"/>
|
||||||
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
|
<div className='flex flex-col justify-center text-center'>
|
||||||
<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">
|
{/* <FontAwesomeIcon width={25} height={50} icon={faGem} className="fas fa-gem" style={{ color: "red" }} /> */}
|
||||||
Get started by editing
|
<div className='w-full grid grid-row-4 justify-center h-1/2'>
|
||||||
<code className="font-mono font-bold">pages/index.tsx</code>
|
<div className='col-span-2 w-1/2 border-t-2 border-white border-r-2'></div>
|
||||||
</p>
|
<div className='col-span-2 h-1/2 w-1/2 border-t-2 border-white border-l-2'></div>
|
||||||
<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">
|
</div>
|
||||||
<a
|
<div className='flex flex-row justify-center'>
|
||||||
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
|
{renderNav(navigationContent)}
|
||||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template-tw&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>
|
</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/10 after:dark:from-sky-900 after:dark:via-[#0141ff]/40 before:lg:h-[360px]">
|
|
||||||
<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>
|
||||||
|
<Modal isOpen={showModal} contentLabel='' style={customStyles} onRequestClose={() => setShowModal(false)}>
|
||||||
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
|
{modalData.content}
|
||||||
<a
|
</Modal>
|
||||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-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`}>
|
|
||||||
Docs{' '}
|
|
||||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
|
||||||
->
|
|
||||||
</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=default-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">
|
|
||||||
->
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
|
||||||
Learn about Next.js in an interactive course with quizzes!
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-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`}>
|
|
||||||
Templates{' '}
|
|
||||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
|
||||||
->
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
|
||||||
Discover and deploy boilerplate example Next.js projects.
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-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`}>
|
|
||||||
Deploy{' '}
|
|
||||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
|
||||||
->
|
|
||||||
</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>
|
</div>
|
||||||
</main>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
public/unspash_image.jpg
Normal file
BIN
public/unspash_image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
@ -25,3 +25,38 @@ body {
|
|||||||
)
|
)
|
||||||
rgb(var(--background-start-rgb));
|
rgb(var(--background-start-rgb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-wrapper {
|
||||||
|
width: 500px;
|
||||||
|
height: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal {
|
||||||
|
background: white;
|
||||||
|
height:100%;
|
||||||
|
width:100%;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user