For Tailwind CSS v3 docs, click here.

旋转半球

An interactive rotating globe component.

通过 CLI 安装

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

手动安装

Install the dependencies

npm
pnpm
bun
yarn
npm install cobe vue-use-spring

复制并粘贴以下代码:

Globe.vue

API

Prop 名称类型默认值描述
classstring""Additional CSS classes for custom styling.
configCOBEOptionsN/AConfiguration object for the globe, following COBE(https://cobe.vercel.app/docs/api) library options.
massnumber1Mass parameter for the spring animation controlling rotation inertia.
tensionnumber280Tension parameter for the spring animation, affecting responsiveness.
frictionnumber100Friction parameter for the spring animation, affecting damping.
precisionnumber0.001Precision parameter for the spring animation calculations.

功能特性

  • Interactive 3D Globe: Provides an interactive 3D globe visualization that users can rotate with mouse or touch interactions.
  • Customizable Markers: Display markers on the globe at specified locations with customizable sizes.
  • Smooth Animations: Utilizes physics-based spring animations for smooth and responsive globe rotations.
  • Configurable Appearance: Customize the globe's appearance and behavior through the config prop using COBE library options.
  • Responsive Design: Automatically adjusts to different screen sizes and resolutions.

感谢

  • Built using the cobe library for WebGL globe visualization.
  • Ported from Magic UI.