shaderz 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +208 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/package.json +51 -0
- package/shaders/CosmicNebulaShader.tsx +265 -0
- package/shaders/GlassTwistShader.tsx +169 -0
- package/shaders/GlossyRibbonShader.tsx +164 -0
- package/shaders/GradientWavesShader.tsx +277 -0
- package/shaders/LiquidOrangeShader.tsx +246 -0
- package/shaders/NeonFluidShader.tsx +259 -0
- package/shaders/OceanWavesShader.tsx +229 -0
- package/shaders/PlasmaShader.tsx +174 -0
- package/shaders/SilkFlowShader.tsx +281 -0
- package/shaders/VideoBackground.tsx +37 -0
- package/videos/glossy-film.mp4 +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
interface VideoBackgroundProps {
|
|
5
|
+
src: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const VideoBackground: React.FC<VideoBackgroundProps> = ({ src, className = '' }) => {
|
|
10
|
+
const videoRef = useRef<HTMLVideoElement>(null);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const video = videoRef.current;
|
|
14
|
+
if (video) {
|
|
15
|
+
video.play().catch((error) => {
|
|
16
|
+
console.log('Autoplay prevented:', error);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, [src]);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<video
|
|
23
|
+
ref={videoRef}
|
|
24
|
+
autoPlay
|
|
25
|
+
loop
|
|
26
|
+
muted
|
|
27
|
+
playsInline
|
|
28
|
+
className={`absolute inset-0 w-full h-full object-cover ${className}`}
|
|
29
|
+
style={{ zIndex: -1 }}
|
|
30
|
+
>
|
|
31
|
+
<source src={src} type="video/mp4" />
|
|
32
|
+
Your browser does not support the video tag.
|
|
33
|
+
</video>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default VideoBackground;
|
|
Binary file
|