Skip to content

Commit 3209ccd

Browse files
committed
Add particle simulation to page
1 parent f9ee64e commit 3209ccd

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"editor.formatOnSaveMode": "file",
1616
"mayank1513.trello-kanban.Workspace.filePath": ".tkb",
1717
"[glsl]": {
18-
"editor.defaultFormatter": "circledev.glsl-canvas"
18+
"editor.defaultFormatter": "raczzalan.webgl-glsl-editor"
1919
}
2020
}

examples/nextjs/src/app/page.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
import MyButton from "./button";
22
import { LandingPage } from "@repo/shared/dist/server";
33
import { Demo } from "@repo/shared";
4+
import { Particles } from "webgl-generative-particles/dist/react";
45

56
export const metadata = {
67
title: "Webgl Generative Particles",
78
};
89

910
/** next.js landing page */
1011
export default function Page(): JSX.Element {
12+
const theta = Math.PI / 6;
1113
return (
1214
<LandingPage title="Next.js Example">
15+
<Particles
16+
style={{ height: "300px", width: "100vw", position: "absolute", left: 0, top: 0 }}
17+
options={{
18+
maxParticles: 100_000,
19+
generationRate: 0.5,
20+
ageRange: [1.01, 1.15],
21+
angleRage: [Math.PI / 2.0 - theta, Math.PI / 2.0 + theta],
22+
speedRange: [0.6, 1.2],
23+
forceField: [0, -0.5],
24+
mouseOff: true,
25+
origin: [0, -1],
26+
}}
27+
/>
1328
<Demo />
1429
<MyButton />
1530
</LandingPage>

packages/shared/src/server/landing-page/landing-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function LandingPage({ title, children }: LandingPageProps) {
4141
<main className={styles.main}>
4242
<h1 className={styles.title}>{title}</h1>
4343
<div className={[styles.center, styles.hero].join(" ")}>
44-
<h2>Craft your next amazing library using</h2>
44+
<h2>Craft your next amazing project using</h2>
4545
<Logo href={`https://github.com/${owner}/${repo}`} />
4646
<strong>Harness the full potential of React 18 Server Components!</strong>
4747
</div>

0 commit comments

Comments
 (0)