-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from macareonie/navpages
Create NavBar, Footer and Routes
- Loading branch information
Showing
13 changed files
with
1,503 additions
and
156 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +0,0 @@ | ||
#root { | ||
max-width: 1280px; | ||
margin: 0 auto; | ||
padding: 2rem; | ||
text-align: center; | ||
} | ||
|
||
.logo { | ||
height: 6em; | ||
padding: 1.5em; | ||
will-change: filter; | ||
transition: filter 300ms; | ||
} | ||
.logo:hover { | ||
filter: drop-shadow(0 0 2em #646cffaa); | ||
} | ||
.logo.react:hover { | ||
filter: drop-shadow(0 0 2em #61dafbaa); | ||
} | ||
|
||
@keyframes logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
a:nth-of-type(2) .logo { | ||
animation: logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.card { | ||
padding: 2em; | ||
} | ||
|
||
.read-the-docs { | ||
color: #888; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,25 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; | ||
import "./App.css"; | ||
import NavBar from "./components/header/NavBar"; | ||
import About from "./pages/about/About"; | ||
import Home from "./pages/home/Home"; | ||
import FoodBlog from "./pages/foodblog/FoodBlog"; | ||
import Footer from "./components/footer/Footer"; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://react.dev" target="_blank"> | ||
<img src={reactLogo} className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.jsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
</> | ||
) | ||
<div> | ||
<Router> | ||
<NavBar /> | ||
<Routes> | ||
<Route exact path="/" element={<Home />} /> | ||
<Route exact path="/about" element={<About />} /> | ||
<Route exact path="/foodblog" element={<FoodBlog />} /> | ||
</Routes> | ||
</Router> | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function Footer() { | ||
return ( | ||
<> | ||
<div className="fixed bottom-0 w-full bg-black text-white px-4 p-10"> | ||
Footer | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { | ||
Disclosure, | ||
DisclosureButton, | ||
DisclosurePanel, | ||
Menu, | ||
MenuButton, | ||
MenuItem, | ||
MenuItems, | ||
} from "@headlessui/react"; | ||
import { Bars3Icon, BellIcon, XMarkIcon } from "@heroicons/react/24/outline"; | ||
|
||
const navigation = [ | ||
{ name: "Home", href: "/", current: true }, | ||
{ name: "About Me", href: "/about", current: false }, | ||
{ name: "Food Blog", href: "/foodblog", current: false }, | ||
]; | ||
|
||
function classNames(...classes) { | ||
return classes.filter(Boolean).join(" "); | ||
} | ||
|
||
export default function Example() { | ||
return ( | ||
<Disclosure as="nav" className="bg-gray-800"> | ||
{({ open }) => ( | ||
<> | ||
<div className="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"> | ||
<div className="relative flex h-16 items-center justify-between"> | ||
<div className="absolute inset-y-0 left-0 flex items-center sm:hidden"> | ||
{/* Mobile menu button*/} | ||
<DisclosureButton className="relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"> | ||
<span className="absolute -inset-0.5" /> | ||
<span className="sr-only">Open main menu</span> | ||
{open ? ( | ||
<XMarkIcon className="block h-6 w-6" aria-hidden="true" /> | ||
) : ( | ||
<Bars3Icon className="block h-6 w-6" aria-hidden="true" /> | ||
)} | ||
</DisclosureButton> | ||
</div> | ||
<div className="flex flex-1 items-center justify-center sm:items-stretch sm:justify-start"> | ||
<div className="flex flex-shrink-0 items-center"> | ||
<img | ||
className="w-10 h-10 rounded-full" | ||
src="https://i.pinimg.com/736x/be/13/d7/be13d79969e314e814d19a6c211772a8.jpg" | ||
alt="Random Picture" | ||
/> | ||
</div> | ||
<div className="hidden sm:ml-6 sm:block"> | ||
<div className="flex space-x-4"> | ||
{navigation.map((item) => ( | ||
<a | ||
key={item.name} | ||
href={item.href} | ||
className={classNames( | ||
item.current | ||
? "bg-gray-900 text-white" | ||
: "text-gray-300 hover:bg-gray-700 hover:text-white", | ||
"rounded-md px-3 py-2 text-lg font-medium" | ||
)} | ||
aria-current={item.current ? "page" : undefined} | ||
> | ||
{item.name} | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<DisclosurePanel className="sm:hidden"> | ||
<div className="space-y-1 px-2 pb-3 pt-2"> | ||
{navigation.map((item) => ( | ||
<DisclosureButton | ||
key={item.name} | ||
as="a" | ||
href={item.href} | ||
className={classNames( | ||
item.current | ||
? "bg-gray-900 text-white" | ||
: "text-gray-300 hover:bg-gray-700 hover:text-white", | ||
"block rounded-md px-3 py-2 text-base font-medium" | ||
)} | ||
aria-current={item.current ? "page" : undefined} | ||
> | ||
{item.name} | ||
</DisclosureButton> | ||
))} | ||
</div> | ||
</DisclosurePanel> | ||
</> | ||
)} | ||
</Disclosure> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,3 @@ | ||
:root { | ||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; | ||
line-height: 1.5; | ||
font-weight: 400; | ||
|
||
color-scheme: light dark; | ||
color: rgba(255, 255, 255, 0.87); | ||
background-color: #242424; | ||
|
||
font-synthesis: none; | ||
text-rendering: optimizeLegibility; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
a { | ||
font-weight: 500; | ||
color: #646cff; | ||
text-decoration: inherit; | ||
} | ||
a:hover { | ||
color: #535bf2; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
display: flex; | ||
place-items: center; | ||
min-width: 320px; | ||
min-height: 100vh; | ||
} | ||
|
||
h1 { | ||
font-size: 3.2em; | ||
line-height: 1.1; | ||
} | ||
|
||
button { | ||
border-radius: 8px; | ||
border: 1px solid transparent; | ||
padding: 0.6em 1.2em; | ||
font-size: 1em; | ||
font-weight: 500; | ||
font-family: inherit; | ||
background-color: #1a1a1a; | ||
cursor: pointer; | ||
transition: border-color 0.25s; | ||
} | ||
button:hover { | ||
border-color: #646cff; | ||
} | ||
button:focus, | ||
button:focus-visible { | ||
outline: 4px auto -webkit-focus-ring-color; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
:root { | ||
color: #213547; | ||
background-color: #ffffff; | ||
} | ||
a:hover { | ||
color: #747bff; | ||
} | ||
button { | ||
background-color: #f9f9f9; | ||
} | ||
} | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function About() { | ||
return ( | ||
<> | ||
<div>About</div> | ||
<p> about me</p> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function FoodBlog() { | ||
return ( | ||
<> | ||
<div>Food Blog</div> | ||
<p>food recipes and random stuff</p> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function Home() { | ||
return ( | ||
<> | ||
<div>Home</div> | ||
<p>Home page stuff here</p> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters