Airline — Our Fleet
A polished Our Fleet marketing page for a fictional airline, built with plain HTML, CSS and vanilla JavaScript. Switch between four aircraft types to reveal live specifications, toggle between performance, dimension and cabin spec views, browse a cabin gallery, and preview a generated seat-configuration map. Includes an aviation-blue and sunrise-orange theme, status pills, animated hero counters, scroll reveals and a fully responsive layout that works down to small phones.
MCP
Code
:root {
--sky: #0a66c2;
--sky-d: #084e95;
--sky-50: #e9f2fb;
--cloud: #f5f8fc;
--sunrise: #ff7a33;
--sunrise-50: #fff0e7;
--ink: #13233b;
--ink-2: #3a4d68;
--muted: #6b7c93;
--bg: #f5f8fc;
--surface: #ffffff;
--line: rgba(19, 35, 59, 0.1);
--line-2: rgba(19, 35, 59, 0.18);
--ok: #1f9d62;
--warn: #e0962a;
--danger: #d4493e;
--boarding: #1f9d62;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 20px;
--shadow-sm: 0 1px 2px rgba(19, 35, 59, 0.06), 0 2px 6px rgba(19, 35, 59, 0.05);
--shadow-md: 0 6px 20px rgba(19, 35, 59, 0.08), 0 2px 6px rgba(19, 35, 59, 0.05);
--shadow-lg: 0 18px 48px rgba(19, 35, 59, 0.14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
font-family: "Inter", system-ui, -apple-system, sans-serif;
background: var(--bg);
color: var(--ink);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.num, .tnum { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
a { color: inherit; }
.btn {
display: inline-flex; align-items: center; justify-content: center;
gap: 8px; font: inherit; font-weight: 600; cursor: pointer;
border: 1px solid transparent; border-radius: 999px;
padding: 10px 18px; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sky); color: #fff; box-shadow: 0 6px 16px rgba(10, 102, 194, 0.28); }
.btn-primary:hover { background: var(--sky-d); }
/* HEADER */
.site-head {
position: sticky; top: 0; z-index: 30;
background: rgba(255, 255, 255, 0.86);
backdrop-filter: saturate(180%) blur(12px);
border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; }
.brand-mark {
display: grid; place-items: center; width: 34px; height: 34px;
border-radius: 10px; color: #fff;
background: linear-gradient(135deg, var(--sky), var(--sky-d));
box-shadow: 0 4px 12px rgba(10, 102, 194, 0.32);
}
.brand-name { font-size: 18px; color: var(--ink); }
.brand-air { color: var(--sunrise); }
.head-nav { display: flex; gap: 6px; margin-left: auto; }
.head-nav a {
text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px;
padding: 8px 12px; border-radius: var(--r-sm); transition: background .15s, color .15s;
}
.head-nav a:hover { background: var(--sky-50); color: var(--sky-d); }
.head-nav a.active { color: var(--sky-d); font-weight: 600; }
.head-cta { padding: 8px 16px; font-size: 14px; }
/* HERO */
.hero {
position: relative; overflow: hidden;
background:
radial-gradient(120% 140% at 100% 0%, rgba(255, 122, 51, 0.1), transparent 50%),
linear-gradient(180deg, var(--sky-50), var(--cloud) 70%);
border-bottom: 1px solid var(--line);
}
.hero::after {
content: ""; position: absolute; inset: 0; pointer-events: none;
background-image: repeating-linear-gradient(115deg, transparent 0 28px, rgba(10, 102, 194, 0.035) 28px 29px);
mask-image: linear-gradient(180deg, #000, transparent);
}
.hero-inner { position: relative; padding: 56px 0 48px; max-width: 720px; }
.eyebrow {
display: inline-flex; align-items: center; gap: 8px;
font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
color: var(--sky-d); background: #fff; border: 1px solid var(--line);
padding: 6px 12px; border-radius: 999px; margin: 0 0 18px; box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 157, 98, 0.18); }
.hero h1 { font-size: clamp(32px, 6vw, 50px); font-weight: 800; color: var(--ink); }
.hero-sub { font-size: clamp(15px, 2vw, 18px); color: var(--ink-2); margin: 16px 0 28px; max-width: 600px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0; }
.hero-stats div {
background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
border-radius: var(--r-md); padding: 14px 16px; backdrop-filter: blur(4px);
}
.hero-stats dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.hero-stats dd { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.hero-stats .num { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
/* SECTION HEAD */
.section-head { margin: 0 0 24px; }
.section-head h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.section-head p { color: var(--muted); margin: 8px 0 0; }
.explorer { padding: 56px 0 72px; }
/* AIRCRAFT TABS */
.ac-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.ac-tab {
display: flex; flex-direction: column; gap: 2px; text-align: left;
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
padding: 12px 18px; cursor: pointer; font: inherit; min-width: 132px;
transition: border-color .15s, box-shadow .2s, transform .15s, background .2s;
}
.ac-tab:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ac-tab:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.ac-tab.is-active {
border-color: transparent; color: #fff;
background: linear-gradient(135deg, var(--sky), var(--sky-d));
box-shadow: var(--shadow-md);
}
.ac-tab-model { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.ac-tab-class { font-size: 12px; color: var(--muted); }
.ac-tab.is-active .ac-tab-class { color: rgba(255, 255, 255, 0.78); }
/* PANEL */
.ac-panel {
background: var(--surface); border: 1px solid var(--line);
border-radius: var(--r-lg); box-shadow: var(--shadow-md);
padding: 24px; overflow: hidden;
}
.ac-panel:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.ac-panel.is-swapping { opacity: 0; transform: translateY(8px); }
.ac-panel { transition: opacity .25s, transform .25s; }
/* SUMMARY */
.ac-summary { display: grid; grid-template-columns: 1.05fr 1.2fr; gap: 24px; }
.ac-visual {
position: relative; border-radius: var(--r-md); overflow: hidden;
min-height: 230px; display: flex; align-items: flex-end; padding: 18px;
color: #fff; isolation: isolate;
}
.ac-visual-bg {
position: absolute; inset: 0; z-index: -1;
background:
radial-gradient(90% 120% at 80% 10%, rgba(255, 122, 51, 0.35), transparent 55%),
linear-gradient(160deg, var(--sky) 0%, var(--sky-d) 60%, #062f5b 100%);
}
.ac-visual::before {
content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
background-image: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.05) 22px 23px);
}
.ac-status {
position: absolute; top: 16px; left: 16px;
font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
padding: 5px 12px; border-radius: 999px;
background: rgba(31, 157, 98, 0.92); color: #fff;
display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.ac-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.ac-silhouette {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%);
width: 78%; height: auto; fill: rgba(255, 255, 255, 0.92);
filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}
.ac-visual-meta { display: flex; flex-direction: column; gap: 2px; }
.ac-tail {
font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
color: rgba(255, 255, 255, 0.78); font-variant-numeric: tabular-nums;
}
.ac-name { font-size: 18px; font-weight: 700; }
.ac-headline h3 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; }
.ac-tag { color: var(--ink-2); margin: 10px 0 16px; font-size: 15px; max-width: 46ch; }
.ac-keyspecs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ac-keyspecs li {
background: var(--cloud); border: 1px solid var(--line); border-radius: var(--r-sm);
padding: 10px 12px;
}
.ac-keyspecs .k { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ac-keyspecs .v { display: block; font-size: 18px; font-weight: 800; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ac-keyspecs .v small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ac-classes { display: flex; flex-wrap: wrap; gap: 8px; }
.class-pill {
font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
border: 1px solid var(--line-2); color: var(--ink-2); background: #fff;
display: inline-flex; align-items: center; gap: 6px;
}
.class-pill::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--dot, var(--sky)); }
/* SPEC BLOCK */
.spec-block { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.spec-toggle { display: inline-flex; gap: 4px; background: var(--cloud); padding: 4px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 18px; }
.spec-pill {
font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
border: 0; background: transparent; color: var(--ink-2);
padding: 8px 16px; border-radius: 999px; transition: background .18s, color .18s, box-shadow .18s;
}
.spec-pill:hover { color: var(--ink); }
.spec-pill.is-active { background: #fff; color: var(--sky-d); box-shadow: var(--shadow-sm); }
.spec-pill:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0; }
.spec-grid .spec {
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
padding: 14px 16px; animation: fadeUp .3s ease both;
}
.spec-grid dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.spec-grid dd { margin: 6px 0 0; font-size: 19px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.spec-grid dd small { font-size: 12px; font-weight: 600; color: var(--muted); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* LOWER: GALLERY + SEATMAP */
.ac-lower { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; }
.ac-lower h4 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.cabin-stage { position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 10; }
.cabin-shot { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 16px; transition: opacity .35s; }
.cabin-shot-art {
position: absolute; inset: 0; z-index: -1;
background-size: cover; background-position: center;
}
.cabin-shot-name {
font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0.02em;
background: rgba(19, 35, 59, 0.55); backdrop-filter: blur(4px);
padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2);
}
.cabin-arrow {
position: absolute; top: 50%; transform: translateY(-50%);
width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
background: rgba(255, 255, 255, 0.92); color: var(--ink); cursor: pointer;
font-size: 22px; line-height: 1; display: grid; place-items: center;
box-shadow: var(--shadow-sm); transition: background .15s, transform .15s;
}
.cabin-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.cabin-arrow:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.cabin-arrow.prev { left: 12px; }
.cabin-arrow.next { right: 12px; }
.cabin-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cabin-thumb {
flex: 1 1 0; min-width: 64px; font: inherit; cursor: pointer;
border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
padding: 8px 6px; font-size: 12px; font-weight: 600; color: var(--ink-2);
transition: border-color .15s, box-shadow .15s, color .15s;
}
.cabin-thumb:hover { border-color: var(--line-2); }
.cabin-thumb.is-active { border-color: var(--sky); color: var(--sky-d); box-shadow: 0 0 0 1px var(--sky); }
.cabin-thumb:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
/* SEAT MAP */
.seat-hint {
font-size: 12px; font-weight: 600; color: var(--sky-d);
background: var(--sky-50); padding: 3px 10px; border-radius: 999px;
}
.seatmap-grid {
display: grid; gap: 5px; justify-content: center;
padding: 16px; background: var(--cloud); border: 1px solid var(--line); border-radius: var(--r-md);
}
.seat-row { display: flex; gap: 5px; align-items: center; justify-content: center; }
.seat {
width: 18px; height: 18px; border-radius: 4px 4px 6px 6px;
background: var(--seat, var(--sky)); opacity: .9;
animation: seatPop .35s ease both;
}
.seat.aisle { width: 14px; background: transparent; opacity: 1; }
@keyframes seatPop { from { opacity: 0; transform: scale(.4); } to { opacity: .9; transform: scale(1); } }
.seat-note { color: var(--muted); font-size: 13px; margin: 12px 0 0; text-align: center; font-variant-numeric: tabular-nums; }
/* FOOTER */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
.foot-inner span { font-size: 13px; color: var(--muted); }
.foot-codes { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; font-weight: 600; color: var(--ink-2) !important; }
/* TOAST */
.toast {
position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px);
background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow-lg);
opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* REVEAL */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
* { animation-duration: .001ms !important; transition-duration: .001ms !important; }
[data-reveal] { opacity: 1; transform: none; }
}
/* RESPONSIVE */
@media (max-width: 880px) {
.ac-summary { grid-template-columns: 1fr; }
.ac-lower { grid-template-columns: 1fr; }
.spec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
.head-nav { display: none; }
.hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
.wrap { width: 100% - 32px; width: calc(100% - 32px); }
.head-cta { display: none; }
.hero-inner { padding: 40px 0 36px; }
.ac-panel { padding: 16px; }
.ac-tab { min-width: calc(50% - 5px); flex: 1 1 calc(50% - 5px); }
.ac-keyspecs { grid-template-columns: 1fr 1fr; }
.spec-grid { grid-template-columns: 1fr 1fr; }
.seat { width: 15px; height: 15px; }
}"use strict";
/* ---------- Fleet data (fictional Skyloom Air) ---------- */
const FLEET = {
a350: {
tail: "SL-A350",
name: "Airbus A350-1000",
title: "Airbus A350-1000",
status: "In service",
tagline:
"Our flagship for the world's longest routes — whisper-quiet, naturally lit, built to fly 16 hours without a refuel.",
keyspecs: [
{ k: "Seats", v: "327", s: "" },
{ k: "Range", v: "8,700", s: "nm" },
{ k: "Cruise", v: "Mach 0.85" }
],
classes: [
{ name: "Suite", dot: "#ff7a33" },
{ name: "Business", dot: "#0a66c2" },
{ name: "Premium", dot: "#1f9d62" },
{ name: "Economy", dot: "#6b7c93" }
],
specs: {
performance: [
{ dt: "Max range", dd: "8,700", sm: "nm" },
{ dt: "Cruise speed", dd: "488", sm: "kt" },
{ dt: "Service ceiling", dd: "43,100", sm: "ft" },
{ dt: "Engines", dd: "2", sm: "Trent XWB" }
],
dimensions: [
{ dt: "Length", dd: "73.8", sm: "m" },
{ dt: "Wingspan", dd: "64.8", sm: "m" },
{ dt: "Height", dd: "17.1", sm: "m" },
{ dt: "MTOW", dd: "319", sm: "t" }
],
cabin: [
{ dt: "Total seats", dd: "327", sm: "" },
{ dt: "Cabin width", dd: "5.61", sm: "m" },
{ dt: "Lie-flat seats", dd: "54", sm: "" },
{ dt: "Wi-Fi", dd: "Full", sm: "cabin" }
]
},
cabins: [
{ name: "Suite", layout: "1-2-1", pitch: "82", seats: 8, grad: ["#1b2c4a", "#0a66c2"], cols: [1, 2, 1] },
{ name: "Business", layout: "1-2-1", pitch: "44", seats: 46, grad: ["#0a66c2", "#084e95"], cols: [1, 2, 1] },
{ name: "Premium", layout: "2-4-2", pitch: "38", seats: 28, grad: ["#177a4c", "#1f9d62"], cols: [2, 4, 2] },
{ name: "Economy", layout: "3-3-3", pitch: "31", seats: 245, grad: ["#3a4d68", "#6b7c93"], cols: [3, 3, 3] }
]
},
b787: {
tail: "SL-B789",
name: "Boeing 787-9 Dreamliner",
title: "Boeing 787-9",
status: "In service",
tagline:
"The workhorse of our long-haul network — composite airframe, higher cabin humidity and dimmable windows for a softer arrival.",
keyspecs: [
{ k: "Seats", v: "281", s: "" },
{ k: "Range", v: "7,635", s: "nm" },
{ k: "Cruise", v: "Mach 0.85" }
],
classes: [
{ name: "Business", dot: "#0a66c2" },
{ name: "Premium", dot: "#1f9d62" },
{ name: "Economy", dot: "#6b7c93" }
],
specs: {
performance: [
{ dt: "Max range", dd: "7,635", sm: "nm" },
{ dt: "Cruise speed", dd: "488", sm: "kt" },
{ dt: "Service ceiling", dd: "43,000", sm: "ft" },
{ dt: "Engines", dd: "2", sm: "GEnx-1B" }
],
dimensions: [
{ dt: "Length", dd: "62.8", sm: "m" },
{ dt: "Wingspan", dd: "60.1", sm: "m" },
{ dt: "Height", dd: "17.0", sm: "m" },
{ dt: "MTOW", dd: "254", sm: "t" }
],
cabin: [
{ dt: "Total seats", dd: "281", sm: "" },
{ dt: "Cabin width", dd: "5.49", sm: "m" },
{ dt: "Lie-flat seats", dd: "30", sm: "" },
{ dt: "Wi-Fi", dd: "Full", sm: "cabin" }
]
},
cabins: [
{ name: "Business", layout: "1-2-1", pitch: "44", seats: 30, grad: ["#0a66c2", "#084e95"], cols: [1, 2, 1] },
{ name: "Premium", layout: "2-3-2", pitch: "38", seats: 21, grad: ["#177a4c", "#1f9d62"], cols: [2, 3, 2] },
{ name: "Economy", layout: "3-3-3", pitch: "31", seats: 230, grad: ["#3a4d68", "#6b7c93"], cols: [3, 3, 3] }
]
},
a321: {
tail: "SL-A21N",
name: "Airbus A321neo",
title: "Airbus A321neo",
status: "In service",
tagline:
"Single-aisle, twin-class comfort for short and medium hops — new-engine option for lower fuel burn and a quieter cabin.",
keyspecs: [
{ k: "Seats", v: "196", s: "" },
{ k: "Range", v: "4,000", s: "nm" },
{ k: "Cruise", v: "Mach 0.78" }
],
classes: [
{ name: "Business", dot: "#0a66c2" },
{ name: "Economy", dot: "#6b7c93" }
],
specs: {
performance: [
{ dt: "Max range", dd: "4,000", sm: "nm" },
{ dt: "Cruise speed", dd: "447", sm: "kt" },
{ dt: "Service ceiling", dd: "39,800", sm: "ft" },
{ dt: "Engines", dd: "2", sm: "LEAP-1A" }
],
dimensions: [
{ dt: "Length", dd: "44.5", sm: "m" },
{ dt: "Wingspan", dd: "35.8", sm: "m" },
{ dt: "Height", dd: "11.8", sm: "m" },
{ dt: "MTOW", dd: "97", sm: "t" }
],
cabin: [
{ dt: "Total seats", dd: "196", sm: "" },
{ dt: "Cabin width", dd: "3.70", sm: "m" },
{ dt: "Recliner seats", dd: "20", sm: "" },
{ dt: "Wi-Fi", dd: "Full", sm: "cabin" }
]
},
cabins: [
{ name: "Business", layout: "2-2", pitch: "38", seats: 20, grad: ["#0a66c2", "#084e95"], cols: [2, 2] },
{ name: "Economy", layout: "3-3", pitch: "30", seats: 176, grad: ["#3a4d68", "#6b7c93"], cols: [3, 3] }
]
},
e190: {
tail: "SL-E290",
name: "Embraer E190-E2",
title: "Embraer E190-E2",
status: "In service",
tagline:
"Our regional connector — a quiet, efficient jet sized for thinner routes, with no middle seats anywhere in the cabin.",
keyspecs: [
{ k: "Seats", v: "106", s: "" },
{ k: "Range", v: "2,850", s: "nm" },
{ k: "Cruise", v: "Mach 0.78" }
],
classes: [
{ name: "Business", dot: "#0a66c2" },
{ name: "Economy", dot: "#6b7c93" }
],
specs: {
performance: [
{ dt: "Max range", dd: "2,850", sm: "nm" },
{ dt: "Cruise speed", dd: "448", sm: "kt" },
{ dt: "Service ceiling", dd: "41,000", sm: "ft" },
{ dt: "Engines", dd: "2", sm: "PW1900G" }
],
dimensions: [
{ dt: "Length", dd: "36.2", sm: "m" },
{ dt: "Wingspan", dd: "33.7", sm: "m" },
{ dt: "Height", dd: "10.9", sm: "m" },
{ dt: "MTOW", dd: "56", sm: "t" }
],
cabin: [
{ dt: "Total seats", dd: "106", sm: "" },
{ dt: "Cabin width", dd: "2.74", sm: "m" },
{ dt: "Window seats", dd: "All", sm: "rows" },
{ dt: "Wi-Fi", dd: "Full", sm: "cabin" }
]
},
cabins: [
{ name: "Business", layout: "2-2", pitch: "37", seats: 12, grad: ["#0a66c2", "#084e95"], cols: [2, 2] },
{ name: "Economy", layout: "2-2", pitch: "31", seats: 94, grad: ["#3a4d68", "#6b7c93"], cols: [2, 2] }
]
}
};
/* ---------- Toast helper ---------- */
let toastTimer;
function toast(msg) {
const el = document.getElementById("toast");
if (!el) return;
el.textContent = msg;
el.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(() => el.classList.remove("show"), 2200);
}
/* ---------- State ---------- */
let currentAc = "a350";
let currentSpec = "performance";
let currentCabin = 0;
/* ---------- Render: summary / key specs / classes ---------- */
function renderSummary(ac) {
const d = FLEET[ac];
document.querySelector("[data-ac-tail]").textContent = d.tail;
document.querySelector("[data-ac-name]").textContent = d.name;
document.querySelector("[data-ac-title]").textContent = d.title;
document.querySelector("[data-ac-tagline]").textContent = d.tagline;
document.querySelector("[data-ac-status]").textContent = d.status;
document.querySelector("[data-ac-keyspecs]").innerHTML = d.keyspecs
.map(
(s) =>
`<li><span class="k">${s.k}</span><span class="v">${s.v}${
s.s ? ` <small>${s.s}</small>` : ""
}</span></li>`
)
.join("");
document.querySelector("[data-ac-classes]").innerHTML = d.classes
.map(
(c) =>
`<span class="class-pill" style="--dot:${c.dot}">${c.name}</span>`
)
.join("");
}
/* ---------- Render: spec grid ---------- */
function renderSpecs(ac, view) {
const rows = FLEET[ac].specs[view] || [];
document.querySelector("[data-ac-specs]").innerHTML = rows
.map(
(r) =>
`<div class="spec"><dt>${r.dt}</dt><dd>${r.dd}${
r.sm ? ` <small>${r.sm}</small>` : ""
}</dd></div>`
)
.join("");
}
/* ---------- Render: cabin gallery ---------- */
function renderCabinThumbs(ac) {
const cabins = FLEET[ac].cabins;
document.querySelector("[data-cabin-thumbs]").innerHTML = cabins
.map(
(c, i) =>
`<button class="cabin-thumb${i === currentCabin ? " is-active" : ""}" role="tab" aria-selected="${
i === currentCabin
}" data-cabin-idx="${i}">${c.name}</button>`
)
.join("");
}
function renderCabinStage(ac) {
const c = FLEET[ac].cabins[currentCabin];
const art = document.querySelector("[data-cabin-art]");
document.querySelector("[data-cabin-name]").textContent = c.name;
art.style.background = `
radial-gradient(120% 90% at 75% 12%, rgba(255,255,255,0.18), transparent 55%),
linear-gradient(155deg, ${c.grad[0]}, ${c.grad[1]})`;
// subtle "seat row" texture
art.style.backgroundImage += "";
const shot = document.querySelector("[data-cabin-shot]");
shot.style.opacity = "0";
requestAnimationFrame(() => (shot.style.opacity = "1"));
renderSeatmap(ac);
}
/* ---------- Render: seat map ---------- */
function renderSeatmap(ac) {
const c = FLEET[ac].cabins[currentCabin];
const grid = document.querySelector("[data-seatmap]");
const seatColor = c.grad[0];
// Build a representative block of rows (cap visual rows for compactness)
const totalCols = c.cols.reduce((a, b) => a + b, 0);
const visRows = Math.min(8, Math.max(4, Math.round(c.seats / totalCols)));
let html = "";
for (let r = 0; r < visRows; r++) {
html += '<div class="seat-row">';
c.cols.forEach((grp, gi) => {
for (let s = 0; s < grp; s++) {
html += `<span class="seat" style="--seat:${seatColor};animation-delay:${(r * totalCols + gi) * 12}ms"></span>`;
}
if (gi < c.cols.length - 1) html += '<span class="seat aisle"></span>';
});
html += "</div>";
}
grid.innerHTML = html;
document.querySelector("[data-seat-class]").textContent = c.name;
document.querySelector(
"[data-seat-note]"
).textContent = `${c.layout} layout · ${c.pitch}" pitch · ${c.seats} seats in this cabin`;
}
/* ---------- Full aircraft swap ---------- */
function selectAircraft(ac, announce) {
if (!FLEET[ac]) return;
currentAc = ac;
currentCabin = 0;
currentSpec = "performance";
const panel = document.getElementById("panel");
panel.classList.add("is-swapping");
setTimeout(() => {
renderSummary(ac);
renderSpecs(ac, currentSpec);
renderCabinThumbs(ac);
renderCabinStage(ac);
// reset spec pills
document.querySelectorAll(".spec-pill").forEach((p) => {
const on = p.dataset.spec === currentSpec;
p.classList.toggle("is-active", on);
p.setAttribute("aria-selected", String(on));
});
panel.classList.remove("is-swapping");
}, 200);
// tab states
document.querySelectorAll(".ac-tab").forEach((t) => {
const on = t.dataset.ac === ac;
t.classList.toggle("is-active", on);
t.setAttribute("aria-selected", String(on));
});
if (announce) toast(`${FLEET[ac].name} selected`);
}
/* ---------- Wire up events ---------- */
function init() {
// aircraft tabs
document.querySelectorAll(".ac-tab").forEach((tab) => {
tab.addEventListener("click", () => selectAircraft(tab.dataset.ac, true));
});
// keyboard nav across aircraft tabs
const tabs = Array.from(document.querySelectorAll(".ac-tab"));
document.querySelector(".ac-tabs").addEventListener("keydown", (e) => {
const i = tabs.indexOf(document.activeElement);
if (i < 0) return;
if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
e.preventDefault();
const next = e.key === "ArrowRight" ? (i + 1) % tabs.length : (i - 1 + tabs.length) % tabs.length;
tabs[next].focus();
selectAircraft(tabs[next].dataset.ac, true);
}
});
// spec toggle
document.querySelectorAll(".spec-pill").forEach((pill) => {
pill.addEventListener("click", () => {
currentSpec = pill.dataset.spec;
document.querySelectorAll(".spec-pill").forEach((p) => {
const on = p === pill;
p.classList.toggle("is-active", on);
p.setAttribute("aria-selected", String(on));
});
renderSpecs(currentAc, currentSpec);
});
});
// cabin gallery — thumbs (delegated, since they re-render)
document.querySelector("[data-cabin-thumbs]").addEventListener("click", (e) => {
const btn = e.target.closest(".cabin-thumb");
if (!btn) return;
currentCabin = Number(btn.dataset.cabinIdx);
renderCabinThumbs(currentAc);
renderCabinStage(currentAc);
});
// cabin arrows
function step(dir) {
const n = FLEET[currentAc].cabins.length;
currentCabin = (currentCabin + dir + n) % n;
renderCabinThumbs(currentAc);
renderCabinStage(currentAc);
}
document.querySelector("[data-cabin-prev]").addEventListener("click", () => step(-1));
document.querySelector("[data-cabin-next]").addEventListener("click", () => step(1));
// hero stat count-up
countUp();
// reveal on scroll
const io = new IntersectionObserver(
(entries) => {
entries.forEach((en) => {
if (en.isIntersecting) {
en.target.classList.add("in");
io.unobserve(en.target);
}
});
},
{ threshold: 0.15 }
);
document.querySelectorAll("[data-reveal]").forEach((el) => io.observe(el));
// first render
selectAircraft(currentAc, false);
}
/* ---------- Hero stat count-up ---------- */
function countUp() {
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
document.querySelectorAll(".hero-stats .num").forEach((el) => {
const target = parseFloat(el.textContent);
if (Number.isNaN(target) || reduce) return;
const decimals = (el.textContent.split(".")[1] || "").length;
const dur = 1100;
const t0 = performance.now();
function tick(now) {
const p = Math.min(1, (now - t0) / dur);
const eased = 1 - Math.pow(1 - p, 3);
el.textContent = (target * eased).toFixed(decimals);
if (p < 1) requestAnimationFrame(tick);
else el.textContent = target.toFixed(decimals);
}
requestAnimationFrame(tick);
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Skyloom Air — Our Fleet</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header class="site-head">
<div class="wrap head-inner">
<a class="brand" href="#" aria-label="Skyloom Air home">
<span class="brand-mark" aria-hidden="true">
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2 16.5 22 7l-5.5 13L13 14l-3.5 4-1-5.5L2 16.5Z"/></svg>
</span>
<span class="brand-name">Skyloom<span class="brand-air">Air</span></span>
</a>
<nav class="head-nav" aria-label="Primary">
<a href="#">Book</a>
<a href="#">Destinations</a>
<a href="#" class="active" aria-current="page">Our Fleet</a>
<a href="#">Experience</a>
</nav>
<a href="#aircraft" class="btn btn-primary head-cta">Explore aircraft</a>
</div>
</header>
<main>
<!-- HERO -->
<section class="hero" data-reveal>
<div class="wrap hero-inner">
<p class="eyebrow"><span class="dot" aria-hidden="true"></span> Fleet & cabins</p>
<h1>A fleet built for the long way around.</h1>
<p class="hero-sub">Eleven aircraft types, four cabin classes, one obsession with quiet, efficient flight. Explore each tail in our fleet — from regional hops to ultra-long-haul.</p>
<dl class="hero-stats">
<div><dt>Aircraft in service</dt><dd><span class="num">68</span></dd></div>
<div><dt>Average fleet age</dt><dd><span class="num">5.4</span> yrs</dd></div>
<div><dt>Routes flown</dt><dd><span class="num">214</span></dd></div>
<div><dt>On-time arrivals</dt><dd><span class="num">88.6</span>%</dd></div>
</dl>
</div>
</section>
<!-- AIRCRAFT EXPLORER -->
<section class="explorer wrap" id="aircraft" aria-labelledby="explorer-h">
<div class="section-head" data-reveal>
<h2 id="explorer-h">Explore the fleet</h2>
<p>Select an aircraft to view specifications, cabins and seat layout.</p>
</div>
<div class="ac-tabs" role="tablist" aria-label="Aircraft selection">
<button class="ac-tab is-active" role="tab" aria-selected="true" id="tab-a350" aria-controls="panel" data-ac="a350">
<span class="ac-tab-model">A350-1000</span>
<span class="ac-tab-class">Ultra long-haul</span>
</button>
<button class="ac-tab" role="tab" aria-selected="false" id="tab-b787" aria-controls="panel" data-ac="b787">
<span class="ac-tab-model">787-9</span>
<span class="ac-tab-class">Long-haul</span>
</button>
<button class="ac-tab" role="tab" aria-selected="false" id="tab-a321" aria-controls="panel" data-ac="a321">
<span class="ac-tab-model">A321neo</span>
<span class="ac-tab-class">Narrow-body</span>
</button>
<button class="ac-tab" role="tab" aria-selected="false" id="tab-e190" aria-controls="panel" data-ac="e190">
<span class="ac-tab-model">E190-E2</span>
<span class="ac-tab-class">Regional</span>
</button>
</div>
<div class="ac-panel" id="panel" role="tabpanel" tabindex="0" aria-live="polite">
<!-- VISUAL + SUMMARY -->
<div class="ac-summary">
<div class="ac-visual" data-ac-visual>
<div class="ac-visual-bg" aria-hidden="true"></div>
<span class="ac-status" data-ac-status>In service</span>
<svg class="ac-silhouette" viewBox="0 0 240 90" aria-hidden="true">
<path d="M8 47 C 60 41, 110 41, 150 43 L 196 30 L 204 31 L 184 45 L 224 47 L 230 44 L 233 47 L 230 50 L 224 47 L 184 49 L 204 63 L 196 64 L 150 51 C 110 53, 60 53, 8 47 Z"/>
<path d="M120 44 L 150 18 L 158 19 L 138 47 Z" opacity=".55"/>
<path d="M120 50 L 150 76 L 158 75 L 138 47 Z" opacity=".55"/>
</svg>
<div class="ac-visual-meta">
<span class="ac-tail" data-ac-tail>SL-A350</span>
<span class="ac-name" data-ac-name>Airbus A350-1000</span>
</div>
</div>
<div class="ac-headline">
<h3 data-ac-title>Airbus A350-1000</h3>
<p class="ac-tag" data-ac-tagline>Our flagship for the world's longest routes — whisper-quiet, naturally lit, built to fly 16 hours without a refuel.</p>
<ul class="ac-keyspecs" data-ac-keyspecs>
<!-- injected -->
</ul>
<div class="ac-classes" data-ac-classes aria-label="Cabin classes available">
<!-- injected -->
</div>
</div>
</div>
<!-- SPEC TABS -->
<div class="spec-block">
<div class="spec-toggle" role="tablist" aria-label="Specification view">
<button class="spec-pill is-active" role="tab" aria-selected="true" data-spec="performance">Performance</button>
<button class="spec-pill" role="tab" aria-selected="false" data-spec="dimensions">Dimensions</button>
<button class="spec-pill" role="tab" aria-selected="false" data-spec="cabin">Cabin</button>
</div>
<dl class="spec-grid" data-ac-specs>
<!-- injected -->
</dl>
</div>
<!-- CABIN GALLERY + SEAT MAP -->
<div class="ac-lower">
<div class="cabin-gallery" aria-labelledby="gallery-h">
<h4 id="gallery-h">Cabin gallery</h4>
<div class="cabin-stage">
<div class="cabin-shot" data-cabin-shot>
<span class="cabin-shot-name" data-cabin-name>Suite</span>
<div class="cabin-shot-art" data-cabin-art></div>
</div>
<button class="cabin-arrow prev" data-cabin-prev aria-label="Previous cabin">‹</button>
<button class="cabin-arrow next" data-cabin-next aria-label="Next cabin">›</button>
</div>
<div class="cabin-thumbs" data-cabin-thumbs role="tablist" aria-label="Cabin classes">
<!-- injected -->
</div>
</div>
<div class="seatmap" aria-labelledby="seat-h">
<h4 id="seat-h">Seat configuration <span class="seat-hint" data-seat-class>Economy</span></h4>
<div class="seatmap-grid" data-seatmap aria-hidden="true">
<!-- injected -->
</div>
<p class="seat-note" data-seat-note>3-3-3 layout · 31" pitch · 250 seats in this cabin</p>
</div>
</div>
</div>
</section>
</main>
<footer class="site-foot">
<div class="wrap foot-inner">
<span>Skyloom Air · A fictional carrier for demonstration.</span>
<span class="foot-codes">JFK · LHR · SIN · HND · DXB · GRU</span>
</div>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Our Fleet
An aviation-styled “Our Fleet” page for the fictional carrier Skyloom Air. The hero introduces the fleet with animated count-up statistics, and an aircraft explorer lets visitors switch between four real-world aircraft types — A350-1000, 787-9, A321neo and E190-E2 — each rendered with its own tail number, status pill, silhouette and cabin-class badges. Selecting a tail swaps the entire panel with a smooth cross-fade.
Beneath the summary, a segmented spec toggle flips the data grid between Performance, Dimensions and Cabin figures using tabular numerals for clean alignment. A cabin gallery with previous/next arrows and class thumbnails steps through Suite, Business, Premium and Economy, while a seat-configuration preview generates a representative seat map (3-3-3, 1-2-1, 2-2, and so on) with staggered pop-in animations and live pitch/seat-count notes.
Everything is self-contained vanilla JavaScript: aircraft tabs are keyboard-navigable,
buttons and inputs are focus-visible, scroll reveals fade sections in, and a small toast
confirms each selection. The layout reflows for narrow screens down to roughly 360px, and
respects prefers-reduced-motion.
Illustrative UI only — fictional airline, not a real booking or flight system.