mirror of https://github.com/mifi/lossless-cut
parent
e49bfee750
commit
84535c8f8e
@ -1,39 +1,45 @@
|
||||
import React, { memo } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import Lottie from 'react-lottie-player';
|
||||
import { Button } from 'evergreen-ui';
|
||||
import { Trans } from 'react-i18next';
|
||||
|
||||
import { primaryColor } from '../colors';
|
||||
import loadingLottie from '../7077-magic-flow.json';
|
||||
|
||||
|
||||
const Loading = memo(({ text, cutProgress }) => (
|
||||
const Working = memo(({ text, cutProgress, onAbortClick }) => (
|
||||
<div style={{ position: 'absolute', zIndex: 1, bottom: 0, top: 0, left: 0, right: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<motion.div
|
||||
style={{ background: primaryColor, boxShadow: `${primaryColor} 0px 0px 20px 25px`, borderRadius: 20, paddingBottom: 15, color: 'white', textAlign: 'center', fontSize: 14 }}
|
||||
style={{ background: primaryColor, boxShadow: `${primaryColor} 0px 0px 20px 25px`, borderRadius: 60, paddingBottom: 5, color: 'white', fontSize: 14, display: 'flex', flexDirection: 'column', alignItems: 'center' }}
|
||||
initial={{ opacity: 0, scale: 0 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0, scale: 0 }}
|
||||
>
|
||||
<div style={{ width: 150, height: 150 }}>
|
||||
<div style={{ width: 150, height: 80 }}>
|
||||
<Lottie
|
||||
loop
|
||||
animationData={loadingLottie}
|
||||
play
|
||||
style={{ width: '170%', height: '130%', marginLeft: '-35%', marginTop: '-29%', pointerEvents: 'none' }}
|
||||
style={{ width: '170%', height: '210%', marginLeft: '-40%', marginTop: '-35%', pointerEvents: 'none' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 10, width: 150 }}>
|
||||
<div style={{ marginTop: 5 }}>
|
||||
{text}...
|
||||
</div>
|
||||
|
||||
{(cutProgress != null) && (
|
||||
<div style={{ marginTop: 10 }}>
|
||||
<div style={{ marginTop: 5 }}>
|
||||
{`${(cutProgress * 100).toFixed(1)} %`}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ marginTop: 5 }}>
|
||||
<Button intent="danger" onClick={onAbortClick} height={20}><Trans>Abort</Trans></Button>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
));
|
||||
|
||||
export default Loading;
|
||||
export default Working;
|
||||
Loading…
Reference in New Issue