Skip to content

Commit 18c7fa1

Browse files
committed
Visual improvements on classic template
1 parent 08d43c2 commit 18c7fa1

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

source/app/metrics/utils.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
}
2929

3030
/**Formatter */
31-
export function format(n, {sign = false, unit = true} = {}) {
31+
export function format(n, {sign = false, unit = true, fixed} = {}) {
3232
if (unit) {
3333
for (const {u, v} of [{u:"b", v:10**9}, {u:"m", v:10**6}, {u:"k", v:10**3}]) {
3434
if (n/v >= 1)
35-
return `${(sign)&&(n > 0) ? "+" : ""}${(n/v).toFixed(2).substr(0, 4).replace(/[.]0*$/, "")}${u}`
35+
return `${(sign)&&(n > 0) ? "+" : ""}${(n/v).toFixed(fixed ?? 2).substr(0, 4).replace(/[.]0*$/, "")}${u}`
3636
}
3737
}
38-
return `${(sign)&&(n > 0) ? "+" : ""}${n}`
38+
return `${(sign)&&(n > 0) ? "+" : ""}${fixed ? n.toFixed(fixed) : n}`
3939
}
4040

4141
/**Bytes formatter */

source/templates/classic/partials/stock.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<% } else { %>
3737
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M13.03 8.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.47 9.28a.75.75 0 011.06-1.06l2.97 2.97V3.75a.75.75 0 011.5 0v7.44l2.97-2.97a.75.75 0 011.06 0z"></path></svg>
3838
<% } %>
39-
<%= f(plugins.stock.delta.toFixed(2), {sign:true}) %> (<%= f((100*plugins.stock.delta/plugins.stock.price).toFixed(2), {sign:true}) %>%)
39+
<%= f(plugins.stock.delta, {sign:true, fixed:2}) %> (<%= f(100*plugins.stock.delta/plugins.stock.price, {sign:true, fixed:2}) %>%)
4040
</div>
4141
</section>
4242
</div>

source/templates/classic/style.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132

133133
/* Labels */
134134
.label {
135-
background-color: #F1F8FF;
135+
background-color: #58A6FF30;
136136
color: #0366D6;
137137
padding: 0 10px;
138138
font-weight: 500;
@@ -143,11 +143,6 @@
143143
font-size: 12px;
144144
}
145145

146-
.label:hover {
147-
background-color: #DDEEFF;
148-
cursor: pointer;
149-
}
150-
151146
/* Habits */
152147
.habits {
153148
margin: 0;
@@ -498,7 +493,7 @@
498493

499494
.repository .name span:last-child {
500495
color: #666666;
501-
font-size: 13px;
496+
font-size: 10px;
502497
}
503498

504499
.repository .description {

0 commit comments

Comments
 (0)