mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-08 11:01:35 +00:00
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
import { useSignals } from "@preact/signals-react/runtime";
|
|
|
|
import { faSpinnerThird } from "@fortawesome/pro-solid-svg-icons";
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
import {
|
|
editorState,
|
|
EditorStates,
|
|
previewSrc,
|
|
} from "~/pages/PageEnigma/store/engine";
|
|
import {
|
|
timelineHeight,
|
|
sidePanelWidth,
|
|
sidePanelVisible,
|
|
} from "~/pages/PageEnigma/store";
|
|
import { pageHeight, pageWidth } from "~/store";
|
|
|
|
import { H3 } from "~/components";
|
|
|
|
export const PreviewFrameImage = () => {
|
|
useSignals();
|
|
if (editorState.value === EditorStates.PREVIEW) {
|
|
if (previewSrc.value === "") {
|
|
return (
|
|
<div
|
|
className="absolute inset-0"
|
|
style={{
|
|
width:
|
|
pageWidth.value -
|
|
(sidePanelVisible.value ? sidePanelWidth.value : 0) -
|
|
84,
|
|
height: pageHeight.value - timelineHeight.value - 68,
|
|
}}>
|
|
<div className="relative flex h-full w-full flex-col items-center justify-center gap-5">
|
|
<span className="absolute h-full w-full bg-black opacity-50" />
|
|
<FontAwesomeIcon icon={faSpinnerThird} spin size="4x" />
|
|
<H3 className="z-20 text-white">Generating Preview...</H3>
|
|
</div>
|
|
</div>
|
|
);
|
|
} else {
|
|
return (
|
|
<img
|
|
className="absolute inset-0 object-cover"
|
|
src={previewSrc.value}
|
|
id="video-scene"
|
|
style={{
|
|
width:
|
|
pageWidth.value -
|
|
(sidePanelVisible.value ? sidePanelWidth.value : 0) -
|
|
84,
|
|
height: pageHeight.value - timelineHeight.value - 68,
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
return null;
|
|
};
|