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.
js/components/shell.js provides the shared page chrome for every Airgead page. It injects the sticky header with navigation links, the mobile drawer, the footer, and the toast notification container. The module calls renderShell() automatically when it is loaded, so including it via a <script type="module"> tag is all that is required to activate the full shell on any page.
Loading the shell
Add the following<script> tag to the <body> of each HTML page. The path prefix (../ vs ../../) depends on the depth of the page relative to the project root.
renderShell() on import. You do not need to call it yourself.
Every page must also include a wrapper element with the data-shell attribute for the shell to target:
The links array
Navigation links are defined in a links array at the top of shell.js. Modifying this array updates both the desktop navigation bar and the mobile drawer simultaneously.
[label, href]. The href values are root-relative paths resolved against the computed path prefix for the current page.
renderShell()
Injects the full page shell into the [data-shell] element. Called automatically on module load — you do not need to call it manually.
The function performs the following steps:
- Reads
location.pathnameto compute the correct root-relative path prefix so that asset and navigation hrefs resolve correctly regardless of which subdirectory the page lives in. - Compares each link’s
hrefagainst the current path to identify the active page and applies theactiveCSS class to the matching link. - Inserts the header (including the nav and mobile drawer) using
insertAdjacentHTML('afterbegin', ...)on the[data-shell]element. - Inserts the footer and toast container using
insertAdjacentHTML('beforeend', ...)on the same element.
renderShell() is exported for completeness, but because it runs automatically on import, you will not normally need to import or invoke it directly.toast(message)
Displays a temporary notification at the bottom centre of the screen. The toast auto-dismisses after 2400 ms.
The text to display inside the toast. Keep messages short — a single line of feedback such as
"Plan saved" or "CSV exported".The toast container element (a
.toast div with role="status" and aria-live="polite") is injected by renderShell(). If renderShell() has not run yet when toast() is called, the call is a no-op and no notification is shown.