Skip to content

Commit 6c12b8b

Browse files
committed
Added tick markers to scale
1 parent 27b84bb commit 6c12b8b

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

src/ui/widgets/Tank/tank.module.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
}
2424

2525
.ScaleMarker {
26-
position: absolute;
27-
left: 0%;
26+
position: absolute;
27+
left: 0%;
28+
}
29+
30+
.ScaleTick {
31+
position: absolute;
32+
left: 20px;
33+
height: 2px;
34+
width: 10px;
35+
background-color: black;
36+
transform: translateY(-1px);
2837
}

src/ui/widgets/Tank/tankWithScale.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,58 @@ export const TankWithScale = (props: {
4343
width: "100px",
4444
top: "10%",
4545
color: foregroundColor.toString(),
46-
transform: "rotate(-90deg) translateX(15px) translateY(-30px)",
46+
transform: "rotate(-90deg) translateX(15px) translateY(-35px)",
4747
...font?.css()
4848
}}
4949
>
5050
{logScale ? Number(max).toExponential(0) : Number(max).toFixed(1)}
5151
</span>
52+
<span
53+
className={classes.ScaleTick}
54+
style={{
55+
top: "10%"
56+
}}
57+
/>
5258
<span
5359
className={classes.ScaleMarker}
5460
style={{
5561
height: "30px",
5662
width: "100px",
5763
top: "50%",
5864
color: foregroundColor.toString(),
59-
transform: "rotate(-90deg) translateX(15px) translateY(-30px)",
65+
transform: "rotate(-90deg) translateX(15px) translateY(-35px)",
6066
...font?.css()
6167
}}
6268
>
6369
{logScale
6470
? Number(max / 2).toExponential(0)
6571
: Number(max / 2).toFixed(1)}
6672
</span>
73+
<span
74+
className={classes.ScaleTick}
75+
style={{
76+
top: "50%"
77+
}}
78+
/>
6779
<span
6880
className={classes.ScaleMarker}
6981
style={{
7082
height: "30px",
7183
width: "100px",
7284
top: "90%",
7385
color: foregroundColor.toString(),
74-
transform: "rotate(-90deg) translateX(15px) translateY(-30px)",
86+
transform: "rotate(-90deg) translateX(15px) translateY(-35px)",
7587
...font?.css()
7688
}}
7789
>
7890
{logScale ? Number(min).toExponential(0) : Number(min).toFixed(1)}
7991
</span>
92+
<span
93+
className={classes.ScaleTick}
94+
style={{
95+
top: "90%"
96+
}}
97+
/>
8098
<span
8199
className={classes.EmptyTank}
82100
style={{

0 commit comments

Comments
 (0)