section-007

Alpine Stage Route Hero

Included in the VaultGet the Vault

A cycling hero with two selectable Alpine mountain sprints, original aerial landscapes and animated road-aligned routes.

intermediate
3 more details
svg-route-drawingcontainer-queriesresponsive-section
Alpine Stage Route Hero - website section preview

This section reads better at your own screen size than in the frame below:

About this section

A focused opening section for cycling hill climbs, mountain sprints and tour operators, with two original synthetic Alpine aerials and a working stage selector. Lac Vert climbs beside a mountain lake; Col des Pins crosses a river bridge before winding up a wooded ridge. The worked example uses two short mountain sprints: 4.8 km with 680 m of climbing, and 3.2 km with 480 m. Each stage pairs its own traced SVG course with a story, distance, climbing total and elevation profile. A racing-green editorial panel anchors the composition as the landscape changes and the next route draws.

What's included

9 items
  • Two selectable stages with distinct road-aligned SVG courses
  • Two original bundled Alpine aerials with recorded generation provenance
  • Coordinated landscape crossfade, route draw and elevation profile
  • Native keyboard- and touch-operable stage buttons
  • Deep racing-green editorial composition with high-visibility course colour
  • Container-aware desktop and mobile layouts
  • Root-scoped brand and motion controls
  • Independent mount, replay and teardown API
  • Readable no-JavaScript, missing-GSAP and reduced-motion states

Perfect for

4 use cases
  • Cycling hill climbs, mountain sprints and stage races
  • Cycling and bikepacking tour operators
  • Triathlon, trail and endurance events
  • Destination campaigns and mountain resorts

How it works

1 section

Each aerial and its course share an SVG coordinate system, keeping the line aligned to the road at every size. Stage buttons select the matching map, stage facts and elevation profile; a scoped GSAP timeline crossfades the landscape and draws the new course. Repeated input settles to the last selection. Without GSAP or with reduced motion, selection is immediate; without JavaScript, both stages remain readable.

Difficulty Intermediate
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this website section's demo, 15 September 2026. A measurement of the demo as shipped, not a promise for your page.

Accessibility
100
Best practices
100

No performance score, on purpose. That figure depends on how you deploy: your server's compression and caching, your CDN, the connection and the device doing the test, none of which the code controls. The same page can score very differently on two consecutive runs, so measure it where it will live.

Included in the Vault

Get the Vault to use this section.

The Vault includes Alpine Stage Route Hero, the HTML, CSS and JavaScript source, the full documentation, an AI setup prompt for your editor, and every update we ship to it. Standard license: unlimited personal and commercial projects. Sections are available only in the Vault for now while the collection is small.

Documentation

Quick start

Copy the <section class="rph-hero" data-rph-hero>…</section> block, assets/style.css, assets/script.js and the assets/img/ folder. Load GSAP 3.12+ before the section script:

Code snippet omitted: it ships with the download.

The body and main element in index.html are preview context. The .rph-hero section is the extractable product.

Make it yours

Edit the race label, headline, stage facts and links directly in the section markup. Each button (data-rph-stage="01" or "02") corresponds in DOM order to a map (data-rph-map) and article (data-rph-copy). Keep all three lists in the same order. Each map contains its own photograph, data-rph-route-line course, endpoint circles and data-rph-elevation profile. Stage labels, SVG descriptions and facts are ordinary HTML; no text is buried in a timeline.

Brand controls live together on .rph-hero at the top of style.css: racing-green ground, image fallback, cream ink, muted ink, high-visibility route accent, divider, font roles, content width, corner radius, padding, transition duration and route width. For example, another race identity can set --rph-ground:#172c44, --rph-map:#263d50, --rph-ink:#f5f0df, --rph-accent:#ff825c and --rph-accent-text:#ffb7a2 without changing the timeline.

The download includes both ready-to-use WebP images in assets/img/. To replace a landscape, provide your own 4:3 image, change the SVG image's href, and trace its road as described below. The source repository retains the generation masters and bake manifest for maintainers; these build inputs are not required or included in the download.

Each photograph sits inside an inline SVG, so its course, endpoints and labels share one coordinate system: 1440 × 1080 for Lac Vert and 1448 × 1086 for Col des Pins. The images have the same 4:3 proportions; xMaxYMid slice keeps the finish side visible as the map resizes. Preserve those proportions or update the viewBox and all coordinates together. Trace replacement roads against the actual image. Terrain and stage statistics are fictional illustrations, not navigational data.

Behaviour and API

Set data-duration="0.72" on the root to change the draw speed. The first course and elevation profile draw when the section mounts. Selecting another stage crossfades its landscape, updates its facts and draws its route. Rapid selections cancel the prior transition and settle to the last requested stage. The headline stays in place.

Inserted sections can be mounted explicitly:

Code snippet omitted: it ships with the download.

mount() is idempotent for the same root; multiple roots operate independently with unique control IDs. destroy() removes this instance's listeners, kills its timeline, reverts its GSAP contexts and restores the original attributes and inline styles. Both stages become readable again, and mounting the root again restores the selector. Unrelated page animation is untouched.

Accessibility and integration

Stage controls are native buttons with aria-pressed, unique aria-controls references and visible focus. Use Tab then Enter/Space, or touch, to select a stage. The details announce changes politely. Stage information is semantic HTML and each action is a normal link. With JavaScript disabled, controls stay hidden and both full maps and stage articles remain visible. Missing GSAP retains working stage selection with immediate changes. Reduced motion also switches immediately and suppresses replay drawing; preference changes are handled while mounted.

This is a primary hero and therefore ships with an h1; change it to the appropriate heading level if it appears later in a host document. It deliberately omits a fictional site masthead so it can sit beneath the buyer's own navigation. The section is container-aware down to 320px and does not require full-viewport width, sticky positioning, smooth scrolling, a map API or a backend. Replace the CTA destination with the matching stage guide, timing page or registration route.

Dependencies and credits

  • GSAP 3.12+ (tested with 3.15.0), subject to the GSAP licence.
  • Archivo and Fraunces are loaded from Google Fonts. Both are licensed under the SIL Open Font License.
  • The two fictional Alpine aerials are original synthetic imagery generated for this section with OpenAI's built-in image generation tool. Generation direction: natural documentary drone photography of a fictional French Alpine valley, clear midsummer light, restrained greens, physically plausible roads and no labels, overlays or map UI. Lac Vert uses a lake and high mountain switchbacks; Col des Pins uses a turquoise river, stone bridge, pine woodland and limestone ridge. Full prompts are retained in the source repository’s assets/img-src/PROMPTS.md. No Google imagery, third-party map tiles or real course data are included.

Worked examples, the events and programmatic API, and the class reference ship with the download, alongside the full source.

Your cart

Your cart is empty

The Vault £99

The Vault library, plus future additions to the library.