Dental — Services List
A trust-first dental treatments directory that sorts services into General, Cosmetic, Orthodontics and Surgery. Filterable category chips reveal icon cards with plain-language summaries, typical duration, price-from badges and a live count. Each card expands an accessible detail panel with what-to-expect notes and a learn-more action, all wrapped in a calm clinical light theme built for clarity and reassurance.
MCP
Code
:root {
--blue: #2563eb;
--blue-d: #1d4ed8;
--blue-50: #eff5ff;
--mint: #34d399;
--mint-50: #e8fbf3;
--ink: #0f2740;
--ink-2: #3a5169;
--muted: #6b7c90;
--bg: #f3f8ff;
--white: #fff;
--line: rgba(15, 39, 64, 0.10);
--line-2: rgba(15, 39, 64, 0.18);
--ok: #22b07d;
--warn: #d98a2b;
--danger: #e05252;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 22px;
--shadow-sm: 0 1px 2px rgba(15, 39, 64, 0.06), 0 4px 12px rgba(15, 39, 64, 0.05);
--shadow-md: 0 6px 20px rgba(15, 39, 64, 0.08), 0 2px 6px rgba(15, 39, 64, 0.05);
--shadow-lg: 0 18px 46px rgba(37, 99, 235, 0.16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
font-family: "Inter", system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: var(--ink);
background:
radial-gradient(1200px 500px at 85% -10%, var(--blue-50), transparent 60%),
radial-gradient(900px 500px at -10% 5%, var(--mint-50), transparent 55%),
var(--bg);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
a { color: inherit; }
/* Buttons */
.btn {
font-family: inherit;
font-weight: 600;
font-size: 0.95rem;
border: 1px solid transparent;
border-radius: 999px;
padding: 10px 20px;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; }
.btn-primary {
background: var(--blue);
color: var(--white);
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { background: var(--blue-d); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-ghost {
background: var(--white);
color: var(--blue-d);
border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue); }
/* Header */
.site-header {
position: sticky;
top: 0;
z-index: 30;
background: rgba(255, 255, 255, 0.82);
backdrop-filter: saturate(1.4) blur(12px);
border-bottom: 1px solid var(--line);
}
.header-inner {
display: flex;
align-items: center;
gap: 18px;
padding: 14px 0;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
display: grid;
place-items: center;
width: 42px; height: 42px;
border-radius: 13px;
color: var(--white);
background: linear-gradient(140deg, var(--blue), #4f8bff);
box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.06rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text small { font-size: 0.72rem; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.header-nav { display: flex; gap: 24px; margin-left: auto; }
.header-nav a {
text-decoration: none;
font-weight: 500;
font-size: 0.92rem;
color: var(--ink-2);
padding: 6px 2px;
position: relative;
}
.header-nav a::after {
content: "";
position: absolute; left: 0; bottom: -2px;
width: 0; height: 2px; border-radius: 2px;
background: var(--blue);
transition: width 0.2s ease;
}
.header-nav a:hover { color: var(--ink); }
.header-nav a:hover::after { width: 100%; }
#bookTop { margin-left: 8px; }
/* Hero */
.hero { padding: 56px 0 30px; }
.hero-inner { text-align: center; }
.pill {
display: inline-flex; align-items: center; gap: 8px;
background: var(--mint-50);
color: #15795a;
border: 1px solid rgba(34, 176, 125, 0.25);
padding: 6px 14px;
border-radius: 999px;
font-size: 0.82rem;
font-weight: 600;
}
.pill .dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--mint);
box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero h1 {
font-size: clamp(2rem, 5vw, 3.15rem);
font-weight: 800;
letter-spacing: -0.03em;
margin: 20px 0 12px;
line-height: 1.08;
}
.lead { max-width: 580px; margin: 0 auto; color: var(--ink-2); font-size: 1.08rem; }
.hero-stats {
display: flex; justify-content: center; gap: 40px;
margin-top: 30px; flex-wrap: wrap;
}
.hero-stats > div { text-align: center; }
.hero-stats strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--blue-d); }
.hero-stats span { font-size: 0.82rem; color: var(--muted); }
/* Services */
.services { padding: 30px 0 20px; }
.services-head {
display: flex; align-items: flex-end; justify-content: space-between;
gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.services-head h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.section-sub { margin: 4px 0 0; color: var(--muted); }
.search {
display: inline-flex; align-items: center; gap: 8px;
background: var(--white);
border: 1px solid var(--line-2);
border-radius: 999px;
padding: 9px 16px;
color: var(--muted);
box-shadow: var(--shadow-sm);
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); color: var(--blue-d); }
.search input {
border: 0; outline: 0; background: transparent;
font-family: inherit; font-size: 0.95rem; color: var(--ink);
min-width: 200px;
}
/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
font-family: inherit;
display: inline-flex; align-items: center; gap: 7px;
background: var(--white);
border: 1px solid var(--line-2);
color: var(--ink-2);
border-radius: 999px;
padding: 8px 15px;
font-size: 0.9rem; font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
}
.chip:hover { border-color: var(--blue); color: var(--blue-d); transform: translateY(-1px); }
.chip:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.chip.is-active {
background: var(--blue);
border-color: var(--blue);
color: var(--white);
box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}
.chip-count {
font-size: 0.72rem; font-weight: 700;
background: var(--blue-50); color: var(--blue-d);
border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.chip.is-active .chip-count { background: rgba(255, 255, 255, 0.25); color: var(--white); }
.result-count { color: var(--muted); font-size: 0.88rem; margin: 6px 2px 16px; }
/* Grid */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 18px;
}
.card {
background: var(--white);
border: 1px solid var(--line);
border-radius: var(--r-lg);
padding: 22px;
box-shadow: var(--shadow-sm);
display: flex;
flex-direction: column;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
animation: rise 0.4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card-top { display: flex; align-items: flex-start; gap: 14px; }
.card-icon {
flex: none;
display: grid; place-items: center;
width: 50px; height: 50px;
border-radius: 15px;
color: var(--blue-d);
background: var(--blue-50);
}
.card[data-cat="cosmetic"] .card-icon { color: #b46b12; background: #fff4e2; }
.card[data-cat="ortho"] .card-icon { color: #15795a; background: var(--mint-50); }
.card[data-cat="surgery"] .card-icon { color: #b13c53; background: #ffeef0; }
.card-cat {
font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
color: var(--muted);
}
.card h3 { font-size: 1.14rem; font-weight: 700; margin: 3px 0 0; letter-spacing: -0.01em; }
.card-desc { color: var(--ink-2); font-size: 0.94rem; margin: 12px 0 0; }
.card-meta {
display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px;
}
.badge {
display: inline-flex; align-items: center; gap: 5px;
font-size: 0.78rem; font-weight: 600;
border-radius: 999px; padding: 4px 11px;
background: var(--blue-50); color: var(--blue-d);
border: 1px solid rgba(37, 99, 235, 0.14);
}
.badge.price { background: var(--mint-50); color: #15795a; border-color: rgba(34, 176, 125, 0.2); }
.badge svg { width: 13px; height: 13px; }
.card-actions { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.learn-more {
font-family: inherit;
background: none; border: 0; padding: 0; cursor: pointer;
color: var(--blue-d); font-weight: 700; font-size: 0.9rem;
display: inline-flex; align-items: center; gap: 6px;
}
.learn-more:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 3px; border-radius: 4px; }
.learn-more .chev { transition: transform 0.2s ease; }
.learn-more[aria-expanded="true"] .chev { transform: rotate(90deg); }
.learn-more:hover { color: var(--blue); }
.save-btn {
margin-left: auto;
background: none; border: 1px solid var(--line-2); border-radius: 999px;
width: 34px; height: 34px; display: grid; place-items: center;
color: var(--muted); cursor: pointer;
transition: all 0.16s ease;
}
.save-btn:hover { color: var(--danger); border-color: var(--danger); background: #fff3f3; }
.save-btn.saved { color: var(--danger); border-color: var(--danger); background: #ffeef0; }
.save-btn:focus-visible { outline: 3px solid rgba(224, 82, 82, 0.35); outline-offset: 2px; }
.save-btn svg { width: 16px; height: 16px; }
.card-detail {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.28s ease;
}
.card-detail > div { overflow: hidden; }
.card-detail.open { grid-template-rows: 1fr; }
.detail-inner {
margin-top: 14px; padding-top: 14px;
border-top: 1px dashed var(--line-2);
}
.detail-inner p { margin: 0 0 10px; font-size: 0.9rem; color: var(--ink-2); }
.detail-inner ul { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); font-size: 0.9rem; }
.detail-inner li { margin-bottom: 4px; }
.detail-inner li::marker { color: var(--blue); }
.empty {
text-align: center; color: var(--muted);
padding: 40px; font-size: 1rem;
background: var(--white); border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
/* CTA band */
.cta-band { padding: 50px 0 60px; }
.cta-inner {
background: linear-gradient(135deg, var(--blue), #4f8bff);
color: var(--white);
border-radius: var(--r-lg);
padding: 36px 40px;
display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
box-shadow: var(--shadow-lg);
}
.cta-inner h2 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.cta-inner p { margin: 6px 0 0; opacity: 0.92; }
.cta-inner .btn-primary { background: var(--white); color: var(--blue-d); box-shadow: 0 8px 20px rgba(0,0,0,0.14); }
.cta-inner .btn-primary:hover { background: #f0f5ff; }
/* Footer */
.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,0.6); }
.footer-inner {
display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
padding: 22px 0; font-size: 0.85rem; color: var(--muted);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--blue-d); }
/* Toast */
.toast {
position: fixed;
left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
background: var(--ink); color: var(--white);
padding: 12px 20px; border-radius: 999px;
font-size: 0.9rem; font-weight: 600;
box-shadow: 0 12px 30px rgba(15,39,64,0.32);
opacity: 0; pointer-events: none;
transition: opacity 0.25s ease, transform 0.25s ease;
z-index: 60;
display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: "✓"; color: var(--mint); font-weight: 800; }
/* Responsive */
@media (max-width: 760px) {
.header-nav { display: none; }
#bookTop { margin-left: auto; }
}
@media (max-width: 520px) {
.wrap { width: 100% - 32px; width: calc(100% - 32px); }
.hero { padding: 36px 0 20px; }
.hero-stats { gap: 26px; }
.services-head { flex-direction: column; align-items: stretch; }
.search { width: 100%; }
.search input { min-width: 0; width: 100%; }
.grid { grid-template-columns: 1fr; }
.cta-inner { padding: 26px 22px; text-align: center; justify-content: center; }
.cta-inner .btn { width: 100%; }
.footer-inner { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}(function () {
"use strict";
// --- Icons (inline SVG paths) ---
var icons = {
tooth:
'<path d="M12 5.5c-2-1.8-4.6-2.2-6-1C4 6.2 4.4 9 5.2 12c.6 2.2 1.1 5.4 2.4 6.2 1.3.8 1.7-2.2 2.6-3.4.5-.7 1.1-.9 1.8-.9s1.3.2 1.8.9c.9 1.2 1.3 4.2 2.6 3.4 1.3-.8 1.8-4 2.4-6.2.8-3 1.2-5.8-.8-7.5-1.4-1.2-4-.8-6 1z"/>',
shield:
'<path d="M12 3l7 3v5c0 4.6-3 7.9-7 9-4-1.1-7-4.4-7-9V6z"/><path d="m9 12 2 2 4-4"/>',
sparkle:
'<path d="M12 3l1.8 4.2L18 9l-4.2 1.8L12 15l-1.8-4.2L6 9l4.2-1.8z"/><path d="M18 14l.9 2 2 .9-2 .9-.9 2-.9-2-2-.9 2-.9z"/>',
smile:
'<circle cx="12" cy="12" r="9"/><path d="M8 14a4 4 0 0 0 8 0"/><path d="M9 9h.01M15 9h.01"/>',
align:
'<rect x="3" y="8" width="18" height="8" rx="2"/><path d="M7 8v8M11 8v8M15 8v8"/>',
scalpel:
'<path d="M4 20 14 10l3 3-10 10z"/><path d="M14 10 20 4a2 2 0 0 0-2.8-2.8L12 6z"/>',
implant:
'<path d="M12 3c-2 0-3.5 1.5-3.5 3.5 0 1.3.6 2.2 1.2 3l.3 6c.1 1.4 3.9 1.4 4 0l.3-6c.6-.8 1.2-1.7 1.2-3C15.5 4.5 14 3 12 3z"/>',
xray:
'<rect x="4" y="3" width="16" height="18" rx="2"/><path d="M9 3v18M15 3v18M4 9h16M4 15h16"/>',
};
// --- Data (fictional) ---
var services = [
{
id: "checkup",
cat: "general",
catLabel: "General",
icon: "shield",
title: "Check-up & Clean",
desc: "A thorough exam, professional scale and polish to keep gums healthy and catch issues early.",
duration: "45 min",
price: "£55",
about:
"A relaxed appointment with a full oral health assessment, gum check and gentle hygienist clean.",
points: [
"Digital notes and clear next-step advice",
"Personalised brushing and flossing tips",
"Recommended every 6 months",
],
},
{
id: "filling",
cat: "general",
catLabel: "General",
icon: "tooth",
title: "Tooth-Coloured Fillings",
desc: "Discreet composite fillings that repair decay and blend naturally with your existing teeth.",
duration: "30–50 min",
price: "£95",
about:
"We remove decay and rebuild the tooth with a colour-matched composite that bonds directly for strength.",
points: [
"Mercury-free, natural finish",
"Local anaesthetic for comfort",
"Usually completed in one visit",
],
},
{
id: "rootcanal",
cat: "general",
catLabel: "General",
icon: "xray",
title: "Root Canal Therapy",
desc: "Save an infected tooth and relieve pain with careful, modern endodontic treatment.",
duration: "60–90 min",
price: "£320",
about:
"Infected pulp is gently cleaned out and the canal sealed, letting you keep your natural tooth.",
points: [
"Rotary instruments for precision",
"Often more comfortable than expected",
"Crown recommended afterwards",
],
},
{
id: "whitening",
cat: "cosmetic",
catLabel: "Cosmetic",
icon: "sparkle",
title: "Teeth Whitening",
desc: "Brighten your smile several shades with a supervised take-home whitening system.",
duration: "2 weeks at home",
price: "£249",
about:
"Custom-fitted trays and professional-grade gel let you whiten safely and gradually at home.",
points: [
"Custom trays taken from your impressions",
"Even, natural-looking results",
"Top-up gel available anytime",
],
},
{
id: "veneers",
cat: "cosmetic",
catLabel: "Cosmetic",
icon: "smile",
title: "Porcelain Veneers",
desc: "Thin, bespoke shells that transform shape, colour and alignment for a confident smile.",
duration: "2–3 visits",
price: "£495",
about:
"Hand-crafted porcelain veneers are bonded to the front of teeth to reshape your smile line.",
points: [
"Digital smile preview before we start",
"Stain-resistant, long-lasting finish",
"Minimal tooth reduction",
],
},
{
id: "bonding",
cat: "cosmetic",
catLabel: "Cosmetic",
icon: "sparkle",
title: "Composite Bonding",
desc: "Reshape chips, gaps and edges in a single visit with sculpted, colour-matched resin.",
duration: "45–60 min",
price: "£140",
about:
"Composite is layered and sculpted directly onto the tooth, then polished for a seamless look.",
points: [
"No drilling in most cases",
"Same-day results",
"Easily repaired or refreshed",
],
},
{
id: "aligners",
cat: "ortho",
catLabel: "Orthodontics",
icon: "align",
title: "Clear Aligners",
desc: "Straighten teeth discreetly with a series of removable, near-invisible aligner trays.",
duration: "6–12 months",
price: "£1,850",
about:
"A guided sequence of clear trays gently moves teeth into place — removable for eating and cleaning.",
points: [
"3D plan of your final smile",
"Fewer clinic visits than braces",
"Interest-free payment plans",
],
},
{
id: "braces",
cat: "ortho",
catLabel: "Orthodontics",
icon: "align",
title: "Fixed Braces",
desc: "Precise, reliable correction for more complex alignment and bite concerns.",
duration: "12–24 months",
price: "£2,400",
about:
"Tooth-coloured or metal brackets guide teeth accurately, ideal for larger movements and bite fixes.",
points: [
"Discreet ceramic option available",
"Regular adjustment appointments",
"Retainer included at the end",
],
},
{
id: "retainer",
cat: "ortho",
catLabel: "Orthodontics",
icon: "smile",
title: "Retainers",
desc: "Protect your investment and keep newly straightened teeth beautifully in place.",
duration: "30 min fitting",
price: "£120",
about:
"Fixed or removable retainers hold your results so your smile stays straight for years to come.",
points: [
"Fixed or clear removable styles",
"Comfortable, low-profile fit",
"Replacements available",
],
},
{
id: "extraction",
cat: "surgery",
catLabel: "Surgery",
icon: "scalpel",
title: "Tooth Extraction",
desc: "Gentle, well-managed removal when a tooth can no longer be saved, with aftercare support.",
duration: "30–45 min",
price: "£150",
about:
"Careful, calm extraction under local anaesthetic with clear aftercare guidance for smooth healing.",
points: [
"Sedation options for anxious patients",
"Written aftercare instructions",
"Follow-up check included",
],
},
{
id: "implant",
cat: "surgery",
catLabel: "Surgery",
icon: "implant",
title: "Dental Implants",
desc: "A permanent, natural-feeling replacement for missing teeth using a titanium post and crown.",
duration: "3–6 months",
price: "£2,200",
about:
"A biocompatible post is placed into the jaw and topped with a custom crown for a stable, lasting result.",
points: [
"3D scan and guided placement",
"Looks and functions like a real tooth",
"Cares for jawbone health",
],
},
{
id: "wisdom",
cat: "surgery",
catLabel: "Surgery",
icon: "xray",
title: "Wisdom Tooth Removal",
desc: "Surgical removal of impacted or painful wisdom teeth by our experienced clinical team.",
duration: "45–60 min",
price: "£280",
about:
"Impacted wisdom teeth are assessed by scan and removed with careful technique to minimise discomfort.",
points: [
"Detailed pre-surgery imaging",
"Sedation available",
"Clear recovery plan",
],
},
];
// --- Elements ---
var grid = document.getElementById("grid");
var filters = document.getElementById("filters");
var searchInput = document.getElementById("search");
var resultCount = document.getElementById("resultCount");
var emptyMsg = document.getElementById("empty");
var toastEl = document.getElementById("toast");
var chips = Array.prototype.slice.call(filters.querySelectorAll(".chip"));
var state = { cat: "all", query: "" };
var saved = {};
function svg(name) {
return (
'<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">' +
(icons[name] || icons.tooth) +
"</svg>"
);
}
function esc(s) {
return String(s).replace(/[&<>"]/g, function (c) {
return { "&": "&", "<": "<", ">": ">", '"': """ }[c];
});
}
// --- Build a card ---
function cardHTML(s) {
var points = s.points
.map(function (p) {
return "<li>" + esc(p) + "</li>";
})
.join("");
return (
'<article class="card" data-cat="' +
s.cat +
'" data-id="' +
s.id +
'">' +
'<div class="card-top">' +
'<div class="card-icon" aria-hidden="true">' +
svg(s.icon) +
"</div>" +
"<div>" +
'<div class="card-cat">' +
esc(s.catLabel) +
"</div>" +
"<h3>" +
esc(s.title) +
"</h3>" +
"</div>" +
"</div>" +
'<p class="card-desc">' +
esc(s.desc) +
"</p>" +
'<div class="card-meta">' +
'<span class="badge"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>' +
esc(s.duration) +
"</span>" +
'<span class="badge price">From ' +
esc(s.price) +
"</span>" +
"</div>" +
'<div class="card-actions">' +
'<button class="learn-more" type="button" aria-expanded="false" aria-controls="detail-' +
s.id +
'">Learn more <span class="chev" aria-hidden="true">›</span></button>' +
'<button class="save-btn" type="button" aria-pressed="false" aria-label="Save ' +
esc(s.title) +
'"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M12 21s-7-4.5-7-10a4 4 0 0 1 7-2.5A4 4 0 0 1 19 11c0 5.5-7 10-7 10z"/></svg></button>' +
"</div>" +
'<div class="card-detail" id="detail-' +
s.id +
'"><div><div class="detail-inner">' +
"<p>" +
esc(s.about) +
"</p>" +
"<ul>" +
points +
"</ul>" +
'<button class="btn btn-ghost book-service" type="button" data-title="' +
esc(s.title) +
'">Book this treatment</button>' +
"</div></div></div>" +
"</article>"
);
}
// --- Render ---
function render() {
var q = state.query.trim().toLowerCase();
var list = services.filter(function (s) {
var matchCat = state.cat === "all" || s.cat === state.cat;
var matchQ =
!q ||
s.title.toLowerCase().indexOf(q) !== -1 ||
s.desc.toLowerCase().indexOf(q) !== -1 ||
s.catLabel.toLowerCase().indexOf(q) !== -1;
return matchCat && matchQ;
});
grid.innerHTML = list.map(cardHTML).join("");
// restore saved state
list.forEach(function (s) {
if (saved[s.id]) {
var btn = grid.querySelector('.card[data-id="' + s.id + '"] .save-btn');
if (btn) {
btn.classList.add("saved");
btn.setAttribute("aria-pressed", "true");
}
}
});
emptyMsg.hidden = list.length !== 0;
var label =
list.length === 0
? "No treatments found"
: "Showing " +
list.length +
" treatment" +
(list.length === 1 ? "" : "s") +
(state.cat === "all" ? "" : " in " + catLabel(state.cat));
resultCount.textContent = label;
}
function catLabel(cat) {
var map = {
general: "General",
cosmetic: "Cosmetic",
ortho: "Orthodontics",
surgery: "Surgery",
};
return map[cat] || cat;
}
// --- Chip counts ---
function updateCounts() {
var counts = { all: services.length, general: 0, cosmetic: 0, ortho: 0, surgery: 0 };
services.forEach(function (s) {
counts[s.cat] = (counts[s.cat] || 0) + 1;
});
Object.keys(counts).forEach(function (k) {
var el = filters.querySelector('[data-count="' + k + '"]');
if (el) el.textContent = counts[k];
});
}
// --- Toast ---
var toastTimer;
function toast(msg) {
toastEl.textContent = msg;
toastEl.hidden = false;
// force reflow then show
void toastEl.offsetWidth;
toastEl.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("show");
setTimeout(function () {
toastEl.hidden = true;
}, 300);
}, 2600);
}
// --- Events: filter chips ---
chips.forEach(function (chip) {
chip.addEventListener("click", function () {
chips.forEach(function (c) {
c.classList.remove("is-active");
c.setAttribute("aria-selected", "false");
});
chip.classList.add("is-active");
chip.setAttribute("aria-selected", "true");
state.cat = chip.getAttribute("data-cat");
render();
});
});
// keyboard arrow nav across chips
filters.addEventListener("keydown", function (e) {
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
var idx = chips.indexOf(document.activeElement);
if (idx === -1) return;
e.preventDefault();
var next = e.key === "ArrowRight" ? idx + 1 : idx - 1;
if (next < 0) next = chips.length - 1;
if (next >= chips.length) next = 0;
chips[next].focus();
});
// --- Search ---
searchInput.addEventListener("input", function () {
state.query = searchInput.value;
render();
});
// --- Delegated grid interactions ---
grid.addEventListener("click", function (e) {
var learn = e.target.closest(".learn-more");
if (learn) {
var detail = document.getElementById(learn.getAttribute("aria-controls"));
var open = learn.getAttribute("aria-expanded") === "true";
learn.setAttribute("aria-expanded", String(!open));
detail.classList.toggle("open", !open);
return;
}
var save = e.target.closest(".save-btn");
if (save) {
var card = save.closest(".card");
var id = card.getAttribute("data-id");
var svc = services.find(function (s) {
return s.id === id;
});
saved[id] = !saved[id];
save.classList.toggle("saved", saved[id]);
save.setAttribute("aria-pressed", String(saved[id]));
toast(saved[id] ? "Saved " + svc.title : "Removed " + svc.title);
return;
}
var book = e.target.closest(".book-service");
if (book) {
toast("Booking request sent for " + book.getAttribute("data-title"));
return;
}
});
// --- Header CTAs ---
var bookTop = document.getElementById("bookTop");
var bookBottom = document.getElementById("bookBottom");
if (bookTop)
bookTop.addEventListener("click", function () {
toast("Thanks! Our team will call to confirm your visit.");
});
if (bookBottom)
bookBottom.addEventListener("click", function () {
toast("Consultation request received — we'll be in touch soon.");
});
// --- Init ---
updateCounts();
render();
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Brightwater Dental Studio — Treatments & Services</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-header">
<div class="wrap header-inner">
<a class="brand" href="#top" aria-label="Brightwater Dental Studio 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="M12 5.5c-2-1.8-4.6-2.2-6-1C4 6.2 4.4 9 5.2 12c.6 2.2 1.1 5.4 2.4 6.2 1.3.8 1.7-2.2 2.6-3.4.5-.7 1.1-.9 1.8-.9s1.3.2 1.8.9c.9 1.2 1.3 4.2 2.6 3.4 1.3-.8 1.8-4 2.4-6.2.8-3 1.2-5.8-.8-7.5-1.4-1.2-4-.8-6 1z" />
</svg>
</span>
<span class="brand-text">
<strong>Brightwater</strong>
<small>Dental Studio</small>
</span>
</a>
<nav class="header-nav" aria-label="Primary">
<a href="#services">Treatments</a>
<a href="#services">Our team</a>
<a href="#services">Pricing</a>
</nav>
<button class="btn btn-primary" id="bookTop" type="button">Book a visit</button>
</div>
</header>
<main id="top">
<section class="hero">
<div class="wrap hero-inner">
<span class="pill">
<span class="dot" aria-hidden="true"></span>
Accepting new patients
</span>
<h1>Gentle, modern dentistry<br />for every smile.</h1>
<p class="lead">Browse our full range of treatments — from routine check-ups to cosmetic makeovers and specialist surgery. Transparent guide pricing, no surprises.</p>
<div class="hero-stats" role="list">
<div role="listitem"><strong>12k+</strong><span>Happy patients</span></div>
<div role="listitem"><strong>4.9</strong><span>Average rating</span></div>
<div role="listitem"><strong>18</strong><span>Years of care</span></div>
</div>
</div>
</section>
<section class="services wrap" id="services" aria-labelledby="services-title">
<div class="services-head">
<div>
<h2 id="services-title">Treatments & services</h2>
<p class="section-sub">Choose a category or search to find the right care for you.</p>
</div>
<div class="search" role="search">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.2-3.2"/></svg>
<input id="search" type="search" placeholder="Search treatments…" aria-label="Search treatments" autocomplete="off" />
</div>
</div>
<div class="filters" role="tablist" aria-label="Filter by category" id="filters">
<button class="chip is-active" role="tab" aria-selected="true" data-cat="all" type="button">All <span class="chip-count" data-count="all">0</span></button>
<button class="chip" role="tab" aria-selected="false" data-cat="general" type="button">General <span class="chip-count" data-count="general">0</span></button>
<button class="chip" role="tab" aria-selected="false" data-cat="cosmetic" type="button">Cosmetic <span class="chip-count" data-count="cosmetic">0</span></button>
<button class="chip" role="tab" aria-selected="false" data-cat="ortho" type="button">Orthodontics <span class="chip-count" data-count="ortho">0</span></button>
<button class="chip" role="tab" aria-selected="false" data-cat="surgery" type="button">Surgery <span class="chip-count" data-count="surgery">0</span></button>
</div>
<p class="result-count" id="resultCount" aria-live="polite"></p>
<div class="grid" id="grid"></div>
<p class="empty" id="empty" hidden>No treatments match your search. Try a different term or category.</p>
</section>
<section class="cta-band wrap">
<div class="cta-inner">
<div>
<h2>Not sure where to start?</h2>
<p>Book a friendly consultation and we'll build a personalised plan together.</p>
</div>
<button class="btn btn-primary btn-lg" id="bookBottom" type="button">Book a consultation</button>
</div>
</section>
</main>
<footer class="site-footer">
<div class="wrap footer-inner">
<span>© 2026 Brightwater Dental Studio · Fictional demo</span>
<span class="footer-links">
<a href="#top">Privacy</a>
<a href="#top">Accessibility</a>
<a href="#top">Contact</a>
</span>
</div>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
<script src="script.js"></script>
</body>
</html>A calm, clinical services page for the fictional Brightwater Dental Studio. Treatments are grouped into four categories — General, Cosmetic, Orthodontics and Surgery — and surfaced as rounded cards, each with a duotone icon, a plain-language summary, a typical-duration line and a soft price-from badge. A sticky header keeps the practice identity and a book-visit call to action in view while patients browse.
Category chips act as an accessible filter: selecting one reveals only the matching services and updates a live result count, while a search field narrows cards by name or description in real time. Every card carries a Learn more control that expands an inline detail panel with what-to-expect notes and a follow-up action, using aria-expanded and keyboard-friendly buttons so the whole grid stays usable without a mouse. A small toast confirms actions like booking or saving a treatment.
The layout collapses gracefully to a single column below 520px, keeps WCAG AA contrast against the airy blue background, and leans on soft shadows and generous whitespace to feel reassuring rather than clinical.
Illustrative UI only — not intended for real medical use.