Skip to content

Commit 0655de2

Browse files
authored
Update readme and fronted for exercise trakcing
2 parents 6c2fb5f + f144342 commit 0655de2

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fitness Tracking App
2-
My second golang project.\
2+
My second golang project.
33
I track my own workouts in the notes app, which is a bit tedious, so I decided to make a web app that would solve the problems I encounter on an almost daily basis.\
44

5-
This poject is the continuation of learning backend web development, which started with the [2D Tic Tac Toe](https://github.com/SteveMCWin/golang_tic_tac_toe) project, also created using golang and SQLite.\
5+
This poject is the continuation of learning backend web development, which started with the [2D Tic Tac Toe](https://github.com/SteveMCWin/golang_tic_tac_toe) project, also created using golang and SQLite.
66

77
## Features
88
- User authentication
@@ -12,6 +12,9 @@ This poject is the continuation of learning backend web development, which start
1212
- Basic workout plan analysis
1313
- Viewing and copying other users workout plans
1414
- Gym - workout plan compatability analysis
15+
- Per-exercise progression over time
1516

1617
## Screenshots
1718
![Check out the screenshots directory](screenshots/plan_example.png?raw=true)
19+
![Check out the screenshots directory](screenshots/exercise_tracking.png?raw=true)
20+

screenshots/exercise_tracking.png

146 KB
Loading

templates/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ <h1>Welcome to My Web App</h1>
3838
<a href="/user/{{ .user_id }}" class="btn">Profile</a>
3939
<a href="/user/search" class="btn">Find User</a>
4040
<a href="/gym/search" class="btn">Find Gyms</a>
41-
<a href="/user/{{ .user_id }}/track/progress/" class="btn">Show Progress</a>
4241
</body>
4342
</html>

templates/track_analysis.html

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
<div class="container">
279279
<div class="header">
280280
<h1>Exercise Progress Tracking</h1>
281-
<p>Monitor your intensity improvements over time</p>
281+
<p>Monitor your progress over time</p>
282282
</div>
283283

284284
<div class="content">
@@ -615,9 +615,6 @@ <h2>Input an exercise you want to see the progress of</h2>
615615
document.getElementById('selectedExerciseType').textContent = `Type: ${selectedExercise.exercise_type}`;
616616
document.getElementById('selectedExerciseDifficulty').textContent = `Difficulty: ${selectedExercise.difficulty}/10`;
617617

618-
// Sort data by time_point
619-
<!-- exerciseProgress.sort((a, b) => new Date(a.time_point) - new Date(b.time_point)); -->
620-
621618
// Prepare data for Chart.js
622619
const labels = exerciseProgress.map(item => {
623620
const date = new Date(item.time_point);
@@ -633,17 +630,13 @@ <h2>Input an exercise you want to see the progress of</h2>
633630

634631
// Calculate statistics
635632
const totalSessions = exerciseProgress.length;
636-
<!-- const avgIntensity = (intensityData.reduce((a, b) => a + b, 0) / totalSessions).toFixed(1); -->
637-
<!-- const maxIntensity = Math.max(...intensityData).toFixed(1); -->
638633
const improvement = exerciseProgress.length > 1
639-
? (intensityData[intensityData.length - 1] - intensityData[0]).toFixed(1)
634+
? ((intensityData[intensityData.length - 1] - intensityData[0])/intensityData[0]*100).toFixed(1)
640635
: 0;
641636

642637
// Update statistics
643638
document.getElementById('totalSessions').textContent = totalSessions;
644-
<!-- document.getElementById('avgIntensity').textContent = avgIntensity; -->
645-
<!-- document.getElementById('maxIntensity').textContent = maxIntensity; -->
646-
document.getElementById('improvement').textContent = improvement > 0 ? `+${improvement}` : improvement;
639+
document.getElementById('improvement').textContent = improvement >= 0 ? `+${improvement}%` : `-${improvement}%`;
647640

648641
// Create the chart
649642
const ctx = document.getElementById('progressChart').getContext('2d');

0 commit comments

Comments
 (0)