diff --git a/WebApp/src/assets.d.ts b/WebApp/src/assets.d.ts new file mode 100644 index 0000000..4997750 --- /dev/null +++ b/WebApp/src/assets.d.ts @@ -0,0 +1 @@ +declare module "*.png"; diff --git a/WebApp/src/assets/bike.png b/WebApp/src/assets/bike.png new file mode 100644 index 0000000..c84934f Binary files /dev/null and b/WebApp/src/assets/bike.png differ diff --git a/WebApp/src/assets/icons/altitude.png b/WebApp/src/assets/icons/altitude.png new file mode 100644 index 0000000..ae1f982 Binary files /dev/null and b/WebApp/src/assets/icons/altitude.png differ diff --git a/WebApp/src/assets/icons/ascending-elevation.png b/WebApp/src/assets/icons/ascending-elevation.png new file mode 100644 index 0000000..6345fe7 Binary files /dev/null and b/WebApp/src/assets/icons/ascending-elevation.png differ diff --git a/WebApp/src/assets/icons/average.png b/WebApp/src/assets/icons/average.png new file mode 100644 index 0000000..7c32a5e Binary files /dev/null and b/WebApp/src/assets/icons/average.png differ diff --git a/WebApp/src/assets/icons/distance-electricity.png b/WebApp/src/assets/icons/distance-electricity.png new file mode 100644 index 0000000..89cfa8a Binary files /dev/null and b/WebApp/src/assets/icons/distance-electricity.png differ diff --git a/WebApp/src/assets/icons/distance.png b/WebApp/src/assets/icons/distance.png new file mode 100644 index 0000000..36797ec Binary files /dev/null and b/WebApp/src/assets/icons/distance.png differ diff --git a/WebApp/src/assets/icons/electricity.png b/WebApp/src/assets/icons/electricity.png new file mode 100644 index 0000000..a22b105 Binary files /dev/null and b/WebApp/src/assets/icons/electricity.png differ diff --git a/WebApp/src/assets/icons/temperature.png b/WebApp/src/assets/icons/temperature.png new file mode 100644 index 0000000..1496d12 Binary files /dev/null and b/WebApp/src/assets/icons/temperature.png differ diff --git a/WebApp/src/assets/icons/time.png b/WebApp/src/assets/icons/time.png new file mode 100644 index 0000000..6d58f5b Binary files /dev/null and b/WebApp/src/assets/icons/time.png differ diff --git a/WebApp/src/components/widgets/gauge.tsx b/WebApp/src/components/widgets/gauge.tsx index b89b2e2..ea2082f 100644 --- a/WebApp/src/components/widgets/gauge.tsx +++ b/WebApp/src/components/widgets/gauge.tsx @@ -27,6 +27,7 @@ export class Gauge extends NumericValue { super.onbeforeremove(vnode); } + protected mainClassName() { return 'gauge'; } protected graphicalRepresentation(vnode: m.Vnode<{}, {}>): m.Children { return ; diff --git a/WebApp/src/components/widgets/numeric-value.css b/WebApp/src/components/widgets/numeric-value.css index 7a0809f..1bb0933 100644 --- a/WebApp/src/components/widgets/numeric-value.css +++ b/WebApp/src/components/widgets/numeric-value.css @@ -11,3 +11,27 @@ div.widget span.decimal-value { div.widget span.unit { font-size: 1.6rem; } + +div.widget div.value-icon { + display: inline-block; + height: 2.3rem; + width: 4rem; + text-align: center; + margin-right: 0.2rem; +} + +div.widget div.value-icon img { + display: inline-block; + height: 100%; + position: relative; + top: 0.2rem; +} + +div.numeric-value { + padding-left: 0.5rem; +} + +div.numeric-value span.unit { + font-size: 1.1rem; + margin-left: 0.2rem; +} diff --git a/WebApp/src/components/widgets/numeric-value.tsx b/WebApp/src/components/widgets/numeric-value.tsx index cd5e0df..0c81e24 100644 --- a/WebApp/src/components/widgets/numeric-value.tsx +++ b/WebApp/src/components/widgets/numeric-value.tsx @@ -11,6 +11,8 @@ export class NumericValue extends Widget { protected unit: string; protected decimals: number; + protected icon?: string; + private integralValueElement: HTMLElement; private decimalValueElement: HTMLElement; @@ -23,16 +25,25 @@ export class NumericValue extends Widget { this.unit = vnode.attrs.unit || ''; this.decimals = vnode.attrs.decimals || 0; + this.icon = vnode.attrs.icon || null; + this.value.onChange(() => this.onValueChange_()); } view(vnode: m.Vnode<{}, {}>): m.Children { - return