Skip to content

Commit db4880f

Browse files
fix: FIT-747: Make Annotation tabs stand out (#8585)
Co-authored-by: ricardoantoniocm <ricardoantoniocm@users.noreply.github.com>
1 parent 99f457e commit db4880f

File tree

5 files changed

+67
-23
lines changed

5 files changed

+67
-23
lines changed

web/libs/editor/src/components/AnnotationsCarousel/AnnotationButton.scss

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
.annotation-button {
22
display: flex;
3-
padding: 4px 8px;
3+
padding: var(--spacing-tighter) var(--spacing-tight);
44
border-radius: var(--corner-radius-small) var(--corner-radius-small) 0 0;
55
border-width: 1px 1px 0;
66
border-style: solid;
77
background-color: var(--color-neutral-surface);
8-
margin-top: 2px;
8+
margin-top: var(--spacing-tightest);
99
align-items: flex-start;
10-
gap: 8px;
10+
gap: var(--spacing-base);
1111
cursor: pointer;
1212
height: calc(100% - 3px);
1313
min-width: 186px;
1414
border-color: var(--color-neutral-border);
15-
transition-property: background-color, border-color;
16-
transition-duration: 150ms;
17-
transition-timing-function: ease-out;
15+
transition: all 150ms ease-out;
1816

1917
&__user {
2018
line-height: 16px;
@@ -28,7 +26,7 @@
2826
&__mainSection {
2927
display: flex;
3028
align-items: center;
31-
gap: 8px;
29+
gap: var(--spacing-tight);
3230
flex: 1 0 auto;
3331

3432
& .annotation-button__userpic_prediction {
@@ -43,7 +41,7 @@
4341
line-height: 16px;
4442
letter-spacing: 0.4px;
4543
text-align: left;
46-
color: var(--color-neutral-content);
44+
color: var(--color-neutral-content-subtle);
4745
}
4846

4947
&__entity-id {
@@ -79,7 +77,11 @@
7977
}
8078

8179
& .annotation-button__trigger {
82-
visibility: visible;
80+
opacity: 1;
81+
}
82+
83+
& .annotation-button__picSection {
84+
opacity: 1;
8385
}
8486
}
8587

@@ -89,6 +91,11 @@
8991
transform: translate(0, 1px);
9092
margin-top: 1px;
9193
height: calc(100% - 2px);
94+
box-shadow: inset 0 4px 2px 0 var(--color-neutral-background), 0 4px 2px 0 rgba(var(--color-neutral-shadow-raw) / 20%);
95+
96+
& .annotation-button__picSection {
97+
opacity: 1;
98+
}
9299

93100
&:hover {
94101
cursor: default;
@@ -97,7 +104,7 @@
97104
}
98105

99106
& .annotation-button__trigger {
100-
visibility: visible;
107+
opacity: 1;
101108
}
102109

103110
& .annotation-button__created {
@@ -131,9 +138,10 @@
131138
display: flex;
132139
border-radius: 4px;
133140
color: var(--color-neutral-content-subtler);
134-
visibility: hidden;
141+
opacity: 0;
135142
padding: var(--spacing-tighter);
136143
border: 1px solid var(--trigger-border-color);
144+
transition: opacity 150ms ease-out, background-color 150ms ease-out;
137145

138146
svg {
139147
width: 20px;
@@ -145,13 +153,18 @@
145153
&:hover {
146154
cursor: pointer;
147155
color: var(--color-neutral-content);
148-
background: var(--color-primary-emphasis-subtle);
149-
border-color: var(--color-primary-border-subtle);
156+
background: var(--color-primary-emphasis);
157+
158+
svg {
159+
color: var(--color-neutral-content);
160+
}
150161
}
151162
}
152163

153164
&__picSection {
154165
position: relative;
166+
opacity: 0.7;
167+
transition: opacity 150ms ease-out;
155168
}
156169

157170
&__status {

web/libs/editor/src/components/AnnotationsCarousel/AnnotationsCarousel.scss

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@
77
min-width: 0;
88
flex: 1;
99

10+
&::before {
11+
content: '';
12+
position: absolute;
13+
top: 0;
14+
left: 0;
15+
width: 8px;
16+
height: 100%;
17+
display: block;
18+
pointer-events: none;
19+
opacity: 0;
20+
background: linear-gradient(to right, rgba(var(--color-neutral-shadow-raw) / 16%), rgba(var(--color-neutral-shadow-raw) / 0%));
21+
z-index: 1;
22+
transition: opacity 300ms ease-out;
23+
}
24+
25+
&_scrolled {
26+
&::before {
27+
opacity: 1;
28+
}
29+
}
30+
1031
&__container {
1132
display: flex;
1233
width: 100%;
@@ -18,12 +39,13 @@
1839
&__carosel {
1940
flex: 1;
2041
display: flex;
21-
gap: 2px;
42+
gap: var(--spacing-tighter);
2243
white-space: nowrap;
44+
padding-left: var(--spacing-tighter);
2345
padding-right: 77px;
2446
position: relative;
2547
transform: translateX(calc(-1 * var(--carousel-left)));
26-
transition: all 0.15s ease-in-out 0s;
48+
transition: all 200ms ease-out 0s;
2749
}
2850

2951
&__carousel-controls {
@@ -33,19 +55,23 @@
3355
top: 50%;
3456
transform: translateY(-50%);
3557
display: flex;
36-
gap: 4px;
37-
padding-right: 4px;
58+
gap: var(--spacing-tighter);
59+
padding-right: var(--spacing-tighter);
60+
61+
button:not(:disabled) {
62+
box-shadow: 0 2px 6px rgba(var(--color-neutral-shadow-raw) / 20%);
63+
}
3864
}
3965

4066
&__nav {
4167
padding: 0;
4268
height: 28px;
4369
width: 28px;
44-
box-shadow: 0 2px 5px 0 rgb(0 0 0 / 20%);
70+
box-shadow: 0 2px 5px 0 rgb(var(--color-neutral-shadow-raw) / 20%);
4571

4672
&:hover {
4773
background: var(--color-primary-emphasis-subtle);
48-
box-shadow: 0 2px 5px 0 rgb(0 0 0 / 20%);
74+
box-shadow: 0 2px 5px 0 rgb(var(--color-neutral-shadow-raw) / 20%);
4975
}
5076

5177
&_disabled {

web/libs/editor/src/components/AnnotationsCarousel/AnnotationsCarousel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const AnnotationsCarousel = observer(({ store, annotationStore }: Annotat
2626
const [isRightDisabled, setIsRightDisabled] = useState(false);
2727

2828
const updatePosition = useCallback(
29-
(e: React.MouseEvent, goLeft = true) => {
29+
(_e: React.MouseEvent, goLeft = true) => {
3030
if (containerRef.current && carouselRef.current) {
3131
const step = containerRef.current.clientWidth;
3232
const carouselWidth = carouselRef.current.clientWidth;
@@ -62,7 +62,11 @@ export const AnnotationsCarousel = observer(({ store, annotationStore }: Annotat
6262
}, [annotationStore, JSON.stringify(annotationStore.predictions), JSON.stringify(annotationStore.annotations)]);
6363

6464
return enableAnnotations || enablePredictions || enableCreateAnnotation ? (
65-
<Block name="annotations-carousel" style={{ "--carousel-left": `${currentPosition}px` }}>
65+
<Block
66+
name="annotations-carousel"
67+
mod={{ scrolled: currentPosition > 0 }}
68+
style={{ "--carousel-left": `${currentPosition}px` }}
69+
>
6670
<Elem ref={containerRef} name="container">
6771
<Elem ref={carouselRef} name="carosel">
6872
{sortAnnotations(entities).map((entity) => (

web/libs/editor/src/components/ContextMenu/ContextMenu.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@
5656
background-color: var(--color-primary-emphasis);
5757
color: var(--color-neutral-content);
5858
border-radius: 4px;
59+
opacity: 1;
5960
}
6061
}

web/libs/editor/src/components/TopBar/TopBar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
display: flex;
77
align-items: stretch;
88
justify-content: space-between;
9-
background-color: var(--color-neutral-background);
9+
background-color: var(--color-neutral-surface);
1010
border-bottom: 1px solid var(--color-neutral-border);
1111
user-select: none;
1212
position: sticky;
@@ -41,7 +41,7 @@
4141

4242
&_newLabelingUI {
4343
display: block;
44-
background-color: var(--color-neutral-background);
44+
background-color: var(--color-neutral-surface);
4545
height: 42px;
4646
border-bottom: 1px solid var(--color-neutral-border);
4747

0 commit comments

Comments
 (0)