From 3dd31e4b35a072638d07a9548097a72fcfc55491 Mon Sep 17 00:00:00 2001
From: Jesko Dujmovic
Date: Mon, 18 Oct 2021 21:26:39 +0200
Subject: [PATCH] initial commit
---
exerciseTypes.js | 36 +++++++++++++++++++++++++++++++
index.html | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
main.js | 52 ++++++++++++++++++++++++++++++++++++++++++++
repTypes.js | 10 +++++++++
4 files changed, 154 insertions(+)
create mode 100644 exerciseTypes.js
create mode 100644 index.html
create mode 100644 main.js
create mode 100644 repTypes.js
diff --git a/exerciseTypes.js b/exerciseTypes.js
new file mode 100644
index 0000000..a8a0bfb
--- /dev/null
+++ b/exerciseTypes.js
@@ -0,0 +1,36 @@
+var exerciseTypes = [
+ { name: "One Arm Dumbbell Row", tags: ["back"] },
+ { name: "Lat Pulldown Wide", tags: ["back"] },
+ { name: "Lat Pulldown Narrow", tags: ["back"] },
+ { name: "Cable Row w/ Wide Neutral Grip", tags: ["back"] },
+ { name: "Cable Row w/ Neutral Grip", tags: ["back"] },
+ { name: "Cable Row w/ Over Grip", tags: ["back"] },
+ { name: "Rear Deltoid Machine", tags: ["back"] },
+ { name: "Biceps Curl", tags: ["biceps"] },
+ { name: "Hammer Curl", tags: ["biceps"] },
+ { name: "Military Press", tags: [] },
+ { name: "Bench Press", tags: [] },
+ { name: "Bench Press Dumbbell", tags: [] },
+ { name: "Butterfly", tags: [] },
+ /*
+ "Incline Bench Press",
+ "Incline Bench Press Dumbbell",
+ "Leg Press",
+ "Squat",
+ "Leg Curl",
+ "Leg Extension",
+ "Dips",
+ "Under Grip Pull Up",
+ "Over Grip Pull Up",
+ "Cable Biceps Curl",
+ "Supported Biceps Curl",
+ "Cable Triceps",
+ "Deadlift",
+ "Standing Calf Raises",
+ "Face Pull",
+ "Machine Shoulder Press",
+ "Dumbbell Shoulder Press",
+ "Machine Bench Press",
+ "21s"
+ */
+];
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..3346073
--- /dev/null
+++ b/index.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+ Workout
+
+ Today's workout muscle group:
+
+
+
+ Today's workout type:
+
+
+
+
+ Today's exercises:
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
new file mode 100644
index 0000000..059a7a1
--- /dev/null
+++ b/main.js
@@ -0,0 +1,52 @@
+exercises = [
+ { exerciseType: exerciseTypes[0], repetitionType: "2-4", reps: "", weight: "2" },
+ { exerciseType: exerciseTypes[0], repetitionType: "2-4", reps: "3", weight: "" }
+]
+var exerciseList = document.getElementById("exercise-list");
+
+function setExercises(exercises) {
+ exerciseList.innerHTML = ''
+ exercises.forEach(element => {
+ var li = document.createElement("li");
+ li.appendChild(document.createTextNode("Exercise "));
+ var exType = document.createElement("select");
+ exerciseTypes.forEach(exercise => {
+ exType.add(new Option(exercise.name, exercise.name));
+ });
+ li.appendChild(exType);
+ var repType = document.createElement("select");
+ repetitionTypes.forEach(repetitionType => {
+ repType.add(new Option(repetitionType, repetitionType));
+ });
+ li.appendChild(repType);
+ li.appendChild(document.createTextNode("Reps done: "));
+ var reps = document.createElement("input");
+ reps.setAttribute("type", "number");
+ reps.value = element.reps;
+ li.appendChild(reps);
+ li.appendChild(document.createTextNode("Weight done: "));
+ var weight = document.createElement("input");
+ weight.setAttribute("type", "number");
+ weight.value = element.weight;
+ li.appendChild(weight);
+ exerciseList.appendChild(li);
+ });
+}
+
+function exercisesEdited() {
+ document.querySelectorAll("#exercise-list > li > input").forEach(element => {
+ if (element.value != "" && element.value != null) {
+ console.log("b");
+ }
+ });
+ return false;
+}
+
+var addExerciseButton = document.getElementById("add-exercise");
+addExerciseButton.onclick = () => {
+ exercises.push({ exerciseType: "", repetitionType: "", reps: "", weight: "" });
+ setExercises(exercises);
+}
+
+setExercises(exercises);
+console.log(exercisesEdited());
diff --git a/repTypes.js b/repTypes.js
new file mode 100644
index 0000000..680cf48
--- /dev/null
+++ b/repTypes.js
@@ -0,0 +1,10 @@
+repetitionTypes = [
+ "2-4",
+ "3-5",
+ "5-8",
+ "8-12",
+ "12-15",
+ "15-20",
+ "Pyramid",
+ "Drop Set 5-8"
+]
\ No newline at end of file