A dark, high-contrast gym homepage built with Bootstrap 6 for a fictional strength club called Forge. It includes a class timetable, membership plans, coach profiles and a free day pass form.
How it works
Everything sits inside .ag-page, which has data-bs-theme="dark" and re-maps the Bootstrap 6 primary role (--bs-primary-bg, --bs-primary-contrast and the rest) to a volt green. Every btn-solid theme-primary, badge, chip and range then uses the brand color.
- Navbar:
navbar lg:navbar-expandwith a<dialog class="drawer drawer-end">that becomes the inline link row from 1024px. "Training" opens a.menuwith icons and descriptions. The script closes the drawer when an in-page link is chosen. - Hero: a full-bleed Unsplash photo under a gradient, an outlined headline (
.ag-outline), two calls to action and a<dl class="ag-stats">stat strip. - Programs and coaches: photo cards (
.ag-program,.ag-coach) that switch from grayscale to color on hover. Coach specialties use Bootstrap 6.chips. - Timetable:
nav nav-tabsday tabs (data-bs-toggle="tab"). The script builds each.tab-panefrom theAG_WEEKobject, opens today's tab withTab.getOrCreateInstance()and marks it with.ag-today. - Membership: a
btn-groupofbtn-checkradios swapsdata-ag-monthly/data-ag-yearlyprices. A Bootstrap 6.form-rangeslider ("How often will you train?") adds.is-recommendedto the plan that fits. - Free pass form:
<form data-bs-validate novalidate>with a Bootstrap 6 Datepicker (its minimum date is set to today in script) and a Combobox for the main goal. On submit the script flags invalid fields with.is-invalid, fakes the request and opens#ag-toast. - FAQ and footer: an exclusive
<details name="ag-faq">accordion, hours and address.
Customization
- Change
--ag-voltand the--bs-primary-*overrides in.ag-page(style.css) to use your brand color. - Edit the
AG_WEEKobject at the top ofscript.jsto set your classes, coaches and capacities per weekday. - Set prices in
data-ag-monthly/data-ag-yearlyon each.ag-price. - Change the thresholds in
recommend()to control whichdata-ag-plancard the range recommends. - Replace the
setTimeoutin the form's submit handler withfetch()to your booking endpoint. - Swap
--ag-displayfor another condensed font, or remove.ag-tickerfor a calmer page. - All photos come from Unsplash. Replace them with photos of your own gym and coaches.
Accessibility
The page has a skip link, labelled navigation and role="tab" / aria-selected tabs. Visually hidden text gives each "Book" button the class name and time. Price and recommendation changes are announced in an aria-live region, and the toast uses role="status". Focus outlines are visible in volt green. Under prefers-reduced-motion the ticker and hover transitions stop.
Bootstrap 6 notes
Built on Bootstrap 6.0.0-alpha.1, so alpha APIs may still change. Here is how Bootstrap 5 patterns map:
btn-solid theme-primaryreplaces the per-color button classes.- Drawer replaces
navbar-collapseand Offcanvas. - Menu replaces Dropdown.
<details>replaces the old accordion collapse..form-rangewraps the range input.- Datepicker and Combobox are new built-in components.
The script imports Drawer, Tab and Toast from the bundle as an ES module.