From 9e2215b70ab778cb06fbd5742c6a41fab700a7c0 Mon Sep 17 00:00:00 2001 From: theoleuthardt Date: Sat, 15 Feb 2025 22:12:14 +0100 Subject: [PATCH] feat: table as dropdown for information about input and output file formats --- frontend/src/app/doc-converter/layout.tsx | 2 +- frontend/src/app/doc-converter/page.tsx | 127 +++++++++++++--------- 2 files changed, 78 insertions(+), 51 deletions(-) diff --git a/frontend/src/app/doc-converter/layout.tsx b/frontend/src/app/doc-converter/layout.tsx index e813701..68aa695 100644 --- a/frontend/src/app/doc-converter/layout.tsx +++ b/frontend/src/app/doc-converter/layout.tsx @@ -4,7 +4,7 @@ import { toolLinks } from "@/constants"; export const metadata: Metadata = { title: toolLinks[0].title, - description: "Converter for documents to pdf format!", + description: "Converter for documents!", }; export default function RootLayout({ diff --git a/frontend/src/app/doc-converter/page.tsx b/frontend/src/app/doc-converter/page.tsx index c275ce7..8255217 100644 --- a/frontend/src/app/doc-converter/page.tsx +++ b/frontend/src/app/doc-converter/page.tsx @@ -7,7 +7,7 @@ import Button from "../../components/Button"; import Link from "next/link"; import { ChevronDown, ChevronUp } from "lucide-react"; -export default function Home() { +export default function DocConverter() { const [file, setFile] = useState(null); const [downloadUrl, setDownloadUrl] = useState(""); const [loading, setLoading] = useState(false); @@ -20,7 +20,7 @@ export default function Home() { } }; - const convertToPdf = async () => { + const convertDoc = async () => { if (!file) { alert("No file selected"); return; @@ -56,9 +56,9 @@ export default function Home() { }; return ( -
+
-
+

doc-converter

)}
{ // TODO: Fix Table Head widths (fixed and the same as the max body width) // TODO: Add hover animation to table head (scale-110, blue text, blue border) - // TODO: Fix general site height and add scrolling - // TODO: Add animated pop in for the table body } -
+
setTableOpen(!tableOpen)} > - +
- - +
📥 Input Format -

📤 Output Format

- {tableOpen ? ( - - ) : ( - - )} +
+ 📥 Input Format + +

📤 Output Format

+
+ {tableOpen ? ( + + ) : ( + + )} +
- {tableOpen && ( - +
+
- - + - - + - - - - - - + - - + - - + - - + + - - + + - - + - - + - - + + - - + + - - + - +
.doc (MS Word) + + .doc (MS Word) + .pdf, .docx, .odt, .txt, .rtf, .html, .epub
.docx (MS Word) + + .docx (MS Word) + .pdf, .odt, .txt, .rtf, .html, .epub
+ .odt (OpenDocument Text) + .pdf, .doc, .docx, .txt, .rtf, .html, .epub
+ .rtf (Rich Text Format) + .pdf, .doc, .docx, .odt, .txt, .html
.txt (Text) + .txt (Text) .pdf, .doc, .docx, .odt, .txt, .html
.html (Webseite) + + .html (Webseite) + .pdf, .doc, .docx, .odt, .rtf, .txt
.epub (E-Book) + + .epub (E-Book) + .pdf, .doc, .docx, .odt, .rtf, .txt
.xls (MS Excel).pdf, .xlsx, .ods, .csv + .xls (MS Excel) + + .pdf, .xlsx, .ods, .csv +
.xlsx (MS Excel).pdf, .xls, .ods, .csv + .xlsx (MS Excel) + .pdf, .xls, .ods, .csv
+ .ods (OpenDocument Spreadsheet) .pdf, .xls, .xlsx, .csv + .pdf, .xls, .xlsx, .csv +
+ .csv (Comma-Separated Values) .pdf, .xls, .xlsx, .ods + .pdf, .xls, .xlsx, .ods +
.ppt (MS PowerPoint).pdf, .pptx, .odp + .ppt (MS PowerPoint) + .pdf, .pptx, .odp
.pptx (MS PowerPoint).pdf, .ppt, .odp + .pptx (MS PowerPoint) + .pdf, .ppt, .odp
+
.odp (OpenDocument Presentation) .pdf, .ppt, .pptx.pdf, .ppt, .pptx
- )} +
-
); }