Calculators · Gutenberg
Heart Rate Calculator block for WordPress
Calculate target heart rate training zones based on age and formula.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Calculate target heart rate training zones based on age and formula.
Inspector panels on this block: Content, Zone Colors, Theme Colors, Sizing. Those titles come from index.js, not from a shared template.
Behavior controls: “Default Formula” options: Fox (220 − age), Tanaka (208 − 0.7×age), Gellish (207 − 0.7×age).
Where to find it
Gutenberg inserter → Calculators → search “Heart Rate Calculator” (block name `blockenberg/heart-rate-calculator` in block.json). Style it in the sidebar after insert.
How to use Heart Rate Calculator block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Heart Rate Calculator”, insert it. Category: Calculators.
- Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Subtitle”, “Default Age”, “Default Formula”.
- Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Content — Title | Text field in the inspector. block.json default: Heart Rate Zone Calculator. Saved as `title`. |
| Subtitle | Text field in the inspector. block.json default: Find your personalized training zones based on your age. Saved as `subtitle`. |
| Default Age | Numeric range control in the inspector. Range 18–80. block.json default: 30. Saved as `defaultAge`. |
| Default Formula | Select control; the chosen value is saved on the block. Options: Fox (220 − age); Tanaka (208 − 0.7×age); Gellish (207 − 0.7×age). block.json default: fox. Saved as `defaultFormula`. |
| Show Zone Icon | On/off toggle in the inspector. On by default. Saved as `showZoneIcon`. |
| Show Zone Purpose | On/off toggle in the inspector. On by default. Saved as `showPurpose`. |
| Zone 1 — Recovery | Color control in the inspector. block.json default: #6ee7b7. Saved as `z1Color`. |
| Zone 2 — Fat Burn | Color control in the inspector. block.json default: #34d399. Saved as `z2Color`. |
| Zone 3 — Aerobic | Color control in the inspector. block.json default: #fbbf24. Saved as `z3Color`. |
| Zone 4 — Threshold | Color control in the inspector. block.json default: #f97316. Saved as `z4Color`. |
| Zone 5 — Max Effort | Color control in the inspector. block.json default: #ef4444. Saved as `z5Color`. |
| Accent | Color control in the inspector. block.json default: #ef4444. Saved as `accentColor`. |
| Section Background | Color control in the inspector. block.json default: #fff7f7. Saved as `sectionBg`. |
| Card Background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Input Background | Color control in the inspector. block.json default: #f9fafb. Saved as `inputBg`. |
| Title Color | Color control in the inspector. block.json default: #111827. Saved as `titleColor`. |
| Subtitle Color | Color control in the inspector. block.json default: #6b7280. Saved as `subtitleColor`. |
| Label Color | Color control in the inspector. block.json default: #374151. Saved as `labelColor`. |
| Max Width (px) | Numeric range control in the inspector. Range 400–1400. block.json default: 760. Saved as `contentMaxWidth`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts.
- JavaScript functions that perform the math: calcMaxHR.
When this is the right block
- Calculate target heart rate training zones based on age and formula — that is the job of Heart Rate Calculator, not a generic content block.
- Use it when you need the editor control labeled “Content — Title”, which exists on this block’s inspector.
- It matches pages about heart rate, training zones, fitness.
- The math runs in the visitor’s browser after publish — no extra calculator plugin.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Heart Rate Calculator block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Heart Rate Calculator”. It sits under Calculators. After insert, open Content and set “Content — Title”, “Subtitle”, “Default Age”, “Default Formula”.
Does Heart Rate Calculator need a server or extra plugin?
No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.
Is the Heart Rate Calculator Gutenberg block free?
Yes. Heart Rate Calculator ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Heart Rate Calculator to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Zone Colors, Theme Colors, Sizing).
Related calculators blocks
BMI Calculator
Interactive Body Mass Index calculator with metric and imperial units, animated result gauge, weight category indicator, and fully customizable styling.
Body Fat Calculator
Calculate body fat percentage using the US Navy method based on height, neck, waist, and hip measurements. Shows body fat category and health range.
Calorie Calculator
BMR and TDEE calorie calculator using the Mifflin-St Jeor equation. Supports metric and imperial units, activity levels, and shows macro nutrient breakdown.
Macro Calculator
Calculate daily macronutrients (protein, carbs, fat) based on TDEE and fitness goals.
Pace Calculator
Running, walking, or cycling pace calculator. Find pace from distance and time, find finish time from pace and distance, or find distance from pace and time. Supports km and miles.
Water Intake Calculator
Calculate recommended daily water intake based on body weight, activity level and climate.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Heart Rate Calculator from the Gutenberg inserter.