Skip to content

Commit

Permalink
chore: add 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
janleigh committed Dec 8, 2023
1 parent 2ad1486 commit df519c6
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 13 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<meta name="theme-color" content="#272727" />

<meta property="og:title" content="Jan Leigh Muñoz | Full-Stack Developer"/>
<meta property="og:title" content="Jan Leigh Muñoz ~ Portfolio"/>
<meta property="og:description" content="student and (idiotic) full-stack developer."/>

<title>Jan Leigh Muñoz | Full-Stack Developer</title>
<title>Jan Leigh's Portfolio</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Footer() {
return (
<div id="footer" className="fixed bottom-8 flex w-11/12 justify-center">
<div className="mx-auto flex justify-start">
<span className="text-verdant-fg py-4">
<span className="py-4 text-verdant-fg">
© 2023 <span className="text-verdant-blue">Jan Leigh Muñoz</span>. All Rights Reserved.
</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/MainContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export function MainContainer() {
return (
<div id="main" className="bg-verdant-bg flex w-screen justify-center">
<div id="main" className="flex w-screen justify-center bg-verdant-bg">
<div className="flex items-center justify-center">
<div className="mx-12">
<img
src="https://github.com/janleigh.png"
alt="PFP"
className="bg-verdant-bg-light h-60 w-60 rounded-full p-4"
className="h-60 w-60 rounded-full bg-verdant-bg-light p-4"
/>
</div>
<div className="mx-8 items-center justify-center">
<div className="text-verdant-fg text-3xl font-bold">
<div className="text-3xl font-bold text-verdant-fg">
Heya! I'm <span className="text-verdant-blue">Jan Leigh</span>!
</div>
<div className="text-verdant-fg-dark text-base">
<div className="text-base text-verdant-fg-dark">
I am a Filipino first-year college student and a self-taught full-stack developer.
<br />
<br />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ export function Navbar() {
return (
<div id="navbar" className="fixed flex w-11/12 justify-center">
<div className="mx-auto flex justify-start">
<span className="text-verdant-fg py-4">
<span className="py-4 text-verdant-fg">
janleigh<span className="text-verdant-blue">.is-a.dev</span>
</span>
</div>
<div className="bg-verdant-bg-light mx-auto flex rounded-2xl px-2">
<div className="mx-auto flex rounded-2xl bg-verdant-bg-light px-2">
<div className="flex justify-end">
<div className="flex lowercase">
<a href="https://github.com/janleigh" target="_blank" className="p-4 text-stone-50">
Expand Down
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import ReactDOM from "react-dom";
import { HashRouter as Router, Route, Routes } from "react-router-dom";

import App from "./pages/App";
import NotFound from "./pages/404";

ReactDOM.render(
<Router>
<Routes>
<Route path="/" element={<App />} />
<Route path="*" element={<NotFound />} />
</Routes>
</Router>,
document.getElementById("root")
Expand Down
33 changes: 33 additions & 0 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useState, useEffect } from "react";

export function App() {
const [reason, setReason] = useState("Not Found.");

useEffect(() => {
if (window.innerWidth < 768) {
setReason("Screen too small.");
} else {
setReason("Not Found.");
}
}, []);

return (
<div id="404" className="flex h-screen w-screen justify-center bg-verdant-bg px-8 py-8">
<div className="flex flex-col items-center justify-center">
<span className="text-6xl text-verdant-fg">\(o_o)/</span>
<span className="my-12 text-center text-3xl text-verdant-fg-dark">
404.
<br />
{reason}
</span>
<span className="text-2xl text-verdant-fg-dark">
<a href="/" className="text-verdant-blue">
Back to Home
</a>
</span>
</div>
</div>
);
}

export default App;
16 changes: 12 additions & 4 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ import Footer from "../components/Footer";
import MainContainer from "../components/MainContainer";
import Navbar from "../components/Navbar";

import NotFound from "./404";

export function App() {
return (
<div id="app" className="bg-verdant-bg flex h-screen w-screen justify-center px-8 py-8">
<Navbar />
<MainContainer />
<Footer />
<div id="app" className="flex h-screen w-screen justify-center bg-verdant-bg px-8 py-8">
{window.innerWidth > 768 ? (
<>
<Navbar />
<MainContainer />
<Footer />
</>
) : (
<NotFound />
)}
</div>
);
}
Expand Down

0 comments on commit df519c6

Please sign in to comment.