Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/liaoyio/suburbia-landing-page

使用 Next.js 15、GSAP、Prismic、Three.js、Tailwind 和 TypeScript 构建 3D 滑板官网!
https://github.com/liaoyio/suburbia-landing-page

gsap nextjs threejs

Last synced: 8 days ago
JSON representation

使用 Next.js 15、GSAP、Prismic、Three.js、Tailwind 和 TypeScript 构建 3D 滑板官网!

Awesome Lists containing this project

README

        

# 🛹 Suburbia Skateboards

**使用 Next.js 15、GSAP、Prismic、Three.js、Tailwind 和 TypeScript 构建 3D 滑板官网!**


![](./public/build-preview.png)


![](./public/preview.png)

## 特性

本项目将为虚构滑板品牌 Suburbia Skateboards 搭建精美交互官网。

- [x] 🔌 [Next.js 15 (App Router)](https://nextjs.org)
- [x] 🎰 [React 19](https://react.dev)
- [x] 💡 [TypeScript](https://typescriptlang.org)
- [x] 🎨 [Tailwind CSS](https://tailwindcss.com)
- [x] 🧩 [Prismic (CMS)](https://prismic.io/)
- [x] ✨ [GSAP (animation)](https://gsap.com/docs/)
- [x] 🪅 [matter-js (2D)](http://brm.io/matter-js/)
- [x] 📸 [Three.js (React))](https://github.com/pmndrs/react-three-fiber)
- [x] 📦 [Netlify (deploy)](https://www.netlify.com/)

使用 Next.js 15、Tailwind CSS 和 Prismic,将Three.js集成到React中实现3D交互效果,最终托管在 Netlify 上。

## Notes

> Youtube 视频教程 🔗: https://www.youtube.com/watch?v=LBOhVng5rk8

### 使用 Prismic

![](./public/Notes/start1.png)


![](./public/Notes/start2.png)


![](./public/Notes/start3.gif)


![](./public/Notes/start4.png)


![](./public/Notes/start5.png)


![](./public/Notes/start6.png)


![](./public/Notes/start7.png)


![](./public/Notes/start8.png)


![](./public/Notes/start9.png)


![](./public/Notes/start10.png)


### 创建 Hero

#### 1. 切片新增字段:

![](./public/Notes/hero-01.png)

#### 2. 在页面使用:

![](./public/Notes/hero-02.png)

🟩 编辑 `src/slices/Hero/index.tsx` 文件:

```tsx
import type { Content } from '@prismicio/client'
import type { JSX } from 'react'
import { PrismicNextLink } from '@prismicio/next'
import { PrismicRichText, type SliceComponentProps } from '@prismicio/react'

/**
* Props for `Hero`.
*/
export type HeroProps = SliceComponentProps

/**
* Component for "Hero" Slices.
*/
export default function Hero({ slice }: HeroProps): JSX.Element {
return (





Click


)
}
```

#### 3. 快速预览 (模拟)

![](./public/Notes/hero-03.png)

点击右上角 Simulate 按钮,可以快速预览样式

🟩 此时我们将页面 heading 设置为了红色,如果你发现样式并没有被添加,需要在 `tailwind.config.ts` 文件设置 `content` 包含 `./src/slices` 文件

```ts
import type { Config } from 'tailwindcss'

export default {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
'./src/slices/**/*.{js,ts,jsx,tsx,mdx}',
],
// ...
} satisfies Config
```

![](./public/Notes/hero-04.png)
回到项目,刷新两次或三次页面,数据就能同步到本地项目了。

![](./public/Notes/hero-05.png)

### 滑板定制页面

![](./public/Notes/build-page.png)

#### 部署

![](./public/Notes/deploy-01.png)


![](./public/Notes/deploy-02.png)