/** * Intro */ import React, { useState, useCallback } from "react"; import Vimeo from "@u-wave/react-vimeo"; export default function Intro({ onComplete }) { const [done, setDone] = useState(false); const [playing, setPlaying] = useState(false); const [player, setPlayer] = useState(false); const [videoSize] = useState(coverWindow()); const handleClose = useCallback(() => { setDone(true); setTimeout(() => { onComplete(); }, 200); }, []); return (
{ setPlaying(true); player.play(); }} />
); } /* */ const coverWindow = () => { const videoRatio = 1.777; const screenRatio = window.innerWidth / window.innerHeight; if (screenRatio > videoRatio) { return { width: "100vw", height: 100 * 1.777 + "vh" }; } else { return { width: "177vh", height: "100vh" }; } };