Skip to content

Commit 892728d

Browse files
committed
Add faq section
1 parent 6967582 commit 892728d

2 files changed

Lines changed: 135 additions & 2 deletions

File tree

src/components/LandingPage/index.js

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import LogoImg from '@site/static/img/phpss-banner.svg';
77
import CodeExample from './CodeExample';
88
import Terminal from './Terminal';
99
import styles from './index.module.css';
10-
import { Code, Cpu, Globe, RefreshCw, CalendarClock, SquareTerminal, Logs, ChartNoAxesCombined, FolderSync, Puzzle, TriangleAlert } from 'lucide-react';
10+
import { Code, Cpu, Globe, RefreshCw, CalendarClock, SquareTerminal, Logs, ChartNoAxesCombined, FolderSync, Puzzle, TriangleAlert, ChevronDown } from 'lucide-react';
1111

1212
const features = [
1313
{
@@ -62,6 +62,42 @@ const features = [
6262
},
6363
];
6464

65+
const faqItems = [
66+
{
67+
question: 'How is it different from PHP-FPM?',
68+
answer: 'Your application remains loaded between requests instead of starting again for every request, reducing repeated startup work.',
69+
},
70+
{
71+
question: 'Can I run an existing PHP application?',
72+
answer: 'Not always without changes. Applications must be designed for an always-in-memory runtime rather than assuming a fresh start for every request.',
73+
},
74+
{
75+
question: 'Does my application need to be asynchronous?',
76+
answer: 'No. Applications can remain synchronous when running on PHPStreamServer.',
77+
},
78+
{
79+
question: 'Can I use asynchronous PHP in my application?',
80+
answer: 'Yes. PHPStreamServer is built around the Revolt event loop and AMPHP, so building asynchronous PHP applications is the most natural way to use it.',
81+
},
82+
83+
{
84+
question: 'How is PHPStreamServer installed?',
85+
answer: 'Composer is all you need to install PHPStreamServer. There is no separate server binary or additional service to set up; you configure and launch it with PHP.',
86+
},
87+
{
88+
question: 'Do I need Nginx or PHP-FPM?',
89+
answer: 'You do not need PHP-FPM. PHPStreamServer keeps your application running and serves requests directly. Nginx is also optional, although you may still choose to use it as a reverse proxy.',
90+
},
91+
{
92+
question: 'Can it replace Cron and Supervisor?',
93+
answer: 'PHPStreamServer includes a scheduler for recurring tasks and a process supervisor for PHP workers and external commands, so separate Cron or Supervisor services are not required.',
94+
},
95+
{
96+
question: 'How do code changes take effect during development?',
97+
answer: 'Because application code stays in memory between requests, changes require a worker reload. The optional file monitor automatically reloads workers when monitored files change.',
98+
},
99+
];
100+
65101
export default function LandingPage() {
66102
const {siteConfig} = useDocusaurusContext();
67103

@@ -183,6 +219,29 @@ export default function LandingPage() {
183219
</div>
184220
</div>
185221
</section>
222+
223+
<section className={`${styles.faqSection} py-8 lg:py-12`}>
224+
<div className="container">
225+
<div className={`${styles.sectionHeading} mb-6 lg:mb-10`}>
226+
<h2>FAQ</h2>
227+
<span/>
228+
</div>
229+
230+
<div className={styles.faqList}>
231+
{faqItems.map((item) => (
232+
<details key={item.question} className={styles.faqItem}>
233+
<summary className={styles.faqQuestion}>
234+
<span>{item.question}</span>
235+
<ChevronDown aria-hidden="true" />
236+
</summary>
237+
<div className={styles.faqAnswer}>
238+
<p>{item.answer}</p>
239+
</div>
240+
</details>
241+
))}
242+
</div>
243+
</div>
244+
</section>
186245
</main>
187246
</Layout>
188247
);

src/components/LandingPage/index.module.css

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@
284284
border-top: 1px solid var(--page-border);
285285
}
286286

287+
.faqSection {
288+
background: var(--page-background);
289+
border-top: 1px solid var(--page-border);
290+
}
291+
287292
.sectionHeading {
288293
position: relative;
289294
}
@@ -404,6 +409,73 @@
404409
line-height: 1.5;
405410
}
406411

412+
.faqList {
413+
@apply flex flex-col gap-3;
414+
}
415+
416+
.faqItem {
417+
@apply rounded-xl shadow-xs;
418+
background: var(--page-surface);
419+
border: 1px solid var(--page-border);
420+
overflow: hidden;
421+
transition: border-color 160ms ease, box-shadow 160ms ease;
422+
}
423+
424+
.faqItem[open] {
425+
border-color: color-mix(in srgb, var(--page-accent), var(--page-border) 56%);
426+
}
427+
428+
.faqQuestion {
429+
@apply p-4 min-h-4;
430+
display: grid;
431+
grid-template-columns: minmax(0, 1fr) auto;
432+
align-items: center;
433+
gap: 1em;
434+
color: inherit;
435+
cursor: pointer;
436+
font-weight: 700;
437+
line-height: 1.4;
438+
list-style: none;
439+
}
440+
441+
.faqQuestion::-webkit-details-marker {
442+
display: none;
443+
}
444+
445+
.faqQuestion:hover {
446+
color: var(--page-accent-dark);
447+
}
448+
449+
.faqQuestion:focus-visible {
450+
outline: 3px solid color-mix(in srgb, var(--page-accent), transparent 58%);
451+
outline-offset: -3px;
452+
}
453+
454+
.faqQuestion svg {
455+
width: 1.25rem;
456+
height: 1.25rem;
457+
color: var(--page-muted);
458+
transition: color 160ms ease, transform 180ms ease;
459+
}
460+
461+
.faqItem[open] .faqQuestion svg {
462+
color: var(--page-accent);
463+
transform: rotate(180deg);
464+
}
465+
466+
.faqAnswer {
467+
@apply px-4 pb-4;
468+
padding: 0 1.1rem 1rem;
469+
color: var(--page-muted);
470+
font-size: 0.94rem;
471+
line-height: 1.65;
472+
}
473+
474+
.faqAnswer p {
475+
@apply pt-4 m-0;
476+
border-top: 1px solid var(--page-border);
477+
}
478+
407479
.commandStep :global(.theme-code-block) {
408480
margin: 0;
409481
}
@@ -471,7 +543,9 @@
471543
@media (prefers-reduced-motion: reduce) {
472544
.primaryButton,
473545
.secondaryButton,
474-
.secondaryButton svg {
546+
.secondaryButton svg,
547+
.faqItem,
548+
.faqQuestion svg {
475549
transition: none;
476550
}
477551
}

0 commit comments

Comments
 (0)