New "browse" UI
Also, separated out browse, ?meta, and ?module request handlers. Fixes #82
This commit is contained in:
18
modules/client/utils/format.js
Normal file
18
modules/client/utils/format.js
Normal file
@ -0,0 +1,18 @@
|
||||
import formatBytes from 'pretty-bytes';
|
||||
|
||||
export { formatBytes };
|
||||
|
||||
export function formatNumber(n) {
|
||||
const digits = String(n).split('');
|
||||
const groups = [];
|
||||
|
||||
while (digits.length) {
|
||||
groups.unshift(digits.splice(-3).join(''));
|
||||
}
|
||||
|
||||
return groups.join(',');
|
||||
}
|
||||
|
||||
export function formatPercent(n, decimals = 1) {
|
||||
return (n * 100).toPrecision(decimals + 2);
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
export default function formatNumber(n) {
|
||||
const digits = String(n).split('');
|
||||
const groups = [];
|
||||
|
||||
while (digits.length) {
|
||||
groups.unshift(digits.splice(-3).join(''));
|
||||
}
|
||||
|
||||
return groups.join(',');
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
export default function formatPercent(n, decimals = 1) {
|
||||
return (n * 100).toPrecision(decimals + 2);
|
||||
}
|
3
modules/client/utils/markup.js
Normal file
3
modules/client/utils/markup.js
Normal file
@ -0,0 +1,3 @@
|
||||
export function createHTML(content) {
|
||||
return { __html: content };
|
||||
}
|
24
modules/client/utils/style.js
Normal file
24
modules/client/utils/style.js
Normal file
@ -0,0 +1,24 @@
|
||||
export const fontSans = `
|
||||
font-family: -apple-system,
|
||||
BlinkMacSystemFont,
|
||||
"Segoe UI",
|
||||
"Roboto",
|
||||
"Oxygen",
|
||||
"Ubuntu",
|
||||
"Cantarell",
|
||||
"Fira Sans",
|
||||
"Droid Sans",
|
||||
"Helvetica Neue",
|
||||
sans-serif;
|
||||
`;
|
||||
|
||||
export const fontMono = `
|
||||
font-family: Menlo,
|
||||
Monaco,
|
||||
Lucida Console,
|
||||
Liberation Mono,
|
||||
DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono,
|
||||
Courier New,
|
||||
monospace;
|
||||
`;
|
Reference in New Issue
Block a user