diff --git a/components/elements/ContactThreeJsComponent.jsx b/components/elements/ContactThreeJsComponent.jsx index c317b00..9a07f00 100644 --- a/components/elements/ContactThreeJsComponent.jsx +++ b/components/elements/ContactThreeJsComponent.jsx @@ -9,12 +9,21 @@ import { DotScreenShader } from "three/examples/jsm/shaders/DotScreenShader.js"; const ContactThreeJsComponent = React.memo(() => { const [isMounted, setIsMounted] = useState(false); const mountRef = useRef(null); + const [webGLSupported, setWebGLSupported] = useState(true); useEffect(() => { setIsMounted(true); if (isMounted) { console.log("useEffect called"); + + if (!checkWebGLSupport()) { + // Handle browsers that do not support WebGL + console.error("WebGL not supported"); + setWebGLSupported(false); + return; + } + let camera, renderer, composer; let object; @@ -106,7 +115,29 @@ const ContactThreeJsComponent = React.memo(() => { } }, [isMounted]); - return
; + const checkWebGLSupport = () => { + try { + const canvas = document.createElement("canvas"); + return !!( + window.WebGLRenderingContext && + (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")) + ); + } catch (e) { + return false; + } + }; + + return ( +
+ {!webGLSupported && ( + webgl is disabled in your browser + )} +
+ ); }); export default ContactThreeJsComponent; diff --git a/components/layouts/ContactFormSection.jsx b/components/layouts/ContactFormSection.jsx index e4ce54a..ff39c0f 100644 --- a/components/layouts/ContactFormSection.jsx +++ b/components/layouts/ContactFormSection.jsx @@ -1,30 +1,24 @@ import ContactButton from "../buttons/ContactButton.jsx"; import ContactThreeJsComponent from "../elements/ContactThreeJsComponent.jsx"; -const ContactFormSection = ({ - text, - buttonText, - email, -}) => { +const ContactFormSection = ({ text, buttonText, email }) => { return ( <> -
-
- - -
-
-
-

{text}

+
+
+
-
- +
+
+

+ {text} +

+
+
+ +
-
); }; diff --git a/public/shilohlogowhite.png b/public/shilohlogowhite.png deleted file mode 100644 index 4143938..0000000 Binary files a/public/shilohlogowhite.png and /dev/null differ diff --git a/public/web-gl-fallback.png b/public/web-gl-fallback.png new file mode 100644 index 0000000..7393fba Binary files /dev/null and b/public/web-gl-fallback.png differ