AW-119-personal-video-edits

add video preview and change loading on /v1/onboarding page
This commit is contained in:
gofnnp 2024-06-24 18:29:36 +04:00
parent c07a1a9724
commit 005b44324a
4 changed files with 13 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

View File

@ -53,14 +53,15 @@ function OnboardingPage() {
const getProgressIntervalTiming = useCallback(() => {
const generateTimeLimit = import.meta.env.AURA_PERSONAL_VIDEO_TIME_LIMIT;
if (progress < 95 || isVideoReady) {
return (onboardingTitles.length * 5000) / 100;
}
return (
const baseTiming = (onboardingTitles.length * 5000) / 100;
if (isVideoReady) return baseTiming;
const generatingVideoTiming =
(Number(generateTimeLimit) * 1000 - new Date().getTime() + createdDate) /
4
);
}, [createdDate, isVideoReady, progress]);
100;
return generatingVideoTiming < baseTiming
? baseTiming
: generatingVideoTiming;
}, [createdDate, isVideoReady]);
useEffect(() => {
progressInterval.current = setInterval(() => {

View File

@ -20,12 +20,7 @@ const PersonalVideo = React.memo<IPersonalVideoProps>(({ url, gender }) => {
};
return (
<div
className={styles.container}
style={{
backgroundColor: gender === "male" ? "#85B6FF" : "#D1ACF2",
}}
>
<div className={styles.container}>
{!isPlaying && !isError && <Loader className={styles.loader} />}
{isError && (
<PlayButton

View File

@ -4,6 +4,10 @@
position: relative;
overflow: hidden;
border-radius: 10px;
background-image: url("/personal_video_preview.webp");
background-size: contain;
background-position: 0 0;
background-repeat: no-repeat;
}
.play-button, .loader {