This commit is contained in:
19
components/GradientBG.tsx
Normal file
19
components/GradientBG.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { useEffect } from 'react'
|
||||
import { Gradient } from '../Gradient.js'
|
||||
|
||||
|
||||
export const GradientBG = () =>{
|
||||
// Create your instance
|
||||
const gradient = new Gradient();
|
||||
|
||||
useEffect(() => {
|
||||
// Call `initGradient` with the selector to your canvas
|
||||
gradient.initGradient('#gradient-background')
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<canvas className='-z-40 w-screen h-screen fixed top-0 left-0' id="gradient-background" data-transition-in />
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user