|
1 | | -import Image from 'next/image' |
2 | | -import { Inter } from '@next/font/google' |
3 | | -import styles from './page.module.css' |
4 | | -import Particles from './particles' |
| 1 | +"use client"; |
5 | 2 |
|
6 | | -const inter = Inter({ subsets: [ 'latin' ] }) |
| 3 | +import Image from "next/image"; |
| 4 | +import { Inter } from "@next/font/google"; |
| 5 | +import styles from "./page.module.css"; |
| 6 | +import Particles from "./particles"; |
| 7 | +import { useParticlesPlugins } from "@tsparticles/react"; |
| 8 | +import { loadFull } from "tsparticles"; |
| 9 | +import { Engine } from "@tsparticles/engine"; |
| 10 | + |
| 11 | +const inter = Inter({ subsets: ["latin"] }); |
7 | 12 |
|
8 | 13 | export default function Home() { |
9 | | - return ( |
10 | | - <main className={styles.main}> |
11 | | - <Particles id="tsparticles" /> |
12 | | - <div className={styles.description}> |
13 | | - <p> |
14 | | - Get started by editing |
15 | | - <code className={styles.code}>app/page.tsx</code> |
16 | | - </p> |
17 | | - <div> |
18 | | - <a |
19 | | - href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
20 | | - target="_blank" |
21 | | - rel="noopener noreferrer" |
22 | | - > |
23 | | - By{' '} |
24 | | - <Image |
25 | | - src="/vercel.svg" |
26 | | - alt="Vercel Logo" |
27 | | - className={styles.vercelLogo} |
28 | | - width={100} |
29 | | - height={24} |
30 | | - priority |
31 | | - /> |
32 | | - </a> |
33 | | - </div> |
34 | | - </div> |
| 14 | + const { done } = useParticlesPlugins(async (engine: Engine) => { |
| 15 | + await loadFull(engine); |
| 16 | + }); |
| 17 | + |
| 18 | + return ( |
| 19 | + <main className={styles.main}> |
| 20 | + <Particles id="tsparticles" done={done} /> |
| 21 | + <div className={styles.description}> |
| 22 | + <p> |
| 23 | + Get started by editing |
| 24 | + <code className={styles.code}>app/page.tsx</code> |
| 25 | + </p> |
| 26 | + <div> |
| 27 | + <a |
| 28 | + href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
| 29 | + target="_blank" |
| 30 | + rel="noopener noreferrer" |
| 31 | + > |
| 32 | + By{" "} |
| 33 | + <Image |
| 34 | + src="/vercel.svg" |
| 35 | + alt="Vercel Logo" |
| 36 | + className={styles.vercelLogo} |
| 37 | + width={100} |
| 38 | + height={24} |
| 39 | + priority |
| 40 | + /> |
| 41 | + </a> |
| 42 | + </div> |
| 43 | + </div> |
35 | 44 |
|
36 | | - <div className={styles.center}> |
37 | | - <Image |
38 | | - className={styles.logo} |
39 | | - src="/next.svg" |
40 | | - alt="Next.js Logo" |
41 | | - width={180} |
42 | | - height={37} |
43 | | - priority |
44 | | - /> |
45 | | - <div className={styles.thirteen}> |
46 | | - <Image src="/thirteen.svg" alt="13" width={40} height={31} priority/> |
47 | | - </div> |
48 | | - </div> |
| 45 | + <div className={styles.center}> |
| 46 | + <Image |
| 47 | + className={styles.logo} |
| 48 | + src="/next.svg" |
| 49 | + alt="Next.js Logo" |
| 50 | + width={180} |
| 51 | + height={37} |
| 52 | + priority |
| 53 | + /> |
| 54 | + <div className={styles.thirteen}> |
| 55 | + <Image src="/thirteen.svg" alt="13" width={40} height={31} priority /> |
| 56 | + </div> |
| 57 | + </div> |
49 | 58 |
|
50 | | - <div className={styles.grid}> |
51 | | - <a |
52 | | - href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
53 | | - className={styles.card} |
54 | | - target="_blank" |
55 | | - rel="noopener noreferrer" |
56 | | - > |
57 | | - <h2 className={inter.className}> |
58 | | - Docs <span>-></span> |
59 | | - </h2> |
60 | | - <p className={inter.className}> |
61 | | - Find in-depth information about Next.js features and API. |
62 | | - </p> |
63 | | - </a> |
| 59 | + <div className={styles.grid}> |
| 60 | + <a |
| 61 | + href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
| 62 | + className={styles.card} |
| 63 | + target="_blank" |
| 64 | + rel="noopener noreferrer" |
| 65 | + > |
| 66 | + <h2 className={inter.className}> |
| 67 | + Docs <span>-></span> |
| 68 | + </h2> |
| 69 | + <p className={inter.className}> |
| 70 | + Find in-depth information about Next.js features and API. |
| 71 | + </p> |
| 72 | + </a> |
64 | 73 |
|
65 | | - <a |
66 | | - href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
67 | | - className={styles.card} |
68 | | - target="_blank" |
69 | | - rel="noopener noreferrer" |
70 | | - > |
71 | | - <h2 className={inter.className}> |
72 | | - Templates <span>-></span> |
73 | | - </h2> |
74 | | - <p className={inter.className}>Explore the Next.js 13 playground.</p> |
75 | | - </a> |
| 74 | + <a |
| 75 | + href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
| 76 | + className={styles.card} |
| 77 | + target="_blank" |
| 78 | + rel="noopener noreferrer" |
| 79 | + > |
| 80 | + <h2 className={inter.className}> |
| 81 | + Templates <span>-></span> |
| 82 | + </h2> |
| 83 | + <p className={inter.className}>Explore the Next.js 13 playground.</p> |
| 84 | + </a> |
76 | 85 |
|
77 | | - <a |
78 | | - href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
79 | | - className={styles.card} |
80 | | - target="_blank" |
81 | | - rel="noopener noreferrer" |
82 | | - > |
83 | | - <h2 className={inter.className}> |
84 | | - Deploy <span>-></span> |
85 | | - </h2> |
86 | | - <p className={inter.className}> |
87 | | - Instantly deploy your Next.js site to a shareable URL with Vercel. |
88 | | - </p> |
89 | | - </a> |
90 | | - </div> |
91 | | - </main> |
92 | | - ) |
| 86 | + <a |
| 87 | + href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" |
| 88 | + className={styles.card} |
| 89 | + target="_blank" |
| 90 | + rel="noopener noreferrer" |
| 91 | + > |
| 92 | + <h2 className={inter.className}> |
| 93 | + Deploy <span>-></span> |
| 94 | + </h2> |
| 95 | + <p className={inter.className}> |
| 96 | + Instantly deploy your Next.js site to a shareable URL with Vercel. |
| 97 | + </p> |
| 98 | + </a> |
| 99 | + </div> |
| 100 | + </main> |
| 101 | + ); |
93 | 102 | } |
0 commit comments