diff --git a/README.md b/README.md index ca8a3a2..78234ae 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,4 @@ To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! \ No newline at end of file diff --git a/components/buttons/ContactButton.jsx b/components/buttons/ContactButton.jsx index 20d1e90..b7287bc 100644 --- a/components/buttons/ContactButton.jsx +++ b/components/buttons/ContactButton.jsx @@ -1,16 +1,7 @@ -import { useState } from 'react'; +import React from 'react'; -const ContactButton = ({ buttonText, email }) => { - const [hovered, setHovered] = useState(false); - const [copied, setCopied] = useState(false); - - const handleHover = () => { - setHovered(true); - }; - - const handleMouseLeave = () => { - setHovered(false); - }; +function ContactButton({ buttonText, email }) { + const [copied, setCopied] = React.useState(false); const handleClick = () => { navigator.clipboard.writeText(email); @@ -22,18 +13,13 @@ const ContactButton = ({ buttonText, email }) => { return ( ); -}; +} -export default ContactButton; +export default ContactButton; \ No newline at end of file diff --git a/components/elements/ContactThreeJsComponent.jsx b/components/elements/ContactThreeJsComponent.jsx index dcf0977..c317b00 100644 --- a/components/elements/ContactThreeJsComponent.jsx +++ b/components/elements/ContactThreeJsComponent.jsx @@ -38,9 +38,9 @@ const ContactThreeJsComponent = React.memo(() => { object = new THREE.Object3D(); scene.add(object); - const geometry = new THREE.BoxGeometry(50, 50, 50); + const geometry = new THREE.DodecahedronGeometry(30, 0); // Larger dodecahedron geometry const material = new THREE.MeshPhongMaterial({ - color: 0xffd700, + color: 0x999999, flatShading: true, }); @@ -49,11 +49,11 @@ const ContactThreeJsComponent = React.memo(() => { mesh.position .set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5) .normalize(); - mesh.position.multiplyScalar(Math.random() * 400); + mesh.position.multiplyScalar(Math.random() * 800); mesh.rotation.set( - Math.random() * 2, - Math.random() * 2, - Math.random() * 2 + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2 ); mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 2; object.add(mesh); diff --git a/components/layouts/Section.jsx b/components/layouts/Section.jsx index 36e3dfa..ab7e71f 100644 --- a/components/layouts/Section.jsx +++ b/components/layouts/Section.jsx @@ -1,115 +1,66 @@ import React, { useEffect, useRef, useState } from "react"; import VideoButton from "../buttons/VideoButton.jsx"; -import Link from "next/link"; -const Section = ({ +function Section({ videoUrl, text, + headingLevel = 1, buttonVideoURL, buttonOneText, - buttonTwoText, - buttonLink = "/", - headingLevel = 1, -}) => { +}) { const videoRef = useRef(null); const [isPlaying, setIsPlaying] = useState(false); - const [hasInteracted, setHasInteracted] = useState(false); useEffect(() => { - const options = { - root: null, - rootMargin: "0px", - threshold: 0.5, - }; + const playPromise = videoRef.current?.play(); - const observer = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { + if (playPromise) { + playPromise + .then(() => { setIsPlaying(true); - if (!isMobile) { - videoRef.current?.play(); - } - } else { - setIsPlaying(false); - videoRef.current?.pause(); - } - }); - }, options); - - if (videoRef.current) { - observer.observe(videoRef.current); + }) + .catch((error) => { + console.error("Play error:", error); + }); } return () => { if (videoRef.current) { - observer.unobserve(videoRef.current); + videoRef.current.pause(); } }; }, []); - let isMobile = false; - if (typeof window !== "undefined") { - isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); + if (headingLevel <= 0 || headingLevel >= 7) { + throw new Error("Invalid heading level"); } - const Heading = headingLevel === 1 ? "h1" : "h2"; + const Heading = `h${headingLevel}`; return (