diff --git a/frontend/src/App.js b/frontend/src/App.js
index facb7a8..ddd15e7 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -5,6 +5,7 @@ import StepTimeDigits from './StepTimeDigits';
import StepTimeChart from './StepTimeChart';
import StepTimeGraph from './StepTimeGraph';
import useStepTime from './useStepTime';
+import StepTimeTredmill from './StepTimeTreadmil';
function App() {
const [currentView, setCurrentView] = useState('StepTimeDigits');
@@ -14,6 +15,7 @@ function App() {
StepTimeDigits: ,
StepTimeChart: ,
StepTimeGraph: ,
+ StepTimeTredmill:
};
let websocket = useRef(null);
diff --git a/frontend/src/Navigation.js b/frontend/src/Navigation.js
index 624c772..4b68ce2 100644
--- a/frontend/src/Navigation.js
+++ b/frontend/src/Navigation.js
@@ -7,6 +7,7 @@ function Naviation({ setCurrentView }) {
setCurrentView('StepTimeDigits')}>Step Time Digits
setCurrentView('StepTimeChart')}>Step Time Chart
setCurrentView('StepTimeGraph')}>Step Time Graph
+ setCurrentView('StepTimeTredmill')}>Step Time Treadmill
);
diff --git a/frontend/src/StepTimeTreadmil.js b/frontend/src/StepTimeTreadmil.js
new file mode 100644
index 0000000..994544f
--- /dev/null
+++ b/frontend/src/StepTimeTreadmil.js
@@ -0,0 +1,37 @@
+import "./StepTimeTreadmill.css"
+
+function StepTimeTreadmill({ stepTime }) {
+ const leftOffsetMin = (stepTime.left - stepTime.targetZones.left.min);
+ const leftOffsetMax = (stepTime.left - stepTime.targetZones.left.max) * -1;
+ const rightOffsetMin = (stepTime.right - stepTime.targetZones.right.min);
+ const rightOffsetMax = (stepTime.right - stepTime.targetZones.right.max) * -1;
+
+ return (
+
+
+
+ );
+}
+
+export default StepTimeTreadmill;
\ No newline at end of file
diff --git a/frontend/src/StepTimeTreadmill.css b/frontend/src/StepTimeTreadmill.css
new file mode 100644
index 0000000..a87e520
--- /dev/null
+++ b/frontend/src/StepTimeTreadmill.css
@@ -0,0 +1,18 @@
+.Treadmill {
+ width: 70vw;
+ height: 85vh;
+ margin: 5vh 0;
+ background-color: grey;
+}
+
+.Treadmill line {
+ stroke-width: .02vw;
+}
+
+.TargetZones line {
+ stroke: orange;
+}
+
+.StepTimeValues line {
+ stroke: black;
+}
\ No newline at end of file
diff --git a/frontend/src/__tests__/App.test.js b/frontend/src/__tests__/App.test.js
index 8c02770..9ca9c73 100644
--- a/frontend/src/__tests__/App.test.js
+++ b/frontend/src/__tests__/App.test.js
@@ -49,6 +49,12 @@ describe("Navbar Component", () => {
expect(screen.getByTestId("step-time-graph-view")).toBeInTheDocument();
});
+ test("Navbar swap renders StepTimeTreadmill view", () => {
+ render();
+ fireEvent.click(screen.getByTestId("step-time-treadmill-nav"));
+ expect(screen.getByTestId("step-time-treadmill-view")).toBeInTheDocument();
+ });
+
test("Navbar swap renders StepTimeDigits view", () => {
render();
fireEvent.click(screen.getByTestId("step-time-graph-nav"));
diff --git a/frontend/src/useStepTime.js b/frontend/src/useStepTime.js
index 6ba3c95..3c58237 100644
--- a/frontend/src/useStepTime.js
+++ b/frontend/src/useStepTime.js
@@ -3,11 +3,11 @@ import { useState, useEffect } from 'react';
function useStepTime() {
// TODO: update default values, check w/ line 14 comment
const [stepTime, setStepTime] = useState({
- left: 0,
- right: 0,
+ left: 27,
+ right: 30,
targetZones: {
- left: { min: 0, max: 0 },
- right: { min: 0, max: 0 }
+ left: { min: 25, max: 35 },
+ right: { min: 25, max: 35 }
}
});