diff --git a/src/web/package.json b/src/web/package.json index f86af01..82eb049 100644 --- a/src/web/package.json +++ b/src/web/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "next dev", "build": "next build", - "start": "next start", + "start": "next start --hostname 0.0.0.0", "lint": "next lint" }, "dependencies": { diff --git a/src/web/public/glb/flamingo.glb b/src/web/public/glb/flamingo.glb new file mode 100644 index 0000000..2135fc0 Binary files /dev/null and b/src/web/public/glb/flamingo.glb differ diff --git a/src/web/public/glb/parrot.glb b/src/web/public/glb/parrot.glb new file mode 100644 index 0000000..2ea9e58 Binary files /dev/null and b/src/web/public/glb/parrot.glb differ diff --git a/src/web/public/glb/stork.glb b/src/web/public/glb/stork.glb new file mode 100644 index 0000000..1358255 Binary files /dev/null and b/src/web/public/glb/stork.glb differ diff --git a/src/web/src/components/Bird.jsx b/src/web/src/components/Bird.jsx new file mode 100644 index 0000000..055ae62 --- /dev/null +++ b/src/web/src/components/Bird.jsx @@ -0,0 +1,39 @@ +import { useEffect } from "react"; +import { useFrame } from "@react-three/fiber"; +import { useAnimations, useGLTF } from "@react-three/drei"; + +export default function Bird({ speed, factor, url, ...props }) { + const { nodes, animations } = useGLTF(url); + const { ref, mixer } = useAnimations(animations); + + useEffect( + () => void mixer.clipAction(animations[0], ref.current).play(), + [mixer, animations, ref], + ); + + useFrame((state, delta) => { + ref.current.rotation.y += + Math.sin((delta * factor) / 2) * Math.cos((delta * factor) / 2) * 1.5; + mixer.update(delta * speed); + }); + + return ( + + + + + + + + + ); +} diff --git a/src/web/src/components/hero.jsx b/src/web/src/components/hero.jsx index 6162bc9..01c3822 100644 --- a/src/web/src/components/hero.jsx +++ b/src/web/src/components/hero.jsx @@ -1,8 +1,9 @@ -"use client"; +use client"; import { Suspense, useMemo } from "react"; import { Canvas } from "@react-three/fiber"; import { motion, AnimatePresence } from "framer-motion"; import { useState, useEffect } from "react"; +import { OrbitControls } from "@react-three/drei"; import Bird from "@/components/Bird"; function HeroSection1() { @@ -40,6 +41,7 @@ function HeroSection1() { + {birds.map((props) => (