From a3a56d431677b5621cbc54ae9f1fc9f92f5e5a0a Mon Sep 17 00:00:00 2001 From: me Date: Fri, 8 May 2026 22:17:50 +0530 Subject: [PATCH] chore: replace empty jsx space braces with nbsp --- .../src/components/drawer/DrawerSection.tsx | 173 +- .../src/components/editor/PostSealModal.tsx | 152 +- frontend/src/components/editor/ToolBar.tsx | 580 ++--- .../src/components/login/WelcomeModal.tsx | 146 +- frontend/src/components/reader/BurnModal.tsx | 176 +- .../components/reader/PostActionOverlay.tsx | 62 +- frontend/src/components/reader/ShareModal.tsx | 138 +- frontend/src/pages/About.tsx | 1872 ++++++++--------- frontend/src/pages/Drawer.tsx | 364 ++-- frontend/src/pages/Home.tsx | 752 +++---- frontend/src/pages/Login.tsx | 236 +-- frontend/src/pages/Register.tsx | 314 +-- frontend/src/pages/VerifyEmail.tsx | 94 +- 13 files changed, 2528 insertions(+), 2531 deletions(-) diff --git a/frontend/src/components/drawer/DrawerSection.tsx b/frontend/src/components/drawer/DrawerSection.tsx index 14874e4..ea23c1d 100644 --- a/frontend/src/components/drawer/DrawerSection.tsx +++ b/frontend/src/components/drawer/DrawerSection.tsx @@ -1,101 +1,98 @@ import { GearFineIcon } from "@phosphor-icons/react"; interface DrawerSectionProps { - id: string; - title: string; - count: number; - subtext: string; - isOpen: boolean; - onClick: () => void; - children: React.ReactNode; - icon: React.ReactNode; + id: string; + title: string; + count: number; + subtext: string; + isOpen: boolean; + onClick: () => void; + children: React.ReactNode; + icon: React.ReactNode; } export function DrawerSection({ - id, - title, - count, - subtext, - isOpen, - onClick, - children, - icon, + id, + title, + count, + subtext, + isOpen, + onClick, + children, + icon, }: DrawerSectionProps) { - return ( -
-
+ return (
- {children} - {count === 0 && ( -

- This drawer remains silent -

- )} -
-
+
+ {children} + {count === 0 && ( +

+ This drawer remains silent +

+ )} +
+
- - - ); + {id === "vault" ? ( + + ) : ( +
+
+
+ )} + +
+ ); } diff --git a/frontend/src/components/editor/PostSealModal.tsx b/frontend/src/components/editor/PostSealModal.tsx index 1cf964f..73574ec 100644 --- a/frontend/src/components/editor/PostSealModal.tsx +++ b/frontend/src/components/editor/PostSealModal.tsx @@ -4,84 +4,84 @@ import { PATHS, ROUTES } from "../../config/routes"; import { Modal } from "../ui/Modal"; interface PostSealModalProps { - sealedTargetId: string | null; - navigate: NavigateFunction; - type: "KEPT" | "VAULT"; + sealedTargetId: string | null; + navigate: NavigateFunction; + type: "KEPT" | "VAULT"; } export function PostSealModal({ - sealedTargetId, - navigate, - type = "KEPT", + sealedTargetId, + navigate, + type = "KEPT", }: PostSealModalProps) { - return ( - - -

Your letter is sealed

-

- It's encrypted and always safe in your drawer. -

- {type === "KEPT" ? ( -

- When you're ready, -
- you can{" "} - read it,{" "} - send it to - someone, or{" "} - burn it to - release -

- ) : ( -

- Be assured that the letter will find you when the time is right. -
- Till then,{" "} - - take a deep breath - - , manifest - , and{" "} - - let it rest - - . -

- )} -
- {type === "KEPT" ? ( - <> - - - - ) : ( - - )} -
-
- ); + return ( + + +

Your letter is sealed

+

+ It's encrypted and always safe in your drawer. +

+ {type === "KEPT" ? ( +

+ When you're ready, +
+ you can  + read it,  + send it to + someone, or  + burn it to + release +

+ ) : ( +

+ Be assured that the letter will find you when the time is right. +
+ Till then,  + + take a deep breath + + , manifest + , and  + + let it rest + + . +

+ )} +
+ {type === "KEPT" ? ( + <> + + + + ) : ( + + )} +
+
+ ); } diff --git a/frontend/src/components/editor/ToolBar.tsx b/frontend/src/components/editor/ToolBar.tsx index e0969da..caa84c1 100644 --- a/frontend/src/components/editor/ToolBar.tsx +++ b/frontend/src/components/editor/ToolBar.tsx @@ -1,321 +1,321 @@ import { - CircleHalfTiltIcon, - ImageIcon, - LockIcon, - PaintBucketIcon, - QuestionIcon, - StampIcon, - TextAUnderlineIcon, - TrayIcon, - VaultIcon, - XCircleIcon, + CircleHalfTiltIcon, + ImageIcon, + LockIcon, + PaintBucketIcon, + QuestionIcon, + StampIcon, + TextAUnderlineIcon, + TrayIcon, + VaultIcon, + XCircleIcon, } from "@phosphor-icons/react"; import { Modal } from "../ui/Modal"; import type { CanvasStyle } from "./ComposeCanvas"; interface ToolBarProps { - onAddImage: () => void; - sealBtnClicked: boolean; - setSealBtnClicked: (v: boolean) => void; - onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; - setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; - onFontChange: (style: CanvasStyle) => void; - latestFontStyle: CanvasStyle; + onAddImage: () => void; + sealBtnClicked: boolean; + setSealBtnClicked: (v: boolean) => void; + onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; + setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; + onFontChange: (style: CanvasStyle) => void; + latestFontStyle: CanvasStyle; } const FONT_FAMILIES: Map = new Map([ - ["Serif", "Playfair Display Variable"], - ["Sans", "Jost Variable"], - ["Cursive", "Playwrite HR Lijeva Variable"], - ["Handwriting", "Architects Daughter"], - ["Slab", "Cutive Mono"], - ["Mono", "Space Mono"], - ["Ink", "Kavivanar"], - ["Crazy(pls no)", "Redacted Script"], + ["Serif", "Playfair Display Variable"], + ["Sans", "Jost Variable"], + ["Cursive", "Playwrite HR Lijeva Variable"], + ["Handwriting", "Architects Daughter"], + ["Slab", "Cutive Mono"], + ["Mono", "Space Mono"], + ["Ink", "Kavivanar"], + ["Crazy(pls no)", "Redacted Script"], ]); const FONT_COLORS: Map = new Map([ - ["Black", "#000"], - ["Gold", "#866a0e"], - ["Purple", "#711caf"], - ["Green", "#1f5b1f"], - ["Blue", "#111e67"], + ["Black", "#000"], + ["Gold", "#866a0e"], + ["Purple", "#711caf"], + ["Green", "#1f5b1f"], + ["Blue", "#111e67"], ]); export function ToolBar({ - onAddImage, - sealBtnClicked, - setSealBtnClicked, - onSave, - setConfirmModal, - onFontChange, - latestFontStyle, + onAddImage, + sealBtnClicked, + setSealBtnClicked, + onSave, + setConfirmModal, + onFontChange, + latestFontStyle, }: ToolBarProps) { - return ( -
-
- {/* Image upload */} - -
- - {/* Font Family */} -
- - -
-
- - {/* Font Color */} -
- - -
    - {Array.from(FONT_COLORS.entries()).map(([_, colorCode]) => ( -
  • +
    + {/* Image upload */} -
  • - ))} -
+
+ + {/* Font Family */} +
+ + +
+
+ + {/* Font Color */} +
+ + +
    + {Array.from(FONT_COLORS.entries()).map(([_, colorCode]) => ( +
  • + +
  • + ))} +
+
+
+ + {/* Draft */} +
+ + +
+ + {/*Seal */} + +
+ +
+ +
+ or +
+ +
+ +
-
- - {/* Draft */} -
- - -
- - {/*Seal */} - -
- -
- -
- or -
- -
- - -
- ); + ); } export function LetterHead() { - return ( -
-
- - - Sealed & View Only - -
-
- ); + return ( +
+
+ + + Sealed & View Only + +
+
+ ); } interface VaultConfirmModalProps { - onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; - setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; - setUnlockDate: (d: Date | null) => void; + onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; + setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; + setUnlockDate: (d: Date | null) => void; } export function VaultConfirmModal({ - onSave, - setConfirmModal, - setUnlockDate, + onSave, + setConfirmModal, + setUnlockDate, }: VaultConfirmModalProps) { - return ( - - -

Take it away, then?

-

- By vaulting this letter, you ask me to hold on to this. -
- I'll remember to mail you this on the unlock date. -
- - {" "} - But I won't let you read or rewrite this letter until then. - -
-

-
{ - e.preventDefault(); - const formData = new FormData(e.currentTarget); - const unlockDateStr = formData.get("vault-date") as string; - const newUnlockDate = new Date(unlockDateStr); - setUnlockDate(newUnlockDate); - await onSave("VAULT", newUnlockDate); - setConfirmModal(null); - }} - id="vault-form" - className="min-w-75" - > -
- Set an unlock date -
- -
- - -
-
-
- ); + return ( + + +

Take it away, then?

+

+ By vaulting this letter, you ask me to hold on to this. +
+ I'll remember to mail you this on the unlock date. +
+ +   + But I won't let you read or rewrite this letter until then. + +
+

+
{ + e.preventDefault(); + const formData = new FormData(e.currentTarget); + const unlockDateStr = formData.get("vault-date") as string; + const newUnlockDate = new Date(unlockDateStr); + setUnlockDate(newUnlockDate); + await onSave("VAULT", newUnlockDate); + setConfirmModal(null); + }} + id="vault-form" + className="min-w-75" + > +
+ Set an unlock date +
+ +
+ + +
+
+
+ ); } diff --git a/frontend/src/components/login/WelcomeModal.tsx b/frontend/src/components/login/WelcomeModal.tsx index 7a2f502..7f1944e 100644 --- a/frontend/src/components/login/WelcomeModal.tsx +++ b/frontend/src/components/login/WelcomeModal.tsx @@ -1,85 +1,85 @@ import { - HandPalmIcon, - ShieldCheckIcon, - WarningIcon, + HandPalmIcon, + ShieldCheckIcon, + WarningIcon, } from "@phosphor-icons/react"; import Logo from "../Logo"; import { Modal } from "../ui/Modal"; import Saajan from "../ui/Saajan"; export default function WelcomeModal({ - setShowWelcome, + setShowWelcome, }: { - setShowWelcome: (show: boolean) => void; + setShowWelcome: (show: boolean) => void; }) { - return ( - <> - -
-
- -
-

- Welcome to   - -

-

- Before we begin, let me make a small promise. - - - Everything you write here is sealed with your password,{" "} - cryptographically - , before it leaves your hands. -
A fancy way of saying, I couldn't if I tried. -

+ return ( + <> + +
+
+ +
+

+ Welcome to   + +

+

+ Before we begin, let me make a small promise. + + + Everything you write here is sealed with your password,  + cryptographically + , before it leaves your hands. +
A fancy way of saying, I couldn't if I tried. +

-
- -
- If you ever happen to forget your password, your letters are lost - to time, forever. -
- - I highly, highly recommend storing this password in your{" "} - - password manager - {" "} - or somewhere safe to remember it. - +
+ +
+ If you ever happen to forget your password, your letters are lost + to time, forever. +
+ + I highly, highly recommend storing this password in your  + + password manager +   + or somewhere safe to remember it. + +
+
+ +
+ +
+
+ +
+
-
- -
- -
-
-
-
- -
- - ); + + ); } diff --git a/frontend/src/components/reader/BurnModal.tsx b/frontend/src/components/reader/BurnModal.tsx index 1d9a303..b8881f2 100644 --- a/frontend/src/components/reader/BurnModal.tsx +++ b/frontend/src/components/reader/BurnModal.tsx @@ -3,97 +3,97 @@ import { useEffect, useState } from "react"; import { Modal } from "../ui/Modal"; interface BurnModalProps { - burnLetter: () => void; - isBurning: boolean; - setShowBurnModal: (show: boolean) => void; - setRevealState: (state: "SEALED" | "REVEALED" | "BURNING" | "BURNED") => void; + burnLetter: () => void; + isBurning: boolean; + setShowBurnModal: (show: boolean) => void; + setRevealState: (state: "SEALED" | "REVEALED" | "BURNING" | "BURNED") => void; } export function BurnModal({ - burnLetter, - isBurning, - setShowBurnModal, - setRevealState, + burnLetter, + isBurning, + setShowBurnModal, + setRevealState, }: BurnModalProps) { - const [flameOn, setFlameOn] = useState(0); - const [rotate, setRotate] = useState(0); - const [burnClicked, setBurnClicked] = useState(false); - useEffect(() => { - if (!burnClicked) return; - if (flameOn === 100) { - setRevealState("SEALED"); - burnLetter(); - } - const interval = setInterval(() => { - setFlameOn((prev) => prev + 1); - setRotate(Math.random() * 4 - 2); - }, 100); - return () => clearInterval(interval); - }, [burnClicked, flameOn, setRevealState, burnLetter]); - - const burnStyle = flameOn < 30 ? "" : `contrast(${flameOn / 30})`; - - return ( - setShowBurnModal(false)}> -
{ + if (!burnClicked) return; + if (flameOn === 100) { + setRevealState("SEALED"); + burnLetter(); } - > - -

- Are you ready to burn this letter? -

-

- Some words are meant to be unsaid, but they don't have to linger - forever. -
- Let the echoes of your unsaid be finally released. -

-
- Press and{" "} - hold the{" "} - flame to proceed. -
-
-
- -
-
-
- ); + const interval = setInterval(() => { + setFlameOn((prev) => prev + 1); + setRotate(Math.random() * 4 - 2); + }, 100); + return () => clearInterval(interval); + }, [burnClicked, flameOn, setRevealState, burnLetter]); + + const burnStyle = flameOn < 30 ? "" : `contrast(${flameOn / 30})`; + + return ( + setShowBurnModal(false)}> +
+ +

+ Are you ready to burn this letter? +

+

+ Some words are meant to be unsaid, but they don't have to linger + forever. +
+ Let the echoes of your unsaid be finally released. +

+
+ Press and  + hold the  + flame to proceed. +
+
+
+ +
+
+
+ ); } diff --git a/frontend/src/components/reader/PostActionOverlay.tsx b/frontend/src/components/reader/PostActionOverlay.tsx index 5f07a55..eadd053 100644 --- a/frontend/src/components/reader/PostActionOverlay.tsx +++ b/frontend/src/components/reader/PostActionOverlay.tsx @@ -2,39 +2,39 @@ import { useNavigate } from "react-router-dom"; import { ROUTES } from "../../config/routes"; interface PostActionOverlayProps { - revealState: "SEALED" | "REVEALED" | "BURNING" | "BURNED"; + revealState: "SEALED" | "REVEALED" | "BURNING" | "BURNED"; } export function PostActionOverlay({ revealState }: PostActionOverlayProps) { - const navigate = useNavigate(); - return ( -
-

- It is done -

-
-

- May your soul find - solace, -
- just like your unsaid{" "} - words did. -

-
- -
-
- ); +

+ It is done +

+
+

+ May your soul find + solace, +
+ just like your unsaid  + words did. +

+
+ +
+
+ ); } diff --git a/frontend/src/components/reader/ShareModal.tsx b/frontend/src/components/reader/ShareModal.tsx index abcbd54..cc37cff 100644 --- a/frontend/src/components/reader/ShareModal.tsx +++ b/frontend/src/components/reader/ShareModal.tsx @@ -3,77 +3,77 @@ import { Modal } from "../ui/Modal"; import Saajan from "../ui/Saajan"; interface ShareModalProps { - shareLink: string | null; - setShareLink: (link: string | null) => void; + shareLink: string | null; + setShareLink: (link: string | null) => void; } export function ShareModal({ shareLink, setShareLink }: ShareModalProps) { - const copyToClipboard = async () => { - if (!shareLink) return; - await navigator.clipboard.writeText(shareLink); - }; - return ( - <> - setShareLink(null)} - data-testid="share-letter-modal" - > -
-
- -

Send this letter

-

- You've carried these words long enough. -
- Send your letter now, and let the{" "} - unsaid finally - find its home. -

-
-
- They'll receive it exactly as you're seeing it now. -
- Nothing more, nothing less. -
-
-
- - -
-
-

- {" "} - Zero-Knowledge Share: -

-

- The key never leaves your or the recipient's browser. -

-
-
- -
- -
- - ); +
+
+ +

Send this letter

+

+ You've carried these words long enough. +
+ Send your letter now, and let the  + unsaid finally + find its home. +

+
+
+ They'll receive it exactly as you're seeing it now. +
+ Nothing more, nothing less. +
+
+
+ + +
+
+

+   + Zero-Knowledge Share: +

+

+ The key never leaves your or the recipient's browser. +

+
+
+ +
+ +
+ + ); } diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx index edecbf1..1c0a67e 100644 --- a/frontend/src/pages/About.tsx +++ b/frontend/src/pages/About.tsx @@ -1,25 +1,25 @@ import { - ArrowArcLeftIcon, - ArrowBendDownLeftIcon, - ArrowBendDownRightIcon, - ArrowRightIcon, - CaretUpIcon, - DetectiveIcon, - FlowerTulipIcon, - GhostIcon, - GithubLogoIcon, - InfoIcon, - LockKeyOpenIcon, - LockLaminatedIcon, - PasswordIcon, - PeaceIcon, - PersonArmsSpreadIcon, - PersonIcon, - QuotesIcon, - ScrollIcon, - SmileyIcon, - SparkleIcon, - VaultIcon, + ArrowArcLeftIcon, + ArrowBendDownLeftIcon, + ArrowBendDownRightIcon, + ArrowRightIcon, + CaretUpIcon, + DetectiveIcon, + FlowerTulipIcon, + GhostIcon, + GithubLogoIcon, + InfoIcon, + LockKeyOpenIcon, + LockLaminatedIcon, + PasswordIcon, + PeaceIcon, + PersonArmsSpreadIcon, + PersonIcon, + QuotesIcon, + ScrollIcon, + SmileyIcon, + SparkleIcon, + VaultIcon, } from "@phosphor-icons/react"; import { ReactLenis } from "lenis/react"; import { AnimatePresence, motion, useScroll, useTransform } from "motion/react"; @@ -37,978 +37,978 @@ import "@fontsource/architects-daughter/index.css"; import { useNavigate } from "react-router-dom"; function HorizontalScroll({ children }: { children: React.ReactNode }) { - const ref = useRef(null); - const { scrollYProgress } = useScroll({ target: ref }); - const x = useTransform(scrollYProgress, [0, 1], ["0%", "-50%"]); + const ref = useRef(null); + const { scrollYProgress } = useScroll({ target: ref }); + const x = useTransform(scrollYProgress, [0, 1], ["0%", "-50%"]); - return ( -
-
- - {children} - -
-
- ); + return ( +
+
+ + {children} + +
+
+ ); } export default function About() { - useEffect(() => { - window.scrollTo(0, 0); - }, []); - return ( - -
- + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return ( + +
+ - - - - + + + + - + - - - - + + + + - -
-
- ); + +
+
+ ); } function PrivacySection() { - return ( -
-

- The   Promise - - privacy - - -

-
-

- Your letters.{" "} - Nobody else's. -

-

- When you write or upload anything{" "} - (yes, even images) here, it gets - encrypted in your browser before anything leaves your device. What - reaches the server is something unreadable—and the server has no - way to change that, because the key never left you. -

-
-
-
-
-

- you see -

- +

+ The   Promise + + privacy + + -

- Your Password -

-

-
- B@z1ng4A +

+
+

+ Your letters.  + Nobody else's.

-
-
- -
-
- -

- Your Letter -

-
-

Hello friend,

-

I've never told anyone this...

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut - semper, justo eget vehicula vestibulum, enim enim suscipit - lectus, et sagittis nibh risus vel metus. Quisque eu ornare - ante, et gravida mauris. Vivamus massa justo, sagittis non - viverra sed, sodales non nisi. Nunc semper, massa a aliquet - dictum, enim nisi malesuada orci, et elementum lectus turpis - et velit. Nam vel felis vitae tortor dignissim malesuada. - Nam suscipit, justo eu elementum pulvinar, magna sem tempor - ex, vitae iaculis tellus odio non nisl. Duis dolor orci, - viverra ut finibus sed, aliquet vitae tortor. Proin sodales - ipsum ac ipsum hendrerit tempus. Nunc nec nibh nibh. Aenean - consequat auctor posuere. Integer sed magna volutpat, - efficitur nisl ut, dignissim neque. Vestibulum convallis nec - dui a euismod. Duis dignissim magna in mattis pulvinar. Sed - blandit nibh quis arcu ornare, sit amet fermentum nisi - rhoncus. -

-
-
-
-
-
-
-
-

- server see -

- -

- Your Password -

-

- 9e54d05f88bdd67a675b03bf1cd0a1647e2109b5aa18185ff6a9ba4c6959a19d +

+ When you write or upload anything  + (yes, even images) here, it gets + encrypted in your browser before anything leaves your device. What + reaches the server is something unreadable—and the server has no + way to change that, because the key never left you.

-
-
- -
-
- -

- Your Letter -

-
-

- SZ0Mq9M9sCZsdDB8HGjk7JfWG56Kaot8Lgma74MCusDUYibUGoR7VviWgvc341pvFV9/IAyot9KtlDvwIX1ZmUw9Oh340JMaajRQ7iNgVjHgAwmJAr2cLbReNqlF6xzaf3mIYkiK9BXNQekk2h/9XufklsqoIXpaK1re7xWQ8mdddzy6z4EQFVH/Ev3np5ERW/ss7Z1kqYWUnANK7olWNL/7GgZmhU+L29rgbR52kcH9fng7gnEI3KEuISYExYCg81G1VaJYspkW3A4qwcet+jXdgmbKvkux5qNw6gyNi9d/YqKV7OUNrmoH190rHdJ5A7HOIv3/SvPhb3Zm4sNF5PcMxmhM0+T9m5PejV1GhV9bMBHbbgacay7hZJU3O0+q+7fBAE/+pqfvZdv78lLDFSdtHAXUpYOvHPrI5BNNwuS3T+FK1zjurLnUPThlOSYRICoZSUcxVswXz897PoRmFNNvbal0dpKUmCFrBwV5c/W3d1+iZor5msbm/JxpbNtys59e0StSTwHKsxvxm/rTuUAxWSOmzt13MDBxxd2zyVnX8rtQ7mEjMJ8IHHpvhKjONoa2S11VBJY68Ee1vNrw7htu+wajvmXhHAyfh1lYql8pu8VvPUG7leEQ9I0pMY35Y/C1cYCBLkDT5zf8NeZFtbp0BNgHd+QDVSFH+GSnvTskU2BCio3YE+zE6cDhvLUOMy3e5RAtPqsi5VzpEUcdCwph+Z+1pFlTxiEZ62i4wNpqw2lhS3b/E9ifJgnncSgRHLtfw/VxHZCRc4tBQ24xSZ507lSlQch+5lQeO7rx2htgd2D7aGNx/UN/xmeuEd4a28AxNOVS3uYh3wTDh8CSXyBRCRPxrANOV1ZBojdfK+v5fOJNPgDn3r5/pG80L3FTkecRB0zFuKNG8jIzi5ADx9k4SlhRNo17gPl2if8gRA6tzTae4kbzieG+woxhUWj/qvXg0MQmg59VTK2HHS34exdKDP9a561svlw+lJ2AtM1EL9srJk8i3kiyEPUeIlaLl3AfgbbSuC2RhlzFFAYuQ06rbsSvEoe4rrYeMXxL9jwVsXX0xrp8H25mOJu3ahn5pFYzADMSGf4L11H1vDArpefj/lW+8zcmogxxBktYYNF/qU4v+9367hp4MEn/84tQPpmb47TL+XpVnl9tQ3r9OfOaW3zX7NkWZbqoX7OgdgHOtTLP/euQujSs2MAzMO4BmbuCS7pR/GTZwDqF1sXiWAkunjo2qpKHieqlvSVmtwEhh6wsNwYTKEkddmTqvKSx0fHRvs3D9lMGJfg7wLSz/3Otx3G65tk9l/3B3r87qQTvbqXmcfnFdEIaR8mO/yMyCKnxtJkJb3lEzNUOrvnSxwL7Gyn54TLTWA== -

-
-
+
+
+
+
+

+ you see +

+ +

+ Your Password +

+

+
+ B@z1ng4A +

+
+
+ +
+
+ +

+ Your Letter +

+
+

Hello friend,

+

I've never told anyone this...

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut + semper, justo eget vehicula vestibulum, enim enim suscipit + lectus, et sagittis nibh risus vel metus. Quisque eu ornare + ante, et gravida mauris. Vivamus massa justo, sagittis non + viverra sed, sodales non nisi. Nunc semper, massa a aliquet + dictum, enim nisi malesuada orci, et elementum lectus turpis + et velit. Nam vel felis vitae tortor dignissim malesuada. + Nam suscipit, justo eu elementum pulvinar, magna sem tempor + ex, vitae iaculis tellus odio non nisl. Duis dolor orci, + viverra ut finibus sed, aliquet vitae tortor. Proin sodales + ipsum ac ipsum hendrerit tempus. Nunc nec nibh nibh. Aenean + consequat auctor posuere. Integer sed magna volutpat, + efficitur nisl ut, dignissim neque. Vestibulum convallis nec + dui a euismod. Duis dignissim magna in mattis pulvinar. Sed + blandit nibh quis arcu ornare, sit amet fermentum nisi + rhoncus. +

+
+
+
+
+
+
+
+

+ server see +

+ +

+ Your Password +

+

+ 9e54d05f88bdd67a675b03bf1cd0a1647e2109b5aa18185ff6a9ba4c6959a19d +

+
+
+ +
+
+ +

+ Your Letter +

+
+

+ SZ0Mq9M9sCZsdDB8HGjk7JfWG56Kaot8Lgma74MCusDUYibUGoR7VviWgvc341pvFV9/IAyot9KtlDvwIX1ZmUw9Oh340JMaajRQ7iNgVjHgAwmJAr2cLbReNqlF6xzaf3mIYkiK9BXNQekk2h/9XufklsqoIXpaK1re7xWQ8mdddzy6z4EQFVH/Ev3np5ERW/ss7Z1kqYWUnANK7olWNL/7GgZmhU+L29rgbR52kcH9fng7gnEI3KEuISYExYCg81G1VaJYspkW3A4qwcet+jXdgmbKvkux5qNw6gyNi9d/YqKV7OUNrmoH190rHdJ5A7HOIv3/SvPhb3Zm4sNF5PcMxmhM0+T9m5PejV1GhV9bMBHbbgacay7hZJU3O0+q+7fBAE/+pqfvZdv78lLDFSdtHAXUpYOvHPrI5BNNwuS3T+FK1zjurLnUPThlOSYRICoZSUcxVswXz897PoRmFNNvbal0dpKUmCFrBwV5c/W3d1+iZor5msbm/JxpbNtys59e0StSTwHKsxvxm/rTuUAxWSOmzt13MDBxxd2zyVnX8rtQ7mEjMJ8IHHpvhKjONoa2S11VBJY68Ee1vNrw7htu+wajvmXhHAyfh1lYql8pu8VvPUG7leEQ9I0pMY35Y/C1cYCBLkDT5zf8NeZFtbp0BNgHd+QDVSFH+GSnvTskU2BCio3YE+zE6cDhvLUOMy3e5RAtPqsi5VzpEUcdCwph+Z+1pFlTxiEZ62i4wNpqw2lhS3b/E9ifJgnncSgRHLtfw/VxHZCRc4tBQ24xSZ507lSlQch+5lQeO7rx2htgd2D7aGNx/UN/xmeuEd4a28AxNOVS3uYh3wTDh8CSXyBRCRPxrANOV1ZBojdfK+v5fOJNPgDn3r5/pG80L3FTkecRB0zFuKNG8jIzi5ADx9k4SlhRNo17gPl2if8gRA6tzTae4kbzieG+woxhUWj/qvXg0MQmg59VTK2HHS34exdKDP9a561svlw+lJ2AtM1EL9srJk8i3kiyEPUeIlaLl3AfgbbSuC2RhlzFFAYuQ06rbsSvEoe4rrYeMXxL9jwVsXX0xrp8H25mOJu3ahn5pFYzADMSGf4L11H1vDArpefj/lW+8zcmogxxBktYYNF/qU4v+9367hp4MEn/84tQPpmb47TL+XpVnl9tQ3r9OfOaW3zX7NkWZbqoX7OgdgHOtTLP/euQujSs2MAzMO4BmbuCS7pR/GTZwDqF1sXiWAkunjo2qpKHieqlvSVmtwEhh6wsNwYTKEkddmTqvKSx0fHRvs3D9lMGJfg7wLSz/3Otx3G65tk9l/3B3r87qQTvbqXmcfnFdEIaR8mO/yMyCKnxtJkJb3lEzNUOrvnSxwL7Gyn54TLTWA== +

+
+
+
+
+
+
-
-
-
-
-
- ); +
+ ); } function SpecsSection() { - const [isModalOpen, setIsModalOpen] = useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); - return ( -
-

- S'more  - - Specs -

-
-

- uses{" "} - Zero Knowledge{" "} - - E - - nd— - - 2 - - — - - E - - nd - - -  E - - ncryption - - - {" "} - for your letters, with{" "} - - Envelope Encryption - {" "} - for the keys. -

-
- This means, both the{" "} - encryption and{" "} - decryption runs on - your device, in your browser. -
    -
  • - Every letter has a{" "} - - unique key - {" "} - which is derived from your original password. -
  • -
  • - Both the letter and the key are encrypted securely and sent to the - server. -
  • -
  • - Now, the server holds{" "} - the envelope,{" "} - the seal and{" "} - - another locked box - - —with a key inside that unseals your letter. -
  • -
- But you— - only you—hold the very thing - that opens that box,{" "} - your password. -
-
- - Nothing on the server is readable without your actual password. -
- Even if someone were to breach in, all they'd find is encrypted - noise and ain't no way they crackin' it.{" "} - - (unless this happens) - -
-
- -
-
+ return ( +
+

+ S'more  + + Specs +

+
+

+ uses  + Zero Knowledge  + + E + + nd— + + 2 + + — + + E + + nd + + +  E + + ncryption + + +   + for your letters, with  + + Envelope Encryption +   + for the keys. +

+
+ This means, both the  + encryption and  + decryption runs on + your device, in your browser. +
    +
  • + Every letter has a  + + unique key +   + which is derived from your original password. +
  • +
  • + Both the letter and the key are encrypted securely and sent to the + server. +
  • +
  • + Now, the server holds  + the envelope,  + the seal and  + + another locked box + + —with a key inside that unseals your letter. +
  • +
+ But you— + only you—hold the very thing + that opens that box,  + your password. +
+
+ + Nothing on the server is readable without your actual password. +
+ Even if someone were to breach in, all they'd find is encrypted + noise and ain't no way they crackin' it.  + + (unless this happens) + +
+
+ +
+
- + - setIsModalOpen(false)}> -
- pi ku e2e diagram -
-
+ setIsModalOpen(false)}> +
+ pi ku e2e diagram +
+
-

- Of course, this level of{" "} - privacy comes with a - catch. No password reset{" "} - for you. -

-

- Your original password is never stored - on the server. So, if it's forgotten, the letters stay sealed - foreeeeveer. -

-
-
- ); +

+ Of course, this level of  + privacy comes with a + catch. No password reset  + for you. +

+

+ Your original password is never stored + on the server. So, if it's forgotten, the letters stay sealed + foreeeeveer. +

+
+
+ ); } function OSSSection() { - return ( -
-

- - is{" "} - -  private - - only for -  your letters {" "} - - - - {" "} - open source ! -

-
-

- is - ...uhhh... pretty - secure. Every claim - about privacy and encryption is publicly available in the code so you - don't have to take my word at it. -

-

- You can also{" "} - Self-host{" "} - in just 4 steps. -

-
-
-            git clone https://git.ramvignesh.dev/me/pi-ku.git
-          
-
-            cd pi-ku
-          
-
-            ./scripts/setup.sh
-          
-
-            ./scripts/start.sh
-          
-
- -
- - View Source - - . -

- Found something to report or request?{" "} - +

- Please say so. - -

-

+ + is  + +  private + + only for +  your letters   + + + +   + open source ! + +
+

+ is + ...uhhh... pretty + secure. Every claim + about privacy and encryption is publicly available in the code so you + don't have to take my word at it. +

+

+ You can also  + Self-host  + in just 4 steps. +

+
+
+                        git clone https://git.ramvignesh.dev/me/pi-ku.git
+                    
+
+                        cd pi-ku
+                    
+
+                        ./scripts/setup.sh
+                    
+
+                        ./scripts/start.sh
+                    
+
-
+
+ + View Source + + . +

+ Found something to report or request?  + + Please say so. + +

+
-

- Built on the shoulders of open source. -

+
-

- wouldn't exist without the work of people who - chose to build in the open. -

-

a big thanks to

-

- - Web Crypto API - - : Browser-native cryptography that runs entirely on your device. The - backbone of everything secure—your letters, keys—here. -

+

+ Built on the shoulders of open source. +

-

- - DaisyUI - {" "} - ·{" "} - - Fabric.js - {" "} - ·{" "} - - Phosphor Icons - - : The brilliant work by others that let me focus on the core - experience instead of re-inventing the wheel. -

+

+ wouldn't exist without the work of people who + chose to build in the open. +

+

a big thanks to

+

+ + Web Crypto API + + : Browser-native cryptography that runs entirely on your device. The + backbone of everything secure—your letters, keys—here. +

-

- Open source is what made possible. It always - feels right to give it back the same way. -

-
-
- ); +

+ + DaisyUI +   + ·  + + Fabric.js +   + ·  + + Phosphor Icons + + : The brilliant work by others that let me focus on the core + experience instead of re-inventing the wheel. +

+ +

+ Open source is what made possible. It always + feels right to give it back the same way. +

+
+ + ); } function StorySection() { - return ( -
-

- The Story -

-
-
- -
-
- - - -
- குறிப்பு - - note. remark. - -
-
- {/* Dict Card */} -
-
-
-
-
pin·ku·rip·pu
-
-
- /noun/ tamil -
+ The Story + +
+
+ +
+
+ + + +
+ குறிப்பு + + note. remark. + +
+
+ {/* Dict Card */} +
+
+
+
+
pin·ku·rip·pu
+
+
+ /noun/ tamil +
-
    -
  1. - postscript; a note written after the letter is signed. -
    -
    - "the most honest thing was always in the{" "} - பி. கு." -
    -
  2. -
  3. the thing you almost didn't say.
  4. -
+
    +
  1. + postscript; a note written after the letter is signed. +
    +
    + "the most honest thing was always in the  + பி. கு." +
    +
  2. +
  3. the thing you almost didn't say.
  4. +
+
+
+
+
+
+
+
+
+
+
+
+
+

+ is an abbreviated transliteration of the + தமிழ் + (Tamil) word + for  +   + —the thing you add after you've already signed your name, what + you write when you thought you were finished, but weren't. +

+

+ + Most of what we actually mean to say never gets said. + +
+ It sits in drafts , in half-written notes, in the pause before we + change the subject.
+ Those words  +   + stay  + + unsaid + + — + a quiet weight difficult to bear. +

+

+ And that's okay... +

+

+ + + was built for putting that weight down. + +
A space for the letters you meant to send, the afterthoughts + that deserved more than silence. +

+
-
-
-
-
-
-
-
-
-
-
-

- is an abbreviated transliteration of the - தமிழ் - (Tamil) word - for{" "} - {" "} - —the thing you add after you've already signed your name, what - you write when you thought you were finished, but weren't. -

-

- - Most of what we actually mean to say never gets said. - -
- It sits in drafts , in half-written notes, in the pause before we - change the subject.
- Those words{" "} - {" "} - stay{" "} - - unsaid - - — - a quiet weight difficult to bear. -

-

- And that's okay... -

-

- - - was built for putting that weight down. - -
A space for the letters you meant to send, the afterthoughts - that deserved more than silence. -

-
-
-
- ); + ); } function ForWhoSection() { - return ( -
-
-

- Who is
this for? -

+ return ( +
+
+

+ Who is
this for? +

-
-

- wasn't built for one kind of person, but a - particular kind of feeling— - - {" "} - the one that lingers very quietly - {" "} - —fragile, yet never breaks. -

+
+

+ wasn't built for one kind of person, but a + particular kind of feeling— + +   + the one that lingers very quietly +   + —fragile, yet never breaks. +

-
- - See if any of these feel too familiar to you - -
- +
+ + See if any of these feel too familiar to you + +
+ +
+
+
-
-
-
-
-
- ); +
+
+ ); } function ArchetypesSection() { - return ( -
-

- The Archetypes -

-

of writing

-
-
-
- - {" "} - To someone you can't reach anymore. - -
-

- A person who left. A relationship that ended without a real - ending. Someone who's still in your life but will never know - what you felt. Some conversations just close before they're - finished. -
-

-

- Write the letter anyway. Keep it close. -

-
-
- - 01 - -
+ return ( +
+

+ The Archetypes +

+

of writing

+
+
+
+ +   + To someone you can't reach anymore. + +
+

+ A person who left. A relationship that ended without a real + ending. Someone who's still in your life but will never know + what you felt. Some conversations just close before they're + finished. +
+

+

+ Write the letter anyway. Keep it close. +

+
+
+ + 01 + +
-
-
- - {" "} - To someone who's still here. - -
-

- Not every letter is about distance. Sometimes you just need to - say something properly—without a text thread, without the - noise of a conversation already in motion. A letter slows it - down. -

-

- Give people their due flowers while they can still smell them. -

+
+
+ +   + To someone who's still here. + +
+

+ Not every letter is about distance. Sometimes you just need to + say something properly—without a text thread, without the + noise of a conversation already in motion. A letter slows it + down. +

+

+ Give people their due flowers while they can still smell them. +

+
+
+ + 02 + +
+
+
+ +
+   + +
+ To yourself, further along. +
+
+

+ Not a journal. Not a note-to-self. A proper letter—to + whoever you'll be in a year, or five, or ten. +
+ Ask yourself of the healed wounds, forgotten fears, or the + things you finally learned to live with. +

+

+ Set a date and let a letter surprise you when you've long + forgotten writing it. +

+
+
+ + 03 + +
+
+
+ +   + For liberation. + +
+

+ Some unsaid words just need to leave your headspace. There's no + recipient, no subject line, no send button. Just the act of + putting it somewhere outside of yourself.
+ That's sometimes enough. +

+

+ Say it once. All of it. Then let it fade. +

+
+
+ + 04 + +
+
-
- - 02 -
-
-
- -
- {" "} - -
- To yourself, further along. -
-
-

- Not a journal. Not a note-to-self. A proper letter—to - whoever you'll be in a year, or five, or ten. -
- Ask yourself of the healed wounds, forgotten fears, or the - things you finally learned to live with. -

-

- Set a date and let a letter surprise you when you've long - forgotten writing it. -

-
-
- - 03 - -
-
-
- - {" "} - For liberation. - -
-

- Some unsaid words just need to leave your headspace. There's no - recipient, no subject line, no send button. Just the act of - putting it somewhere outside of yourself.
- That's sometimes enough. -

-

- Say it once. All of it. Then let it fade. -

-
-
- - 04 - -
- -
-
- ); + ); } function AttributionSection() { - const [hover, setHover] = useState<{ - visible: boolean; - x: number; - y: number; - }>({ visible: false, x: 0, y: 0 }); + const [hover, setHover] = useState<{ + visible: boolean; + x: number; + y: number; + }>({ visible: false, x: 0, y: 0 }); - const navigate = useNavigate(); + const navigate = useNavigate(); - return ( -
- {/* Saajan hover image */} - - {hover.visible && ( - - )} - + return ( +
+ {/* Saajan hover image */} + + {hover.visible && ( + + )} + -

- Honest Speak -

-
-
- Hi. -

Thank you so much for making it this far. Really.

-

- took a while to exist. -
- This started as a{" "} - - CS50W - {" "} - capstone—one I kept postponing until I ran out of excuses. - When I sat down to build it, it felt heavier than a typical - assignment—not just because things were difficult. It had to - be something that outlasted the grade. I wanted to make this one - count more than anything else I'd ever made. Something as close to - perfect as I could get it. Something to be remembered for—a - Swan Song if you will. -

-

So, I gave it all I've got.

-

- Of course, frustrations, id-exisi crises, crept in from time to - time. But helped me re-kindle the love for - the odd hours spent obsessing over the tiniest UX decisions and - endlessly polishing the UI{" "} - - (only if I could've just made my mind up on one design system - sooner, instead of paddling in a sea of muses, muses everywhere) - - . I know I've shared the nuts and bolts of {" "} - here—the core philosophies, how it all works—but the - heart of it is really something you have to find by exploring it - yourself. -

-

- The "why" behind all of this didn't just appear out of nowhere. For - a while, I kept coming back to{" "} - - setHover({ - visible: true, - x: e.clientX, - y: e.clientY, - }) - } - onMouseMove={(e) => - setHover((h) => ({ - ...h, - x: e.clientX, - y: e.clientY, - })) - } - onMouseLeave={() => setHover((h) => ({ ...h, visible: false }))} - > - Saajan - {" "} - from{" "} - - The Lunchbox - {" "} - —brought to life with such subtle brilliance by{" "} - - Irrfan Khan - {" "} - - —the quiet emotional weight he carries through a lonely and - mechanized life, right up until those letters arrive and something - inside him finally loosens. The ending feels like a deep sigh of{" "} - - "it is what it is" - - , but the simple act of writing—of letting the unsaid - out—offered him a brief, yet necessary ease. I think about - that a lot. -

-

- There's a lot that goes{" "} - - unsaid - {" "} - these days. Not for a lack of feeling, not for the lack of time, but - because the ways we reach each other have quietly changed. We're - always reachable digitally, yet - somehow the things that actually matter most end up staying - inside—a trapped one at that. -
- Maybe writing can/will help. Maybe putting words somewhere - deliberate makes them feel less like a weight you're carrying alone. -

-

Or maybe it won't—but it's worth a try.

-

- is for that try. I hope it helps. Really. -

-

- —Ram -

-

- P.S. And just so we're clear—I wrote every word of this - myself—as I continue to back{" "} - - Em DASH - - . Why should AI get to have all the fun with 'em em dashes?{" "} - (get it?) -

+ Honest Speak + +
+
+ Hi. +

Thank you so much for making it this far. Really.

+

+ took a while to exist. +
+ This started as a  + + CS50W +   + capstone—one I kept postponing until I ran out of excuses. + When I sat down to build it, it felt heavier than a typical + assignment—not just because things were difficult. It had to + be something that outlasted the grade. I wanted to make this one + count more than anything else I'd ever made. Something as close to + perfect as I could get it. Something to be remembered for—a + Swan Song if you will. +

+

So, I gave it all I've got.

+

+ Of course, frustrations, id-exisi crises, crept in from time to + time. But helped me re-kindle the love for + the odd hours spent obsessing over the tiniest UX decisions and + endlessly polishing the UI  + + (only if I could've just made my mind up on one design system + sooner, instead of paddling in a sea of muses, muses everywhere) + + . I know I've shared the nuts and bolts of   + here—the core philosophies, how it all works—but the + heart of it is really something you have to find by exploring it + yourself. +

+

+ The "why" behind all of this didn't just appear out of nowhere. For + a while, I kept coming back to  + + setHover({ + visible: true, + x: e.clientX, + y: e.clientY, + }) + } + onMouseMove={(e) => + setHover((h) => ({ + ...h, + x: e.clientX, + y: e.clientY, + })) + } + onMouseLeave={() => setHover((h) => ({ ...h, visible: false }))} + > + Saajan +   + from  + + The Lunchbox +   + —brought to life with such subtle brilliance by  + + Irrfan Khan +   + + —the quiet emotional weight he carries through a lonely and + mechanized life, right up until those letters arrive and something + inside him finally loosens. The ending feels like a deep sigh of  + + "it is what it is" + + , but the simple act of writing—of letting the unsaid + out—offered him a brief, yet necessary ease. I think about + that a lot. +

+

+ There's a lot that goes  + + unsaid +   + these days. Not for a lack of feeling, not for the lack of time, but + because the ways we reach each other have quietly changed. We're + always reachable digitally, yet + somehow the things that actually matter most end up staying + inside—a trapped one at that. +
+ Maybe writing can/will help. Maybe putting words somewhere + deliberate makes them feel less like a weight you're carrying alone. +

+

Or maybe it won't—but it's worth a try.

+

+ is for that try. I hope it helps. Really. +

+

+ —Ram +

+

+ P.S. And just so we're clear—I wrote every word of this + myself—as I continue to back  + + Em DASH + + . Why should AI get to have all the fun with 'em em dashes?  + (get it?) +

+
+
+   + I think we forget things if there is nobody to tell them. + + ~ Saajan Fernandes,  + + The Lunchbox + + +
+
+
+ +
-
- {" "} - I think we forget things if there is nobody to tell them. - - ~ Saajan Fernandes,{" "} - - The Lunchbox - - -
-
-
- -
-
- ); + ); } diff --git a/frontend/src/pages/Drawer.tsx b/frontend/src/pages/Drawer.tsx index 0be1e0c..8ad4246 100644 --- a/frontend/src/pages/Drawer.tsx +++ b/frontend/src/pages/Drawer.tsx @@ -1,9 +1,9 @@ import { - ArchiveIcon, - FeatherIcon, - FileDashedIcon, - PaperPlaneTiltIcon, - VaultIcon, + ArchiveIcon, + FeatherIcon, + FileDashedIcon, + PaperPlaneTiltIcon, + VaultIcon, } from "@phosphor-icons/react"; import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; @@ -17,191 +17,191 @@ import { PATHS } from "../config/routes"; import { useAuth } from "../hooks/useAuth"; import { useLetters } from "../hooks/useLetters"; import { - formatRelativeDate, - formatRelativeDateWithoutTime, + formatRelativeDate, + formatRelativeDateWithoutTime, } from "../utils/dateFormat"; export default function Drawer() { - const { user, logout } = useAuth(); + const { user, logout } = useAuth(); - const [openSection, setOpenSection] = useState(null); - const navigate = useNavigate(); - const location = useLocation(); - const [showWelcomeLetter, setShowWelcomeLetter] = useState( - !!location.state?.firstTime, - ); - const { drafts, kept, sent, vault, loading, isAuthRequired } = useLetters(); + const [openSection, setOpenSection] = useState(null); + const navigate = useNavigate(); + const location = useLocation(); + const [showWelcomeLetter, setShowWelcomeLetter] = useState( + !!location.state?.firstTime, + ); + const { drafts, kept, sent, vault, loading, isAuthRequired } = useLetters(); - if (!user) return null; + if (!user) return null; - const toggleSection = (id: string) => - setOpenSection(openSection === id ? null : id); + const toggleSection = (id: string) => + setOpenSection(openSection === id ? null : id); - return ( -
-
+ return ( +
+
- {showWelcomeLetter && ( - { - setShowWelcomeLetter(false); - navigate(location.pathname, { replace: true, state: {} }); - }} - /> - )} + {showWelcomeLetter && ( + { + setShowWelcomeLetter(false); + navigate(location.pathname, { replace: true, state: {} }); + }} + /> + )} - {isAuthRequired && } -
- -
- Personal Archive + {isAuthRequired && } +
+ +
+ Personal Archive +
+
+ Welcome Back  + {user.full_name} + +
+
+ +
+ {loading ? ( +
+ + + Opening your cabinet... + +
+ ) : ( + <> + toggleSection("drafts")} + icon={} + > + {drafts.map((draft) => ( + + ))} + + + toggleSection("kept")} + icon={} + > + {kept.map((letter) => ( + + ))} + + toggleSection("sent")} + icon={} + > + {sent.map((letter) => ( + + ))} + + toggleSection("vault")} + icon={} + > + {vault.map((letter) => ( + new Date().toISOString()} + /> + ))} + + + )} +
+ + + +
+ For your unsaid. +
+ {!showWelcomeLetter && ( +
+ +
+ )}
-
- Welcome Back{" "} - {user.full_name} - -
-
- -
- {loading ? ( -
- - - Opening your cabinet... - -
- ) : ( - <> - toggleSection("drafts")} - icon={} - > - {drafts.map((draft) => ( - - ))} - - - toggleSection("kept")} - icon={} - > - {kept.map((letter) => ( - - ))} - - toggleSection("sent")} - icon={} - > - {sent.map((letter) => ( - - ))} - - toggleSection("vault")} - icon={} - > - {vault.map((letter) => ( - new Date().toISOString()} - /> - ))} - - - )} -
- - - -
- For your unsaid. -
- {!showWelcomeLetter && ( -
- -
- )} -
- ); + ); } diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 5dd3d0f..c8e7dcf 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -1,10 +1,10 @@ import { InfoIcon } from "@phosphor-icons/react"; import { ReactLenis } from "lenis/react"; import { - motion, - useMotionValueEvent, - useScroll, - useTransform, + motion, + useMotionValueEvent, + useScroll, + useTransform, } from "motion/react"; import { useRef, useState } from "react"; import { useNavigate } from "react-router-dom"; @@ -19,383 +19,383 @@ import "@fontsource/space-mono/index.css"; import "@fontsource/architects-daughter/index.css"; export default function Home() { - const sectionContainer1 = useRef(null); - const { scrollYProgress } = useScroll({ - target: sectionContainer1, - }); - const [isEnvelopeFlipped, setIsEnvelopeFlipped] = useState(true); - const [flapOpen, setFlapOpen] = useState(false); - const [recipient, setRecipient] = useState("someone dear"); - const [ignite, setIgnite] = useState(false); + const sectionContainer1 = useRef(null); + const { scrollYProgress } = useScroll({ + target: sectionContainer1, + }); + const [isEnvelopeFlipped, setIsEnvelopeFlipped] = useState(true); + const [flapOpen, setFlapOpen] = useState(false); + const [recipient, setRecipient] = useState("someone dear"); + const [ignite, setIgnite] = useState(false); - const navigate = useNavigate(); + const navigate = useNavigate(); - useMotionValueEvent(scrollYProgress, "change", (latestScrollValue) => { - if (latestScrollValue > 0.54) { - setFlapOpen(false); - } else { - setFlapOpen(true); - } - if (latestScrollValue <= 0.6) { - setIsEnvelopeFlipped(true); - } else { - setIsEnvelopeFlipped(false); - } - if (latestScrollValue > 0.68) { - setRecipient("future me"); - } else { - setRecipient("someone dear"); - } - if (latestScrollValue > 0.77) { - setIgnite(true); - } else { - setIgnite(false); - } - }); + useMotionValueEvent(scrollYProgress, "change", (latestScrollValue) => { + if (latestScrollValue > 0.54) { + setFlapOpen(false); + } else { + setFlapOpen(true); + } + if (latestScrollValue <= 0.6) { + setIsEnvelopeFlipped(true); + } else { + setIsEnvelopeFlipped(false); + } + if (latestScrollValue > 0.68) { + setRecipient("future me"); + } else { + setRecipient("someone dear"); + } + if (latestScrollValue > 0.77) { + setIgnite(true); + } else { + setIgnite(false); + } + }); - return ( - -
-
- {/* Intro */} - -

- You've been carrying something -

- - unsaid - -
+ return ( + +
+
+ {/* Intro */} + +

+ You've been carrying something +

+ + unsaid + +
- -
- and that's okay... -
-
- {/* pi. ku. */} - - - - is a{" "} - - safe space - - ,
- - where you can - -
-
+ +
+ and that's okay... +
+
+ {/* pi. ku. */} + + + + is a{" "} + + safe space + + ,
+ + where you can + +
+
-
- - pen down your unsaid words into{" "} - - letters - - . - - {/* Seal */} - - seal it{" "} - - secure - {" "} - and{" "} - - private - - . - - {/* Send / vault */} - - send it to{" "} - - someone dear - - - - {" "} - or{" "} - - - yourself in the future - - . - - - {/* Burn */} - - and even burn it{" "} - to release the burden. - - {/* Outro */} - - You've been carrying it long enough. - - {/* CTA */} - - - - -
+
+ + pen down your unsaid words into  + + letters + + . + + {/* Seal */} + + seal it  + + secure +   + and  + + private + + . + + {/* Send / vault */} + + send it to  + + someone dear + + + +   + or  + + + yourself in the future + + . + + + {/* Burn */} + + and even burn it  + to release the burden. + + {/* Outro */} + + You've been carrying it long enough. + + {/* CTA */} + + + + +
-
- -
-
-
- letter +
+ +
+
+
+ letter +
+
+
+ {/* Envelope */} + + { }} + isFlip={isEnvelopeFlipped} + openFlap={flapOpen} + /> + + {/* Saajan */} + + + + {/* Orb */} + +
+
-
- - {/* Envelope */} - - {}} - isFlip={isEnvelopeFlipped} - openFlap={flapOpen} - /> - - {/* Saajan */} - - - - {/* Orb */} - -
-
-
-
-
- ); +
+
+ ); } diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx index 0621949..6de015f 100644 --- a/frontend/src/pages/Login.tsx +++ b/frontend/src/pages/Login.tsx @@ -16,135 +16,135 @@ import { useAuth } from "../hooks/useAuth"; import { CryptoUtils } from "../utils/crypto"; const loginSchema = z.object({ - email: z.email("Please enter a valid email"), - password: z.string().min(1, "Password is required"), + email: z.email("Please enter a valid email"), + password: z.string().min(1, "Password is required"), }); type LoginInputs = z.infer; export default function Login() { - const navigate = useNavigate(); - const location = useLocation(); - const [isLoading, setIsLoading] = useState(false); - const [apiError, setApiError] = useState(null); - const { setAuthStore } = useAuth(); - const [showWelcome, setShowWelcome] = useState(!!location.state?.firstTime); - const [saajanMessage, setSaajanMessage] = useState( - "I was wondering when you'd return.", - ); - const nextRoute = location.state?.redirectUrl || ROUTES.DRAWER; + const navigate = useNavigate(); + const location = useLocation(); + const [isLoading, setIsLoading] = useState(false); + const [apiError, setApiError] = useState(null); + const { setAuthStore } = useAuth(); + const [showWelcome, setShowWelcome] = useState(!!location.state?.firstTime); + const [saajanMessage, setSaajanMessage] = useState( + "I was wondering when you'd return.", + ); + const nextRoute = location.state?.redirectUrl || ROUTES.DRAWER; - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: zodResolver(loginSchema), - }); + const { + register, + handleSubmit, + formState: { errors }, + } = useForm({ + resolver: zodResolver(loginSchema), + }); - const onSubmit = async (data: LoginInputs) => { - setIsLoading(true); - setApiError(null); - try { - // client side key derivation for e2e encryption - const { masterKey, authHash } = await CryptoUtils.deriveKeyBundle( - data.password, - data.email, - ); + const onSubmit = async (data: LoginInputs) => { + setIsLoading(true); + setApiError(null); + try { + // client side key derivation for e2e encryption + const { masterKey, authHash } = await CryptoUtils.deriveKeyBundle( + data.password, + data.email, + ); - // send just the authHash as the password to the server - const { data: authData } = await publicApi.post(endpoints.LOGIN, { - email: data.email, - password: authHash, - }); + // send just the authHash as the password to the server + const { data: authData } = await publicApi.post(endpoints.LOGIN, { + email: data.email, + password: authHash, + }); - const { data: userData } = await api.get(endpoints.ME, { - headers: { Authorization: `Bearer ${authData.access}` }, - }); + const { data: userData } = await api.get(endpoints.ME, { + headers: { Authorization: `Bearer ${authData.access}` }, + }); - await setAuthStore(authData.access, userData, masterKey); + await setAuthStore(authData.access, userData, masterKey); - navigate(nextRoute, { replace: true, state: location.state }); - } catch (err) { - let message = - "Sorry, we're experiencing technical issues.\nPlease try again later."; - if (axios.isAxiosError(err) && err.response?.status !== 500) { - message = err.response?.data?.detail || err.response?.data?.message; - } - setApiError(message); - } finally { - setIsLoading(false); - } - }; - - return ( -
- {!showWelcome && } - {showWelcome && } -
-
-

-   Enter Archive -

- - {apiError && ( -
- {apiError} -
- )} - - setSaajanMessage("I remember you.")} - /> - - - setSaajanMessage("The one thing I cannot know for you.") + navigate(nextRoute, { replace: true, state: location.state }); + } catch (err) { + let message = + "Sorry, we're experiencing technical issues.\nPlease try again later."; + if (axios.isAxiosError(err) && err.response?.status !== 500) { + message = err.response?.data?.detail || err.response?.data?.message; } - /> + setApiError(message); + } finally { + setIsLoading(false); + } + }; -
- -
-
or
-
- New to ?{" "} - - . -
- -
-
- ); + return ( +
+ {!showWelcome && } + {showWelcome && } +
+
+

+   Enter Archive +

+ + {apiError && ( +
+ {apiError} +
+ )} + + setSaajanMessage("I remember you.")} + /> + + + setSaajanMessage("The one thing I cannot know for you.") + } + /> + +
+ +
+
or
+
+ New to ?  + + . +
+ +
+
+ ); } diff --git a/frontend/src/pages/Register.tsx b/frontend/src/pages/Register.tsx index feb75c7..cbaded4 100644 --- a/frontend/src/pages/Register.tsx +++ b/frontend/src/pages/Register.tsx @@ -14,171 +14,171 @@ import { ROUTES } from "../config/routes"; import { CryptoUtils } from "../utils/crypto"; const registerSchema = z - .object({ - full_name: z.string().min(2, "Name must be at least 2 characters"), - email: z.email("Please enter a valid email"), - password: z.string().min(8, "Password must be at least 8 characters"), - confirm_password: z.string(), - }) - .refine((data) => data.password === data.confirm_password, { - message: "Passwords don't match", - path: ["confirm_password"], - }); + .object({ + full_name: z.string().min(2, "Name must be at least 2 characters"), + email: z.email("Please enter a valid email"), + password: z.string().min(8, "Password must be at least 8 characters"), + confirm_password: z.string(), + }) + .refine((data) => data.password === data.confirm_password, { + message: "Passwords don't match", + path: ["confirm_password"], + }); type RegisterInputs = z.infer; export default function Register() { - const navigate = useNavigate(); - const [isLoading, setIsLoading] = useState(false); - const [apiError, setApiError] = useState(null); - const [saajanMessage, setSaajanMessage] = useState( - "I didn't think I'd be here either.\nAnd yet, here we are.", - ); + const navigate = useNavigate(); + const [isLoading, setIsLoading] = useState(false); + const [apiError, setApiError] = useState(null); + const [saajanMessage, setSaajanMessage] = useState( + "I didn't think I'd be here either.\nAnd yet, here we are.", + ); - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: zodResolver(registerSchema), - }); + const { + register, + handleSubmit, + formState: { errors }, + } = useForm({ + resolver: zodResolver(registerSchema), + }); - const onSubmit = async (data: RegisterInputs) => { - setSaajanMessage("Good. I'll remember that."); - setIsLoading(true); - setApiError(null); - try { - // we generate the key bundle here to get the authHash (password) to be haSHed and stored in the db. - const { authHash } = await CryptoUtils.deriveKeyBundle( - data.password, - data.email, - ); + const onSubmit = async (data: RegisterInputs) => { + setSaajanMessage("Good. I'll remember that."); + setIsLoading(true); + setApiError(null); + try { + // we generate the key bundle here to get the authHash (password) to be haSHed and stored in the db. + const { authHash } = await CryptoUtils.deriveKeyBundle( + data.password, + data.email, + ); - await publicApi.post(endpoints.REGISTER, { - full_name: data.full_name, - email: data.email, - password: authHash, - }); - navigate(ROUTES.VERIFY_EMAIL, { replace: true }); - } catch (err) { - let message = "Registration failed. Please try again."; - if (axios.isAxiosError(err)) { - message = err.response?.data?.message || message; - } - setApiError(message); - } finally { - setIsLoading(false); - } - }; + await publicApi.post(endpoints.REGISTER, { + full_name: data.full_name, + email: data.email, + password: authHash, + }); + navigate(ROUTES.VERIFY_EMAIL, { replace: true }); + } catch (err) { + let message = "Registration failed. Please try again."; + if (axios.isAxiosError(err)) { + message = err.response?.data?.message || message; + } + setApiError(message); + } finally { + setIsLoading(false); + } + }; - return ( -
- -
-
-
- Create a Account -
+ return ( +
+ +
+ +
+ Create a Account +
- {apiError && ( -
- {apiError} + {apiError && ( +
+ {apiError} +
+ )} + + + setSaajanMessage("Hello friend. What should I call you?") + } + /> + + + setSaajanMessage( + "Where should I send your letters?\nNo empty lunchboxes, please.", + ) + } + /> + + + setSaajanMessage( + "Something only you know.\nI have one of those too.", + ) + } + /> + + + setSaajanMessage( + "Just once? Trust me, \nsome things are worth repeating twice.", + ) + } + /> + +
+ +

+ Choose a password you won't forget.
+ Just like life,  + there is no reset  + here. If you lose it, your letters cannot be recovered. +

+
+ +
+ +
+
or
+
+ Been here before?  + + . +
+
- )} - - - setSaajanMessage("Hello friend. What should I call you?") - } - /> - - - setSaajanMessage( - "Where should I send your letters?\nNo empty lunchboxes, please.", - ) - } - /> - - - setSaajanMessage( - "Something only you know.\nI have one of those too.", - ) - } - /> - - - setSaajanMessage( - "Just once? Trust me, \nsome things are worth repeating twice.", - ) - } - /> - -
- -

- Choose a password you won't forget.
- Just like life,{" "} - there is no reset{" "} - here. If you lose it, your letters cannot be recovered. -

-
- -
- -
-
or
-
- Been here before?{" "} - - . -
- -
-
- ); +
+ ); } diff --git a/frontend/src/pages/VerifyEmail.tsx b/frontend/src/pages/VerifyEmail.tsx index 03145c0..bc708e1 100644 --- a/frontend/src/pages/VerifyEmail.tsx +++ b/frontend/src/pages/VerifyEmail.tsx @@ -3,53 +3,53 @@ import Logo from "../components/Logo"; import Saajan from "../components/ui/Saajan"; export default function VerifyEmail() { - return ( -
- + return ( +
+ -
-
- +
+
+ +
+ +
+

+ Check Your Mailbox +

+

+ You're one train away from starting your   + journey. +

+
+ +
+ +
+

+ Nothing yet? Sometimes letters take the wrong train. Check your spam + folder. +
+ + The link expires in 24 hours. + +
I'm patient... but not endlessly so +

+
+ + +
- -
-

- Check Your Mailbox -

-

- You're one train away from starting your {" "} - journey. -

-
- -
- -
-

- Nothing yet? Sometimes letters take the wrong train. Check your spam - folder. -
- - The link expires in 24 hours. - -
I'm patient... but not endlessly so -

-
- - -
-
- ); + ); }