From 9051133495eaca319033624c9cc0bfe3c167ab20 Mon Sep 17 00:00:00 2001 From: Mike Bodge Date: Fri, 27 Sep 2024 11:23:07 -0700 Subject: [PATCH] remove three card --- .../root/VideoCardsSection/ThreeCard.tsx | 176 ------------------ 1 file changed, 176 deletions(-) delete mode 100644 apps/web/src/components/base-org/root/VideoCardsSection/ThreeCard.tsx diff --git a/apps/web/src/components/base-org/root/VideoCardsSection/ThreeCard.tsx b/apps/web/src/components/base-org/root/VideoCardsSection/ThreeCard.tsx deleted file mode 100644 index db40a4ea5a..0000000000 --- a/apps/web/src/components/base-org/root/VideoCardsSection/ThreeCard.tsx +++ /dev/null @@ -1,176 +0,0 @@ -'use client'; - -import { useErrors } from 'apps/web/contexts/Errors'; -import { useCallback, useRef, useEffect, useState, useMemo } from 'react'; -import Card from 'apps/web/src/components/base-org/Card'; -import Text from 'apps/web/src/components/base-org/typography/Text'; -import Title from 'apps/web/src/components/base-org/typography/Title'; -import { TitleLevel } from 'apps/web/src/components/base-org/typography/Title/types'; -import { Canvas, useFrame } from '@react-three/fiber'; -//import { EffectComposer, Bloom, SMAA } from '@react-three/postprocessing'; -import { Environment, Lightformer, useGLTF } from '@react-three/drei'; -import * as THREE from 'three'; - -//import environmentLight from 'apps/web/src/components/ThreeHero/assets/environmentLight.jpg'; -import modelToUse from 'apps/web/src/components/ThreeHero/assets/babylon_optimize_1.glb'; - -const blue = '#105eff'; - -type VideoCardProps = { title: string; description: string; scene: string }; - -export default function VideoCard({ title, description, scene }: VideoCardProps) { - const playAnimation = () => {}; - return ( -
- -
- - {title} - - - {description} -
-
- -
-
- ); -} - -function ThreeCardScene({ scene }: { scene: string }) { - const [isVisible, setIsVisible] = useState(true); - const [isWindowFocused, setIsWindowFocused] = useState(true); - const containerRef = useRef(null); - - const handleVisibilityChange = useCallback(() => { - setIsWindowFocused(!document.hidden); - }, []); - - useEffect(() => { - document.addEventListener('visibilitychange', handleVisibilityChange); - return () => { - document.removeEventListener('visibilitychange', handleVisibilityChange); - }; - }, [handleVisibilityChange]); - - useEffect(() => { - if (!containerRef.current) return; - - const observer = new IntersectionObserver( - ([entry]) => { - setIsVisible(entry.isIntersecting); - }, - { threshold: 0.1 }, // Adjust this value as needed - ); - - observer.observe(containerRef.current); - - return () => { - observer.disconnect(); - }; - }, []); - - const isActive = isVisible && isWindowFocused; - - return ( -
- - {/* - - - */} - - - - - -
- ); -} - -function EnvironmentSetup() { - return ( - - - - - self.lookAt(0, 0, 0)} - position={[10, 10, 0]} - scale={4} - /> - - ); -} - -function ThreeModel({ scene }: { scene: string }) { - const [over, setOver] = useState(false); - const { nodes } = useGLTF(modelToUse); - const groupRef = useRef(); - - const geo = useMemo(() => { - switch (scene) { - case 'chain': - return nodes.Boole.geometry; - case 'globe': - return nodes.Globe.geometry; - case 'eth': - default: - return nodes.ETH.geometry; - } - }, []); - - useFrame(({ clock }) => { - //if (groupRef.current) { - groupRef.current.rotation.y = Math.sin(clock.getElapsedTime()); - groupRef.current.position.z = THREE.MathUtils.lerp( - groupRef.current.position.z, - over ? -0.5 : 0, - 0.1, - ); - //} - }); - - return ( - setOver(true)} - onPointerLeave={() => setOver(false)} - > - - - - - - - - - ); -}