| 1 | import Transition from "@/components/transition"; |
| 2 | import { AiOutlineRight, AiOutlineMail |
| 3 | import { FiGithub } |
| 4 | import { Projects } |
| 5 | import Badge from "@/components/badge |
| 6 | import { |
| 7 | allEnglishWritings, |
| 8 | allGermanWritings, |
| 9 | } from "@/.content-collections/generated"; |
| 10 | import Nextjs from "@/icons/next |
| 11 | import NestJS from "@/icons/nest |
| 12 | import Prisma from "@/icons/prisma |
| 13 | import Grafana from "@/icons/grafana |
| 14 | import Flutter from "@/icons/flutter |
| 15 | import { Link } |
| 16 | import { getLocale, getTranslations |
| 17 | import { Metadata } |
| 18 | import { EffectTS } |
| 19 | import { SITE_URL } |
| 20 | |
| 21 | const BIRTH_DATE = " |
| 22 | |
| 23 | function age(): number |
| 24 | return Math.floor |
| 25 | (Date.now() |
| 26 | (1000 * 60 * |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | export async function generateMetadata |
| 31 | params: Promise |
| 32 | }): Promise<Metadata |
| 33 | const { locale |
| 34 | const t = |
| 35 | |
| 36 | const title = |
| 37 | const description = |
| 38 | age: age(), |
| 39 | })}`; |
| 40 | |
| 41 | return { |
| 42 | // Absolute so the layout's "%s | Gurpal Singh" template does not repeat the name. |
| 43 | title: { absolute: title |
| 44 | description, |
| 45 | keywords: [ |
| 46 | "Gurpal Singh", |
| 47 | "PhantomKnight287", |
| 48 | "Full Stack Developer", |
| 49 | "Next.js", |
| 50 | "Nest.js", |
| 51 | "React", |
| 52 | "Flutter", |
| 53 | "TypeScript", |
| 54 | "Portfolio", |
| 55 | ], |
| 56 | alternates: { |
| 57 | canonical: `${SITE_URL} |
| 58 | languages: { en: " |
| 59 | }, |
| 60 | openGraph: { |
| 61 | title, |
| 62 | description, |
| 63 | type: "website", |
| 64 | url: `${SITE_URL} |
| 65 | siteName: title, |
| 66 | }, |
| 67 | twitter: { |
| 68 | card: "summary_large_image", |
| 69 | site: "@PhantomKnight287", |
| 70 | creator: "@PhantomKnight287", |
| 71 | title, |
| 72 | description, |
| 73 | }, |
| 74 | }; |
| 75 | } |
| 76 | |
| 77 | export default async function |
| 78 | const t = |
| 79 | const locale = |
| 80 | |
| 81 | return ( |
| 82 | <div className="flex mt-5 flex-col max-w-[600px] mx-auto p-5 lg:p-0 |
| 83 | <div className="container |
| 84 | <h1 className="text-xl font-bold text-gray-400 |
| 85 | <span className=""> |
| 86 | <Transition /> |
| 87 | </h1> |
| 88 | <p className="mt-5 text-xl text-gray-400 |
| 89 | {t("HomePage.description", |
| 90 | </p> |
| 91 | <p className="mt-5 text-xl text-gray-400 |
| 92 | {t("HomePage.currently") |
| 93 | <Badge href=" |
| 94 | <Nextjs className=" |
| 95 | </Badge> |
| 96 | ,{" "} |
| 97 | <Badge href=" |
| 98 | <NestJS className=" |
| 99 | </Badge> |
| 100 | ,{" "} |
| 101 | <Badge href=" |
| 102 | <Prisma className=" |
| 103 | Prisma |
| 104 | </Badge> |
| 105 | ,{" "} |
| 106 | <Badge href=" |
| 107 | <EffectTS className=" |
| 108 | Effect |
| 109 | </Badge> |
| 110 | ,{" "} |
| 111 | <Badge href=" |
| 112 | <Grafana className=" |
| 113 | Grafana |
| 114 | </Badge>{" " |
| 115 | {t("HomePage.learning") |
| 116 | <Badge href={ |
| 117 | <Flutter className=" |
| 118 | Flutter |
| 119 | </Badge> |
| 120 | . |
| 121 | </p> |
| 122 | {locale === "de |
| 123 | <> |
| 124 | <p className="mt-5 text-xl text-gray-400 |
| 125 | Notiz: Ich lerne Deutsch und habe beschlossen, mein Portfolio zur |
| 126 | Übung zu übersetzen. Bitte verzeihen Sie mir etwaige Fehler. |
| 127 | </p> |
| 128 | </> |
| 129 | ) : null} |
| 130 | |
| 131 | <div className="flex items-start mt-5 w-full justify-start flex-col |
| 132 | <div className="flex flex-row items-center justify-start |
| 133 | <div className="aspect-square flex-none h-[10px] overflow-hidden relative w-2.5 will-change-transform bg-green-500 rounded-full |
| 134 | <div className="flex flex-col justify-start shrink-0 opacity-100 ml-2 |
| 135 | <p className="text-white |
| 136 | </div> |
| 137 | </div> |
| 138 | <br /> |
| 139 | <div className="flex flex-row mt-3 gap-3 |
| 140 | <a |
| 141 | href="https://github.com/phantomknight287" |
| 142 | target="_blank" |
| 143 | rel="noopener noreferrer" |
| 144 | className="flex flex-row items-center justify-start gap-2.5 |
| 145 | text-white transition duration-300 ease-in-out |
| 146 | bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5 |
| 147 | " |
| 148 | > |
| 149 | <FiGithub className=" |
| 150 | </a> |
| 151 | <a |
| 152 | href="mailto:phantomknight287@proton.me" |
| 153 | target="_blank" |
| 154 | rel="noopener noreferrer" |
| 155 | className="flex flex-row items-center justify-start gap-2.5 |
| 156 | text-white transition duration-300 ease-in-out |
| 157 | bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5 |
| 158 | " |
| 159 | > |
| 160 | <AiOutlineMail className=" |
| 161 | </a> |
| 162 | </div> |
| 163 | </div> |
| 164 | <div className="w-full h-[1px] |
| 165 | <div className="mt-5 |
| 166 | <h1 className="text-2xl text-white mt-5 |
| 167 | <div className="flex flex-col |
| 168 | {Projects.map(( |
| 169 | <Link |
| 170 | className="proj group" |
| 171 | key={project.name |
| 172 | href={`/projects/${project |
| 173 | > |
| 174 | <article className="flex flex-row gap-0 items-start justify-between lg:justify-start mt-1 mb-1 w-full overflow-hidden |
| 175 | <div className="flex flex-row gap-2 justify-start opacity-100 flex-none shrink-0 h-auto relative whitespace-pre w-auto mr-3 |
| 176 | <h1 className="text-lg leading-[1.3em] text-left text-gray-300 group-hover:text-white inline-flex underline |
| 177 | {project.name} |
| 178 | </h1> |
| 179 | <p className="line-clamp-1 text-gray-400 max-w-full |
| 180 | {t(`Projects.${project |
| 181 | </p> |
| 182 | </div> |
| 183 | </article> |
| 184 | </Link> |
| 185 | ))} |
| 186 | </div> |
| 187 | </div> |
| 188 | <div className="mt-5 |
| 189 | <h1 className="text-2xl text-white mt-5 mb-0 |
| 190 | <div className="flex flex-col |
| 191 | {[...(locale |
| 192 | .sort((a, |
| 193 | .map((writing) |
| 194 | <Link |
| 195 | className="proj group" |
| 196 | key={writing._meta |
| 197 | href={`/writings/${writing |
| 198 | > |
| 199 | <article className="flex flex-row gap-0 items-start justify-between lg:justify-start mt-1 mb-1 w-full overflow-hidden |
| 200 | <div className="flex flex-row gap-2 justify-start opacity-100 flex-none shrink-0 h-auto relative whitespace-pre w-auto mr-3 |
| 201 | <h1 className="text-lg leading-[1.3em] text-left text-gray-300 group-hover:text-white inline-flex underline line-clamp-1 overflow-ellipsis |
| 202 | {writing.title} |
| 203 | </h1> |
| 204 | </div> |
| 205 | </article> |
| 206 | </Link> |
| 207 | ))} |
| 208 | </div> |
| 209 | </div> |
| 210 | </div> |
| 211 | </div> |
| 212 | ); |
| 213 | } |