Skip to content

Commit

Permalink
Feat/404 and fixes (#30)
Browse files Browse the repository at this point in the history
* chore: reduced og image size

* chore: company logo translate on hover

* chore: buttons with flex wrap

* fix: analytics tags working

* chore: improved styling

* feat: 404 page added
  • Loading branch information
kunalkeshan authored Feb 7, 2023
1 parent 927eaf0 commit cc5a42a
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 34 deletions.
2 changes: 1 addition & 1 deletion components/about/Resume.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ResumeCard: React.FC<ResumeCardDataType> = ({
<Link
href={website}
target="_blank"
className="flex h-16 w-16 items-center justify-center overflow-hidden rounded-full border-2 border-black shadow-3d-small transition-all duration-300 hover:shadow-3d lg:h-20 lg:w-20"
className="flex h-16 w-16 items-center justify-center overflow-hidden rounded-full border-2 border-black shadow-3d-small transition-all duration-300 hover:-translate-y-1 hover:shadow-3d lg:h-20 lg:w-20"
>
<Image
src={logo}
Expand Down
6 changes: 3 additions & 3 deletions components/landing/Portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ProjectCard: React.FC<ProjectDataType> = ({
<FaArrowRight className="transition-all duration-300 group-hover:translate-x-1" />
</Link>
) : (
<div className="mt-8 flex w-full items-center gap-4 font-[Montserrat] text-sm font-semibold md:flex-wrap">
<div className="mt-8 flex w-full flex-wrap items-center gap-4 font-[Montserrat] text-sm font-semibold">
{github && (
<Link
className="flex items-center gap-2 rounded-xl py-2 px-8 transition-all duration-300 hover:-translate-y-1 hover:bg-portfolio-main"
Expand Down Expand Up @@ -106,9 +106,9 @@ const Portfolio: React.FC<{ showTill?: number }> = ({ showTill }) => {
transition={{ delay: 0.4, type: "spring" }}
className="mx-auto mt-20 min-h-screen max-w-7xl px-5 xl:mt-5"
>
<h2 className="group relative mx-auto max-w-[26ch] text-center text-5xl font-semibold">
<h2 className="group relative mx-auto max-w-[26ch] text-center text-3xl font-semibold leading-tight md:text-5xl">
Some fine additions to my{" "}
<span className="mt-1 bg-portfolio-main px-1 leading-tight">
<span className="mt-1 whitespace-nowrap bg-portfolio-main px-1 leading-tight">
development portfolio
</span>
<MemeTooltip
Expand Down
66 changes: 66 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* 404 Page
*/

// Dependencies
import React from "react";
import Head from "next/head";
import PublicLayout from "../layouts/PublicLayout";
import WorkInProgress from "../components/reusable/WorkInProgress";
import { motion } from "framer-motion";
import Image from "next/image";
import Link from "next/link";

const NotFoundPage = () => {
return (
<>
<Head>
<title>Not Found | 404</title>
</Head>
<PublicLayout>
<motion.section
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ delay: 0.2, type: "spring" }}
className="mx-auto mt-10 mb-20 max-w-7xl px-5"
>
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ delay: 0.4, type: "spring" }}
className="relative z-20 flex w-full flex-col items-center justify-center lg:mt-20 lg:flex-row"
>
<h1 className="absolute left-1/2 top-1/4 z-10 -translate-x-1/2 gap-10 font-[Montserrat] text-[10rem] font-extrabold text-themes-txt_secondary text-opacity-10 md:text-[15rem] lg:left-1/4 lg:-top-20">
404
</h1>
<div className="z-20 w-full max-w-[200px] md:max-w-xs lg:mr-8 lg:ml-auto">
<Image
src="/404.svg"
alt="404"
width={100}
height={100}
className="object-fit h-auto w-full drop-shadow-2xl"
/>
</div>
<div className="mt-8 w-fit text-center font-semibold lg:mr-auto lg:text-left">
<p className="text-5xl lg:text-7xl">Oops!</p>
<p className="mt-4 text-4xl lg:text-6xl">Page not found</p>
<p className="mx-auto mt-2 max-w-md font-[Montserrat] text-themes-txt_secondary md:text-lg lg:mx-0 lg:text-xl">
A disturbance in the force has caused this page to disappear.
</p>
<Link
href="/"
className="mt-8 block w-full rounded-xl bg-themes-txt_primary px-8 py-4 text-themes-bg_primary transition-all duration-300 hover:-translate-y-1 hover:bg-portfolio-accent lg:w-fit lg:text-lg
"
>
Go to homepage
</Link>
</div>
</motion.div>
</motion.section>
</PublicLayout>
</>
);
};

export default NotFoundPage;
15 changes: 15 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import "../styles/globals.css";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { pageview } from "../utils/gtag";
import { useEffect } from "react";

export default function App({ Component, pageProps }: AppProps) {
const router = useRouter();

useEffect(() => {
const handleRouteChange = (url: URL) => {
pageview(url);
};
router.events.on("routeChangeComplete", handleRouteChange);
return () => {
router.events.off("routeChangeComplete", handleRouteChange);
};
}, [router.events]);

return <Component {...pageProps} />;
}
41 changes: 16 additions & 25 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { Html, Head, Main, NextScript } from "next/document";
import Script from "next/script";
import { isProduction } from "../config";
import { GA_TRACKING_ID } from "../utils/gtag";

export default function Document() {
const metaDescription =
"Full-stack dev with a passion for delivering value & helping others thrive. As a 3rd-year Electronics & Communication Engineering student at SRMIST, I offer top-notch full-stack web dev services with a focus on consistency, discipline, grit & hard work. Codelance Devs, my web design co., helps SMEs establish a web presence. I aim to be a knowledgeable software dev & assist startups & enterprises. Passionate about tech education, open-source, productivity & building openly. Improving my skills & sharing my expertise in full-stack dev.";
const metaImage = "/thumbnail.png";
const metaWebsite = `https://kunalkeshan.dev`;
const metaDescription =
"Full-stack dev with a passion for delivering value & helping others thrive. As a 3rd-year Electronics & Communication Engineering student at SRMIST, I offer top-notch full-stack web dev services with a focus on consistency, discipline, grit & hard work. Codelance Devs, my web design co., helps SMEs establish a web presence. I aim to be a knowledgeable software dev & assist startups & enterprises. Passionate about tech education, open-source, productivity & building openly. Improving my skills & sharing my expertise in full-stack dev.";
const metaImage = "/thumbnail.png";
const metaWebsite = `https://kunalkeshan.dev`;

export default function Document() {
return (
<Html className="" lang="en">
<Html lang="en">
<Head>
<link rel="icon" href="/favicon.ico" />
<link
Expand Down Expand Up @@ -47,6 +46,7 @@ export default function Document() {

{/* <!-- Open Graph / Facebook --> */}
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Kunal Keshan" />
<meta property="og:url" content={metaWebsite} />
<meta property="og:title" content="Kunal Keshan" />
<meta property="og:description" content={metaDescription} />
Expand All @@ -58,31 +58,22 @@ export default function Document() {
<meta property="twitter:title" content="Kunal Keshan" />
<meta property="twitter:description" content={metaDescription} />
<meta property="twitter:image" content={metaImage} />

<meta name="robots" content="all" />
{isProduction && (
<>
<Script
async
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
/>
<Script
id="google-analytics"
strategy="afterInteractive"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
<Script
async
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GA_TRACKING_ID}', {
page_path: window.location.pathname,
});
`,
}}
/>
</>
)}
`}
</Script>
</Head>
<body className="font-['Nunito Sans'] relative bg-[#FAF9F6] text-themes-txt_primary">
<Main />
Expand Down
2 changes: 0 additions & 2 deletions pages/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import React from "react";
import Head from "next/head";
import PublicLayout from "../../layouts/PublicLayout";
import WorkInProgress from "../../components/reusable/WorkInProgress";
import { motion } from "framer-motion";
import Portfolio from "../../components/landing/Portfolio";

Expand All @@ -23,7 +22,6 @@ const ProjectsPage = () => {
transition={{ delay: 0.4, type: "spring" }}
className="mx-auto mt-10 mb-20 max-w-7xl px-5"
>
{/* <WorkInProgress /> */}
<Portfolio />
</motion.section>
</PublicLayout>
Expand Down
2 changes: 1 addition & 1 deletion pages/tributes/[tributeSlug]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Tributes Page
* Individual Tributes Page
*/

// Dependencies
Expand Down
4 changes: 2 additions & 2 deletions pages/tributes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const TributeCard: React.FC<TributeDataType> = ({
];

return (
<li className="z-10 flex w-full flex-col gap-4 rounded-xl border-3 border-black bg-white px-10 py-5 shadow-3d">
<li className="group z-10 flex w-full flex-col gap-4 rounded-xl border-3 border-black bg-white px-10 py-5 shadow-3d">
<div className="relative z-20 mx-auto flex w-full items-center justify-center">
<Link
href={`/tributes/${slug}`}
Expand All @@ -76,7 +76,7 @@ const TributeCard: React.FC<TributeDataType> = ({
</Link>
<Link
href={`/tributes/${slug}`}
className="absolute bottom-0 right-[40px] -z-10 flex h-full max-h-[80px] max-w-[80px] rotate-6 items-center justify-center overflow-hidden rounded-full border-2 border-black bg-white shadow-3d-small transition-all duration-300 hover:z-0 hover:-translate-y-1 hover:shadow-3d"
className="absolute bottom-0 left-1/2 -z-10 flex h-full max-h-[80px] max-w-[80px] -translate-x-1/2 rotate-6 items-center justify-center overflow-hidden rounded-full border-2 border-black bg-white shadow-3d-small transition-all duration-300 hover:z-0 hover:-translate-y-1 hover:rotate-12 hover:shadow-3d group-hover:left-[75%]"
>
<Image
src={company.logo}
Expand Down
1 change: 1 addition & 0 deletions public/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit cc5a42a

@vercel
Copy link

@vercel vercel bot commented on cc5a42a Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.