diff --git a/src/TimelineSeg.jsx b/src/TimelineSeg.jsx index 6f00e444..6fd764e9 100644 --- a/src/TimelineSeg.jsx +++ b/src/TimelineSeg.jsx @@ -8,66 +8,54 @@ const TimelineSeg = ({ isCutRangeValid, duration: durationRaw, cutStartTime, cutEndTime, apparentCutStart, apparentCutEnd, isActive, segNum, onSegClick, color, }) => { - const markerWidth = 4; const duration = durationRaw || 1; - const cutSectionWidth = `calc(${((apparentCutEnd - apparentCutStart) / duration) * 100}% - ${markerWidth * 2}px)`; + const cutSectionWidth = `${((apparentCutEnd - apparentCutStart) / duration) * 100}%`; + const markerWidth = 4; const startTimePos = `${(apparentCutStart / duration) * 100}%`; - const endTimePos = `${(apparentCutEnd / duration) * 100}%`; const markerBorder = isActive ? `2px solid ${color.lighten(0.5).string()}` : undefined; + const backgroundColor = isActive ? color.lighten(0.5).alpha(0.5).string() : color.alpha(0.5).string(); const markerBorderRadius = 5; const startMarkerStyle = { - background: color.alpha(0.5).string(), width: markerWidth, - left: startTimePos, borderLeft: markerBorder, borderTopLeftRadius: markerBorderRadius, borderBottomLeftRadius: markerBorderRadius, }; const endMarkerStyle = { - background: color.alpha(0.5).string(), width: markerWidth, - marginLeft: -markerWidth, - left: endTimePos, borderRight: markerBorder, borderTopRightRadius: markerBorderRadius, borderBottomRightRadius: markerBorderRadius, }; - const cutSectionStyle = { - background: color.alpha(0.5).string(), - marginLeft: markerWidth, - left: startTimePos, - width: cutSectionWidth, - }; const onThisSegClick = () => onSegClick(segNum); return ( - // eslint-disable-next-line react/jsx-fragments -
+ {cutStartTime !== undefined && ( -
+
)} {isCutRangeValid && (cutStartTime !== undefined || cutEndTime !== undefined) && ( - )} {cutEndTime !== undefined && ( -
+
)} -
+ ); }; diff --git a/src/main.css b/src/main.css index 3d504c84..af026a53 100644 --- a/src/main.css +++ b/src/main.css @@ -73,25 +73,6 @@ input, button, textarea, :focus { background-color: #444; } -.timeline-wrapper .current-time, .timeline-wrapper .cut-section, .timeline-wrapper .cut-time-marker { - position: absolute; - bottom: 0; - top: 0; -} - -.timeline-wrapper .cut-section { - z-index: 1; -} -.timeline-wrapper .cut-time-marker { - z-index: 2; - box-sizing: border-box; -} -.timeline-wrapper .current-time { - z-index: 3; - background-color: rgba(255, 255, 255, 1); - width: 1px; -} - .help-sheet { background: #525252; color: white; diff --git a/src/renderer.jsx b/src/renderer.jsx index 0a26f9e3..06511f85 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -1019,7 +1019,7 @@ const App = memo(() => { >
- {currentTimePos !== undefined &&
} + {currentTimePos !== undefined &&
} {cutSegments.map((seg, i) => (