export function fitnessAppFinderQuiz(form: FormTs) {
form.setTitle(() => 'šŖ Find Your Perfect Fitness App');
// ============ RECOMMENDATION SYSTEM ============
const answers = form.state<Record<string, string | string[] | number>>({});
const setAnswer = (key: string, value: string | string[] | number) => {
answers.update(current => ({ ...current, [key]: value }));
};
type FitnessGoal = 'weight-loss' | 'muscle-building' | 'general-fitness' | 'flexibility' | 'endurance' | 'stress-relief';
type WorkoutType = 'strength' | 'cardio' | 'hiit' | 'yoga' | 'running' | 'cycling' | 'mixed';
const getAppRecommendations = (): { name: string; price: string; bestFor: string; features: string[]; rating: number }[] => {
const goal = answers()['fitnessGoal'] as FitnessGoal;
const workoutTypes = (answers()['workoutTypes'] as string[]) || [];
const experience = answers()['experience'] as string;
const budget = answers()['budget'] as string;
const equipment = answers()['equipment'] as string;
const motivation = answers()['motivation'] as string;
const allApps = [
{
name: 'Peloton',
price: '$13-44/month',
bestFor: 'Cycling, running, strength with world-class instructors',
features: ['Live & on-demand classes', 'Leaderboards', 'Music integration', 'Multiple workout types'],
rating: 4.8,
tags: ['cardio', 'cycling', 'running', 'strength', 'yoga', 'hiit'],
budget: 'premium',
equipment: 'some',
social: true
},
{
name: 'Nike Training Club',
price: 'Free',
bestFor: 'Varied workouts with professional guidance',
features: ['185+ free workouts', 'Training plans', 'No equipment options', 'Nike athlete trainers'],
rating: 4.7,
tags: ['strength', 'cardio', 'hiit', 'yoga', 'mixed'],
budget: 'free',
equipment: 'none',
social: false
},
{
name: 'Fitbod',
price: '$13/month',
bestFor: 'Personalized strength training with gym equipment',
features: ['AI-powered workouts', 'Muscle recovery tracking', 'Gym equipment integration', 'Progressive overload'],
rating: 4.6,
tags: ['strength', 'muscle-building'],
budget: 'mid',
equipment: 'full',
social: false
},
{
name: 'Strava',
price: 'Free-$12/month',
bestFor: 'Running and cycling with GPS tracking',
features: ['GPS tracking', 'Segment challenges', 'Social community', 'Training analysis'],
rating: 4.7,
tags: ['running', 'cycling', 'cardio', 'endurance'],
budget: 'free',
equipment: 'none',
social: true
},
{
name: 'Apple Fitness+',
price: '$10/month',
bestFor: 'Apple Watch users wanting variety',
features: ['Watch integration', '12 workout types', 'Meditation', 'Trainer variety'],
rating: 4.6,
tags: ['cardio', 'strength', 'yoga', 'hiit', 'cycling', 'running', 'mixed'],
budget: 'mid',
equipment: 'some',
social: false
},
{
name: 'Calm',
price: '$15/month',
bestFor: 'Meditation, sleep, and stress relief',
features: ['Guided meditation', 'Sleep stories', 'Breathing exercises', 'Masterclasses'],
rating: 4.8,
tags: ['stress-relief', 'yoga', 'flexibility'],
budget: 'mid',
equipment: 'none',
social: false
},
{
name: 'Down Dog',
price: '$8/month',
bestFor: 'Customizable yoga practice',
features: ['6 yoga styles', 'Custom duration', 'Offline access', 'New practice every time'],
rating: 4.9,
tags: ['yoga', 'flexibility', 'stress-relief'],
budget: 'budget',
equipment: 'none',
social: false
},
{
name: 'SWEAT',
price: '$20/month',
bestFor: 'Women-focused workout programs',
features: ['Kayla Itsines programs', 'BBG workouts', 'Meal planning', 'Progress photos'],
rating: 4.5,
tags: ['strength', 'hiit', 'cardio', 'mixed'],
budget: 'mid',
equipment: 'some',
social: true
},
{
name: 'Hevy',
price: 'Free-$10/month',
bestFor: 'Gym workout tracking and logging',
features: ['Workout logging', 'Progress graphs', 'Exercise library', 'Routine builder'],
rating: 4.7,
tags: ['strength', 'muscle-building'],
budget: 'free',
equipment: 'full',
social: true
},
{
name: 'Centr',
price: '$30/month',
bestFor: 'Chris Hemsworth\'s holistic fitness program',
features: ['Workouts + meals', 'Meditation', 'Celebrity trainers', 'Functional training'],
rating: 4.4,
tags: ['strength', 'hiit', 'mixed', 'stress-relief'],
budget: 'premium',
equipment: 'some',
social: false
},
{
name: 'Couch to 5K',
price: '$5 one-time',
bestFor: 'Beginner runners',
features: ['8-week program', 'Audio coaching', 'Music integration', 'Simple progression'],
rating: 4.6,
tags: ['running', 'cardio', 'endurance'],
budget: 'budget',
equipment: 'none',
social: false
},
{
name: 'Freeletics',
price: '$13-50/month',
bestFor: 'AI-coached bodyweight HIIT',
features: ['AI coach', 'No equipment needed', 'HIIT focus', 'Adaptive difficulty'],
rating: 4.5,
tags: ['hiit', 'cardio', 'strength', 'mixed'],
budget: 'mid',
equipment: 'none',
social: true
}
];
// Score each app based on user preferences
const scoredApps = allApps.map(app => {
let score = 0;
// Match workout types
workoutTypes.forEach(type => {
if (app.tags.includes(type)) score += 15;
});
// Match fitness goal
if (goal === 'weight-loss' && (app.tags.includes('hiit') || app.tags.includes('cardio'))) score += 10;
if (goal === 'muscle-building' && app.tags.includes('strength')) score += 15;
if (goal === 'flexibility' && app.tags.includes('yoga')) score += 15;
if (goal === 'stress-relief' && (app.tags.includes('yoga') || app.tags.includes('stress-relief'))) score += 15;
if (goal === 'endurance' && (app.tags.includes('running') || app.tags.includes('cycling'))) score += 15;
// Match budget
if (budget === 'free' && app.budget === 'free') score += 20;
if (budget === 'low' && (app.budget === 'free' || app.budget === 'budget')) score += 15;
if (budget === 'medium' && app.budget !== 'premium') score += 10;
if (budget === 'high') score += 5;
// Match equipment
if (equipment === 'none' && app.equipment === 'none') score += 15;
if (equipment === 'minimal' && (app.equipment === 'none' || app.equipment === 'some')) score += 10;
if (equipment === 'full' && app.equipment === 'full') score += 10;
// Match motivation style
if (motivation === 'social' && app.social) score += 10;
if (motivation === 'guided' && app.features.some(f => f.toLowerCase().includes('coach') || f.toLowerCase().includes('trainer'))) score += 10;
// Beginner bonus
if (experience === 'beginner' && (app.name === 'Nike Training Club' || app.name === 'Couch to 5K')) score += 10;
return { ...app, score };
});
// Sort by score and return top 3
return scoredApps
.sort((a, b) => b.score - a.score)
.slice(0, 3)
.map(({ name, price, bestFor, features, rating }) => ({ name, price, bestFor, features, rating }));
};
const getTopRecommendation = () => {
const recs = getAppRecommendations();
return recs[0] || { name: 'Nike Training Club', price: 'Free', bestFor: 'General fitness', features: [], rating: 4.7 };
};
// ============ COMPLETION SCREEN ============
form.configureCompletionScreen({
type: 'text',
title: () => 'šŖ Your Perfect Fitness App Match',
message: () => {
const top = getTopRecommendation();
return `Based on your goals and preferences, we recommend ${top.name}! Download your guide with app comparisons and getting started tips.`;
}
});
// ============ PAGES SETUP ============
const pages = form.addPages('quiz-pages', {
heightMode: 'current-page'
});
// ============ PAGE 1: Fitness Goals ============
const page1 = pages.addPage('goals', { mobileBreakpoint: 500 });
page1.addRow(row => {
row.addTextPanel('header1', {
label: 'Step 1 of 5: Your Fitness Goals',
computedValue: () => 'What do you want to achieve with a fitness app?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page1.addSpacer({ height: '24px' });
page1.addRow(row => {
row.addRadioButton('fitnessGoal', {
label: 'What\'s your primary fitness goal?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'weight-loss', name: 'š„ Weight Loss - Burn calories and shed pounds' },
{ id: 'muscle-building', name: 'šŖ Build Muscle - Gain strength and size' },
{ id: 'general-fitness', name: 'š General Fitness - Stay active and healthy' },
{ id: 'flexibility', name: 'š§ Flexibility - Improve mobility and balance' },
{ id: 'endurance', name: 'š“ Endurance - Build cardio stamina' },
{ id: 'stress-relief', name: 'š§ Stress Relief - Mental wellness and relaxation' }
],
onValueChange: (val) => setAnswer('fitnessGoal', val || '')
});
});
page1.addRow(row => {
row.addSuggestionChips('workoutTypes', {
label: 'What types of workouts interest you? (Select all)',
isRequired: true,
suggestions: [
{ id: 'strength', name: 'šļø Strength Training' },
{ id: 'cardio', name: 'ā¤ļø Cardio' },
{ id: 'hiit', name: 'ā” HIIT' },
{ id: 'yoga', name: 'š§ Yoga/Pilates' },
{ id: 'running', name: 'š Running' },
{ id: 'cycling', name: 'š“ Cycling' }
],
alignment: 'left',
onValueChange: (val) => setAnswer('workoutTypes', val || [])
});
});
// ============ PAGE 2: Experience & Schedule ============
const page2 = pages.addPage('experience', { mobileBreakpoint: 500 });
page2.addRow(row => {
row.addTextPanel('header2', {
label: 'Step 2 of 5: Your Experience',
computedValue: () => 'Help us match the right difficulty level',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addRadioButton('experience', {
label: 'What\'s your current fitness level?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'beginner', name: 'š± Beginner - New to working out or returning after a break' },
{ id: 'intermediate', name: 'šæ Intermediate - Work out regularly, know the basics' },
{ id: 'advanced', name: 'š³ Advanced - Experienced, looking for challenging workouts' }
],
onValueChange: (val) => setAnswer('experience', val || '')
});
});
page2.addRow(row => {
row.addSlider('workoutsPerWeek', {
label: 'How many days per week can you work out?',
isRequired: true,
min: 1,
max: 7,
step: 1,
defaultValue: 3,
unit: 'days/week',
onValueChange: (val) => setAnswer('workoutsPerWeek', val || 3)
});
});
page2.addRow(row => {
row.addRadioButton('sessionLength', {
label: 'How long are your typical workout sessions?',
isRequired: true,
orientation: 'horizontal',
options: [
{ id: 'short', name: '15-20 min' },
{ id: 'medium', name: '30-45 min' },
{ id: 'long', name: '60+ min' }
],
onValueChange: (val) => setAnswer('sessionLength', val || '')
});
});
// ============ PAGE 3: Equipment & Environment ============
const page3 = pages.addPage('equipment', { mobileBreakpoint: 500 });
page3.addRow(row => {
row.addTextPanel('header3', {
label: 'Step 3 of 5: Your Setup',
computedValue: () => 'What equipment do you have access to?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addRadioButton('equipment', {
label: 'What equipment do you have?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'none', name: 'š None - Bodyweight only at home' },
{ id: 'minimal', name: 'š Minimal - Dumbbells, resistance bands, mat' },
{ id: 'some', name: 'šļø Some - Basic home gym setup' },
{ id: 'full', name: 'šŖ Full Gym - Access to complete gym' }
],
onValueChange: (val) => setAnswer('equipment', val || '')
});
});
page3.addRow(row => {
row.addRadioButton('location', {
label: 'Where will you primarily work out?',
isRequired: true,
orientation: 'horizontal',
options: [
{ id: 'home', name: 'š At home' },
{ id: 'gym', name: 'š¢ At the gym' },
{ id: 'outdoor', name: 'š³ Outdoors' },
{ id: 'mixed', name: 'š Mix of all' }
],
onValueChange: (val) => setAnswer('location', val || '')
});
});
// ============ PAGE 4: Preferences ============
const page4 = pages.addPage('preferences', { mobileBreakpoint: 500 });
page4.addRow(row => {
row.addTextPanel('header4', {
label: 'Step 4 of 5: Your Preferences',
computedValue: () => 'What features matter most to you?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addRadioButton('motivation', {
label: 'What keeps you motivated?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'guided', name: 'šÆ Guided instruction - Tell me exactly what to do' },
{ id: 'social', name: 'š„ Social features - Compete with friends, leaderboards' },
{ id: 'tracking', name: 'š Progress tracking - See my improvements over time' },
{ id: 'variety', name: 'š² Variety - Different workouts to prevent boredom' }
],
onValueChange: (val) => setAnswer('motivation', val || '')
});
});
page4.addRow(row => {
row.addRadioButton('budget', {
label: 'What\'s your budget for a fitness app?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'free', name: 'š Free only' },
{ id: 'low', name: 'šµ Under $10/month' },
{ id: 'medium', name: 'š° $10-20/month' },
{ id: 'high', name: 'š $20+/month for premium features' }
],
onValueChange: (val) => setAnswer('budget', val || '')
});
});
// ============ PAGE 5: Results ============
const page5 = pages.addPage('results', { mobileBreakpoint: 500 });
page5.addRow(row => {
row.addTextPanel('header5', {
label: 'Step 5 of 5: Your Recommendations',
computedValue: () => 'Here are the best fitness apps for you',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page5.addSpacer({ height: '24px' });
page5.addRow(row => {
row.addTextPanel('topPick', {
computedValue: () => {
const top = getTopRecommendation();
return `š #1 Pick: ${top.name}`;
},
customStyles: {
fontSize: '1.4rem',
fontWeight: '700',
textAlign: 'center',
color: '#059669',
padding: '20px',
background: 'linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)',
borderRadius: '12px',
border: '2px solid #10b981'
}
});
});
page5.addRow(row => {
row.addTextPanel('topPickDetails', {
computedValue: () => {
const top = getTopRecommendation();
return `${top.bestFor}\nš° ${top.price} | ā ${top.rating}/5`;
},
customStyles: {
fontSize: '0.95rem',
textAlign: 'center',
whiteSpace: 'pre-line',
marginTop: '0.5rem'
}
});
});
// Features of top pick
const featuresSection = page5.addSubform('features', {
title: '⨠Key Features',
isCollapsible: true,
customStyles: {
marginTop: '1rem',
background: '#f0fdf4',
borderRadius: '8px'
}
});
featuresSection.addRow(row => {
row.addTextPanel('featuresList', {
computedValue: () => {
const top = getTopRecommendation();
return top.features.map(f => `⢠${f}`).join('\n');
},
customStyles: {
fontSize: '0.9rem',
whiteSpace: 'pre-line',
lineHeight: '1.8'
}
});
});
// Other recommendations
const alternativesSection = page5.addSubform('alternatives', {
title: 'šÆ Other Great Options',
isCollapsible: true,
customStyles: {
marginTop: '1rem',
background: '#f9fafb',
borderRadius: '8px'
}
});
alternativesSection.addRow(row => {
row.addTextPanel('otherApps', {
computedValue: () => {
const recs = getAppRecommendations();
return recs.slice(1).map((r, i) =>
`#${i + 2}. ${r.name} (${r.price})\n ${r.bestFor}`
).join('\n\n');
},
customStyles: {
fontSize: '0.9rem',
whiteSpace: 'pre-line',
lineHeight: '1.6'
}
});
});
// ============ PAGE 6: Lead Capture ============
const page6 = pages.addPage('lead-capture', { mobileBreakpoint: 500 });
page6.addRow(row => {
row.addTextPanel('header6', {
label: 'Get Your Complete Fitness App Guide',
computedValue: () => 'Receive detailed comparisons and getting started tips',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page6.addSpacer({ height: '24px' });
page6.addRow(row => {
row.addTextbox('name', {
label: 'Your Name',
isRequired: true,
placeholder: 'Alex Smith'
}, '1fr');
row.addEmail('email', {
label: 'Email Address',
isRequired: true,
placeholder: 'alex@email.com'
}, '1fr');
});
page6.addRow(row => {
row.addCheckboxList('consent', {
options: [
{ id: 'guide', name: 'š§ Send me my fitness app guide (PDF)', isRequired: true },
{ id: 'tips', name: 'š” Weekly workout tips and motivation' },
{ id: 'deals', name: 'š·ļø App deals and free trial alerts' }
],
defaultValue: ['guide'],
orientation: 'vertical'
});
});
// ============ PDF REPORT ============
form.configurePdf('fitness-report', pdf => {
pdf.configure({
filename: 'your-fitness-app-guide.pdf',
pageSize: 'A4',
allowUserDownload: true,
downloadButtonLabel: 'š Download Fitness Guide',
header: {
title: 'Your Perfect Fitness App Guide',
subtitle: 'Personalized recommendations for your goals'
},
footer: {
text: 'Generated by FormTs Fitness App Finder',
showPageNumbers: true
}
});
pdf.addSection('Your Fitness Profile', section => {
section.addRow(row => {
row.addField('Primary Goal', (answers()['fitnessGoal'] as string) || 'Not specified');
row.addField('Experience Level', (answers()['experience'] as string) || 'Not specified');
});
section.addRow(row => {
row.addField('Workouts/Week', `${answers()['workoutsPerWeek'] || 3} days`);
row.addField('Budget', (answers()['budget'] as string) || 'Not specified');
});
});
pdf.addSection('Top Recommendations', section => {
const recs = getAppRecommendations();
section.addTable(
['Rank', 'App', 'Price', 'Rating', 'Best For'],
recs.map((r, i) => [`#${i + 1}`, r.name, r.price, `${r.rating}/5`, r.bestFor])
);
});
pdf.addSection('Getting Started Tips', section => {
section.addText('1. Start with the free trial before committing');
section.addText('2. Set realistic goals - consistency beats intensity');
section.addText('3. Schedule workouts like appointments');
section.addText('4. Track your progress to stay motivated');
section.addText('5. Mix workout types to prevent burnout');
});
pdf.addSection('Free Alternatives', section => {
section.addText('⢠Nike Training Club - Completely free, excellent variety');
section.addText('⢠YouTube Fitness - Channels like POPSUGAR, Fitness Blender');
section.addText('⢠Strava (free tier) - Great for runners and cyclists');
section.addText('⢠Hevy (free tier) - Solid gym workout tracker');
});
});
// ============ SUBMIT BUTTON ============
form.configureSubmitButton({
label: () => 'šŖ Get My Fitness Guide'
});
form.configureSubmitBehavior({
sendToServer: true
});
}