From 5d85226ff0f8a6be4f33bc31bfa7c7f339815bba Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 22 Aug 2026 12:22:01 +0700 Subject: [PATCH] feat(export): redesign PDF view for formal publication styling without colors or watermarks --- apps/web/app/components/PdfExportView.tsx | 534 ++++++++-------------- apps/web/app/globals.css | 58 ++- packages/core/src/export.helpers.ts | 2 +- 3 files changed, 248 insertions(+), 346 deletions(-) diff --git a/apps/web/app/components/PdfExportView.tsx b/apps/web/app/components/PdfExportView.tsx index c0bcd13..4559022 100644 --- a/apps/web/app/components/PdfExportView.tsx +++ b/apps/web/app/components/PdfExportView.tsx @@ -38,6 +38,8 @@ export default function PdfExportView({ const [copiedMd, setCopiedMd] = useState(false); const sectionMeta = getSectionMeta(summary.section); + const categoriesList = summary.categories || []; + const authorsList = summary.authors || []; // Available categories for filtering const allCategories = useMemo(() => { @@ -101,76 +103,26 @@ export default function PdfExportView({ URL.revokeObjectURL(url); } - function getCategoryBadgeClass(category: string): string { - const cat = category.toLowerCase(); - if (cat.includes("web")) { - return "bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-500/30"; - } - if (cat.includes("crypto")) { - return "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30"; - } - if (cat.includes("pwn") || cat.includes("binary")) { - return "bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30"; - } - if (cat.includes("reverse") || cat.includes("rev")) { - return "bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/30"; - } - if (cat.includes("forensic") || cat.includes("dfir")) { - return "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30"; - } - if (cat.includes("osint")) { - return "bg-teal-500/10 text-teal-600 dark:text-teal-400 border-teal-500/30"; - } - return "bg-[var(--brand)]/10 text-[var(--brand)] dark:text-[var(--accent)] border-[var(--brand)]/30"; - } - - function getCategoryIcon(category: string): string { - const cat = category.toLowerCase(); - if (cat.includes("web")) return "๐ŸŒ"; - if (cat.includes("crypto")) return "๐Ÿ”"; - if (cat.includes("pwn") || cat.includes("binary")) return "โšก"; - if (cat.includes("reverse") || cat.includes("rev")) return "โš™๏ธ"; - if (cat.includes("forensic") || cat.includes("dfir")) return "๐Ÿ”"; - if (cat.includes("osint")) return "๐Ÿ›ฐ๏ธ"; - if (cat.includes("mobile")) return "๐Ÿ“ฑ"; - if (cat.includes("hardware")) return "๐Ÿ”Œ"; - return "๐Ÿšฉ"; - } - - function getDifficultyBadgeClass(difficulty: string): string { - const diff = difficulty.toLowerCase(); - if (/easy|simple|beginner/i.test(diff)) { - return "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30"; - } - if (/medium|intermediate/i.test(diff)) { - return "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30"; - } - if (/hard|expert|advanced|insane/i.test(diff)) { - return "bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30"; - } - return "bg-[var(--bg-elevated)] text-[var(--text-muted)] border-[var(--border-color)]"; - } - return (
{/* ========================================================================= - Export Control Toolbar (Hidden in Print) + Export Control Toolbar (Screen Only โ€” Hidden in Print) ========================================================================= */} -