For Tailwind CSS v3 docs, click here.

Cosmic Portal

A breathtaking, animated 3D portal built with Three.js that features glowing rings, floating crystals, space distortion, and interdimensional streams.

API

Prop NameTypeDefaultDescription
portalComplexitynumber4Controls the complexity of the portal effects and geometry.
crystalCountnumber12Number of floating crystals in the scene.
primaryColorstring#9b59b6Main color for portal and background glow.
secondaryColorstring#3498dbSecondary color for blending and glow.
accentColorstring#e74c3cColor used for portal energy and highlight.
vortexColorstring#2ecc71Color used for swirling vortex and dimensional streams.
rotationSpeednumber0.3Speed at which objects rotate.
bloomStrengthnumber1.2Intensity of bloom postprocessing.
bloomRadiusnumber0.7Radius of the bloom effect.
bloomThresholdnumber0.2Threshold for bloom visibility.
dimensionShiftnumber4Level of dimension distortion for shader animation.

Features

  • Stunning Visuals: Animated cosmic background, glowing vortex rings, and interdimensional streams.
  • Shader Driven Effects: Unique portal burst, distortion, and pulsing animations.
  • User Controls: Zoom, rotate, and orbit around the scene using OrbitControls.
  • Postprocessing: Includes bloom and FXAA for cinematic quality.
  • Dynamic Colors: Easily shift dimensions and regenerate colors using exposed methods.
  • Exposed Actions: Call activatePortal() to trigger portal effects or shiftDimensions() to regenerate the visual style.

Installation

Ensure the following libraries are installed in your project:

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

Install using CLI

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

Install Manually

Copy and paste the following code

CosmicPortal.vue

Credits