Workout Plan Generator
Define your training style and generate a structured weekly workout schedule.
PERSONALIZED TRAINING PLAN
Goal: | Days/Week:
Primary Goal
Hypertrophy (Muscle Gain)
Total Weekly Sets
0
Estimated Time
0 min
Weekly Schedule Overview
Detailed Routine List
[Image of main muscle groups] *For Hypertrophy, aim for 10-20 sets per muscle group per week. This plan is a template; adjust weight/RPE based on individual performance.*
Add Exercise to Routine
Current Routine Exercises (0)
Training Goals
No exercises added yet.
'; document.getElementById('current-exercise-count').innerText = 0; return; } routine.sort((a, b) => { const dayA = weekdays.indexOf(a.day); const dayB = weekdays.indexOf(b.day); return dayA - dayB; }); routine.forEach(ex => { const item = document.createElement('div'); item.className = 'flex items-center justify-between p-3 mb-2 bg-white border border-gray-200 rounded-lg shadow-sm'; item.innerHTML = `
${ex.exercise}
(${ex.sets}x ${ex.reps})
`;
container.appendChild(item);
});
document.getElementById('current-exercise-count').innerText = routine.length;
}
function wpgUpdateDashboard() {
const goal = document.getElementById('inp-goal').value || 'Undefined';
const daysPerWeek = parseInt(document.getElementById('inp-days').value) || 0;
const experience = document.getElementById('inp-experience').value || 'N/A';
const scheduleContainer = document.getElementById('weekly-schedule-container');
const detailedListContainer = document.getElementById('detailed-routine-list');
scheduleContainer.innerHTML = '';
detailedListContainer.innerHTML = '';
let totalSets = 0;
let totalTime = 0;
const routinesByDay = {};
weekdays.forEach(day => routinesByDay[day] = []);
routine.forEach(ex => {
if (ex.day !== 'Rest') {
routinesByDay[ex.day].push(ex);
totalSets += ex.sets;
totalTime += ex.duration;
}
});
// --- 1. Render Weekly Schedule Overview ---
const activeDays = weekdays.slice(0, daysPerWeek);
const restDays = weekdays.slice(daysPerWeek);
// Determine columns needed based on actual routine data
const uniqueDaysWithWork = new Set(routine.map(r => r.day));
const scheduleDays = weekdays.filter(day => uniqueDaysWithWork.has(day) || activeDays.includes(day));
// Ensure container columns are set appropriately for responsiveness
scheduleContainer.className = `grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-${Math.min(4, scheduleDays.length)} gap-4`;
scheduleDays.forEach(day => {
const exercises = routinesByDay[day] || [];
const isRest = !activeDays.includes(day) && exercises.length === 0;
let dayTotalSets = 0;
let dayTotalTime = 0;
const exerciseHtml = exercises.map(ex => {
dayTotalSets += ex.sets;
dayTotalTime += ex.duration;
return `${ex.day} | ${ex.load} | ${ex.duration} min
${ex.exercise} (${ex.sets}x ${ex.reps})
`;
}).join('');
scheduleContainer.innerHTML += `
${day} ${isRest ? '(Rest Day)' : ''}
${isRest ? 'Scheduled Rest or Active Recovery.
' : exerciseHtml} ${!isRest && exercises.length > 0 ? `Volume: ${dayTotalSets} sets | Est Time: ${dayTotalTime} min
` : ''}
${ex.exercise}
Day: ${ex.day} | Sets: ${ex.sets} | Reps: ${ex.reps} | Load: ${ex.load} | Est. Time: ${ex.duration} min
