AW-119-personal-video-edits
add video preview and change loading on /v1/onboarding page
This commit is contained in:
parent
c07a1a9724
commit
005b44324a
BIN
public/personal_video_preview.webp
Normal file
BIN
public/personal_video_preview.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 482 KiB |
@ -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(() => {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user