| 1 | import Transition from "@/components/transition"; |
| 2 | import { AiOutlineRight, AiOutlineMail |
| 3 | import { FiGithub, FiExternalLink |
| 4 | import { Experiences, 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 | const monthYear = |
| 82 | month: "long", |
| 83 | year: "numeric", |
| 84 | }); |
| 85 | |
| 86 | // "2024-06" parses as UTC midnight and can render as the previous month in |
| 87 | // negative-offset timezones, so build the date locally. |
| 88 | const parseMonth = |
| 89 | const [year, |
| 90 | return new Date |
| 91 | }; |
| 92 | |
| 93 | const writings = |
| 94 | ...(locale === |
| 95 | ] |
| 96 | .sort((a, |
| 97 | .slice(0, 4 |
| 98 | |
| 99 | return ( |
| 100 | <div className="flex mt-5 flex-col max-w-[600px] mx-auto p-5 lg:p-0 |
| 101 | <div className="container |
| 102 | <h1 className="text-xl font-bold text-gray-400 |
| 103 | <span className=""> |
| 104 | <Transition /> |
| 105 | </h1> |
| 106 | <p className="mt-5 text-xl text-gray-400 |
| 107 | {t("HomePage.description", |
| 108 | </p> |
| 109 | <p className="mt-5 text-xl text-gray-400 |
| 110 | {t("HomePage.currently") |
| 111 | <Badge href=" |
| 112 | <Nextjs className=" |
| 113 | </Badge> |
| 114 | ,{" "} |
| 115 | <Badge href=" |
| 116 | <NestJS className=" |
| 117 | </Badge> |
| 118 | ,{" "} |
| 119 | <Badge href=" |
| 120 | <Prisma className=" |
| 121 | Prisma |
| 122 | </Badge> |
| 123 | ,{" "} |
| 124 | <Badge href=" |
| 125 | <EffectTS className=" |
| 126 | Effect |
| 127 | </Badge> |
| 128 | ,{" "} |
| 129 | <Badge href=" |
| 130 | <Grafana className=" |
| 131 | Grafana |
| 132 | </Badge>{" " |
| 133 | {t("HomePage.learning") |
| 134 | <Badge href={ |
| 135 | <Flutter className=" |
| 136 | Flutter |
| 137 | </Badge> |
| 138 | . |
| 139 | </p> |
| 140 | {locale === "de |
| 141 | <> |
| 142 | <p className="mt-5 text-xl text-gray-400 |
| 143 | Notiz: Ich lerne Deutsch und habe beschlossen, mein Portfolio zur |
| 144 | Übung zu übersetzen. Bitte verzeihen Sie mir etwaige Fehler. |
| 145 | </p> |
| 146 | </> |
| 147 | ) : null} |
| 148 | |
| 149 | <div className="flex items-start mt-5 w-full justify-start flex-col |
| 150 | <div className="flex flex-row items-center justify-start |
| 151 | <div className="aspect-square flex-none h-[10px] overflow-hidden relative w-2.5 will-change-transform bg-green-500 rounded-full |
| 152 | <div className="flex flex-col justify-start shrink-0 opacity-100 ml-2 |
| 153 | <p className="text-white |
| 154 | Available for new opportunities ·{" "} |
| 155 | <a |
| 156 | href="https://drive.google.com/file/d/1YCyt6R_PS9A8LAalHj6ob7NqLY8X9hcq/view?usp=drive_link" |
| 157 | target="_blank" |
| 158 | rel="noopener noreferrer" |
| 159 | className="underline decoration-neutral-600 underline-offset-4 hover:decoration-neutral-300" |
| 160 | > |
| 161 | {t("HomePage.resume") |
| 162 | </a> |
| 163 | </p> |
| 164 | </div> |
| 165 | </div> |
| 166 | <br /> |
| 167 | <div className="flex flex-row mt-3 gap-3 |
| 168 | <a |
| 169 | href="https://github.com/phantomknight287" |
| 170 | target="_blank" |
| 171 | rel="noopener noreferrer" |
| 172 | className="flex flex-row items-center justify-start gap-2.5 |
| 173 | text-white transition duration-300 ease-in-out |
| 174 | bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5 |
| 175 | " |
| 176 | > |
| 177 | <FiGithub className=" |
| 178 | </a> |
| 179 | <a |
| 180 | href="mailto:phantomknight287@proton.me" |
| 181 | target="_blank" |
| 182 | rel="noopener noreferrer" |
| 183 | className="flex flex-row items-center justify-start gap-2.5 |
| 184 | text-white transition duration-300 ease-in-out |
| 185 | bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5 |
| 186 | " |
| 187 | > |
| 188 | <AiOutlineMail className=" |
| 189 | </a> |
| 190 | </div> |
| 191 | </div> |
| 192 | <div className="w-full h-[1px] |
| 193 | |
| 194 | {Experiences.length > |
| 195 | <section className="mt-10 |
| 196 | <h2 className="text-2xl text-white |
| 197 | <div className="mt-4 flex flex-col |
| 198 | {[...Experiences] |
| 199 | .map((exp) |
| 200 | <details |
| 201 | key={`${exp |
| 202 | className="group border-b border-neutral-800 py-4 last:border-b-0" |
| 203 | > |
| 204 | <summary className="flex cursor-pointer list-none items-baseline gap-3 [&::-webkit-details-marker]:hidden |
| 205 | <AiOutlineRight className=" |
| 206 | <span className="min-w-0 flex-1 text-neutral-100 |
| 207 | {exp.role} |
| 208 | {exp.company} |
| 209 | </span> |
| 210 | <span className="shrink-0 text-sm tabular-nums text-neutral-500 |
| 211 | {monthYear.format(parseMonth |
| 212 | {exp.end |
| 213 | ? monthYear.format( |
| 214 | : t("Experience.present" |
| 215 | </span> |
| 216 | </summary> |
| 217 | <div className="mt-3 flex flex-col gap-3 pl-6 |
| 218 | <ul className="flex list-disc flex-col gap-1 pl-4 text-sm text-neutral-500 marker:text-neutral-700 |
| 219 | {exp.points.map |
| 220 | <li key={point |
| 221 | {point} |
| 222 | </li> |
| 223 | ))} |
| 224 | </ul> |
| 225 | <div className="flex flex-wrap gap-1.5 |
| 226 | {exp.tags.map |
| 227 | <span |
| 228 | key={tag} |
| 229 | className="rounded border border-neutral-800 bg-neutral-900 px-1.5 py-0.5 text-xs text-neutral-400" |
| 230 | > |
| 231 | {tag} |
| 232 | </span> |
| 233 | ))} |
| 234 | </div> |
| 235 | {exp.url ? |
| 236 | <a |
| 237 | href={exp.url |
| 238 | target="_blank" |
| 239 | rel="noopener noreferrer" |
| 240 | className="text-sm text-neutral-500 underline decoration-neutral-700 underline-offset-4 hover:text-neutral-100" |
| 241 | > |
| 242 | {exp.company} |
| 243 | </a> |
| 244 | ) : null} |
| 245 | </div> |
| 246 | </details> |
| 247 | ))} |
| 248 | </div> |
| 249 | </section> |
| 250 | ) : null} |
| 251 | |
| 252 | <section className="mt-10 |
| 253 | <h2 className="text-2xl text-white |
| 254 | <div className="mt-4 flex flex-col |
| 255 | {Projects.map(( |
| 256 | <div |
| 257 | key={project.slug |
| 258 | className="group flex flex-col gap-1 border-b border-neutral-800 py-4 last:border-b-0" |
| 259 | > |
| 260 | <div className="flex w-full items-baseline gap-3 |
| 261 | <Link |
| 262 | href={`/projects/${project |
| 263 | className="min-w-0 flex-1 truncate text-neutral-100 underline-offset-4 group-hover:underline" |
| 264 | > |
| 265 | {project.name} |
| 266 | </Link> |
| 267 | <span className="flex shrink-0 items-center gap-2 text-neutral-500 |
| 268 | {project.urls.githubUrl |
| 269 | <a |
| 270 | href={project.urls |
| 271 | target="_blank" |
| 272 | rel="noopener noreferrer" |
| 273 | aria-label={`${project |
| 274 | className="hover:text-neutral-100" |
| 275 | > |
| 276 | <FiGithub /> |
| 277 | </a> |
| 278 | ) : null} |
| 279 | {project.urls.liveUrl |
| 280 | <a |
| 281 | href={project.urls |
| 282 | target="_blank" |
| 283 | rel="noopener noreferrer" |
| 284 | aria-label={`${project |
| 285 | className="hover:text-neutral-100" |
| 286 | > |
| 287 | <FiExternalLink /> |
| 288 | </a> |
| 289 | ) : null} |
| 290 | </span> |
| 291 | </div> |
| 292 | <p className="text-pretty text-sm text-neutral-500 |
| 293 | {t(`Projects.${project |
| 294 | </p> |
| 295 | <div className="mt-1 flex flex-wrap gap-1.5 |
| 296 | {project.tags.slice |
| 297 | <span |
| 298 | key={tag} |
| 299 | className="rounded border border-neutral-800 bg-neutral-900 px-1.5 py-0.5 text-xs text-neutral-400" |
| 300 | > |
| 301 | {tag} |
| 302 | </span> |
| 303 | ))} |
| 304 | </div> |
| 305 | </div> |
| 306 | ))} |
| 307 | </div> |
| 308 | </section> |
| 309 | |
| 310 | <section className="mt-10 |
| 311 | <div className="flex items-baseline justify-between gap-3 |
| 312 | <h2 className="text-2xl text-white |
| 313 | <Link |
| 314 | href="/writings" |
| 315 | className="inline-flex items-center gap-1 text-sm text-neutral-500 hover:text-neutral-100" |
| 316 | > |
| 317 | {t("HomePage.viewAll") |
| 318 | <AiOutlineRight /> |
| 319 | </Link> |
| 320 | </div> |
| 321 | <div className="mt-4 flex flex-col |
| 322 | {writings.map(( |
| 323 | <Link |
| 324 | className="group flex flex-col gap-1 border-b border-neutral-800 py-4 last:border-b-0" |
| 325 | key={writing._meta |
| 326 | href={`/writings/${writing |
| 327 | > |
| 328 | <span className="flex w-full items-baseline gap-3 |
| 329 | <span className="min-w-0 flex-1 truncate text-neutral-100 underline-offset-4 group-hover:underline |
| 330 | {writing.title} |
| 331 | </span> |
| 332 | <span className="shrink-0 text-sm tabular-nums text-neutral-500 |
| 333 | {monthYear.format(writing |
| 334 | </span> |
| 335 | </span> |
| 336 | <span className="text-pretty text-sm text-neutral-500 |
| 337 | {writing.summary} |
| 338 | </span> |
| 339 | </Link> |
| 340 | ))} |
| 341 | </div> |
| 342 | </section> |
| 343 | </div> |
| 344 | </div> |
| 345 | ); |
| 346 | } |