diff --git a/frontend/public/screenshots/letter.webp b/frontend/public/screenshots/letter.webp new file mode 100644 index 0000000..3e19316 Binary files /dev/null and b/frontend/public/screenshots/letter.webp differ diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 65a532e..f34ef68 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -1,3 +1,4 @@ +import { InfoIcon } from "@phosphor-icons/react"; import { motion, useMotionValueEvent, @@ -6,8 +7,10 @@ import { useTransform, } from "motion/react"; import { useRef, useState } from "react"; +import { useNavigate } from "react-router-dom"; import Logo from "../components/Logo"; import { EnvelopeReveal } from "../components/reader/EnvelopeReveal"; +import { ROUTES } from "../config/routes.ts"; import { formatDate } from "../utils/dateFormat.ts"; export default function Home() { @@ -15,16 +18,24 @@ export default function Home() { const { scrollYProgress: section1ScrollProgress } = useScroll({ target: sectionContainer1, }); - const smoothProgress = useSpring(section1ScrollProgress, { + const smoothProgress1 = useSpring(section1ScrollProgress, { stiffness: 100, damping: 30, restDelta: 0.001, }); const [isEnvelopeFlipped, setIsEnvelopeFlipped] = useState(true); + const [flapOpen, setFlapOpen] = useState(false); const [recipient, setRecipient] = useState("someone dear"); const [ignite, setIgnite] = useState(false); + const navigate = useNavigate(); + useMotionValueEvent(section1ScrollProgress, "change", (latestScrollValue) => { + if (latestScrollValue > 0.54) { + setFlapOpen(false); + } else { + setFlapOpen(true); + } if (latestScrollValue <= 0.6) { setIsEnvelopeFlipped(true); } else { @@ -48,11 +59,12 @@ export default function Home() { className="relative w-full h-[850vh] bg-base-100 font-serif" >
+ {/* Intro */}

@@ -66,20 +78,25 @@ export default function Home() {
and that's okay...
+ {/* pi. ku. */} @@ -88,12 +105,12 @@ export default function Home() { className="mt-6 text-4xl md:text-6xl text-base-content/60 " style={{ opacity: useTransform( - smoothProgress, + smoothProgress1, [0.22, 0.25, 0.35, 0.4], [0, 1, 1, 0], ), y: useTransform( - smoothProgress, + smoothProgress1, [0.25, 0.3, 0.35, 0.4], [20, 0, 0, -20], ), @@ -114,16 +131,17 @@ export default function Home() { +
. + {/* Seal */} . + {/* Send / vault */} {" "} @@ -202,15 +222,16 @@ export default function Home() { . + {/* Burn */} burn it to release the burden. -
-
- + You've been carrying it long enough. + + {/* CTA */} + + + + +
+ +
+ +
+
+
+ letter +
+
+
+ {/* Envelope */} + {}} isFlip={isEnvelopeFlipped} + openFlap={flapOpen} /> + {/* Orb */}