wip, input of the weights and reps per set. working on state save for each exercise
parent
c036a97d39
commit
831f7c4ad1
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="./logo.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Gym Tracker</title><script type="module" crossorigin src="./assets/index-17e1b7ef.js"></script></head><body><div id="app"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="./logo.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Gym Tracker</title><script type="module" crossorigin src="./assets/index-3d69e972.js"></script></head><body><div id="app"></div></body></html>
|
||||
|
|
@ -4,12 +4,14 @@
|
|||
<h1>Chest</h1>
|
||||
<ExerciseList muscle="Chest"/>
|
||||
</div>
|
||||
<div>
|
||||
<weightsInput/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ExerciseList} from "@/components/Index.js";
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<template>
|
||||
//TODO make view resposive on button click add
|
||||
<div class="w-2/3 mx-auto">
|
||||
<div class="warmup-sets mt-12 w-2/3">
|
||||
<label>Warm-Up Sets</label>
|
||||
<button @click="warmUpAddSet()" class="add-btn bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded ml-5">Add</button>
|
||||
<div v-for="warmupset in warmUpSets" class="item" :key="warmupset">
|
||||
<div v-for="warmupset in warmUpInput.warmUpSets" class="item" :key="warmupset">
|
||||
{{ warmupset }}
|
||||
<input type="warmUpInput" name="warmupweight" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Weight in Kg" />
|
||||
<input name="warmupweight" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Weight in Kg" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -14,14 +15,14 @@
|
|||
<button @click="workingAddSet()" class="add-btn bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded ml-7">Add</button>
|
||||
|
||||
<div>
|
||||
<div v-for="(workingset, index) in workingSets" class="item flex justify-smart mt-3" :key="index">
|
||||
<div v-for="(workingset, index) in workingInput.workingSets" class="item flex justify-smart mt-3" :key="index">
|
||||
{{ workingset }}
|
||||
<div class="ml-3">
|
||||
<input v-model="workingSetInput" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Weight in Kg"/>
|
||||
<input v-model="workingInput.workingSets" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Weight in Kg"/>
|
||||
</div>
|
||||
<label>Reps</label>
|
||||
<div class="ml-3">
|
||||
<input v-model="ExerciseList.workingReps" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Reps">
|
||||
<input v-model="workingInput.workingReps" class="mt-1 px-3 py-2 bg-black border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block rounded-md sm:text-sm focus:ring-1" placeholder="Reps">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -33,38 +34,43 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref} from 'vue'
|
||||
import { useWeightStore } from '@/stores/storeWeight';
|
||||
import {ExerciseList} from "@/components/Index.js";
|
||||
|
||||
let warmUpSetCount = 0;
|
||||
let workingSetCount = 0;
|
||||
|
||||
const weight = useWeightStore();
|
||||
const workingSetInput = ref('');
|
||||
const workingRepsSets = ref('');
|
||||
const warmUpSets = ref([]);
|
||||
const workingSets = ref([]);
|
||||
|
||||
const warmUpInput = () => {
|
||||
weightInput.value = warmUpInput.value;
|
||||
repInput.value = warmUpInput.value;
|
||||
let warmUpInput = {
|
||||
warmUpSets: [],
|
||||
warmUpReps: []
|
||||
}
|
||||
|
||||
let workingInput = {
|
||||
workingSets: [],
|
||||
workingReps: []
|
||||
}
|
||||
|
||||
const warmUpAddSet = () => {
|
||||
const newWarmUpSet = {
|
||||
id: warmUpSetCount++,
|
||||
content: warmUpSetCount + ". Set"
|
||||
};
|
||||
warmUpSets.value.push(newWarmUpSet.content);
|
||||
}
|
||||
warmUpInput.warmUpSets.push(newWarmUpSet.content);
|
||||
console.log(warmUpInput.warmUpSets);
|
||||
};
|
||||
|
||||
const workingAddSet = () => { const newWorkingSet = {
|
||||
const workingAddSet = () => {
|
||||
const newWorkingSet = {
|
||||
id: workingSetCount++,
|
||||
content: workingSetCount + ". Set"
|
||||
};
|
||||
workingSets.value.push(newWorkingSet.content);};
|
||||
workingInput.workingSets.push(newWorkingSet.content);
|
||||
console.log(workingInput);
|
||||
};
|
||||
|
||||
const addWeight = () => {
|
||||
//TODO: Add warmup sets and reps to store
|
||||
weight.addWeight(workingSetInput.value, workingRepsSets.value);
|
||||
workingSetInput.value = "";
|
||||
workingRepsSets.value = "";
|
||||
|
|
|
|||
Loading…
Reference in New Issue