From 298b9fc13f5e5ff5a1432c2cf2c76c8f65643c62 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 31 Mar 2024 23:29:19 -0500 Subject: [PATCH] pixel alignment, better outlines, and more figma matching --- web/src/App.tsx | 2 +- web/src/components/timeline/EventSegment.tsx | 14 ++--- web/src/views/events/EventView.tsx | 60 +++++++++++--------- web/src/views/events/RecordingView.tsx | 2 +- 4 files changed, 41 insertions(+), 37 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index c50c53307..743d98711 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -31,7 +31,7 @@ function App() { {isMobile && }
diff --git a/web/src/components/timeline/EventSegment.tsx b/web/src/components/timeline/EventSegment.tsx index 08a78a30b..7f8d0f72c 100644 --- a/web/src/components/timeline/EventSegment.tsx +++ b/web/src/components/timeline/EventSegment.tsx @@ -170,24 +170,20 @@ export function EventSegment({ const segmentClick = useCallback(() => { if (contentRef.current && startTimestamp) { const element = contentRef.current.querySelector( - `[data-segment-start="${startTimestamp - segmentDuration}"]`, + `[data-segment-start="${startTimestamp - segmentDuration}"] .review-item-ring`, ); if (element instanceof HTMLElement) { scrollIntoView(element, { scrollMode: "if-needed", behavior: "smooth", }); - element.classList.add( - `outline-severity_${severityType}`, - `shadow-severity_${severityType}`, - ); - element.classList.add("outline-3"); - element.classList.remove("outline-0"); + element.classList.add(`outline-severity_${severityType}`); + element.classList.remove("outline-transparent"); // Remove the classes after a short timeout setTimeout(() => { - element.classList.remove("outline-3"); - element.classList.add("outline-0"); + element.classList.remove(`outline-severity_${severityType}`); + element.classList.add("outline-transparent"); }, 3000); } diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsx index 6d49762e3..9cdbf2c03 100644 --- a/web/src/views/events/EventView.tsx +++ b/web/src/views/events/EventView.tsx @@ -206,12 +206,12 @@ export default function EventView({ return (
-
+
{isMobile && ( )} {currentItems && @@ -533,7 +533,7 @@ function DetectionReview({ data-segment-start={ alignStartDateToTimeline(value.start_time) - segmentDuration } - className={`review-item outline outline-offset-1 rounded-lg shadow-none transition-all my-1 md:my-0 ${selected ? `outline-3 outline-severity_${value.severity} shadow-severity_${value.severity}` : "outline-0 duration-500"}`} + className="review-item relative rounded-lg" >
+
); })} @@ -563,7 +566,7 @@ function DetectionReview({ )}
-
+
{reviewCameras.map((camera) => { let grow; @@ -823,30 +826,35 @@ function MotionReview({ } const detectionType = getDetectionType(camera.name); return ( - { - videoPlayersRef.current[camera.name] = controller; - }} - onClick={() => - onOpenRecording({ - camera: camera.name, - startTime: currentTime, - severity: "significant_motion", - }) - } - /> +
+ { + videoPlayersRef.current[camera.name] = controller; + }} + onClick={() => + onOpenRecording({ + camera: camera.name, + startTime: currentTime, + severity: "significant_motion", + }) + } + /> +
+
); })}
-
+
{isMobile && (