mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-20 16:45:10 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { useContext, useEffect, useState } from "react"
|
|
import { EngineContext } from "../../contexts/EngineContext"
|
|
|
|
import { LoadingDotsTyping } from "~/components";
|
|
export const PreviewEngineCamera = ()=>{
|
|
const editorEngine = useContext(EngineContext);
|
|
//take data from egine context
|
|
|
|
const [showLoader, setShowLoader] = useState<boolean>(true);
|
|
useEffect(()=>{
|
|
setTimeout(()=>setShowLoader(false), 5000);
|
|
},[]);
|
|
return (
|
|
<div
|
|
id="preview-engine-camera"
|
|
className="absolute bottom-0 w-30 m-4"
|
|
>
|
|
<div className="relative">
|
|
<div
|
|
className="text-white bg-ui-panel pt-1 px-2 pb-3 -z-10 rounded-t-lg -mb-2 w-fit"
|
|
>
|
|
<p>Camera View</p>
|
|
</div>
|
|
<div className="relative rounded-lg border border-white box overflow-hidden">
|
|
|
|
<canvas className="aspect-video max-h-40" id="camera-view"></canvas>
|
|
<div className="absolute w-full h-full top-0 left-0">
|
|
<LoadingDotsTyping isShowing={showLoader}/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
} |