Skip to content

Commit 5a8c9bd

Browse files
committed
feat: add FAQ section
1 parent 2f600f0 commit 5a8c9bd

File tree

4 files changed

+328
-1
lines changed

4 files changed

+328
-1
lines changed

app/page.tsx

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ChevronRight, Github, GithubIcon} from "lucide-react";
1+
import {ChevronRight} from "lucide-react";
22
import {buttonVariants} from "@/components/ui/button";
33
import Link from "next/link";
44
import {cn} from "@/lib/utils";
@@ -7,6 +7,13 @@ import {RainbowButton} from "@/components/magicui/rainbow-button";
77
import {AnimatedGridPattern} from "@/components/magicui/animated-grid-pattern";
88
import {AnimatedGradientText} from "@/components/magicui/animated-gradient-text";
99
import {CodeComparison} from "@/components/magicui/code-comparison";
10+
import {
11+
Accordion,
12+
AccordionContent,
13+
AccordionItem,
14+
AccordionTrigger,
15+
} from "@/components/ui/accordion"
16+
1017

1118
export default function Home() {
1219
const beforeCode = `package my.plugin;
@@ -88,6 +95,31 @@ class MyPlugin(Plugin):
8895
self.logger.info("ServerCommandEvent is called!")
8996
9097
`;
98+
99+
const faqs = [
100+
{
101+
question: "What is Nukkit?",
102+
answer: "Nukkit was the original Java-based server software for Minecraft: Bedrock Edition, created by Vincent \"MagicDroidX\" Wu. It was designed to be fast, stable, and plugin-friendly. It's now considered a legacy project and is no longer actively maintained by its creator."
103+
},
104+
{
105+
question: "Is Nukkit still maintained?",
106+
answer: "No. The original Nukkit project has reached end-of-life, and all ongoing work by the creator has moved to its spiritual successor, Endstone."
107+
},
108+
{
109+
question: "What is Endstone?",
110+
answer: "Endstone is the official spiritual successor to Nukkit, created and maintained by the same author. It provides a high-level plugin API for the Bedrock Dedicated Server (BDS), with first-class support for Python and C++ plugins and full feature parity with vanilla Minecraft. Endstone delivers the same terrain generation, world biomes, AI behavior, and command functionality as the official server, and its API is designed to feel familiar to Nukkit plugin authors."
111+
},
112+
{
113+
question: "What about Cloudburst/Nukkit?",
114+
answer: "Cloudburst/Nukkit is the community-maintained fork that picked up where Nukkit left off. While the CloudburstMC team keeps the codebase alive under GPL 3.0, they focus on maintenance rather than adding new features or driving major improvements. As a result, Cloudburst/Nukkit still lacks some vanilla Bedrock features (such as terrain generation and mob AI) and often trails behind in adopting updates. Neither the original Nukkit creator nor the Endstone project is affiliated with, or responsible for Cloudburst/Nukkit."
115+
},
116+
{
117+
question: "Which should I choose: Endstone or Cloudburst/Nukkit?",
118+
answer: "For the fastest access to new Bedrock features, the most accurate vanilla behavior, and official backing from the original author, we strongly recommend Endstone. If you prefer a pure-Java solution with a long-lasting plugin ecosystem and don't mind that some vanilla features are missing, Cloudburst/Nukkit remains an option."
119+
}
120+
];
121+
122+
91123
return (
92124
<div>
93125
<section>
@@ -177,6 +209,25 @@ class MyPlugin(Plugin):
177209
</div>
178210
</div>
179211
</section>
212+
<section id="faq" className="pt-4">
213+
<div className="flex flex-col w-full max-w-full gap-4 py-1 px-7 md:px-10 md:mx-auto">
214+
<h2 className="mb-2 text-center text-5xl font-bold leading-[1.2] tracking-tighter text-foreground">
215+
Frequently Asked Question
216+
</h2>
217+
<Accordion type="single" collapsible className="w-full" defaultValue="item-0">
218+
{faqs.map((faq, index) => (
219+
<AccordionItem value={`item-${index}`} key={faq.question}>
220+
<AccordionTrigger className="text-lg font-semibold text-left">
221+
{faq.question}
222+
</AccordionTrigger>
223+
<AccordionContent className="text-muted-foreground text-base">
224+
{faq.answer}
225+
</AccordionContent>
226+
</AccordionItem>
227+
))}
228+
</Accordion>
229+
</div>
230+
</section>
180231
</div>
181232
);
182233
}

components/ui/accordion.tsx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
"use client"
2+
3+
import * as React from "react"
4+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
5+
import { ChevronDownIcon } from "lucide-react"
6+
7+
import { cn } from "@/lib/utils"
8+
9+
function Accordion({
10+
...props
11+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
12+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />
13+
}
14+
15+
function AccordionItem({
16+
className,
17+
...props
18+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
19+
return (
20+
<AccordionPrimitive.Item
21+
data-slot="accordion-item"
22+
className={cn("border-b last:border-b-0", className)}
23+
{...props}
24+
/>
25+
)
26+
}
27+
28+
function AccordionTrigger({
29+
className,
30+
children,
31+
...props
32+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
33+
return (
34+
<AccordionPrimitive.Header className="flex">
35+
<AccordionPrimitive.Trigger
36+
data-slot="accordion-trigger"
37+
className={cn(
38+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
39+
className
40+
)}
41+
{...props}
42+
>
43+
{children}
44+
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
45+
</AccordionPrimitive.Trigger>
46+
</AccordionPrimitive.Header>
47+
)
48+
}
49+
50+
function AccordionContent({
51+
className,
52+
children,
53+
...props
54+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
55+
return (
56+
<AccordionPrimitive.Content
57+
data-slot="accordion-content"
58+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
59+
{...props}
60+
>
61+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
62+
</AccordionPrimitive.Content>
63+
)
64+
}
65+
66+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"@radix-ui/react-accordion": "^1.2.11",
1213
"@radix-ui/react-separator": "^1.1.7",
1314
"@radix-ui/react-slot": "^1.2.3",
1415
"@shikijs/transformers": "^3.4.2",

0 commit comments

Comments
 (0)