import { useState, useEffect, useRef } from "react"; export default function SquirrelHome() { const [tick, setTick] = useState(0); const [night, setNight] = useState(false); const [recording, setRecording] = useState(true); const [alert, setAlert] = useState(false); const rafRef = useRef(); const startRef = useRef(Date.now()); useEffect(() => { const loop = () => { setTick(Math.floor((Date.now() - startRef.current) / 50)); rafRef.current = requestAnimationFrame(loop); }; rafRef.current = requestAnimationFrame(loop); return () => cancelAnimationFrame(rafRef.current); }, []); useEffect(() => { setAlert(tick % 200 > 60 && tick % 200 < 110); }, [tick]); const t = tick * 0.04; const leafBob = Math.sin(t * 1.1) * 1.8; const squirrelPeek = Math.sin(t * 0.5) * 5; const blinkOpen = tick % 80 > 3; const windSway = Math.sin(t * 0.7) * 2; const skyTop = night ? "#0b1426" : "#aee6ff"; const skyBot = night ? "#1a2a1a" : "#d4f0c0"; const leaf1 = night ? "#1e3d1a" : "#3a8c2a"; const leaf2 = night ? "#254d20" : "#4aaa35"; const wd = "#4a2e1a", wm = "#6b3f20", wl = "#8b5530"; return (
{night && [...Array(35)].map((_, i) => (
))}
Wildlife Monitoring Station

๐ŸŒณ Squirrel Nest Observatory

{/* SVG Scene */} {/* Moon/Sun */} {night ? (<>) : (<>)} {/* Clouds */} {!night && } {/* Ground */} {[38,88,138,375,428,468].map((x,i)=>( ))} {/* Tree */} {/* Nest Box */} {[256,268,281,295,309,320].map((x,i)=>( ))} {/* Squirrel */} {blinkOpen ? (<> ) : (<> )} {/* Camera post */} {/* Camera */} {[-20,-12,12,20].map((x,i)=>)} RLC-810A {[[-20,28],[20,28],[-20,46],[20,46]].map(([x,y],i)=>( {night&&} ))} {/* FOV */} {/* Detection box */} {alert && } {/* Labels */} ๐Ÿ“ท REOLINK RLC-810A ๐Ÿ  NEST BOX {night?"โ—€ IR BEAM":"โ—€ FOV"} {alert && <>๐Ÿฟ ANIMAL DETECTED} {/* Info Panel */}
REOLINK
RLC-810A
{recording?"โ— REC":"โ—‹ STANDBY"} CH-01
{/* Live feed */}
๐Ÿฟ
{alert && (
ANIMAL 94%
)} {night &&
โ—‰ IR
}
{new Date().toLocaleTimeString()}
4K
{alert &&
โšก ANIMAL DETECTED
} {[["Sensor","8MP ยท 1/2.7\" CMOS"],["Resolution","3840 ร— 2160"],["Lens","2.8mm f/1.6"],["Night Vision",night?"IR Active (100ft)":"Day Color"],["Detection","Animal / Person"],["Storage","MicroSD 256GB"],["Power","PoE 802.3af"],["Rating","IP67 โœ“"]].map(([k,v])=>(
{k} {v}
))}
๐Ÿ“ Placement Guide
Mount 3โ€“5 ft from nest hole, same height. Angle slightly up. One PoE cable = power + video.
{/* Controls */}
{[ { label: recording?"โน Stop Recording":"โบ Start Recording", onClick: ()=>setRecording(v=>!v) }, { label: night?"โ˜€๏ธ Day Mode":"๐ŸŒ™ Night Mode", onClick: ()=>setNight(v=>!v) }, ].map(({ label, onClick })=>( ))}
); }