import { motion } from 'framer-motion'; import { useRef, useEffect } from 'react'; function EnterToFloorTwo(props) { const vd = useRef(null); const opacity = props.opacity || 0; if (opacity == 1) { setTimeout(() => { vd.current.play(); }, 100); } useEffect(() => { vd.current.addEventListener('ended', () => { setTimeout(() => { vd.current.currentTime = 0; }, 1000); }); }, []); return ( ); } export default EnterToFloorTwo;