Create a custom Elementor widget named “Ripple Effect Image” with the following requirements:
1. Functionality:
- Implement a WebGL-based liquid ripple distortion effect on image hover using Three.js.
- The effect should be driven by mouse movement, creating fluid, water-like ripples that distort the background image.
- Ensure the effect is smooth and performs well.
2. Content Controls:
- Image: Media control to upload the background image.
- Title: Text control for a main heading overlay (centered).
- Subtitle: Text control for a sub-heading overlay (centered).
3. Settings Controls (Sliders):
- Ripple Intensity: Control the strength/amplitude of the distortion.
- Speed: Control the animation speed of the ripples.
4. Style Controls:
- Dimensions: Width and Height controls for the widget container (responsive).
- Typography: Standard Elementor typography controls for the Title.
- Colors: Color control for the Title text.
5. Technical Implementation:
Use Three.js (load from CDN) for the rendering.
Implement proper resizing logic to ensure the image covers the container aspect ratio (like CSS object-fit: cover) without distortion or cutting off.
- Use standard Elementor widget structure (PHP class,
rendermethod, JS handler). - Ensure all assets (CSS/JS) are enqueued correctly and only when the widget is used.