187

Car Dealership Website Template

£29
or the whole Vault, £99

The business, people and figures in this demo are made up for the example. Any resemblance to a real company is a coincidence.

Six-page car dealership website template where every car stands side-on against one studio wall with its model code set huge behind it. Drag the line-up, filter stock by make, price and year, open condition close-ups and work out finance. Also suits motorbike dealers, boat brokers, plant hire and watch resellers; shown as a Leeds dealer that restores modern classics.

ScrollTriggerFlip advanced
8 more details
draggableflip-filtertimeline-controlscroll-revealclip-pathview-transitionsprogressive-enhancementkeyboard-navigation

Updated

About this template

A six-page site for a dealer who sells objects that look best side-on. Every car is photographed exactly in profile against the same warm stone wall, and that wall is the page ground, so the cars sit in the page instead of in photo frames. Behind each car its short model code (E30, MX-5, 911, GTI) is set in extra-condensed capitals so large that the car's roofline cuts through the letters, and a ruled ledger of year, miles, owners and price runs along the bottom of the first screen. Tail-light red is kept for prices; every other colour is the cars' paint.

Read the full template overview

The home page is a line-up: drag a car off the wall, press the arrow keys or use the buttons, and the next car drives in while its code rolls up and the ledger figures roll over. Stock puts the same cut-outs in a two-up line-up beside a column of large make names and price and year sliders, with a typed ledger of cars sold this year that the same filters narrow. Each car has one data-driven page with numbered hotspots on its photograph that open close-ups, the list of faults those numbers point to, the work done and a finance calculator. Restoration pairs a founder's letter and a workshop job card with a before and after slider for every car; Finance and Visit carry the calculator, a representative example, a real street map and a viewing request form.

The worked example is Halden Motor Co., a small dealer in Kirkstall, Leeds that restores the 1985 to 2005 modern classics it sells. Everything about the cars lives in one plain data file, so the same pages sell motorbikes, boats, plant or watches: photograph each object side-on against one wall, give it a short code and its figures, and the line-up, stock filters and car pages follow.

Car Dealership - website template preview

What's included

14 items
  • Six plain HTML pages: Home, Stock, a data-driven car page, Restoration, Finance and Visit, sharing one stylesheet, one script and one stock table
  • Home line-up: drag a car off the wall, use the arrow keys or the buttons, and the next car drives in while its model code and the ledger figures roll over
  • The model code behind each car is measured and sized to that car, so its roofline always cuts the letters, at every screen size
  • The swap is interrupt-safe: fast repeated clicks, a drag reversed mid-gesture, keys pressed while a car is still moving and a window resized mid-swap all land on one clean car
  • Stock: two-up line-up of the same side-on cut-outs, filtered by make, price and year with a Flip reflow; hover or focus swaps each card's summary for its spec line
  • A typed ledger of cars sold this year that the same filters narrow, plus an empty state with a reset
  • One car page for every car (car.html?car=id): title and price, a ruled spec band, numbered condition hotspots that open close-ups, the matching faults list, the work done and the next car
  • Finance calculator on the car page and the Finance page: pick a car, drag the deposit and the term, and the monthly payment, credit and total payable follow
  • Restoration: founder's letter, a workshop job card and a before and after slider for every car in stock
  • Visit: a real street map on OpenFreeMap tiles with the drive from the station drawn on it, opening hours and a viewing request form
  • Designed phone menu: a paper sheet of the page names set large, each with a live figure from the stock table
  • Plain page loads with a short cross-document view transition where the browser supports it
  • Self-hosted fonts and baked WebP images, with the hero car preloaded
  • Accessible: native buttons, radios and range inputs throughout, keyboard control of the line-up and every slider, a polite live region for each new car, full no-JS and reduced-motion pages

Perfect for

5 use cases
  • Independent car dealers and used car showrooms
  • Classic and modern classic car specialists and restorers
  • Motorbike dealers and scooter shops
  • Boat brokers and caravan or campervan dealers
  • Plant and machinery hire, watch and camera resellers

How it works

5 sections

One stock table drives every page

assets/cars.js holds every car: name, model code, figures, colour, description, work done, condition hotspots and the geometry of its photograph. The home line-up, the stock cards and filters, the car page, the before and after rows and the finance calculators all read it, so adding a car is one entry and its images. The pages ship with the first car written out in HTML so they read without JavaScript.

The wall, the code and the car

Each stage is three layers: a photograph of the empty studio wall, the model code, and the car cut out on a shared transparent canvas with its contact shadow baked in. All cars sit on the same canvas, scaled by their real length, so their tyres meet the floor at the same line. The script measures each code with the browser's own text metrics and sizes it from the car: the baseline sits halfway down the body and the letters run on until the windscreen and roof cut them.

A line-up that cannot get stuck

One timeline owns every swap. A new click, key or drag stops it where it is and starts the next swap from the current positions towards fixed end points, so nothing drifts however fast the input comes. Drags decide their axis on the first movement, leave vertical swipes to the page, and only count as a flick if the pointer is still moving when it lets go.

Condition reports tied to the photograph

Each car's hotspots are positioned in percent of its photograph, so they stay on the car at any size. A hotspot or its entry in the faults list opens a close-up beside the car on desktop or under it on a phone; Escape, the close button or a click elsewhere closes it and returns focus. Close-ups can be separate photographs, as for the MX-5, or crops of the car's own photograph.

Fallbacks

Without JavaScript every page is a complete document: the first car, its spec and faults list with close-up images, the before and after photographs one above the other, a link to the map, and the menu as a row of links. With reduced motion the line-up crossfades instead of driving, the figures change in place and the map route is drawn at once.

Plugins ScrollTrigger, Flip
Difficulty Advanced
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this template's demo (6 pages, lowest score shown), from the latest scan. 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.

Questions about this template

Will this suit a dealer that sells something other than classic cars?

Yes. The design depends on one rule: photograph every item side-on against the same wall. Motorbikes, boats on trailers, vans, plant, even watches or cameras on a backdrop work the same way. Replace the cut-outs and the wall photograph, give each item a short code such as a model number, and change the ledger labels from miles and owners to whatever your buyers compare, such as hours or engine size.

How do I add my own cars and photographs?

Add an entry to assets/cars.js with the car's figures, code, description and hotspots, then add two images named after it: a cut-out on a transparent 2400 by 1000 canvas with the tyres on the floor near the bottom, and a smaller copy. The README explains the canvas, how to measure roof and windscreen positions, and how to place hotspots in percent of the photograph.

Does the viewing request form send anything?

No. It is an unwired front end: it checks the name and phone number, then shows an in-page confirmation and nothing is sent or stored. It collects a name, phone number, the chosen car, a preferred day and a note. Point it at Formspree, Netlify Forms, your dealer management system or CRM before you go live.

Are the finance figures real quotes?

They are an illustration calculated in the browser: equal monthly hire purchase payments at the representative APR set in assets/cars.js. There is no lender connection, credit check or application. Set your own APR, deposit limits and terms there, and have your finance wording and representative example checked against your lender's and regulator's requirements before publishing.

Can I list more cars, or show only a few?

The line-up, stock grid, filters, car page and calculators all build from the list in assets/cars.js, so four cars or forty work the same way. With a long list the home line-up still shows one car at a time; the stock page is where buyers browse. With a single car the line-up hides its arrows.

Are the before and after photographs real restorations?

No. Every photograph in the template, including the before and after pairs, is AI-generated for the fictional Halden Motor Co. The pairs are illustrative. If you use the comparison sliders, replace them with your own photographs of the same car taken from the same spot, so the claim the slider makes is true.

The Vault opens this source and the whole library.

Each product gives you the HTML, CSS and JavaScript source, the full documentation and an AI setup prompt, licensed for unlimited personal and commercial projects. Every paid product is tested for desktop and mobile layouts, reduced-motion handling, animation cleanup and keyboard controls wherever there is something to operate.

One payment, over 350 products, and future additions to the library.

Documentation

Quick Start

  1. Unzip and open index.html in a browser, or serve the folder with any static server (npx serve .).
  2. The pages are plain HTML files: index.html (home), stock.html, car.html, restoration.html, finance.html and visit.html.
  3. Every page shares assets/style.css, assets/cars.js (the stock table) and assets/script.js. There is no build step.
  4. Deploy the folder as it is to any static host.

Using It With Your Own Design

  • Stock: every car is an entry in assets/cars.js (see The stock table). Edit it and the home line-up, stock grid and filters, car pages, before and after rows and calculators follow.
  • Colours: six values at the top of assets/style.css: --wall (the studio wall, sampled from the photographs), --floor, --paper, --ink, --red (prices, the active hotspot, and one full band a page for the faults promise) and their RGB triples. Measured contrast pairs are in the comment above them.
  • Type: Sofia Sans Extra Condensed (model codes, figures, headings) and Sofia Sans (text), self-hosted in assets/fonts/. Change the @font-face rules and --font-display/--font-body in assets/style.css and the two font preloads in each page's head. The script measures the model code in whatever face --font-display names.
  • Brand marks: the stamped seals share one geometry, the hidden .seal-defs SVG just above each page's footer. Each seal <use>s its rings and sets its own wording in its <textPath> and its centre in .seal__h (the car page's centre is the job number, filled from cars.js). Ink and angle come from CSS: color and --seal-r on the seal's modifier class. The giant cut-off words are the footer's .foot__mark (sized for six letters; change the divisor in its font-size for a longer or shorter name), the .cut paragraph on visit.html ("LS4", sized from --chars against its panel, with --show the share of the letters left above the edge) and the inner page titles (sized from --chars on the h1).
  • Photographs: the design depends on one rule: every item photographed exactly side-on against one wall, at one camera height. Keep that rule with your own photographs and the line-up reads as a set.
  • Another business: motorbikes, boats, vans, plant, watches or cameras all work. Change the ledger labels (Year, Miles, Owners, Price) in index.html and the matching keys in script.js's writeLedger, and the spec band labels in car.html.

Pages and Configuration

Page Sections Hands-on piece
Home Line-up stage with the ledger, how a car gets on the wall, a fault from a listing, the workshop band with the job card, finance and visit links Drag, keys or buttons walk the line-up
Stock Make, price and year filters beside a two-up line-up, sold this year Filters reflow the cards; hover or focus shows each car's spec
Car (car.html?car=<id>) Title, price and spec band, condition report, faults list, the car and the work done, finance, next car Hotspots open close-ups; deposit and term sliders
Restoration Founder's letter, job card for the car on the ramp, a before and after per car Drag across each comparison
Finance Calculator, how it works, representative example, questions Car picker, deposit and term
Visit Map with the drive from the station, address and hours, viewing request form Map, form

Every feature looks for its own markup and does nothing when it is missing, so you can delete a section, or a page and its nav links, without editing the script.

The stock table (assets/cars.js)

window.HALDEN holds three things:

  • finance: apr (percent), minDepositPct, maxDepositPct, defaultDepositPct, depositStep, terms (months) and defaultTerm.
  • visit: shop ([longitude, latitude] of the pin) and route, a list of [longitude, latitude] points drawn from the first point to the shop.
  • cars: one entry per car, in line-up order: id (used in car.html?car=<id>), code (the short model code behind the car; three or four characters fill the wall best), make, model, chassis, name, year, miles, owners, price, colour, interior, engine, gearbox, mot, img, the photograph geometry (roof, pillar, front, rear, and optional wheels: [{ x, y, r }, ...] for spinning rims on the home stage — omit for non-wheeled stock), summary (stock card), intro and body (car page), work and job (what was done), and spots.
  • sold: cars sold this year for the Stock ledger: name, make, year, miles, price, month.

Pages without JavaScript show what is written in the HTML: the first car on index.html and car.html, and every card, make button and sold row on stock.html. Writing them out also means the page does not shift as it loads. The script fills the home and car pages from the table, and rebuilds the stock cards, make buttons or sold rows only when they no longer match it. So when you change the stock, update those static copies too; until you do, the page still works but shifts once on load, and visitors without JavaScript see the old content.

The car photographs

Each car is two files in assets/img/: <img>.webp (1800 by 750) and <img>-sm.webp (900 by 375). Both are the car cut out on a transparent canvas of 12 by 5 proportions, with a soft contact shadow baked in:

  • Tyres meet the floor at 95.5% of the canvas height (the CONTACT value in script.js).
  • Scale every car by its real length against the longest car, so they stand together as a set; centre each horizontally.
  • Measure four values from the cut-out as fractions of the canvas: roof (top of the roof, of the height), and front, pillar (where the windscreen meets the bonnet) and rear (of the width). The script sizes the model code from these so the roofline cuts it.

assets/img/stage.webp is the empty wall behind every car. Shoot your own empty wall from the same camera position, or use a plain colour by deleting the <img class="stage__wall"> elements.

Condition hotspots

spots is a list of { x, y, title, text, img }. x and y are percentages of the car canvas, so the dot stays on the car at any size. img names a close-up in assets/img/ (<name>.webp at 4:3 for the close-up and <name>-sm.webp for the faults list). Leave img out and the page uses <id>-spot-<n>.webp, which in this template are crops of the car's own photograph. The faults list is numbered to match the dots.

Before and after

Each row on restoration.html pairs before-<id>.webp and after-<id>.webp (16:9). The two must be the same car from the same spot so the divider lines up. A native range input underneath carries keyboard and screen reader control. The pairs shipped here are illustrative: AI-generated, not photographs of real restorations. Replace them with your own before you publish a before and after claim.

Finance

The calculators work out equal monthly hire purchase payments on the price less the deposit, at the representative APR from cars.js. They are an illustration in the browser, not a quote: there is no lender connection. Have your finance wording and representative example checked before publishing.

Map

The Visit page draws a real street map with MapLibre GL on OpenFreeMap tiles (no key, no account) when the map nears the screen. The pin and route come from visit in cars.js; the route here is a real driving route from Leeds station. Until the map loads, or without WebGL, the section shows a link to the location on OpenStreetMap. Keep the OpenStreetMap attribution.

Viewing request form

The form on visit.html is a static front end. It checks the name and phone number, then replaces itself with a confirmation; nothing is sent or stored. It collects name, phone, car, preferred day and a note. Connect it to Formspree, Netlify Forms or your CRM by giving the form an action and removing the submit handler in initBook. car.html links to it with ?car=<id> so the car is preselected.

Accessibility

  • Skip link, landmarks and one h1 per page; the current page is marked with aria-current in both navigations.
  • The line-up stage is focusable: Left and Right arrows change car, and so do the Previous and Next buttons. A polite live region announces each car and its price. The model code is decorative and hidden from assistive technology; the car's name is a real link in the ledger.
  • Phone menu: a real button with aria-expanded and aria-controls; focus moves into the menu and Escape or a click outside closes it.
  • Filters are native buttons with aria-pressed and native range inputs with live outputs; the result count is announced.
  • Hotspots are buttons; the close-up panel takes focus and returns it to the control that opened it.
  • Before and after sliders and calculator controls are native range inputs with readable values.
  • Contrast is measured for every text and ground pair (see the comment at the top of style.css).
  • Reduced motion: the line-up crossfades, figures change in place, the filters reflow without movement and the map route is drawn at once. Without JavaScript every page is a complete document.

Dependencies

  • GSAP 3.15.0 core, ScrollTrigger and (on the Stock page) Flip, from jsDelivr. The template needs GSAP 3.12+.
  • MapLibre GL 4.7.1 from unpkg, Visit page only, loaded when the map nears the screen. Map style and tiles from OpenFreeMap, data from OpenStreetMap contributors.
  • Fonts: Sofia Sans and Sofia Sans Extra Condensed (SIL Open Font License, assets/fonts/OFL.txt), self-hosted.

Photographs

Every photograph is AI-generated for this fictional business and bundled as baked WebP files in assets/img/: the four cars and their cut-outs, the empty studio wall, the MX-5 close-ups, the workshop and welding photographs, and the before and after pairs. None shows a real car for sale or a real restoration, and none contains readable words or brand logos beyond the shapes of the cars themselves. Replace each with your own at the same name and proportions, then update its alt text (and captions on Home and Restoration) to describe what your photograph shows.

Teardown

The pages are plain page loads and need no teardown. If you mount a page inside an app shell, call window.destroyHalden() to revert its animations and ScrollTriggers.

Also in your download: the full source, worked examples, the events and programmatic API, and the class reference.

£29