Workout Plan Generator

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)

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})
${ex.day} | ${ex.load} | ${ex.duration} min
`; 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.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
` : ''}
`; }); // --- 2. Render Detailed Routine List (PDF friendly) --- routine.forEach(ex => { detailedListContainer.innerHTML += `

${ex.exercise}

Day: ${ex.day} | Sets: ${ex.sets} | Reps: ${ex.reps} | Load: ${ex.load} | Est. Time: ${ex.duration} min

`; }); // --- 3. Update Stats --- document.getElementById('out-goal-name').innerText = `${goal} (${experience})`; document.getElementById('stat-total-sets').innerText = totalSets; document.getElementById('stat-total-time').innerText = `${totalTime} min`; document.getElementById('out-pdf-goal').innerText = goal; document.getElementById('out-pdf-days').innerText = `${daysPerWeek} training days`; } function wpgDownloadPDF() { wpgUpdateDashboard(); // Ensure latest data is rendered const element = document.getElementById('wpg-print-area'); // Show PDF header and hide controls const headers = element.querySelectorAll('.pdf-header'); headers.forEach(h => h.style.display = 'block'); const controls = element.querySelectorAll('.pdf-hide'); controls.forEach(c => c.style.display = 'none'); const opt = { margin: 0.5, filename: 'Workout_Plan.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' } }; html2pdf().set(opt).from(element).save().then(function() { // Revert changes after download headers.forEach(h => h.style.display = 'none'); controls.forEach(c => c.style.display = 'flex'); // Re-show button container that was hidden by pdf-hide class document.querySelector('.wpg-btn-container').style.display = 'flex'; }); }
Scroll to Top