Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/airgead-investment-calculator/llms.txt

Use this file to discover all available pages before exploring further.

The Results page loads the most recent calculation from localStorage (stored under the key airgead_current_calc) and presents it as a detailed breakdown of your projected investment growth. If no calculation is found in storage — for example, if you navigate here directly without first running a calculation — the page immediately redirects back to calculator.html so you can enter your inputs.

Summary Card

At the top of the page, a dark green summary card gives you the headline numbers at a glance:
  • Final balance with deposits — the projected balance at the end of the chosen period, including the starting balance, all monthly deposits, and all compounded interest.
  • Total principal — the sum of the starting balance plus every monthly deposit made over the full period. This is the total amount of money you contributed, before any interest is applied.
  • Total interest earned — the final balance with deposits minus the total principal. This is the amount the investment grew purely through compounding.
  • Final balance without deposits — displayed in a secondary card beneath the main summary. This shows what the starting balance alone would have grown to over the same period. The card reads: “Just leaving the initial $X to grow.”

Growth Chart

Below the summary card, a canvas chart rendered by drawGrowthChart() from js/lib/charts.js visualises the full year-by-year growth trajectory.

With monthly deposits

Plotted as a dark green area line showing the balance growing with both compounding and regular contributions.

Without deposits

Plotted as a grey area line showing only the compounded growth of the starting balance.
Additional chart details:
  • Y-axis uses abbreviated currency labels — values in the thousands are shown as $Xk, values in the millions as $Xm.
  • X-axis labels years at evenly spaced intervals using the format Y0, Y10, Y20, and so on, ending with the final year. The number of labels shown adapts to the available viewport width.
  • The chart redraws automatically on window resize to stay sharp and correctly proportioned at any viewport width.

Year-by-Year Table

Beneath the chart, a full breakdown table contains one row for year 0 (the starting point) through year N (the end of the projection). The table scrolls horizontally on narrow viewports.
ColumnDescription
YearThe year number, from 0 (initial state) to the final year of the projection.
With depositsProjected balance including all deposits and compounding. Displayed in bold green.
Without depositsProjected balance of the starting balance alone, with no contributions.
Total principalThe starting balance plus all monthly deposits contributed up to and including that year.
Interest earnedThe balance with deposits minus the total principal — the amount earned purely through compounding.
The final row of the year-by-year table should always match the values shown in the summary card. Both figures come from the last entry in the same results array, so they are always consistent.

Save Plan

Clicking Save Plan in the toolbar appends the current calculation to your browser’s saved plan history.
1

Click Save Plan

Triggers the click handler in js/pages/results.js, which reads the current saved plans from localStorage.
2

Plan object is created

A new plan object is constructed with the following fields:
  • id — a timestamp string (Date.now().toString()) used as a unique identifier.
  • date — the current date and time as an ISO 8601 string.
  • name — a human-readable label, e.g. "Plan: $250/mo for 20 years".
  • data — the full calculation object, including both inputs and the complete results array.
3

Saved to localStorage

The new plan is appended to the existing array and the updated array is written back to airgead_saved_plans in localStorage.
4

Toast confirmation

A toast notification reading “Plan saved locally” appears briefly at the bottom of the screen to confirm the save.

Export CSV

Clicking Export CSV in the toolbar triggers downloadCsv() from js/lib/calculator.js, which builds the file entirely in the browser and initiates a download — no server request is made. The downloaded file is named airgead-{years}-year-plan.csv (for example, airgead-20-year-plan.csv). It contains the following columns:
ColumnValue
YearYear number (0 through N)
With DepositsProjected balance including contributions
Without DepositsProjected balance of starting balance only
Total PrincipalCumulative starting balance plus all deposits to that year
Interest EarnedBalance with deposits minus total principal
The export uses a Blob with MIME type text/csv;charset=utf-8;, creates an object URL, and programmatically clicks a temporary <a> element to trigger the browser’s file download dialog. A ← Back to Calculator button in the top toolbar returns you to calculator.html. The Calculator page will reload with its default input values.

Build docs developers (and LLMs) love