Skip to content

Commit 642b66e

Browse files
authored
Merge pull request #43 from Bruno-366/copilot/fix-42
Add rounds and numeric duration/distance to HIIT workouts in blockTemplates.ts
2 parents 4282e53 + fc15a43 commit 642b66e

File tree

3 files changed

+50
-27
lines changed

3 files changed

+50
-27
lines changed

β€Žsrc/blockTemplates.tsβ€Ž

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const blockTemplates = {
174174
days: [
175175
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x6", intensity: 75 },
176176
{ type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x12", intensity: 65 },
177-
{ type: "hiit", activity: "Reset-20", duration: 20 },
177+
{ type: "hiit", activity: "Reset-20", duration: 20, rounds: 5 },
178178
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x6", intensity: 75 },
179179
{ type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x12", intensity: 65 },
180180
{ type: "rest" },
@@ -185,7 +185,7 @@ export const blockTemplates = {
185185
days: [
186186
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x5", intensity: 80 },
187187
{ type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x10", intensity: 70 },
188-
{ type: "hiit", activity: "Reset-20", duration: 15 },
188+
{ type: "hiit", activity: "Reset-20", duration: 15, rounds: 4 },
189189
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x5", intensity: 80 },
190190
{ type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x10", intensity: 70 },
191191
{ type: "rest" },
@@ -196,7 +196,7 @@ export const blockTemplates = {
196196
days: [
197197
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x3", intensity: 85 },
198198
{ type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x8", intensity: 75 },
199-
{ type: "hiit", activity: "Reset-20", duration: 15 },
199+
{ type: "hiit", activity: "Reset-20", duration: 15, rounds: 4 },
200200
{ type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x3", intensity: 85 },
201201
{ type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x8", intensity: 75 },
202202
{ type: "rest" },
@@ -211,7 +211,7 @@ export const blockTemplates = {
211211
days: [
212212
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x6,3x6,1x6", intensity: 75 },
213213
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x12,4x12,4x12", intensity: 65 },
214-
{ type: "hiit", activity: "Reset-20", duration: 20 },
214+
{ type: "hiit", activity: "Reset-20", duration: 20, rounds: 5 },
215215
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x6,3x6,1x6", intensity: 75 },
216216
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x12,4x12,4x12", intensity: 65 },
217217
{ type: "rest" },
@@ -222,7 +222,7 @@ export const blockTemplates = {
222222
days: [
223223
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x5,3x5,1x5", intensity: 80 },
224224
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x10,4x10,4x10", intensity: 70 },
225-
{ type: "hiit", activity: "Reset-20", duration: 15 },
225+
{ type: "hiit", activity: "Reset-20", duration: 15, rounds: 4 },
226226
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x5,3x5,1x5", intensity: 80 },
227227
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x10,4x10,4x10", intensity: 70 },
228228
{ type: "rest" },
@@ -233,7 +233,7 @@ export const blockTemplates = {
233233
days: [
234234
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x3,3x3,1x3", intensity: 85 },
235235
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x8,4x8,4x8", intensity: 75 },
236-
{ type: "hiit", activity: "Reset-20", duration: 15 },
236+
{ type: "hiit", activity: "Reset-20", duration: 15, rounds: 4 },
237237
{ type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x3,3x3,1x3", intensity: 85 },
238238
{ type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x8,4x8,4x8", intensity: 75 },
239239
{ type: "rest" },
@@ -248,7 +248,7 @@ export const blockTemplates = {
248248
days: [
249249
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x12", intensity: 50 },
250250
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x12", intensity: 50 },
251-
{ type: "hiit", activity: "Hill Sprints", duration: "3 sprints" },
251+
{ type: "hiit", activity: "Hill Sprints", rounds: 3 },
252252
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x12", intensity: 55 },
253253
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x12", intensity: 55 },
254254
{ type: "rest" },
@@ -259,7 +259,7 @@ export const blockTemplates = {
259259
days: [
260260
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x10", intensity: 60 },
261261
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x10", intensity: 60 },
262-
{ type: "hiit", activity: "Hill Sprints", duration: "5 sprints" },
262+
{ type: "hiit", activity: "Hill Sprints", rounds: 5 },
263263
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x10", intensity: 65 },
264264
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x10", intensity: 65 },
265265
{ type: "rest" },
@@ -270,7 +270,7 @@ export const blockTemplates = {
270270
days: [
271271
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x8", intensity: 70 },
272272
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x8", intensity: 70 },
273-
{ type: "hiit", activity: "Hill Sprints", duration: "7 sprints" },
273+
{ type: "hiit", activity: "Hill Sprints", rounds: 7 },
274274
{ type: "hypertrophy", exercises: ["DB Shoulder Press", "1-Arm DB Bench Press", "Weighted Dips", "Weighted Pull-Ups", "1-Arm DB Rows", "DB Upright Rows", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x8", intensity: 75 },
275275
{ type: "hypertrophy", exercises: ["Leg Extensions", "Lying Leg Curls", "Leg Press", "Calf Raises", "Back Extensions", "Hanging Leg Raises", "Adduction Machine", "Abduction Machine"], sets: "4x8", intensity: 75 },
276276
{ type: "rest" },
@@ -285,29 +285,29 @@ export const blockTemplates = {
285285
days: [
286286
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 70 },
287287
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 70 },
288-
{ type: "hiit", activity: "Tempo Run", duration: "5 km" },
288+
{ type: "hiit", activity: "Tempo Run", distance: 5000 },
289289
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 70 },
290290
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 70 },
291-
{ type: "hiit", activity: "GC 9", duration: "" },
291+
{ type: "hiit", activity: "GC 9", distance: 100, rounds: 10 },
292292
{ type: "rest" }
293293
]
294294
},
295295
{
296296
days: [
297297
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 80 },
298298
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 80 },
299-
{ type: "hiit", activity: "600m Resets", duration: "" },
299+
{ type: "hiit", activity: "600m Resets", distance: 600, rounds: 6 },
300300
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 80 },
301301
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 80 },
302-
{ type: "hiit", activity: "GC 9", duration: "" },
302+
{ type: "hiit", activity: "GC 9", distance: 100, rounds: 10 },
303303
{ type: "rest" }
304304
]
305305
},
306306
{
307307
days: [
308308
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 90 },
309309
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x3", intensity: 90 },
310-
{ type: "hiit", activity: "Tempo Run", duration: "5 km" },
310+
{ type: "hiit", activity: "Tempo Run", distance: 5000 },
311311
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 90 },
312312
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x3,5x3", intensity: 90 },
313313
{ type: "rest" },
@@ -318,29 +318,29 @@ export const blockTemplates = {
318318
days: [
319319
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 75 },
320320
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 75 },
321-
{ type: "hiit", activity: "600m Resets", duration: "" },
321+
{ type: "hiit", activity: "600m Resets", distance: 600, rounds: 6 },
322322
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 75 },
323323
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 75 },
324-
{ type: "hiit", activity: "GC 9", duration: "" },
324+
{ type: "hiit", activity: "GC 9", distance: 100, rounds: 10 },
325325
{ type: "rest" }
326326
]
327327
},
328328
{
329329
days: [
330330
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 85 },
331331
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x3", intensity: 85 },
332-
{ type: "hiit", activity: "Tempo Run", duration: "5 km" },
332+
{ type: "hiit", activity: "Tempo Run", distance: 5000 },
333333
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 85 },
334334
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x3,5x3", intensity: 85 },
335-
{ type: "hiit", activity: "GC 9", duration: "" },
335+
{ type: "hiit", activity: "GC 9", distance: 100, rounds: 10 },
336336
{ type: "rest" }
337337
]
338338
},
339339
{
340340
days: [
341341
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x2", intensity: 95 },
342342
{ type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x2", intensity: 95 },
343-
{ type: "hiit", activity: "600m Resets", duration: "" },
343+
{ type: "hiit", activity: "600m Resets", distance: 600, rounds: 6 },
344344
{ type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x2", intensity: 95 },
345345
{ type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x2,5x2", intensity: 95 },
346346
{ type: "rest" },

β€Žsrc/components/CardioWorkouts.svelteβ€Ž

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
4646
// Start LiSS timer function
4747
const startLissTimer = () => {
48-
const duration = cardioWorkout().duration as number
48+
const duration = cardioWorkout().duration
49+
if (duration === undefined) return
50+
4951
const durationInSeconds = duration * 60
5052
const now = Date.now()
5153
@@ -120,7 +122,7 @@
120122
121123
// Derived timer display values
122124
const displayDuration = $derived(() => {
123-
if (workout.type === 'liss' && typeof cardioWorkout().duration === 'number') {
125+
if (workout.type === 'liss' && cardioWorkout().duration !== undefined) {
124126
if (lissTimer.isActive || lissTimer.isPaused || lissTimer.timeLeft > 0) {
125127
// Show countdown timer
126128
const minutes = Math.floor(lissTimer.timeLeft / 60)
@@ -135,7 +137,7 @@
135137
})
136138
137139
const showTimerControls = $derived(() => {
138-
return workout.type === 'liss' && typeof cardioWorkout().duration === 'number'
140+
return workout.type === 'liss' && cardioWorkout().duration !== undefined
139141
})
140142
141143
// Derived button states for conditional styling
@@ -173,11 +175,30 @@
173175
<h3 class="text-2xl font-bold mb-2">
174176
{cardioWorkout().activity}
175177
</h3>
176-
{#if cardioWorkout().duration}
178+
{#if cardioWorkout().duration !== undefined}
177179
<div class="text-4xl font-bold">{displayDuration()}</div>
178-
{#if typeof cardioWorkout().duration === 'number'}
179-
<div class="text-sm opacity-90 mt-1">minutes</div>
180-
{/if}
180+
<div class="text-sm opacity-90 mt-1">
181+
{#if workout.type === 'liss'}
182+
minutes
183+
{:else}
184+
seconds
185+
{/if}
186+
</div>
187+
{/if}
188+
{#if cardioWorkout().distance !== undefined}
189+
<div class="text-4xl font-bold">{cardioWorkout().distance}</div>
190+
<div class="text-sm opacity-90 mt-1">
191+
{#if workout.type === 'liss'}
192+
km
193+
{:else}
194+
m
195+
{/if}
196+
</div>
197+
{/if}
198+
{#if cardioWorkout().rounds !== undefined}
199+
<div class="text-2xl font-semibold mt-2">
200+
{cardioWorkout().rounds} rounds
201+
</div>
181202
{/if}
182203
</div>
183204

β€Žsrc/types.tsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export interface HypertrophyWorkout extends BaseWorkout {
2121
export interface CardioWorkout extends BaseWorkout {
2222
type: 'liss' | 'hiit';
2323
activity: string;
24-
duration: number | string;
24+
duration?: number; // seconds for HIIT, minutes for LISS
25+
distance?: number; // meters for HIIT, kilometers for LISS
26+
rounds?: number;
2527
}
2628

2729
export interface RestWorkout extends BaseWorkout {

0 commit comments

Comments
Β (0)