Skip to content

Commit 0e728a3

Browse files
chore: color changes
1 parent fa3b95a commit 0e728a3

File tree

3 files changed

+65
-46
lines changed

3 files changed

+65
-46
lines changed

src/features/Overview/ShredsProgression/ShredsSlotLabels.tsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import PeerIcon from "../../../components/PeerIcon";
1111
import { skippedClusterSlotsAtom } from "../../../atoms";
1212
import { isStartupProgressVisibleAtom } from "../../StartupProgress/atoms";
1313

14+
const height = 30;
15+
1416
/**
1517
* Labels for shreds slots.
1618
* Don't render during startup, because there will be multiple overlapping slots
@@ -23,7 +25,12 @@ export default function ShredsSlotLabels() {
2325
if (isStartup) return;
2426

2527
return (
26-
<Flex overflow="hidden" position="relative" style={{ height: "25px" }}>
28+
<Flex
29+
overflow="hidden"
30+
position="relative"
31+
// extra space for borders
32+
height={`${height + 2}px`}
33+
>
2734
{groupLeaderSlots.map((slot) => (
2835
<SlotGroupLabel key={slot} firstSlot={slot} />
2936
))}
@@ -53,36 +60,41 @@ function SlotGroupLabel({ firstSlot }: SlotGroupLabelProps) {
5360

5461
return (
5562
<Flex
56-
height="100%"
63+
height={`${height}px`}
5764
direction="column"
5865
gap="2px"
5966
position="absolute"
60-
justify="center"
6167
align="center"
6268
overflow="hidden"
6369
id={getSlotGroupLabelId(firstSlot)}
6470
className={clsx(styles.slotGroupLabel, {
6571
[styles.you]: isLeader,
66-
[styles.skipped]: skippedSlots.size > 0,
6772
})}
6873
>
6974
<Flex
70-
justify="center"
7175
align="center"
72-
width="100%"
73-
gap="4px"
74-
p="1px 2px"
75-
wrap="nowrap"
7676
flexGrow="1"
77-
className={styles.slotGroupNameContainer}
77+
px="2px"
78+
className={clsx(styles.slotGroupTopContainer, {
79+
[styles.skipped]: skippedSlots.size > 0,
80+
})}
7881
>
79-
<PeerIcon
80-
url={peer?.info?.icon_url}
81-
size={17}
82-
isYou={isLeader}
83-
hideTooltip
84-
/>
85-
<Text className={styles.name}>{name}</Text>
82+
<Flex
83+
justify="center"
84+
align="center"
85+
width="100%"
86+
gap="4px"
87+
wrap="nowrap"
88+
className={styles.slotGroupNameContainer}
89+
>
90+
<PeerIcon
91+
url={peer?.info?.icon_url}
92+
size={17}
93+
isYou={isLeader}
94+
hideTooltip
95+
/>
96+
<Text className={styles.name}>{name}</Text>
97+
</Flex>
8698
</Flex>
8799

88100
<Flex

src/features/Overview/ShredsProgression/shreds.module.css

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,63 @@
11
.slot-group-label {
2-
--group-x: 0;
3-
--group-y: -150%;
2+
--group-x: -100000px;
43
--group-name-opacity: 0;
54

6-
background-color: #15181e;
5+
background-color: #080b13;
76
border-radius: 2px;
87
border: 1px solid #3c4652;
98
will-change: transform, width;
10-
transform: translate(var(--group-x), var(--group-y));
9+
transform: translate(var(--group-x));
1110

1211
&.you {
1312
border: 1px solid #2a7edf;
1413
}
1514

16-
&.skipped {
17-
background-color: var(--red-2);
18-
}
15+
.slot-group-top-container {
16+
width: 100%;
17+
background-color: #15181e;
18+
19+
&.skipped {
20+
background-color: var(--red-2);
21+
}
1922

20-
.slot-group-name-container {
21-
opacity: var(--group-name-opacity);
22-
transition: opacity 1s;
23-
will-change: opacity;
23+
.slot-group-name-container {
24+
opacity: var(--group-name-opacity);
25+
transition: opacity 0.8s;
26+
will-change: opacity;
2427

25-
.name {
26-
font-size: 14px;
27-
line-height: normal;
28-
color: #ccc;
29-
white-space: nowrap;
30-
overflow: hidden;
31-
text-overflow: ellipsis;
28+
.name {
29+
font-size: 14px;
30+
line-height: normal;
31+
color: #ccc;
32+
white-space: nowrap;
33+
overflow: hidden;
34+
text-overflow: ellipsis;
35+
}
3236
}
3337
}
3438

3539
.slot-bars-container {
40+
flex-shrink: 0;
3641
.slot-bar {
3742
--slot-x: 0;
38-
--slot-opacity: -150%;
3943

4044
position: absolute;
4145
will-change: transform, width;
42-
transform: translate(var(--slot-x), var(--slot-y));
46+
transform: translate(var(--slot-x));
4347

4448
height: 100%;
4549
border-radius: 3px;
4650
&:nth-child(1) {
47-
background-color: var(--blue-9);
51+
background-color: var(--blue-7);
4852
}
4953
&:nth-child(2) {
50-
background-color: var(--blue-7);
54+
background-color: var(--blue-6);
5155
}
5256
&:nth-child(3) {
5357
background-color: var(--blue-5);
5458
}
5559
&:nth-child(4) {
56-
background-color: var(--blue-3);
60+
background-color: var(--blue-4);
5761
}
5862

5963
&.skipped {

src/features/Overview/ShredsProgression/shredsProgressionPlugin.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -689,13 +689,15 @@ function moveLabelPosition(
689689
const prevPositions = prevLabelPositions?.[key];
690690
const prevVisible = !!prevPositions?.[slotNumber];
691691

692-
if (forceUpdates || isVisible !== prevVisible) {
693-
// hide / show
694-
const prop = isGroup ? "--group-y" : "--slot-y";
695-
el.style.setProperty(prop, isVisible ? "0" : "-150%");
692+
if (!isVisible) {
693+
if (forceUpdates || prevVisible) {
694+
// hide
695+
const prop = isGroup ? "--group-x" : "--slot-x";
696+
el.style.setProperty(prop, isVisible ? "0" : "-100000px");
697+
}
698+
return;
696699
}
697700

698-
if (!isVisible) return;
699701
positionsToMutate[slotNumber] = position;
700702

701703
const xPos = position[0];
@@ -709,7 +711,8 @@ function moveLabelPosition(
709711
// no width data -- extend to max width
710712
const width = position[1];
711713
const isExtended = position[1] == null;
712-
const extendedWidth = width ?? maxXPos - xPos;
714+
// extend past maxXPos to hide right border
715+
const extendedWidth = width ?? maxXPos + 1 - xPos;
713716
const prevWidth = prevPositions?.[slotNumber]?.[1];
714717

715718
if (forceUpdates || extendedWidth !== prevWidth) {

0 commit comments

Comments
 (0)