Skip to content

Commit

Permalink
Clean up project, add example header and footer
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidoo committed May 15, 2020
1 parent 5cf4050 commit 56abffc
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 157 deletions.
26 changes: 26 additions & 0 deletions components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export default function Footer() {
return (
<>
<footer>
Made with{' '}
<img src="/netliheart.svg" alt="Netlify Logo" className="logo" /> for
you
</footer>
<style jsx>{`
footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
.logo {
height: 1em;
margin: 5px;
}
`}</style>
</>
)
}
3 changes: 3 additions & 0 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Header() {
return <h1 className="title">Welcome to my app!</h1>
}
2 changes: 1 addition & 1 deletion pages/api/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

export default (req, res) => {
res.statusCode = 200
res.json({ name: 'John Doe' })
res.json({ name: 'Jane Doe' })
}
159 changes: 7 additions & 152 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,27 @@
import Head from 'next/head'
import Header from '@components/Header'
import Footer from '@components/Footer'

export default function Home() {
return (
<div className="container">
<Head>
<title>Create Next App</title>
<title>Next Stater!</title>
<link rel="icon" href="/favicon.ico" />
</Head>

<main>
<h1 className="title">
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>

<Header />
<p className="description">
Get started by editing <code>pages/index.js</code>
</p>

<div className="grid">
<a href="https://nextjs.org/docs" className="card">
<h3>Documentation &rarr;</h3>
<p>Find in-depth information about Next.js features and API.</p>
</a>

<a href="https://nextjs.org/learn" className="card">
<h3>Learn &rarr;</h3>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>

<a
href="https://github.com/zeit/next.js/tree/master/examples"
className="card"
>
<h3>Examples &rarr;</h3>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>

<a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="card"
>
<h3>Deploy &rarr;</h3>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className="logo" />
</a>
</footer>
<Footer />

<style jsx>{`
.container {
min-height: 100vh;
padding: 0 0.5rem;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -78,115 +37,11 @@ export default function Home() {
align-items: center;
}
footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
footer img {
margin-left: 0.5rem;
}
footer a {
display: flex;
justify-content: center;
align-items: center;
}
a {
color: inherit;
text-decoration: none;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
line-height: 1.5;
font-size: 1.5rem;
}
code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
margin-top: 3rem;
}
.card {
margin: 1rem;
flex-basis: 45%;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h3 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
}
`}</style>

Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
9 changes: 9 additions & 0 deletions public/netliheart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions public/vercel.svg

This file was deleted.

0 comments on commit 56abffc

Please sign in to comment.