forked from emre/www_projectmycelium_com
- Changed cube gradient colors from cyan to blue for better visual consistency - Updated glow effects and shadows to use blue (rgba(59, 130, 246)) instead of cyan - Modified background aura gradients in StackSection for enhanced depth perception - Replaced HomeFeaturesDark component with new HomeSlider in HomePage layout - Added isolate property to StackSection to prevent gradient bleeding - Enhanced background layer in StackSection with additional
24 lines
603 B
TypeScript
24 lines
603 B
TypeScript
import React, { useEffect } from "react";
|
|
|
|
export const useOutsideClick = (
|
|
ref: React.RefObject<HTMLDivElement>,
|
|
callback: Function
|
|
) => {
|
|
useEffect(() => {
|
|
const listener = (event: any) => {
|
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
return;
|
|
}
|
|
callback(event);
|
|
};
|
|
|
|
document.addEventListener("mousedown", listener);
|
|
document.addEventListener("touchstart", listener);
|
|
|
|
return () => {
|
|
document.removeEventListener("mousedown", listener);
|
|
document.removeEventListener("touchstart", listener);
|
|
};
|
|
}, [ref, callback]);
|
|
};
|