1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 19:52:44 +01:00
lossless-cut/src/InverseCutSegment.jsx
Mikael Finstad b2705bacb6 Improvements:
- Allow toggle sidebar
- Allow zoom with CTRL+mousewheel #254
- Improve performance
- modularize code
- remove standalone fontawesome
2020-02-26 11:11:28 +08:00

33 lines
1.0 KiB
JavaScript

import React, { memo } from 'react';
import { motion } from 'framer-motion';
import { FaTrashAlt, FaSave } from 'react-icons/fa';
import { mySpring } from './animations';
import { saveColor } from './colors';
const InverseCutSegment = memo(({ start, end, duration, invertCutSegments }) => (
<motion.div
style={{
position: 'absolute',
top: 0,
bottom: 0,
left: `${(start / duration) * 100}%`,
width: `${((end - start) / duration) * 100}%`,
display: 'flex',
alignItems: 'center',
pointerEvents: 'none',
}}
layoutTransition={mySpring}
>
<div style={{ flexGrow: 1, borderBottom: '1px dashed rgba(255, 255, 255, 0.3)', marginLeft: 5, marginRight: 5 }} />
{invertCutSegments ? (
<FaSave style={{ color: saveColor }} size={16} />
) : (
<FaTrashAlt style={{ color: 'rgba(255, 255, 255, 0.3)' }} size={16} />
)}
<div style={{ flexGrow: 1, borderBottom: '1px dashed rgba(255, 255, 255, 0.3)', marginLeft: 5, marginRight: 5 }} />
</motion.div>
));
export default InverseCutSegment;