diff --git a/src/App.tsx b/src/App.tsx
index ee8ae64..b5822a2 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -3,6 +3,7 @@ import { WorkoutPlot } from './components/WorkoutPlot';
import { WorkoutStats } from './components/WorkoutStats';
import { parse, chunkRangeIntervals, Duration } from 'make-workout';
import { ErrorMessage } from './components/ErrorMessage';
+import styled from 'styled-components';
const defaultWorkout = `Name: Hello
@@ -14,6 +15,15 @@ FreeRide: 10:00
Cooldown: 10:00 60%..30%
`;
+const AppContainer = styled.div`
+ max-width: 800px;
+ margin: 0 auto;
+`;
+
+const AppTitle = styled.h1`
+ font-weight: normal;
+`;
+
// Split range-intervals into 1 minute chunks
const chunkSize = new Duration(60);
@@ -34,12 +44,12 @@ export function App() {
}, [setText, setWorkout, setError]);
return (
-
-
Workout editor
+
+ Workout editor
{error && {error}}
-
+
);
}
diff --git a/src/components/WorkoutPlot.tsx b/src/components/WorkoutPlot.tsx
index 25b1815..4a5e57b 100644
--- a/src/components/WorkoutPlot.tsx
+++ b/src/components/WorkoutPlot.tsx
@@ -12,9 +12,7 @@ const toBarProps = (interval: Interval, workoutDuration: Duration, maxIntensity:
const Plot = styled.div`
white-space: nowrap;
overflow: hidden;
- width: 800px;
height: 200px;
- background: rgba(0,0,0, 0.03);
border-radius: 5px;
padding: 5px;
margin: 10px 0;
diff --git a/src/components/WorkoutStats.tsx b/src/components/WorkoutStats.tsx
index 6359679..a9e3698 100644
--- a/src/components/WorkoutStats.tsx
+++ b/src/components/WorkoutStats.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { stats, Workout, Intensity } from 'make-workout';
import { formatDuration } from './formatDuration';
+import styled from 'styled-components';
const formatIntensity = (intensity: Intensity): string => `${Math.round(intensity.value * 100)}%`;
@@ -8,22 +9,53 @@ const StatsLine: React.FC<{ label: string, value: string | number }> = ({ label,
{label} {value}
);
+const Container = styled.div`
+ display: grid;
+ grid-template-columns: 1fr 3fr;
+ border: 1px solid #bbb;
+ border-radius: 10px;
+ padding: 10px;
+ font-size: 12px;
+ background: rgba(255, 255, 255, 0.6);
+`;
+const Section = styled.section``;
+
+const Header = styled.h2`
+ margin: 0;
+ font-size: 14px;
+ font-weight: normal;
+`;
+const List = styled.ul`
+ margin: 1m 0;
+ padding: 0;
+ list-style: none;
+`;
+const ZoneList = styled(List)`
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+`;
+
+
export const WorkoutStats: React.FC<{workout: Workout}> = ({ workout }) => {
const {totalDuration, averageIntensity, normalizedIntensity, tss, zones} = stats(workout);
return (
-
-
Summary
-
-
Zone distribution
-
- {zones.map(zone => ()) }
-
-
+
+
+
+
+
+ {zones.map(zone => ()) }
+
+
+
)
};
diff --git a/src/index.css b/src/index.css
index ce2700d..0d508cf 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,7 +1,7 @@
body {
margin: 0;
padding: 40px;
- background-color: #f5f5e5;
+ background-color: #f7f7f2;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;