diff --git a/README.md b/README.md index 192e574..eec4a7c 100644 --- a/README.md +++ b/README.md @@ -109,21 +109,6 @@ Unbroken/ └── .eslintrc.cjs # ESLint configuration ``` -## 🔍 Adding Your React Component - -To add your existing `.tsx` file: - -1. Place your component file in the `src/` directory -2. Import and use it in `src/App.tsx`: - ```tsx - import YourComponent from './YourComponent'; - - function App() { - return ; - } - ``` -3. Install any additional dependencies your component needs - ## 🚨 CI/CD The repository includes GitHub Actions workflow that runs on every push and pull request: @@ -185,4 +170,4 @@ Create `.env` files for different environments: ## 📄 License -This project is open source and available under the [MIT License](LICENSE). \ No newline at end of file +This project is open source and available under the [MIT License](LICENSE). diff --git a/src/App.tsx b/src/App.tsx index e4e4617..8168611 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,31 +1,1096 @@ -import { useState } from 'react' +import React, { useState, useEffect } from 'react'; +import { ChevronRight, Activity, Calendar, Settings, Clock, CheckCircle } from 'lucide-react'; -function App() { - const [count, setCount] = useState(0) +const App = () => { + // Block Templates + const blockTemplates = { + endurance1: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 70 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "3x5", intensity: 70 }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 70 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 80 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "3x5", intensity: 80 }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 80 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x3", intensity: 90 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "3x3", intensity: 90 }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x3", intensity: 90 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 75 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "3x5", intensity: 75 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x5", intensity: 75 }, + { type: "liss", activity: "LISS run", duration: 120 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x3", intensity: 85 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "3x3", intensity: 85 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "3x3", intensity: 85 }, + { type: "liss", activity: "LISS run", duration: 120 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "4x2", intensity: 95 }, + { type: "liss", activity: "LISS run", duration: 90 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Trap Bar Deadlift"], sets: "4x2", intensity: 95 }, + { type: "liss", activity: "LISS run", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Front Squat", "Weighted Pull-up"], sets: "4x2", intensity: 95 }, + { type: "liss", activity: "LISS run", duration: 120 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "deload" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "rest" } + ] + } + ] + }, + powerbuilding1: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x8", intensity: 60 }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x8", intensity: 60 }, + { type: "liss", activity: "LISS run", duration: 20 }, + { type: "strength", exercises: ["Deadlift"], sets: "5x8", intensity: 60 }, + { type: "liss", activity: "Ruck", duration: 60 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x6", intensity: 70 }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x6", intensity: 70 }, + { type: "liss", activity: "LISS run", duration: 20 }, + { type: "strength", exercises: ["Deadlift"], sets: "5x5", intensity: 70 }, + { type: "liss", activity: "Ruck", duration: 60 }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 80 }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 80 }, + { type: "liss", activity: "LISS run", duration: 20 }, + { type: "strength", exercises: ["Deadlift"], sets: "10x3", intensity: 80 }, + { type: "liss", activity: "Ruck", duration: 60 }, + { type: "rest" } + ] + } + ] + }, + powerbuilding2: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x8,4x12", intensity: "70,55" }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Deadlift"], sets: "4x8,4x12", intensity: "70,55" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x8,4x12", intensity: "70,55" }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x6,4x10", intensity: "75,60" }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Deadlift"], sets: "4x6,4x10", intensity: "75,60" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x6,4x10", intensity: "75,60" }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x3,4x8", intensity: "80,65" }, + { type: "liss", activity: "Walk", duration: 60 }, + { type: "strength", exercises: ["Overhead Press", "Deadlift"], sets: "4x3,4x8", intensity: "80,65" }, + { type: "liss", activity: "LISS run", duration: 30 }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "4x3,4x8", intensity: "80,65" }, + { type: "rest" }, + { type: "rest" } + ] + } + ] + }, + powerbuilding3: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x6", intensity: 75 }, + { type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x12", intensity: 65 }, + { type: "hiit", activity: "Reset-20", duration: 20 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x6", intensity: 75 }, + { type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x12", intensity: 65 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x5", intensity: 80 }, + { type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x10", intensity: 70 }, + { type: "hiit", activity: "Reset-20", duration: 15 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x5", intensity: 80 }, + { type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x10", intensity: 70 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x3", intensity: 85 }, + { type: "hypertrophy", exercises: ["DB Chest Flys", "DB Reverse Flys", "DB Lateral Raises", "DB Pullovers", "DB Bicep Curls", "DB Skull Crushers"], sets: "4x8", intensity: 75 }, + { type: "hiit", activity: "Reset-20", duration: 15 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Power Clean"], sets: "3x3", intensity: 85 }, + { type: "hypertrophy", exercises: ["KB Bulgarian Split Squat", "KB Cossack Squat", "KB Hack Squat", "Calf Raise", "Adduction Machine", "Abduction Machine"], sets: "4x8", intensity: 75 }, + { type: "rest" }, + { type: "rest" } + ] + } + ] + }, + powerbuilding3bulgarian: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x6,3x6,1x6", intensity: 75 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x12,4x12,4x12", intensity: 65 }, + { type: "hiit", activity: "Reset-20", duration: 20 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x6,3x6,1x6", intensity: 75 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x12,4x12,4x12", intensity: 65 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x5,3x5,1x5", intensity: 80 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x10,4x10,4x10", intensity: 70 }, + { type: "hiit", activity: "Reset-20", duration: 15 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x5,3x5,1x5", intensity: 80 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x10,4x10,4x10", intensity: 70 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x3,3x3,1x3", intensity: 85 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x8,4x8,4x8", intensity: 75 }, + { type: "hiit", activity: "Reset-20", duration: 15 }, + { type: "strength", exercises: ["Bench Press", "Squat", "Deadlift"], sets: "3x3,3x3,1x3", intensity: 85 }, + { type: "hypertrophy", exercises: ["Bench Press", "Squat", "Romanian Deadlift"], sets: "4x8,4x8,4x8", intensity: 75 }, + { type: "rest" }, + { type: "rest" } + ] + } + ] + }, + bodybuilding: { + weeks: [ + { + days: [ + { 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 }, + { 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 }, + { type: "hiit", activity: "Hill Sprints", duration: "3 sprints" }, + { 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 }, + { 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 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { 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 }, + { 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 }, + { type: "hiit", activity: "Hill Sprints", duration: "5 sprints" }, + { 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 }, + { 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 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { 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 }, + { 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 }, + { type: "hiit", activity: "Hill Sprints", duration: "7 sprints" }, + { 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 }, + { 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 }, + { type: "rest" }, + { type: "rest" } + ] + } + ] + }, + strength: { + weeks: [ + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 70 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 70 }, + { type: "hiit", activity: "Tempo Run", duration: "5 km" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 70 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 70 }, + { type: "hiit", activity: "GC 9", duration: "" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 80 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 80 }, + { type: "hiit", activity: "600m Resets", duration: "" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 80 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 80 }, + { type: "hiit", activity: "GC 9", duration: "" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 90 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x3", intensity: 90 }, + { type: "hiit", activity: "Tempo Run", duration: "5 km" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 90 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x3,5x3", intensity: 90 }, + { type: "rest" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 75 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x5", intensity: 75 }, + { type: "hiit", activity: "600m Resets", duration: "" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x5", intensity: 75 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x5,5x5", intensity: 75 }, + { type: "hiit", activity: "GC 9", duration: "" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 85 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x3", intensity: 85 }, + { type: "hiit", activity: "Tempo Run", duration: "5 km" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x3", intensity: 85 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x3,5x3", intensity: 85 }, + { type: "hiit", activity: "GC 9", duration: "" }, + { type: "rest" } + ] + }, + { + days: [ + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x2", intensity: 95 }, + { type: "strength", exercises: ["Weighted Pull-up", "Overhead Press"], sets: "5x2", intensity: 95 }, + { type: "hiit", activity: "600m Resets", duration: "" }, + { type: "strength", exercises: ["Bench Press", "Squat"], sets: "5x2", intensity: 95 }, + { type: "strength", exercises: ["Deadlift", "Overhead Press"], sets: "3x2,5x2", intensity: 95 }, + { type: "rest" }, + { type: "rest" } + ] + } + ] + } + }; - return ( -
-
-

- Unbroken -

-
- +
+ ); + }; + + const renderExerciseSet = (exercise, exerciseIndex, setScheme, schemeIndex, intensity, weight, workout) => { + const [sets, reps] = setScheme.split('x'); + const warmupSets = workout.type === 'strength' && weight > 0 ? calculateWarmupSets(exercise, weight) : []; + + return ( +
+

{exercise}

+
+ {setScheme} @ {intensity}%{weight > 0 && ` (${weight} ${state.weightUnit})`} +
+ + {warmupSets.length > 0 && ( +
+
Warm-up Sets
+
+ {warmupSets.map((warmupSet, warmupIndex) => ( +
+
+ Warm-up {warmupIndex + 1} + {warmupSet.reps} reps + {warmupSet.weight} {state.weightUnit} +
+ +
+ ))} +
+
+ )} + +
+
Working Sets
+ {Array.from({ length: parseInt(sets) }).map((_, setIndex) => ( +
+
+ Set {setIndex + 1} + {reps} reps +
+
+ {weight > 0 && ( +
+ + {state.weightUnit} +
+ )} + +
+
+ ))} +
+
+ ); + }; + + const renderWorkout = () => { + const workout = getCurrentWorkout(); + if (!workout) return

Workout template not yet implemented

; + + if (['rest', 'deload', 'liss', 'hiit'].includes(workout.type)) { + return renderSimpleWorkout(workout.type, workout); + } + + if (workout.type === 'strength' || workout.type === 'hypertrophy') { + return ( +
+ {workout.exercises.map((exercise, exerciseIndex) => { + const setSchemes = workout.sets.split(','); + const intensities = String(workout.intensity).split(','); + const shouldMapByIndex = setSchemes.length === workout.exercises.length; + const exerciseSetSchemes = shouldMapByIndex ? [setSchemes[exerciseIndex]] : setSchemes; + + return exerciseSetSchemes.map((setScheme, schemeIndex) => { + const intensityIndex = shouldMapByIndex ? exerciseIndex : schemeIndex; + const intensity = parseInt(intensities[intensityIndex] || intensities[0]); + const weight = workout.type === 'strength' ? + calculateWeight(exercise, intensity) : + calculateHypertrophyWeight(exercise, intensity); + + return renderExerciseSet(exercise, exerciseIndex, setScheme, schemeIndex, intensity, weight, workout); + }); + })} + -

- This is a barebones React app ready for your custom component. -

-

- Ready to be deployed on Cloudflare Pages -

+ ); + } + return null; + }; + + const currentBlockInfo = state.customPlan[0]; + const progressPercent = ((state.currentWeek - 1) / currentBlockInfo.weeks) * 100; + const { strengthExercises, hypertrophyExercises } = getCurrentBlockExercises(); + + return ( +
+
+
+

TACTICAL BARBELL

+

Hybrid Athlete Tracker

+
+ +
+ {['overview', 'workout', 'history', 'settings'].map((tab) => ( + + ))} +
+ +
+ {state.activeTab === 'overview' && ( +
+
+

Current Block

+
{currentBlockInfo.name}
+
+
+
+
Week {state.currentWeek} of {currentBlockInfo.weeks}
+
+ +
+

Upcoming Blocks

+ {state.customPlan.slice(1, 4).map((block, index) => ( +
+
{block.name}
+
{block.weeks} weeks
+
+ ))} +
+ + +
+ )} + + {state.activeTab === 'workout' && ( +
+
+
Week {state.currentWeek}, Day {state.currentDay}
+
{currentBlockInfo.name}
+
+ {renderWorkout()} +
+ )} + + {state.activeTab === 'history' && ( +
+ {state.completedWorkouts.length === 0 ? ( +
+ +

No workout history yet

+

Complete your first workout to see it here

+
+ ) : ( +
+ {state.completedWorkouts.slice(-10).reverse().map((workout, index) => { + const date = new Date(workout.date); + const workoutType = workout.details?.type || 'unknown'; + const config = HISTORY_CONFIGS[workoutType] || HISTORY_CONFIGS.rest; + const workoutSummary = config.getSummary ? config.getSummary(workout.details) : config.summary; + + return ( +
+
+
+ {date.toLocaleDateString()} at {date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} +
+ + {config.label} + +
+
{workout.blockName || 'Unknown Block'}
+
Week {workout.week}, Day {workout.day}
+ {workoutSummary &&
{workoutSummary}
} + {workout.details?.sets && ( +
+ Sets: {workout.details.sets}{workout.details.intensity && ` @ ${workout.details.intensity}%`} +
+ )} +
+ ); + })} +
+ )} +
+ )} + + {state.activeTab === 'settings' && ( +
+
+

Training Plan

+
+ {state.customPlan.map((block, index) => ( +
+ {index > 0 && ( +
handleDrag('over', { e })} + onDragEnter={(e) => handleDrag('enter', { e, index })} + onDragLeave={(e) => handleDrag('leave', { e })} + onDrop={(e) => handleDrag('drop', { e, index })} + className={state.draggedIndex !== null && state.dragOverIndex === index + ? 'min-h-16 border-2 border-dashed border-blue-400 bg-blue-50 rounded-lg flex items-center justify-center mb-3 p-3' + : 'h-3 mb-3' + } + > + {state.draggedIndex !== null && state.dragOverIndex === index && ( + Drop here + )} +
+ )} + +
handleDrag('start', { e, index })} + onDragEnd={() => handleDrag('end', {})} + className={`border rounded-lg p-3 ${ + index === 0 ? 'border-blue-500 bg-blue-50 border-2' : 'border-gray-200 hover:shadow-md cursor-move' + } ${state.draggedIndex === index ? 'opacity-50 transform rotate-2' : ''}`} + > +
+ {index !== 0 &&
⋮⋮
} +
+
+ {index === 0 && Current} +
{block.name}
+
+
{block.weeks} weeks
+
+ {index !== 0 && ( + + )} +
+ {index === 0 && ( +
+ Week {state.currentWeek} of {block.weeks} • Day {state.currentDay} +
+ )} +
+
+ ))} +
+ +
+ + +
+
+ +
+

Exercise Database - {currentBlockInfo.name}

+
+ Showing exercises for your current block. Values update automatically for weight calculations. +
+ + {strengthExercises.length > 0 && ( +
+

+ + Strength Exercises (1RM - {state.weightUnit}) +

+
+ {strengthExercises.map((exercise) => { + const exerciseKey = getExerciseKey(exercise); + + return ( +
+ + updateState({ + maxes: { ...state.maxes, [exerciseKey]: parseFloat(e.target.value) || 0 } + })} + className="w-24 p-2 border-2 border-gray-300 rounded-lg text-sm font-medium focus:border-red-500 focus:ring-2 focus:ring-red-200 transition-all" + placeholder="1RM" + step={state.weightUnit === 'kg' ? '2.5' : '5'} + /> +
+ ); + })} +
+
+ )} + + {hypertrophyExercises.length > 0 && ( +
+

+ + Hypertrophy Exercises (10RM - {state.weightUnit}) +

+
+ {hypertrophyExercises.map((exercise) => { + const exerciseKey = getExerciseKey(exercise); + + return ( +
+ + updateState({ + tenRMs: { ...state.tenRMs, [exerciseKey]: parseFloat(e.target.value) || 0 } + })} + className="w-24 p-2 border-2 border-gray-300 rounded-lg text-sm font-medium focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all" + placeholder="10RM" + step="1" + /> +
+ ); + })} +
+
+ )} + + {strengthExercises.length === 0 && hypertrophyExercises.length === 0 && ( +
+ +

No resistance exercises in current block

+

Switch to a strength or powerbuilding block to see exercise settings

+
+ )} +
+ +
+

Preferences

+ + +
+ + + + {state.showResetConfirm && ( +
+
+

Reset All Progress?

+

Are you sure you want to reset all progress? This cannot be undone.

+
+ + +
+
+
+ )} +
+ )} +
- ) -} + ); +}; -export default App \ No newline at end of file +export default App;