Skip to content

Commit 7400a91

Browse files
committed
Make some minor style adjustments
1 parent d2475ce commit 7400a91

File tree

5 files changed

+57
-31
lines changed

5 files changed

+57
-31
lines changed

src/components/upload/FileCard.css

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
justify-content: space-between;
66
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.25);
77
position: relative;
8-
padding: 35px 1em;
8+
padding: 45px 1em 50px;
99
text-align: center;
1010
margin-top: 1em;
1111
}
1212

1313
.fileCard .fileCard__closeButton {
14-
background-color: #f0972f;
15-
color: #fcfcfc;
14+
background-color: var(--color-tree-root);
15+
color: var(--color-bg);
1616
height: 30px;
1717
width: 30px;
1818
border: none;
@@ -46,27 +46,45 @@
4646
.fileCard .fileCard__keywords {
4747
margin-top: 1em;
4848
font-size: 16px;
49-
color: #5b5b5b;
49+
color: var(--color-label);
5050
max-width: 90%;
5151
}
5252

5353
.fileCard .fileCard__statGroup {
5454
margin-top: 1em;
5555
}
56+
5657
.fileCard .fileCard__stats {
5758
margin-top: 0.5em;
5859
display: flex;
5960
flex-direction: column;
6061
align-items: center;
6162
}
63+
6264
.fileCard .fileCard__stats__count {
6365
font-size: 24px;
6466
font-weight: 600;
6567
}
68+
6669
.fileCard .fileCard__stats__unit {
6770
font-size: 14px;
68-
color: #5b5b5b;
71+
color: var(--color-label);
72+
}
73+
74+
.fileCard .fileCard__weight {
75+
position: absolute;
76+
bottom: 0.5rem;
77+
right: 0.5rem;
6978
}
79+
80+
.fileCard .fileCard__weight small {
81+
font-size: 60%;
82+
}
83+
84+
.fileCard.capped .fileCard__weight small {
85+
color: var(--color-red-accent);
86+
}
87+
7088
.fileCard_progressBar {
7189
position: absolute;
7290
bottom: 0;
@@ -77,20 +95,20 @@
7795
background: #f0f0f0;
7896
}
7997
.fileCard_progressBar .fileCard_progressAdjustment {
80-
background: #009d35;
98+
background: var(--color-tree-leaf);
8199
width: 100%;
82100
transform-origin: 0%;
83101
height: 3px;
84102
margin: 0;
85103
}
86104

87-
.capped {
105+
.fileCard.capped {
88106
background: var(--color-bg-accent);
89107
}
90108

91109
.fileCard .fileCard__moveButton {
92-
background-color: #f0972f;
93-
color: #fcfcfc;
110+
background-color: var(--color-tree-root);
111+
color: var(--color-bg);
94112
height: 30px;
95113
width: 30px;
96114
border: none;

src/components/upload/FileCard.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ const FileCard: FC<Props> = ({
3333
size = 0,
3434
cumSize = 0,
3535
}: Props) => {
36-
const numberFormat = new Intl.NumberFormat();
36+
const countFormat = new Intl.NumberFormat(undefined);
37+
const weightFormat = new Intl.NumberFormat(undefined, {
38+
minimumFractionDigits: 2,
39+
});
3740

3841
return (
3942
<div className={capped ? "fileCard capped" : "fileCard"}>
@@ -52,29 +55,26 @@ const FileCard: FC<Props> = ({
5255
<div className="fileCard__statGroup">
5356
<span className="fileCard__stats">
5457
<strong className="fileCard__stats__count">
55-
{numberFormat.format(articles)}
58+
{countFormat.format(articles)}
5659
</strong>
5760
<small className="fileCard__stats__unit">
5861
{articles === 1 ? "article" : "articles"}
5962
</small>
6063
</span>
6164
<span className="fileCard__stats">
6265
<strong className="fileCard__stats__count">
63-
{numberFormat.format(citations)}
66+
{countFormat.format(citations)}
6467
</strong>
6568
<small className="fileCard__stats__unit">
6669
{citations === 1 ? "citation" : "citations"}
6770
</small>
6871
</span>
69-
<span className="fileCard__stats">
70-
<small className="fileCard__stats__unit">
71-
size: {numberFormat.format(round(size, 1))}MB
72-
</small>
73-
<small className="fileCard__stats__unit">
74-
cum. size: {numberFormat.format(round(cumSize, 1))}MB/
75-
{numberFormat.format(round(MAX_SIZE, 1))}MB
76-
</small>
77-
</span>
72+
</div>
73+
<div className="fileCard__weight">
74+
<small title="To keep our costs down, we need to limit the ammount of data we process for each tree.">
75+
{weightFormat.format(round(cumSize, 2))} /{" "}
76+
{weightFormat.format(round(MAX_SIZE, 2))} [MB]
77+
</small>
7878
</div>
7979
<div className="fileCard_progressBar">
8080
<div

src/components/upload/Home.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import { round } from "../../utils/mathUtils";
1515

1616
import "./Home.css";
1717

18-
const numberFormat = new Intl.NumberFormat();
18+
const countFormat = new Intl.NumberFormat();
19+
const weightFormat = new Intl.NumberFormat(undefined, {
20+
minimumFractionDigits: 2,
21+
maximumFractionDigits: 2,
22+
});
1923

2024
const createTree = async ({
2125
app,
@@ -81,22 +85,21 @@ const Home: FC<{}> = () => {
8185
<div className="information-cant-article">
8286
<div className="frame-article">
8387
<span className="total-articles">
84-
{numberFormat.format(articleCap)}/
85-
{numberFormat.format(totalArticles)}
88+
{countFormat.format(articleCap)}/{countFormat.format(totalArticles)}
8689
</span>
8790
<span className="articles">articles</span>
8891
</div>
8992
<div className="frame-article">
9093
<span className="total-articles">
91-
{numberFormat.format(citationCap)}/
92-
{numberFormat.format(totalCitations)}
94+
{countFormat.format(citationCap)}/
95+
{countFormat.format(totalCitations)}
9396
</span>
9497
<span className="articles">citations</span>
9598
</div>
9699
<div className="frame-article">
97100
<span className="total-articles">
98-
{numberFormat.format(round(sizeCap, 1))}/
99-
{numberFormat.format(round(MAX_SIZE, 1))}
101+
{weightFormat.format(round(sizeCap, 2))}/
102+
{weightFormat.format(round(MAX_SIZE, 2))}
100103
</span>
101104
<span className="articles">size [MB]</span>
102105
</div>

src/components/vectors/MoveFirstIcon.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import React from "react";
33
const MoveFirstIcon = () => (
44
<svg
55
className="move-icon"
6+
viewBox="0 0 18 20"
7+
fill="none"
68
xmlns="http://www.w3.org/2000/svg"
7-
viewBox="0 0 970.504 970.503"
89
>
9-
<path d="M120.027 962.802c26.6 0 53.5-8.801 75.7-27l288.1-234.7 290.899 237c22.301 18.1 49.101 27 75.7 27 34.8 0 69.4-15.101 93.101-44.2 41.899-51.4 34.1-127-17.2-168.8l-366.7-298.8c-44.1-36-107.5-36-151.6 0l-363.8 296.5c-51.4 41.8-59.1 117.399-17.3 168.8 23.8 29.1 58.3 44.2 93.1 44.2z" />
10-
<path d="M120.027 541.902c26.6 0 53.5-8.8 75.7-27l288.1-234.7 290.899 237c22.301 18.101 49.101 27 75.7 27 34.8 0 69.4-15.1 93.101-44.2 41.899-51.399 34.1-127-17.2-168.8l-366.7-298.8c-44.1-36-107.5-36-151.6 0l-363.8 296.4c-51.4 41.9-59.1 117.5-17.3 168.9 23.8 29.1 58.3 44.2 93.1 44.2z" />
10+
<path
11+
d="M16 10L8 2M10 10l-8 8M16 18l-8-8M10 2l-8 8"
12+
stroke="#FCFCFC"
13+
stroke-width="3"
14+
/>
1115
</svg>
1216
);
1317

src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ template {
370370
--color-tree-trunk: #904c14;
371371
--color-bg: #fcfcfc;
372372
--color-bg-accent: #f0f0f0;
373+
--color-red-accent: rgb(226, 132, 148);
373374
--color-link: #366fc6;
374375
--color-link-hover: #3a6099;
375376
--color-label: #5b5b5b;

0 commit comments

Comments
 (0)