This commit is contained in:
@@ -3,12 +3,15 @@ import { Gradient } from '../Gradient.js'
|
|||||||
|
|
||||||
|
|
||||||
export const GradientBG = () =>{
|
export const GradientBG = () =>{
|
||||||
// Create your instance
|
|
||||||
const gradient = new Gradient();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Call `initGradient` with the selector to your canvas
|
// Call `initGradient` with the selector to your canvas
|
||||||
gradient.initGradient('#gradient-background')
|
const canvasElement = document.getElementById("gradient-background");
|
||||||
|
const gradient: any = new Gradient();
|
||||||
|
if (canvasElement) {
|
||||||
|
gradient.initGradient("#gradient-background");
|
||||||
|
} else {
|
||||||
|
gradient.pause();
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user