';
return;
}
// Create HTML for each day
plan.forEach(dayPlan => {
const dayCard = document.createElement('div');
dayCard.className = 'wpg-day-card';
// Day header
const dayHeader = document.createElement('h3');
dayHeader.className = 'wpg-day-title';
dayHeader.textContent = dayPlan.day;
dayCard.appendChild(dayHeader);
// Warm-up section
const warmupSection = this.createExerciseSection('Warm-up', dayPlan.warmup);
dayCard.appendChild(warmupSection);
// Main workout section
const mainSection = this.createExerciseSection('Main Workout', dayPlan.main);
dayCard.appendChild(mainSection);
// Cool-down section
const cooldownSection = this.createExerciseSection('Cool-down', dayPlan.cooldown);
dayCard.appendChild(cooldownSection);
// Add to plan display
this.planDisplay.appendChild(dayCard);
});
},
// Create HTML for an exercise section
createExerciseSection: function(title, exercises) {
const section = document.createElement('div');
section.className = 'wpg-exercise-section';
const sectionTitle = document.createElement('h4');
sectionTitle.textContent = title;
section.appendChild(sectionTitle);
const exerciseList = document.createElement('ul');
exerciseList.className = 'wpg-exercise-list';
exercises.forEach(exercise => {
const listItem = document.createElement('li');
listItem.className = 'wpg-exercise-item';
const emojiSpan = document.createElement('span');
emojiSpan.className = 'wpg-exercise-emoji';
emojiSpan.textContent = exercise.emoji;
emojiSpan.setAttribute('aria-hidden', 'true');
const textSpan = document.createElement('span');
textSpan.textContent = `${exercise.name} (${exercise.duration} min)`;
listItem.appendChild(emojiSpan);
listItem.appendChild(textSpan);
exerciseList.appendChild(listItem);
});
section.appendChild(exerciseList);
return section;
},
// Save plan to localStorage
savePlan: function(plan, quote) {
const planData = {
plan: plan,
quote: quote,
timestamp: new Date().toISOString()
};
localStorage.setItem('workoutPlan', JSON.stringify(planData));
},
// Copy plan to clipboard
copyToClipboard: function() {
// Create text representation of the plan
let textToCopy = "MY CUSTOM WORKOUT PLAN\n\n";
const planData = JSON.parse(localStorage.getItem('workoutPlan'));
if (!planData || !planData.plan) {
this.showError("No workout plan available to copy.");
return;
}
planData.plan.forEach(day => {
textToCopy += `${day.day.toUpperCase()}\n`;
textToCopy += "Warm-up:\n";
day.warmup.forEach(ex => {
textToCopy += `- ${ex.emoji} ${ex.name} (${ex.duration} min)\n`;
});
textToCopy += "Main Workout:\n";
day.main.forEach(ex => {
textToCopy += `- ${ex.emoji} ${ex.name} (${ex.duration} min)\n`;
});
textToCopy += "Cool-down:\n";
day.cooldown.forEach(ex => {
textToCopy += `- ${ex.emoji} ${ex.name} (${ex.duration} min)\n`;
});
textToCopy += "\n";
});
textToCopy += `Motivational Quote: "${planData.quote}"`;
// Use the Clipboard API to copy text
navigator.clipboard.writeText(textToCopy).then(() => {
// Provide visual feedback
const originalText = this.copyButton.textContent;
this.copyButton.textContent = "Copied!";
setTimeout(() => {
this.copyButton.textContent = originalText;
}, 2000);
}).catch(err => {
console.error('Failed to copy: ', err);
this.showError('Failed to copy to clipboard. Please try again.');
});
},
// Download plan as PDF
downloadAsPDF: function() {
const planData = JSON.parse(localStorage.getItem('workoutPlan'));
if (!planData || !planData.plan) {
this.showError("No workout plan available to download.");
return;
}
// Create a printable version
const printableContent = document.createElement('div');
printableContent.innerHTML = `
Your Custom Workout Plan
"${planData.quote}"
${planData.plan.map(day => `
${day.day}
Warm-up:
${day.warmup.map(ex => `- ${ex.emoji} ${ex.name} (${ex.duration} min)
`).join('')}
Main Workout:
${day.main.map(ex => `- ${ex.emoji} ${ex.name} (${ex.duration} min)
`).join('')}
Cool-down:
${day.cooldown.map(ex => `- ${ex.emoji} ${ex.name} (${ex.duration} min)
`).join('')}
`).join('')}
`;
// Create a new window for printing
const printWindow = window.open('', '_blank');
printWindow.document.write(`
My Workout Plan
${printableContent.innerHTML}
`);
printWindow.document.close();
// Wait for content to load then print
printWindow.onload = function() {
printWindow.print();
};
},
// Toggle share options visibility
toggleShareOptions: function(e) {
e.stopPropagation();
this.shareOptions.classList.toggle('show');
},
// Share plan on social media
sharePlan: function(e) {
const platform = e.target.classList[1].split('-')[1]; // Get platform from class
const planData = JSON.parse(localStorage.getItem('workoutPlan'));
if (!planData) {
this.showError("No workout plan available to share.");
return;
}
// Create share text
let shareText = "Check out my custom workout plan!";
// Platform-specific sharing URLs
let shareUrl = "";
const encodedText = encodeURIComponent(shareText);
switch(platform) {
case 'whatsapp':
shareUrl = `https://wa.me/?text=${encodedText}`;
break;
case 'twitter':
shareUrl = `https://twitter.com/intent/tweet?text=${encodedText}`;
break;
case 'facebook':
shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}"e=${encodedText}`;
break;
}
// Open share window
if (shareUrl) {
window.open(shareUrl, '_blank', 'width=600,height=400');
}
// Hide share options
this.shareOptions.classList.remove('show');
}
};
// Initialize the workout generator
workoutGenerator.init();
});
How to use the Workout Plan Generator
- Select Gender: Choose your gender from the dropdown menu.
- Set Fitness Goal: Pick what you want to achieve (e.g., weight loss, muscle gain).
- Choose Workout Level: Select your experience level (e.g., Beginner, Intermediate).
- Set Frequency: Choose how many days per week you want to work out.
- Set Duration: Select how many minutes you want each session to last.
- Get Results: Click the blue Generate Workout Plan button to see your custom routine.
Use Cases
Discover how our Workout Plan Generator can make fitness simple and effective for everyone
💡
Personal Trainers
Easily generate personalized workout plans tailored to each client’s fitness goals and preferences.
👨🏫
Fitness Coaches
Design structured training programs for groups and bootcamps quickly and effectively.
🏋️
Gym Owners
Offer diverse, custom workout plans to engage your gym members and keep them motivated.
🏆
Sports Teams
Build performance-focused training routines that boost speed, strength, and conditioning.
⭐
Fitness Enthusiasts
Stay on track with progressive workout plans designed for your personal fitness journey.
✨
Corporate Wellness Programs
Support workplace wellness with accessible, easy-to-follow workout plans for employees.
FAQs
What is a Workout Plan Generator?
A Workout Plan Generator is an online tool that creates a personalized exercise plan for you based on your fitness goal, level, available time, and equipment. No more guessing — you get a ready-to-follow routine in seconds.
Can beginners use this tool?
Absolutely! In fact, it’s perfect for beginners. Just select “Beginner” as your level, and the generator will give you safe, simple workouts to get started without overwhelming you.
How many days per week should I train?
That depends on your schedule and goals. The tool lets you pick your preferred number of days, but consistency matters more than intensity. Even 3 days a week can deliver great results if you stick to it.
Can I use this for weight loss?
Yes! Just select “Weight Loss” as your fitness goal, and you’ll get a mix of calorie-burning workouts like cardio, HIIT, and strength training to speed up fat loss.
What if I want to build muscle?
Choose “Muscle Gain” and the generator will design progressive resistance-based workouts focused on strength and hypertrophy. Expect lots of sets, reps, and compound lifts.
Is the workout plan really customized?
Yep! The plan adapts based on your gender, fitness level, goals, equipment, days per week, and session duration. It’s not a one-size-fits-all template — it’s tailored to you.
How often should I change my workout plan?
It’s a good idea to update your plan every 4–6 weeks. This prevents plateaus and keeps your progress steady. Our tool makes it super easy to generate a fresh plan whenever you’re ready.
Can I download my workout plan?
Yes, you can save or download your plan (if that feature is enabled). That way, you can keep it handy on your phone or print it out for quick reference at the gym.