mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
feat: add product hunt banner to landing page
This commit is contained in:
@ -1,9 +1,13 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
import relativeTime from "dayjs/plugin/relativeTime";
|
import relativeTime from "dayjs/plugin/relativeTime";
|
||||||
|
import timezone from "dayjs/plugin/timezone";
|
||||||
|
import utc from "dayjs/plugin/utc";
|
||||||
|
|
||||||
dayjs.extend(localizedFormat);
|
dayjs.extend(localizedFormat);
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
|
dayjs.extend(timezone);
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
export const dayjsLocales: Record<string, () => Promise<ILocale>> = {
|
export const dayjsLocales: Record<string, () => Promise<ILocale>> = {
|
||||||
"af-ZA": () => import("dayjs/locale/af"),
|
"af-ZA": () => import("dayjs/locale/af"),
|
||||||
|
|||||||
@ -3,13 +3,16 @@ import { Link } from "react-router-dom";
|
|||||||
|
|
||||||
import { Logo } from "@/client/components/logo";
|
import { Logo } from "@/client/components/logo";
|
||||||
|
|
||||||
|
import { ProductHuntBanner } from "./product-hunt-banner";
|
||||||
|
|
||||||
export const Header = () => (
|
export const Header = () => (
|
||||||
<motion.header
|
<motion.header
|
||||||
className="fixed inset-x-0 top-0 z-20"
|
className="fixed inset-x-0 top-0 z-20"
|
||||||
initial={{ opacity: 0, y: -50 }}
|
initial={{ opacity: 0, y: -50 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0, transition: { delay: 0.3, duration: 0.3 } }}
|
||||||
transition={{ delay: 0.3, duration: 0.3 }}
|
|
||||||
>
|
>
|
||||||
|
<ProductHuntBanner />
|
||||||
|
|
||||||
<div className="bg-gradient-to-b from-background to-transparent py-3">
|
<div className="bg-gradient-to-b from-background to-transparent py-3">
|
||||||
<div className="container flex items-center justify-between">
|
<div className="container flex items-center justify-between">
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
|
|||||||
@ -0,0 +1,31 @@
|
|||||||
|
/* eslint-disable lingui/no-unlocalized-strings */
|
||||||
|
|
||||||
|
import { RocketLaunch } from "@phosphor-icons/react";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
|
export const ProductHuntBanner = () => {
|
||||||
|
const timezonePST = "America/Los_Angeles";
|
||||||
|
|
||||||
|
const startTime = dayjs.tz("2023-11-24 00:01", timezonePST);
|
||||||
|
const endTime = dayjs.tz("2023-11-25 00:00", timezonePST);
|
||||||
|
const currentTime = dayjs().tz(timezonePST);
|
||||||
|
|
||||||
|
const isLaunchDay = currentTime.isAfter(startTime) && currentTime.isBefore(endTime);
|
||||||
|
|
||||||
|
if (!isLaunchDay) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a href="https://www.producthunt.com/posts/reactive-resume-v4" target="_blank" rel="noreferrer">
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: -50, height: 32 }}
|
||||||
|
animate={{ opacity: 1, y: 0, transition: { delay: 0.9, duration: 0.3 } }}
|
||||||
|
whileHover={{ height: 48 }}
|
||||||
|
className="flex w-screen items-center justify-center gap-x-1.5 bg-orange-600 text-xs font-bold leading-relaxed text-orange-50"
|
||||||
|
>
|
||||||
|
<RocketLaunch weight="bold" size={12} />
|
||||||
|
<span>Support Reactive Resume on Product Hunt today!</span>
|
||||||
|
</motion.div>
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
};
|
||||||
@ -17,12 +17,12 @@ export const HeroSection = () => (
|
|||||||
|
|
||||||
<div className="mx-auto max-w-7xl px-6 lg:flex lg:h-screen lg:items-center lg:px-12">
|
<div className="mx-auto max-w-7xl px-6 lg:flex lg:h-screen lg:items-center lg:px-12">
|
||||||
<motion.div
|
<motion.div
|
||||||
className="mx-auto max-w-3xl shrink-0 lg:mx-0 lg:max-w-xl lg:pt-8"
|
className="mx-auto mt-32 max-w-3xl shrink-0 lg:mx-0 lg:mt-0 lg:max-w-xl lg:pt-8"
|
||||||
viewport={{ once: true }}
|
viewport={{ once: true }}
|
||||||
initial={{ opacity: 0, x: -100 }}
|
initial={{ opacity: 0, x: -100 }}
|
||||||
whileInView={{ opacity: 1, x: 0 }}
|
whileInView={{ opacity: 1, x: 0 }}
|
||||||
>
|
>
|
||||||
<div className="mt-24 flex items-center gap-x-4 sm:mt-32 lg:mt-0">
|
<div className="hidden items-center gap-x-4 sm:flex">
|
||||||
<Badge>{t`Version 4`}</Badge>
|
<Badge>{t`Version 4`}</Badge>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|||||||
Reference in New Issue
Block a user