diff --git a/frontend/src/lib/components/AnnotationLayer.svelte b/frontend/src/lib/components/AnnotationLayer.svelte index 2afe3b47..cb862772 100644 --- a/frontend/src/lib/components/AnnotationLayer.svelte +++ b/frontend/src/lib/components/AnnotationLayer.svelte @@ -14,6 +14,7 @@ let { color, blockNumbers = {}, activeAnnotationId = null, + dimmed = false, onDraw, onAnnotationClick }: { @@ -22,6 +23,7 @@ let { color: string; blockNumbers?: Record; activeAnnotationId?: string | null; + dimmed?: boolean; onDraw: (rect: DrawRect) => void; onAnnotationClick?: (id: string) => void; } = $props(); @@ -123,15 +125,15 @@ const containerStyle = $derived( top: {annotation.y * 100}%; width: {annotation.width * 100}%; height: {annotation.height * 100}%; - background-color: {hexToRgba(annotation.color, hoveredId === annotation.id || annotation.id === activeAnnotationId ? 0.5 : 0.3)}; - box-shadow: {annotation.id === activeAnnotationId ? `inset 0 0 0 2px ${hexToRgba(annotation.color, 0.8)}` : hoveredId === annotation.id ? `inset 0 0 0 2px ${hexToRgba(annotation.color, 0.8)}` : 'none'}; - opacity: {activeAnnotationId && annotation.id !== activeAnnotationId ? 0.3 : 1}; + background-color: {hexToRgba(annotation.color, dimmed ? 0.3 : (hoveredId === annotation.id || annotation.id === activeAnnotationId ? 0.5 : 0.3))}; + box-shadow: {dimmed ? 'none' : (annotation.id === activeAnnotationId ? `inset 0 0 0 2px ${hexToRgba(annotation.color, 0.8)}` : hoveredId === annotation.id ? `inset 0 0 0 2px ${hexToRgba(annotation.color, 0.8)}` : 'none')}; + opacity: {dimmed ? 1 : (activeAnnotationId && annotation.id !== activeAnnotationId ? 0.3 : 1)}; pointer-events: auto; cursor: pointer; transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease; " > - {#if blockNumbers[annotation.id]} + {#if !dimmed && blockNumbers[annotation.id]}