The minimalistic document archiving platform.
feat(index): added faq (#33)
Corentin Thomassetb398f8351d77
diff --git a/src/components/FaqAccordion.astro b/src/components/FaqAccordion.astronew file mode 100644index 00000000..5166d8bb--- /dev/null+++ b/src/components/FaqAccordion.astro@@ -0,0 +1,103 @@+---+const title = 'Frequently Asked Questions';+const description = 'Everything you need to know about Papra';+const items = [+ {+ question: 'What is Papra?',+ answer: 'Papra is an open-source document management platform designed to help you organize, secure, and archive your files effortlessly. It provides a centralized solution for managing all your documents in one place.',+ },+ {+ question: 'Is Papra really open-source?',+ answer: 'Yes! Papra is completely open-source and available under the AGPL-3.0 license. You can view the source code on GitHub and even self-host it if you prefer.',+ },+ {+ question: 'How does document organization work?',+ answer: 'Papra uses a combination of organizations, tags, and powerful search functionality to help you organize your documents. You can create organizations for teams or companies, add tags for categorization, and find documents quickly with our search feature.',+ },+ {+ question: 'Can I self-host Papra?',+ answer: 'Absolutely! Since Papra is open-source, you can self-host it on your own infrastructure. This gives you complete control over your data and allows you to customize the platform to your specific needs.',+ },+ {+ question: 'What file types does Papra support?',+ answer: 'Papra supports a wide range of document types including PDFs, text files, code files, invoices, spreadsheets, and many more. The platform is designed to handle various file formats commonly used in business and personal document management.',+ },+ {+ question: 'Are my documents secure?',+ answer: 'Yes! Papra uses industry-standard in-transit and at-rest encryption to protect your documents.',+ },+ {+ question: 'Are my data stored in Europe?',+ answer: 'Yes! Papra is hosted in Europe and all data is stored in Europe.',+ },+ {+ question: 'How can I get started with Papra?',+ answer: 'Getting started with Papra is easy! Simply sign up for a free account, upload your documents, and start organizing them. You can also check out our documentation for more detailed instructions on how to use the platform.',+ },+];+---++<div class="max-w-800px mx-auto px-6 py-42">+ <h2 class="text-3xl font-semibold text-pretty mb-4 text-center">{title}</h2>+ <p class="text-muted-foreground text-lg text-center mb-24">{description}</p>++ <div>+ {+ items.map((item, index) => (+ <div class="border-x border-t first:rounded-t-lg last:border-b last:rounded-b-lg bg-background overflow-hidden">+ <button class="w-full px-6 py-4 text-left flex items-center justify-between" data-faq-toggle data-faq-index={index} aria-expanded="false" aria-controls={`faq-content-${index}`}>+ <span class="font-semibold text-sm sm:text-base">{item.question}</span>+ <div class="i-tabler-chevron-down size-5 text-muted-foreground transition-transform duration-200" data-faq-icon aria-hidden="true" />+ </button>++ <div class="px-6 pb-0 max-h-0 overflow-hidden transition-all duration-300 ease-in-out" data-faq-content data-faq-index={index} id={`faq-content-${index}`}>+ <div class="pb-4">+ <p class="text-muted-foreground leading-relaxed">{item.answer}</p>+ </div>+ </div>+ </div>+ ))+ }+ </div>+</div>++<script>+ function expandItem(toggle: HTMLElement, content: HTMLElement, icon: HTMLElement) {+ toggle.setAttribute('aria-expanded', 'true');+ content.style.maxHeight = `${content.scrollHeight}px`;+ icon.style.transform = 'rotate(180deg)';+ }++ function collapseItem(toggle: HTMLElement, content: HTMLElement, icon: HTMLElement) {+ toggle.setAttribute('aria-expanded', 'false');+ content.style.maxHeight = '0';+ icon.style.transform = 'rotate(0deg)';+ }++ function handleToggleClick(e: Event) {+ const target = e.currentTarget as HTMLElement;+ const index = target.getAttribute('data-faq-index');+ const content = document.querySelector(`[data-faq-content][data-faq-index="${index}"]`) as HTMLElement;+ const icon = target.querySelector('[data-faq-icon]') as HTMLElement;+ const isExpanded = target.getAttribute('aria-expanded') === 'true';++ if (isExpanded) {+ collapseItem(target, content, icon);+ } else {+ expandItem(target, content, icon);+ }+ }++ function initFaqAccordion() {+ const toggles = document.querySelectorAll('[data-faq-toggle]');+ toggles.forEach((toggle) => {+ toggle.addEventListener('click', handleToggleClick);+ });+ }++ // Initialize FAQ accordion when DOM is loaded+ document.addEventListener('DOMContentLoaded', initFaqAccordion);++ // Also initialize for Astro's client-side navigation+ document.addEventListener('astro:page-load', initFaqAccordion);+</script>diff --git a/src/pages/index.astro b/src/pages/index.astroindex 02327267..e5cce27c 100644--- a/src/pages/index.astro+++ b/src/pages/index.astro@@ -2,6 +2,7 @@import { Image } from 'astro:assets';import { config } from '../app.config';import Hero from '../assets/papra-screenshot.png';+import FaqAccordion from '../components/FaqAccordion.astro';import FeaturesBento from '../components/FeaturesBento.astro';import Footer from '../components/Footer.astro';import Header from '../components/Header.astro';@@ -9,22 +10,20 @@ import Layout from '../layouts/Layout.astro';---<Layout>- <div class="relative overflow-hidden pb-300px">+ <div class="relative overflow-hidden pb-300px bg-[linear-gradient(to_right,#80808010_1px,transparent_1px),linear-gradient(to_bottom,#80808010_1px,transparent_1px)] bg-[size:48px_48px]">+ <div class="z-9 bg-gradient-to-b from-background to-transparent w-full h-full absolute top-0 left-0"></div><div class="z-10 bg-primary w-80% max-w-1000px h-400px rounded-xl blur-64 op-20 absolute bottom--100px left-50% -translate-x-50%"></div><Header />- <div class="max-w-2xl mx-auto pt-20 pb-32 px-4 mt-24 text-center">+ <div class="max-w-2xl mx-auto pt-20 pb-32 px-4 mt-24 text-center z-50 relative"><h1 class="text-4xl font-bold mb-4 text-pretty">Your Open-Source Solution to Document Chaos</h1><p class="text-lg text-muted-foreground">An open-source document management platform designed to help you organize, secure, and archive your files effortlessly.</p><div class="flex items-center justify-center gap-2 mt-8"><a href="https://demo.papra.app" class="border text-sm font-bold rounded py-2 px-4 rounded-xl hover:border-primary hover:text-primary transition" target="_blank"> Live Demo </a>- <a- href={config.requestEarlyAccessLink}- class="text-sm flex items-center gap-1.5 bg-primary hover:bg-primary/80 font-bold rounded py-2 px-4 rounded-xl text-primary-foreground transition"- >+ <a href={config.requestEarlyAccessLink} class="text-sm flex items-center gap-1.5 bg-primary hover:bg-primary/80 font-bold rounded py-2 px-4 rounded-xl text-primary-foreground transition">Join the private beta<div class="i-tabler-arrow-right size-5"></div></a>@@ -38,28 +37,31 @@ import Layout from '../layouts/Layout.astro';<FeaturesBento />-<div class="bg-card py-64 border-t flex items-center justify-center gap-8 sm:gap-12 flex-col sm:flex-row relative overflow-hidden">-<div class="max-w-600px px-6 text-center sm:text-left"><h2 class="text-2xl sm:text-4xl font-bold max-w-650px mx-auto">Papra is <span class="bg-primary text-primary-foreground px-3 py-1 rounded-md inline-block leading-tight">open-source</span></h2><p class="text-muted-foreground mx-auto mt-4 text-lg">- The whole Papra ecosystem is proudly open-source and easily self-hostable. It's available on <a href="https://github.com/papra-hq/papra" class="text-primary hover:underline">GitHub</a> under the <a href="https://github.com/papra-hq/papra/blob/main/LICENSE" class="text-primary hover:underline">AGPL-3.0</a> license.+ The whole Papra ecosystem is proudly open-source and easily self-hostable. It's available on <a href="https://github.com/papra-hq/papra" class="text-primary hover:underline">GitHub</a> under the+ <a href="https://github.com/papra-hq/papra/blob/main/LICENSE" class="text-primary hover:underline">AGPL-3.0</a> license.</p></div><div class="flex items-center justify-center gap-2 mt-8">- <a href="https://github.com/papra-hq/papra" class="border text-sm font-bold rounded py-2 px-4 rounded-xl hover:border-primary hover:text-primary transition flex items-center gap-2 flex-shrink-0" target="_blank"> See on GitHub <div class="i-tabler-arrow-right size-5" aria-hidden="true"></div> </a>+ <a+ href="https://github.com/papra-hq/papra"+ class="border text-sm font-bold rounded py-2 px-4 rounded-xl hover:border-primary hover:text-primary transition flex items-center gap-2 flex-shrink-0"+ target="_blank"+ >+ See on GitHub <div class="i-tabler-arrow-right size-5" aria-hidden="true"></div>+ </a></div>-</div>-- <div class="py-64 relative overflow-hidden border-y relative">- <div class="z-10 bg-primary w-90% max-w-1000px h-80px rounded-full blur-64 op-15 absolute top--50px left-50% -translate-x-50% "></div>+ <!-- <div class="py-64 relative overflow-hidden border-y relative">+ <div class="z-10 bg-primary w-90% max-w-1000px h-80px rounded-full blur-64 op-15 absolute top--50px left-50% -translate-x-50%"></div><div class="z-10 bg-primary size-64 rounded-full blur-84 op-20 transform translate-x--80% translate-y--33% absolute"></div><div class="z-10 bg-primary size-128 rounded-full blur-84 op-20 transform translate-x-80% translate-y-33% absolute right-0"></div>@@ -70,25 +72,27 @@ import Layout from '../layouts/Layout.astro';<div class="text-lg mt-4">- Ada, FICSIT Inc.</div></div></div>- </div>+ </div> -->-<div class="bg-card py-32">- <div class="max-w-1200px mx-auto px-6">- <div class="border rounded-xl bg-background pt-32 pb-24 bg-[linear-gradient(to_right,#80808010_1px,transparent_1px),linear-gradient(to_bottom,#80808010_1px,transparent_1px)] bg-[size:48px_48px] px-6">- <h2 class="text-2xl sm:text-4xl font-bold text-center max-w-650px mx-auto">- Trusted by home, startups, and enterprises of all sizes.- </h2>+ <FaqAccordion />- <div class="flex mt-4 items-center justify-center">- <a href={config.requestEarlyAccessLink} class="font-semibold text-background px-4 py-2 hover:bg-primary/80 rounded-lg bg-primary transition mt-8 inline-block flex items-center">- Join the private beta+ <div class="bg-card py-32">+ <div class="max-w-1200px mx-auto px-6">+ <div+ class="border rounded-xl bg-background pt-32 pb-24 bg-[linear-gradient(to_right,#80808010_1px,transparent_1px),linear-gradient(to_bottom,#80808010_1px,transparent_1px)] bg-[size:48px_48px] px-6"+ >+ <h2 class="text-2xl sm:text-4xl font-bold text-center max-w-650px mx-auto">Trusted by home, startups, and enterprises of all sizes.</h2>- <div class="i-tabler-arrow-right ml-2 size-5" aria-hidden="true"></div>- </a>+ <div class="flex mt-4 items-center justify-center">+ <a href={config.requestEarlyAccessLink} class="font-semibold text-background px-4 py-2 hover:bg-primary/80 rounded-lg bg-primary transition mt-8 inline-block flex items-center">+ Join the private beta++ <div class="i-tabler-arrow-right ml-2 size-5" aria-hidden="true"></div>+ </a>+ </div></div></div></div>-</div><Footer /></Layout>