Command Palette

Search for a command to run...

Docs
Ripple Distortion

Ripple Distortion

An interactive image distortion effect with mouse-driven ripples using Three.js

Installation

Usage

import RippleDistortion from "@/components/ruixen/ripple-distortion";
 
export default function App() {
  return (
    <div className="relative h-screen w-full">
      <RippleDistortion
        imageSrc="/path/to/your/image.jpg"
        frequency={30.0}
        amplitude={0.02}
        speed={5.0}
        className="w-full h-full"
      />
      <div className="relative z-10">{/* Your content here */}</div>
    </div>
  );
}

Props

PropTypeDefaultDescription
imageSrcstring-Path to the image to be distorted
frequencynumber30.0Frequency of the ripple waves
amplitudenumber0.02Amplitude/strength of the distortion effect
speednumber5.0Speed of the ripple animation
classNamestring""Additional CSS classes

Features

  • Interactive: Ripples follow mouse movement
  • WebGL Powered: Uses Three.js for smooth performance
  • Customizable: Adjustable wave properties
  • Responsive: Automatically adapts to container size