For Tailwind CSS v3 docs, click here.

粒子漩涡

一个带有粒子旋转的动画背景。

通过 CLI 安装

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/bg-particle-whirlpool.json"

手动安装

Install the dependencies

npm
pnpm
bun
yarn
npm install three postprocessing
npm install -D @types/three

复制并粘贴以下代码:

ParticleWhirlpoolBg.vue

示例

Without blur and overlay

With particleCount 500

API

Prop 名称类型默认值描述
classstring""Additional CSS classes for custom styling.
blurnumber0Amount of blur to apply to the background, specified in pixels.
particleCountnumber2000Number of particles in the whirlpool animation.

功能特性

  • Interactive Whirlpool Animation: Renders a captivating whirlpool effect with particles that respond to mouse and touch interactions.
  • Customizable Particle Count: Adjust the particleCount prop to control the number of particles in the animation.
  • Dynamic Blur Effect: Use the blur prop to apply a blur effect over the background, enhancing the visual depth.
  • Slot Support: Overlay additional content on top of the animation using the default slot.
  • Responsive Design: The component adjusts to fit the width and height of its parent container, ensuring compatibility across different screen sizes.

感谢

  • Built with the Three.js library for 3D rendering and animations.
  • Inspired by TroisJs