import wixData from 'wix-data';
import wixLocation from 'wix-location';
import { sendLeadFollowUpEmail } from 'backend/email';
const answers = [0, 0, 0, 0, 0, 0, 0];
function getScore() {
return answers.reduce((sum, value) => sum + value, 0);
}
function getCategory(score) {
if (score >= 20) return 'high';
if (score >= 11) return 'mid';
if (score > 0) return 'low';
return 'unscored';
}
function getTierContent(score) {
const category = getCategory(score);
if (category === 'high') {
return {
title: 'You need structure now.',
message: 'Your score says the issue is not information. It is execution. Earned is built for you, and coaching is the next move if you are done wasting time.',
primaryLabel: 'Buy Earned Now',
secondaryLabel: 'Apply for Coaching',
primaryLink: 'https://a.co/d/0hpQyJ2q',
secondaryLink: '/coaching',
redirectLink: '/coaching'
};
}
if (category === 'mid') {
return {
title: 'You are close, but inconsistent.',
message: 'You know enough to do better, but your habits are still beating your goals. Earned will sharpen your standard and help you stop starting over.',
primaryLabel: 'Get the Book',
secondaryLabel: 'See BernardFit',
primaryLink: 'https://a.co/d/0hpQyJ2q',
secondaryLink: '/',
redirectLink: '/earned/mid'
};
}
if (category === 'low') {
return {
title: 'You are not all the way serious yet.',
message: 'That can change fast. Start with Earned. Let the book challenge the way you think before you ask for bigger results.',
primaryLabel: 'Start With Earned',
secondaryLabel: 'Visit BernardFit',
primaryLink: 'https://a.co/d/0hpQyJ2q',
secondaryLink: '/',
redirectLink: '/earned/low'
};
}
return {
title: 'Score yourself honestly.',
message: 'Answer the questions. Your score updates live and shows you where you really stand.',
primaryLabel: 'Buy Earned',
secondaryLabel: 'Visit BernardFit',
primaryLink: 'https://a.co/d/0hpQyJ2q',
secondaryLink: '/',
redirectLink: '/earned'
};
}
function updateVisualState() {
const score = getScore();
const category = getCategory(score);
const tier = getTierContent(score);
$w('#scoreText').text = String(score);
$w('#categoryText').text = category.toUpperCase();
$w('#resultTitle').text = tier.title;
$w('#resultMessage').text = tier.message;
$w('#primaryCtaButton').label = tier.primaryLabel;
$w('#secondaryCtaButton').label = tier.secondaryLabel;
$w('#primaryCtaButton').link = tier.primaryLink;
$w('#secondaryCtaButton').link = tier.secondaryLink;
}
function selectAnswer(questionIndex, value) {
answers[questionIndex] = value;
updateVisualState();
}
function wireQuestion(questionNumber, questionIndex) {
for (let value = 1; value <= 5; value += 1) {
$w(`#q${questionNumber}_${value}`).onClick(() => {
selectAnswer(questionIndex, value);
});
}
}
$w.onReady(function () {
wireQuestion(1, 0);
wireQuestion(2, 1);
wireQuestion(3, 2);
wireQuestion(4, 3);
wireQuestion(5, 4);
wireQuestion(6, 5);
wireQuestion(7, 6);
updateVisualState();
$w('#submitButton').onClick(async () => {
const firstName = $w('#firstNameInput').value?.trim();
const email = $w('#emailInput').value?.trim().toLowerCase();
const score = getScore();
const category = getCategory(score);
const tier = getTierContent(score);
if (!firstName || !email) {
$w('#resultMessage').text = 'Enter your first name and email before submitting.';
return;
}
if (category === 'unscored') {
$w('#resultMessage').text = 'Answer the questions before submitting. Human honesty is apparently still required.';
return;
}
$w('#submitButton').disable();
$w('#submitButton').label = 'Submitting...';
try {
await wixData.insert('EarnedLeads', {
firstName,
email,
score,
category,
answers: JSON.stringify(answers),
source: 'earned-page',
submittedAt: new Date()
});
await sendLeadFollowUpEmail({
firstName,
email,
score,
category
});
wixLocation.to(tier.redirectLink);
} catch (error) {
console.error('Lead submission failed:', error);
$w('#resultMessage').text = 'Something broke during signup. Check your collection permissions and backend email settings.';
$w('#submitButton').enable();
$w('#submitButton').label = 'Join + Get Routed';
}
});
});
top of page
About Us
This is a space to tell users about yourself and your business. Let them know who you are, what you do, and what this website is all about. Double click to start editing.
Samantha Beasley
Personal Training
Meal Prep
IG: _Samanthabeasley
Phone: 567-249-9499
Hi! I'm Samantha Beasley, and I offer in-person training and meal prepping. I am passionate about helping my clients to achieve their goals and I am dedicated to providing a tailored and holistic approach. I strive to create a positive and empowering atmosphere to enable my clients to reach their full potential. Join me today and start your journey to a healthier and happier lifestyle.
Shane Lewandowski Sr.
Personal Training
IG: Trainer_shane_
Phone: 419-807-2052
Shane Lewandowski is a personal trainer and coach dedicated to helping others reach their fitness goals. His passion is to bring out the best in his clients through intensity and hard work, while providing them with the necessary tools and guidance to ensure success.
By offering in person training and a high level of accountability, Shane is able to provide individuals with the motivation and support they need to succeed. Through his unique approach, he has helped many of his clients reach their fitness goals, and he is confident that he can do the same for you.