Create source implementations for packages imported by NomGap: - @bytelyst/accessibility — ARIA helper functions (alertLabel, progressLabel, etc.) - @bytelyst/celebrations — celebration engine for milestones - @bytelyst/gentle-notifications — guilt-free notification filtering - @bytelyst/time-references — human-friendly fasting time references - @bytelyst/subscription-client — billing/subscription HTTP client - @bytelyst/quick-actions — progressive disclosure UI helpers - @bytelyst/referral-client — referral program client - @bytelyst/marketplace-client — influencer marketplace client - @bytelyst/org-client — B2B org management client Made-with: Cursor
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
export interface TimeReference {
|
|
emoji: string;
|
|
text: string;
|
|
}
|
|
|
|
export function getTimeReference(hours: number): TimeReference {
|
|
if (hours < 1) {
|
|
return { emoji: "⏱️", text: "A quick meditation" };
|
|
}
|
|
if (hours < 4) {
|
|
return { emoji: "🎬", text: "A movie marathon" };
|
|
}
|
|
if (hours < 8) {
|
|
return { emoji: "✈️", text: "A cross-country flight" };
|
|
}
|
|
if (hours < 12) {
|
|
return { emoji: "🌙", text: "A full night's sleep" };
|
|
}
|
|
if (hours < 16) {
|
|
return { emoji: "🏔️", text: "A day hike" };
|
|
}
|
|
if (hours < 24) {
|
|
return { emoji: "🌍", text: "A day trip abroad" };
|
|
}
|
|
if (hours < 36) {
|
|
return { emoji: "🚂", text: "A train across the country" };
|
|
}
|
|
if (hours < 48) {
|
|
return { emoji: "⛵", text: "A weekend sailing trip" };
|
|
}
|
|
return { emoji: "🏕️", text: "A multi-day adventure" };
|
|
}
|
|
|
|
export function getEncouragingMessage(hours: number): string {
|
|
if (hours < 4) {
|
|
return "Great start! Your body is beginning to adjust.";
|
|
}
|
|
if (hours < 8) {
|
|
return "You're doing well. Insulin is dropping.";
|
|
}
|
|
if (hours < 12) {
|
|
return "Halfway through a standard fast. Fat burning is ramping up!";
|
|
}
|
|
if (hours < 16) {
|
|
return "You've passed 12 hours. Autophagy is beginning.";
|
|
}
|
|
if (hours < 24) {
|
|
return "Deep into your fast. Your body is thriving.";
|
|
}
|
|
if (hours < 36) {
|
|
return "Incredible discipline! Growth hormone is surging.";
|
|
}
|
|
return "Extraordinary commitment. Your body is deeply healing.";
|
|
}
|