Skip to content

digitalcolony/cruxcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

79 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Potato Hack Fitness Calculators ๐Ÿฅ”๐Ÿ’ช

Modern Health & Fitness Calculators - Available as Web App & Desktop App

This is a collection of sleek, user-friendly health and fitness calculators built with Astro. Say goodbye to boring, outdated calculator interfaces and hello to engaging, modern tools for your health journey. Download as a desktop or mobile app for the best experience!

โœจ Features

  • ๐Ÿงฎ BMI Calculator - Calculate your Body Mass Index with instant visual feedback
  • ๐Ÿ”ฅ BMR Calculators - Multiple basal metabolic rate formulas:
    • Harris-Benedict Equation
    • Mifflin-St Jeor Equation
    • Katch-McArdle Formula (requires body fat %)
  • ๏ฟฝ Body Fat Calculator - Navy circumference method for accurate body fat percentage measurement
  • โค๏ธ Heart Rate Zones Calculator - Calculate optimal training zones using Karvonen and percentage methods
  • ๏ฟฝ๐Ÿ’ช One Rep Max Calculator - Estimate maximum lift capacity using Epley, Brzycki, and Lombardi formulas
  • ๐Ÿ‹๏ธ Muscle Potential Calculator - Casey Butt's scientific formula for predicting natural muscle-building potential
  • ๐Ÿƒ Running Pace Calculator - Calculate race finish times for 5K, 10K, half marathon, and full marathon distances
  • ๐Ÿฅ” Potato Hack Calculator - Calorie deficit calculator for the potato-based weight loss approach with 3, 4, 5 day and weekly estimates
  • ๐Ÿ“ฑ Progressive Web App (PWA) - Download and install as a desktop or mobile app
  • โšก Always Up-to-Date - Automatic updates when new features are added
  • ๐Ÿ”„ Shared Values System - Input data once, use across all calculators
  • ๐Ÿ“ฑ Responsive Design - Works perfectly on desktop, tablet, and mobile
  • โšก Fast & Lightweight - Built with Astro for optimal performance

๐Ÿ“ฑ Download as an App

Desktop Installation (Windows, Mac, Linux)

  1. Visit cruxcalc.netlify.app in Chrome, Edge, or Firefox
  2. Look for the "Install" or "Download" icon in your browser's address bar
  3. Click to install - it will appear as a standalone desktop app
  4. Launch from your desktop, taskbar, or start menu

Mobile Installation (Android & iOS)

  1. Open cruxcalc.netlify.app in your mobile browser
  2. Android: Tap "Add to Home Screen" or "Install App"
  3. iOS: Tap the Share button โ†’ "Add to Home Screen"
  4. The app icon will appear on your home screen

App Benefits

  • ๐Ÿ–ฅ๏ธ Standalone Window - Opens without browser UI for distraction-free calculations
  • โšก Instant Access - Launch directly from desktop/home screen
  • ๐Ÿ”„ Auto-Updates - Always get the latest features and bug fixes
  • ๐Ÿ’พ Offline Ready - Basic functionality works without internet
  • ๐ŸŽฏ Native Feel - Behaves like a traditional desktop/mobile app

๐ŸŒ Social Media Optimized

Professional link previews when shared on:

  • Facebook - Custom branded Open Graph cards
  • Twitter - Dedicated Twitter Card images
  • LinkedIn - Professional preview cards
  • WhatsApp/SMS - Rich link previews

Each calculator has its own themed social media image for better engagement.

๐Ÿš€ Project Structure

/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ favicon.svg
โ”‚   โ”œโ”€โ”€ site.webmanifest           # PWA configuration
โ”‚   โ”œโ”€โ”€ sharedValues.js            # Cross-calculator persistent storage
โ”‚   โ”œโ”€โ”€ reactiveSharedValues.js    # Event-driven shared values helpers
โ”‚   โ”œโ”€โ”€ og-*.png                   # Social media images
โ”‚   โ”œโ”€โ”€ android-chrome-*.png       # PWA icons
โ”‚   โ”œโ”€โ”€ debug.html                 # Dev-only shared values inspector
โ”‚   โ”œโ”€โ”€ debug-simple.html          # Minimal inspector
โ”‚   โ””โ”€โ”€ image-templates/           # Social media image generators
โ”‚       โ”œโ”€โ”€ generate-images.js
โ”‚       โ”œโ”€โ”€ generate-favicons.js
โ”‚       โ””โ”€โ”€ README.md
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/                # Reusable Astro components
โ”‚   โ”‚   โ”œโ”€โ”€ CalculatorLayout.astro
โ”‚   โ”‚   โ”œโ”€โ”€ RangeSlider.astro, UnitToggle.astro, GenderToggle.astro
โ”‚   โ”‚   โ”œโ”€โ”€ ResultCard.astro, ResultValue.astro, CategoryBadge.astro, ComparisonTable.astro
โ”‚   โ”‚   โ”œโ”€โ”€ InputGroup.astro, ValidationDisplay.astro
โ”‚   โ”‚   โ””โ”€โ”€ Header.astro, Footer.astro
โ”‚   โ”œโ”€โ”€ layouts/
โ”‚   โ”‚   โ””โ”€โ”€ Layout.astro           # Main layout with SEO & social meta
โ”‚   โ”œโ”€โ”€ pages/                     # Calculator pages (auto-routed)
โ”‚   โ”‚   โ”œโ”€โ”€ index.astro            # Homepage with calculator grid
โ”‚   โ”‚   โ”œโ”€โ”€ bmi.astro, bmr.astro, body-fat.astro, heart-rate-zones.astro
โ”‚   โ”‚   โ”œโ”€โ”€ one-rep-max.astro, muscle-potential.astro, running.astro, potato-hack.astro
โ”‚   โ”‚   โ””โ”€โ”€ components.astro       # Component showcase
โ”‚   โ””โ”€โ”€ styles/
โ”‚       โ””โ”€โ”€ global.css             # Neo-brutalist styling
โ”œโ”€โ”€ astro.config.mjs               # Astro site configuration
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ CALCULATOR_CHECKLIST.md, CALCULATOR_REQUIREMENTS.md, REFACTOR_PLAN.md
โ””โ”€โ”€ LICENSE

๐Ÿงž Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

๐Ÿงฎ Available Calculators

BMI Calculator (/bmi)

Calculate your Body Mass Index with instant visual feedback and health category classification.

BMR Calculators (/bmr)

  • Harris-Benedict - Classic formula from 1919, revised in 1984
  • Mifflin-St Jeor - More accurate for modern populations (1990)
  • Katch-McArdle - Most accurate when body fat % is known

Body Fat Calculator (/body-fat)

Calculate body fat percentage using the U.S. Navy circumference method featuring:

  • Gender-specific formulas for accurate measurements
  • Real-time body fat category feedback
  • Visual category indicators (Essential, Athletic, Fitness, Average, Obese)
  • Measurement guidance for neck, waist, and hip circumferences
  • Supports both imperial and metric units

Heart Rate Zones Calculator (/heart-rate-zones)

Calculate personalized heart rate training zones using:

  • Karvonen Method - Uses resting heart rate for personalized zones
  • Percentage Method - Based on maximum heart rate percentage
  • Five training zones: Active Recovery, Aerobic Base, Aerobic, Lactate Threshold, Neuromuscular Power
  • Real-time zone feedback and training recommendations
  • Age-based maximum heart rate estimation

One Rep Max Calculator (/one-rep-max)

Estimate your maximum lift capacity using three proven formulas:

  • Epley Formula - Most commonly used in powerlifting
  • Brzycki Formula - Popular alternative with different rep range focus
  • Lombardi Formula - Traditional formula for strength estimation
  • Compare results across all three methods
  • Input current weight and reps to calculate 1RM

Muscle Potential Calculator (/muscle-potential)

Uses Casey Butt's scientifically-validated formula to predict natural muscle-building potential based on:

  • Height
  • Wrist circumference (frame size indicator)
  • Ankle circumference (frame size indicator)
  • Body fat percentage

Running Pace Calculator (/running)

Calculate race finish times based on your per-mile pace with features including:

  • Interactive pace slider with 5-second increments
  • Finish times for 5K, 10K, half marathon, and full marathon
  • Pace categorization (Elite, Sub-Elite, Competitive, Advanced, Intermediate, Recreational, Beginner, Walking/Jogging, Walking)
  • Persistent pace preference using localStorage

Potato Hack Calculator (/potato-hack)

Specialized calculator for the potato-based weight loss approach featuring:

  • Calorie deficit calculations based on potato consumption
  • BMR integration from other calculators
  • Adjustable potato portions and cooking method considerations
  • Weight loss timeline projections

๐Ÿ”„ Shared Values System

The calculators feature a smart shared values system that allows you to:

  • Enter your basic measurements once
  • Use them across all calculators automatically
  • Save time and ensure consistency
  • Values persist during your browser session

๐ŸŽจ Design Philosophy

  • Neo-Brutalist Design - Bold, functional design with strong visual hierarchy
  • Modern & Clean - Contemporary design that's easy on the eyes
  • Mobile-First - Responsive design that works on any device
  • PWA Standards - App-like experience with offline capabilities
  • Accessibility - Semantic HTML and keyboard navigation support
  • Performance - Fast loading with minimal JavaScript
  • User-Friendly - Intuitive interfaces with helpful explanations

๐Ÿ“Š Scientific Accuracy

All formulas implemented are scientifically validated:

  • BMI uses the standard WHO classification
  • BMR formulas are peer-reviewed and widely accepted
  • Body Fat (Navy Method) developed by the Naval Health Research Center, widely used by U.S. military
  • Heart Rate Zones based on Karvonen method and percentage-based calculations used by sports scientists
  • One Rep Max formulas are established strength training standards used in powerlifting and sports
  • Casey Butt's muscle potential formula is based on extensive analysis of drug-free bodybuilders
  • Potato hack calculations include resistant starch reduction for cooled potatoes (17%)

๐Ÿ› ๏ธ Built With

  • Astro - Modern static site generator
  • Progressive Web App - PWA standards for app-like experience
  • Vanilla JavaScript - For calculator logic and interactivity
  • CSS3 - Modern styling with custom properties and grid/flexbox
  • HTML5 - Semantic markup for accessibility
  • Open Graph & Twitter Cards - Professional social media sharing

๐Ÿš€ Getting Started

For Users

Simply visit cruxcalc.netlify.app and start calculating! Optionally download as an app for the best experience.

For Developers

  1. Clone the repository

    git clone <repository-url>
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Open your browser Navigate to http://localhost:4321 to see the app in action!

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ›๏ธ Project Governance

See the project constitution for governance, quality gates, and change control: PROJECT_CONSTITUTION.md

๐Ÿค Contributing

Contributions are welcome! Whether it's:

  • Adding new calculators
  • Improving existing formulas
  • Enhancing the UI/UX
  • Fixing bugs
  • Improving documentation

Feel free to open an issue or submit a pull request.

๐Ÿ”— Learn More


Built with ๐Ÿฅ” for the health and fitness community - Available everywhere as a web app!

About

๐Ÿ’ช๐Ÿป Potato Hack Fitness Calculators

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors