Onboarding — Welcome / first-run modal
A polished first-run welcome modal for product onboarding, built as an accessible dialog with role=dialog, aria-modal, a focus trap, and Escape or backdrop dismissal. It greets a returning user by name, pairs a gradient illustration header with two or three icon-led highlight bullets, and offers a primary Get started action alongside a low-key Skip for now link. A page button replays it, dismissal is remembered for the session, and live variant switches toggle single-screen versus a two-step carousel and an illustration versus compact header.
MCP
Codice
:root {
--brand: #5b5bf0;
--brand-d: #4646d6;
--brand-700: #3a3ab8;
--brand-50: #eef0ff;
--accent: #00b4a6;
--accent-soft: #d8f5f2;
--ink: #101322;
--ink-2: #3a4060;
--muted: #6c7393;
--bg: #f6f7fb;
--white: #ffffff;
--surface: #ffffff;
--line: rgba(16, 19, 34, 0.1);
--line-2: rgba(16, 19, 34, 0.16);
--ok: #2f9e6f;
--warn: #d98a2b;
--danger: #d4503e;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 20px;
--sh-1: 0 1px 2px rgba(16, 19, 34, 0.08);
--sh-2: 0 8px 24px rgba(16, 19, 34, 0.08);
--sh-3: 0 24px 64px rgba(16, 19, 34, 0.22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
}
button { font-family: inherit; }
:focus-visible {
outline: 2px solid var(--brand);
outline-offset: 2px;
border-radius: 4px;
}
/* ---------- Demo app shell ---------- */
.app { min-height: 100vh; filter: saturate(0.98); }
.topbar {
position: sticky;
top: 0;
z-index: 5;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px clamp(16px, 4vw, 40px);
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(10px);
border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 10px;
background: var(--brand-50);
color: var(--brand);
}
.brand-name { font-weight: 800; letter-spacing: -0.01em; }
.brand-sub {
font-size: 12px;
font-weight: 600;
color: var(--muted);
padding: 2px 8px;
border: 1px solid var(--line);
border-radius: 999px;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.ghost-btn {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 8px 14px;
font-size: 13px;
font-weight: 600;
color: var(--ink-2);
background: var(--white);
border: 1px solid var(--line-2);
border-radius: var(--r-sm);
cursor: pointer;
transition: background 0.15s, border-color 0.15s, transform 0.06s;
}
.ghost-btn:hover { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.ghost-btn:active { transform: translateY(1px); }
.avatar {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--brand));
color: #fff;
font-size: 12px;
font-weight: 700;
}
.canvas { padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 40px); }
.canvas-inner { max-width: 980px; margin: 0 auto; }
.skeleton {
background: linear-gradient(100deg, #eceef6 30%, #f5f6fb 50%, #eceef6 70%);
background-size: 200% 100%;
animation: shimmer 1.6s linear infinite;
border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-title { height: 38px; width: 46%; margin-bottom: 28px; border-radius: var(--r-sm); }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.sk-card { height: 140px; }
.sk-row { height: 20px; margin-bottom: 14px; }
.sk-row.short { width: 70%; }
/* ---------- Overlay & modal ---------- */
.overlay {
position: fixed;
inset: 0;
z-index: 50;
display: grid;
place-items: center;
padding: 20px;
}
.overlay[hidden] { display: none; }
.backdrop {
position: absolute;
inset: 0;
background: rgba(16, 19, 34, 0.46);
backdrop-filter: blur(3px);
animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
position: relative;
width: min(440px, 100%);
background: var(--surface);
border-radius: var(--r-lg);
box-shadow: var(--sh-3);
overflow: hidden;
animation: pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop {
from { opacity: 0; transform: translateY(14px) scale(0.96); }
}
.close-x {
position: absolute;
top: 12px;
right: 12px;
z-index: 3;
display: grid;
place-items: center;
width: 32px;
height: 32px;
border: none;
border-radius: 50%;
background: rgba(255, 255, 255, 0.85);
color: var(--ink-2);
cursor: pointer;
transition: background 0.15s, color 0.15s, transform 0.1s;
}
.close-x:hover { background: #fff; color: var(--ink); transform: rotate(90deg); }
/* Hero / illustration header */
.hero {
position: relative;
height: 150px;
display: block;
}
.hero-art { width: 100%; height: 100%; display: block; }
.hero-badge {
position: absolute;
top: 14px;
left: 16px;
z-index: 2;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
color: #fff;
background: rgba(255, 255, 255, 0.22);
border: 1px solid rgba(255, 255, 255, 0.4);
padding: 4px 10px;
border-radius: 999px;
}
/* Compact layout hides hero, shows inline logo badge */
.modal[data-layout="compact"] .hero { display: none; }
.modal[data-layout="compact"] .modal-body { padding-top: 30px; }
.modal[data-layout="compact"] .eyebrow::before {
content: "";
display: inline-grid;
width: 0;
}
.modal-body { padding: 24px 26px 22px; }
.eyebrow {
display: inline-flex;
align-items: center;
gap: 7px;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.02em;
text-transform: uppercase;
color: var(--brand-700);
margin-bottom: 10px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.dot-accent { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dlg-title {
margin: 0 0 6px;
font-size: 23px;
font-weight: 800;
letter-spacing: -0.02em;
color: var(--ink);
}
.dlg-title.sm { font-size: 19px; }
.dlg-desc { margin: 0 0 18px; font-size: 14.5px; color: var(--muted); }
.highlights { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.hl {
display: flex;
gap: 12px;
align-items: flex-start;
padding: 10px 12px;
border: 1px solid var(--line);
border-radius: var(--r-md);
background: linear-gradient(180deg, #fff, #fcfcff);
transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hl:hover { border-color: var(--line-2); box-shadow: var(--sh-1); transform: translateX(2px); }
.hl-ic {
flex: none;
display: grid;
place-items: center;
width: 38px;
height: 38px;
border-radius: 11px;
}
.ic-brand { background: var(--brand-50); color: var(--brand); }
.ic-accent { background: var(--accent-soft); color: var(--accent); }
.ic-warn { background: #fdf0dc; color: var(--warn); }
.hl-txt { display: flex; flex-direction: column; gap: 2px; }
.hl-txt strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.hl-txt span { font-size: 13px; color: var(--muted); }
/* Step 2 */
.step2[hidden] { display: none; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.choice {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 14px 8px;
font-size: 13px;
font-weight: 600;
color: var(--ink-2);
background: var(--white);
border: 1.5px solid var(--line);
border-radius: var(--r-md);
cursor: pointer;
transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.choice .choice-ic { color: var(--muted); transition: color 0.15s; }
.choice:hover { border-color: var(--brand); }
.choice[aria-checked="true"] {
border-color: var(--brand);
background: var(--brand-50);
color: var(--brand-700);
}
.choice[aria-checked="true"] .choice-ic { color: var(--brand); }
/* Progress dots */
.progress { display: flex; gap: 7px; justify-content: center; margin: 18px 0 16px; }
.progress[hidden] { display: none; }
.step-dot {
width: 8px;
height: 8px;
border-radius: 999px;
background: var(--line-2);
transition: width 0.25s, background 0.25s;
}
.step-dot.is-active { width: 22px; background: var(--brand); }
/* Actions */
.modal-actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-top: 6px;
}
.action-right { display: flex; align-items: center; gap: 8px; }
.link-btn {
border: none;
background: none;
padding: 8px 2px;
font-size: 14px;
font-weight: 600;
color: var(--muted);
cursor: pointer;
border-radius: var(--r-sm);
transition: color 0.15s;
}
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.primary-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 11px 18px;
font-size: 14px;
font-weight: 700;
color: #fff;
background: linear-gradient(180deg, var(--brand), var(--brand-d));
border: none;
border-radius: var(--r-sm);
cursor: pointer;
box-shadow: 0 4px 12px rgba(91, 91, 240, 0.32);
transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}
.primary-btn:hover { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(91, 91, 240, 0.42); }
.primary-btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(91, 91, 240, 0.32); }
.primary-btn.sm { padding: 9px 16px; font-size: 13px; }
.ghost-btn.back { padding: 11px 16px; }
.ghost-btn.back[hidden] { display: none; }
/* ---------- Variant bar ---------- */
.variant-bar {
position: fixed;
bottom: 16px;
left: 50%;
transform: translateX(-50%);
z-index: 40;
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
justify-content: center;
padding: 10px 14px;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(12px);
border: 1px solid var(--line-2);
border-radius: 999px;
box-shadow: var(--sh-2);
max-width: calc(100% - 24px);
}
.variant-group { display: flex; align-items: center; gap: 8px; }
.variant-label {
font-size: 11px;
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--muted);
}
.seg {
display: inline-flex;
padding: 3px;
background: var(--bg);
border: 1px solid var(--line);
border-radius: 999px;
}
.seg-btn {
border: none;
background: none;
padding: 6px 12px;
font-size: 12.5px;
font-weight: 600;
color: var(--ink-2);
border-radius: 999px;
cursor: pointer;
transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active {
background: var(--white);
color: var(--brand-700);
box-shadow: var(--sh-1);
}
/* ---------- Toast ---------- */
.toast-wrap {
position: fixed;
top: 18px;
left: 50%;
transform: translateX(-50%);
z-index: 60;
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
pointer-events: none;
}
.toast {
display: flex;
align-items: center;
gap: 9px;
padding: 10px 16px;
font-size: 13.5px;
font-weight: 600;
color: var(--ink);
background: var(--white);
border: 1px solid var(--line);
border-left: 3px solid var(--accent);
border-radius: var(--r-sm);
box-shadow: var(--sh-2);
animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast .t-ic { color: var(--accent); display: grid; place-items: center; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) {
* { animation-duration: 0.01ms !important; }
}
/* ---------- Responsive ---------- */
@media (max-width: 520px) {
.skeleton-grid { grid-template-columns: 1fr; }
.sk-title { width: 70%; }
.brand-sub { display: none; }
.ghost-btn#replayBtn span,
.ghost-btn#replayBtn { font-size: 12px; }
.modal { width: 100%; }
.modal-body { padding: 20px 18px 18px; }
.hero { height: 124px; }
.dlg-title { font-size: 20px; }
.modal-actions { flex-wrap: wrap; }
.action-right { width: 100%; justify-content: flex-end; }
.variant-bar {
flex-direction: column;
border-radius: var(--r-lg);
gap: 10px;
width: calc(100% - 24px);
}
.variant-group { width: 100%; justify-content: space-between; }
.choices { grid-template-columns: 1fr; }
.choice { flex-direction: row; justify-content: center; }
}(function () {
"use strict";
var overlay = document.getElementById("overlay");
var modal = document.getElementById("modal");
var closeX = document.getElementById("closeX");
var skipBtn = document.getElementById("skipBtn");
var primaryBtn = document.getElementById("primaryBtn");
var primaryLabel = document.getElementById("primaryLabel");
var backBtn = document.getElementById("backBtn");
var replayBtn = document.getElementById("replayBtn");
var openDemoBtn = document.getElementById("openDemoBtn");
var step2 = document.getElementById("step2");
var progress = document.getElementById("progress");
var stepDots = progress.querySelectorAll(".step-dot");
var toastWrap = document.getElementById("toastWrap");
// Session state — remembers dismissal for this session only.
var state = {
dismissed: false, // would normally persist; kept in-memory for the demo session
flow: "single", // single | carousel
header: "illustration", // illustration | compact
step: 0,
};
var lastFocused = null;
/* ---------- Toast helper ---------- */
function toast(msg) {
var el = document.createElement("div");
el.className = "toast";
el.setAttribute("role", "status");
el.innerHTML =
'<span class="t-ic"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="m5 13 4 4L19 7"/></svg></span>' +
"<span></span>";
el.lastChild.textContent = msg;
toastWrap.appendChild(el);
setTimeout(function () {
el.classList.add("out");
setTimeout(function () {
if (el.parentNode) el.parentNode.removeChild(el);
}, 240);
}, 2400);
}
/* ---------- Render flow / header variants ---------- */
function applyHeader() {
modal.setAttribute("data-layout", state.header);
}
function renderStep() {
var carousel = state.flow === "carousel";
progress.hidden = !carousel;
if (!carousel) {
// Single screen
state.step = 0;
step2.hidden = true;
backBtn.hidden = true;
primaryLabel.textContent = "Get started";
return;
}
// Carousel
if (state.step === 0) {
step2.hidden = true;
backBtn.hidden = true;
primaryLabel.textContent = "Next";
} else {
step2.hidden = false;
backBtn.hidden = false;
primaryLabel.textContent = "Finish setup";
}
stepDots.forEach(function (d, i) {
d.classList.toggle("is-active", i === state.step);
});
}
/* ---------- Open / close ---------- */
function openModal(reset) {
if (reset !== false) state.step = 0;
applyHeader();
renderStep();
lastFocused = document.activeElement;
overlay.hidden = false;
document.body.style.overflow = "hidden";
// focus the primary action
setTimeout(function () {
primaryBtn.focus();
}, 30);
}
function closeModal(reason) {
overlay.hidden = true;
document.body.style.overflow = "";
state.dismissed = true;
if (lastFocused && lastFocused.focus) lastFocused.focus();
if (reason) toast(reason);
}
/* ---------- Focus trap ---------- */
function getFocusable() {
return Array.prototype.filter.call(
modal.querySelectorAll(
'button, [href], input, [tabindex]:not([tabindex="-1"])'
),
function (el) {
return !el.disabled && el.offsetParent !== null;
}
);
}
function onKeydown(e) {
if (overlay.hidden) return;
if (e.key === "Escape") {
e.preventDefault();
closeModal("Welcome dismissed");
return;
}
if (e.key === "Tab") {
var items = getFocusable();
if (!items.length) return;
var first = items[0];
var last = items[items.length - 1];
if (e.shiftKey && document.activeElement === first) {
e.preventDefault();
last.focus();
} else if (!e.shiftKey && document.activeElement === last) {
e.preventDefault();
first.focus();
}
}
}
/* ---------- Primary / back ---------- */
function onPrimary() {
if (state.flow === "carousel" && state.step === 0) {
state.step = 1;
renderStep();
var f = step2.querySelector('.choice[aria-checked="true"]') || primaryBtn;
f.focus();
return;
}
closeModal();
toast("You're all set — welcome to Northwind");
}
function onBack() {
state.step = 0;
renderStep();
primaryBtn.focus();
}
/* ---------- Step 2 choices ---------- */
step2.addEventListener("click", function (e) {
var btn = e.target.closest(".choice");
if (!btn) return;
step2.querySelectorAll(".choice").forEach(function (c) {
c.setAttribute("aria-checked", String(c === btn));
});
toast("Template: " + btn.getAttribute("data-choice"));
});
/* ---------- Variant switcher ---------- */
document.querySelectorAll(".seg").forEach(function (seg) {
seg.addEventListener("click", function (e) {
var btn = e.target.closest(".seg-btn");
if (!btn) return;
seg.querySelectorAll(".seg-btn").forEach(function (b) {
b.classList.toggle("is-active", b === btn);
b.setAttribute("aria-checked", String(b === btn));
});
if (btn.dataset.flow) {
state.flow = btn.dataset.flow;
if (state.flow === "single") state.step = 0;
renderStep();
}
if (btn.dataset.header) {
state.header = btn.dataset.header;
applyHeader();
}
// Reflect the change live if the modal is open
if (!overlay.hidden) {
renderStep();
applyHeader();
} else {
openModal();
}
});
});
/* ---------- Wiring ---------- */
primaryBtn.addEventListener("click", onPrimary);
backBtn.addEventListener("click", onBack);
closeX.addEventListener("click", function () {
closeModal("Welcome dismissed");
});
skipBtn.addEventListener("click", function () {
closeModal("Skipped — you can replay anytime");
});
openDemoBtn.addEventListener("click", function () {
openModal();
});
replayBtn.addEventListener("click", function () {
openModal();
toast("Replaying the welcome");
});
overlay.addEventListener("mousedown", function (e) {
if (e.target.hasAttribute("data-close")) {
closeModal("Welcome dismissed");
}
});
document.addEventListener("keydown", onKeydown);
/* ---------- First-run auto-show ---------- */
// Show automatically on first run of the session.
if (!state.dismissed) {
openModal();
}
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Onboarding — Welcome / first-run modal</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>
<!-- Demo page behind the modal -->
<div class="app" aria-hidden="false">
<header class="topbar">
<div class="brand">
<span class="logo" aria-hidden="true">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none"><path d="M12 2.5 3 7v10l9 4.5 9-4.5V7l-9-4.5Z" fill="currentColor" opacity=".18"/><path d="M12 2.5 3 7l9 4.5L21 7l-9-4.5Z" fill="currentColor"/><path d="M3 7v10l9 4.5V11.5L3 7Z" fill="currentColor" opacity=".55"/></svg>
</span>
<span class="brand-name">Northwind</span>
<span class="brand-sub">Workspace</span>
</div>
<div class="topbar-actions">
<button class="ghost-btn" id="replayBtn" type="button">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 4v4h4"/></svg>
Replay welcome
</button>
<span class="avatar" aria-hidden="true">RG</span>
</div>
</header>
<main class="canvas">
<div class="canvas-inner">
<div class="skeleton sk-title"></div>
<div class="skeleton-grid">
<div class="skeleton sk-card"></div>
<div class="skeleton sk-card"></div>
<div class="skeleton sk-card"></div>
</div>
<div class="skeleton sk-row"></div>
<div class="skeleton sk-row short"></div>
</div>
</main>
</div>
<!-- Welcome modal -->
<div class="overlay" id="overlay" hidden>
<div class="backdrop" data-close></div>
<div class="modal" role="dialog" aria-modal="true" aria-labelledby="dlgTitle" aria-describedby="dlgDesc" id="modal" data-layout="illustration">
<button class="close-x" id="closeX" type="button" aria-label="Close welcome">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="m6 6 12 12M18 6 6 18"/></svg>
</button>
<!-- Illustration header -->
<div class="hero" id="hero">
<span class="hero-badge">New here</span>
<svg class="hero-art" viewBox="0 0 320 150" role="img" aria-label="Welcome illustration" preserveAspectRatio="xMidYMid slice">
<defs>
<linearGradient id="g1" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5b5bf0"/><stop offset="1" stop-color="#4646d6"/></linearGradient>
</defs>
<rect width="320" height="150" fill="url(#g1)"/>
<circle cx="262" cy="34" r="56" fill="#ffffff" opacity=".08"/>
<circle cx="44" cy="118" r="40" fill="#ffffff" opacity=".10"/>
<g opacity=".95">
<rect x="118" y="44" width="84" height="62" rx="10" fill="#ffffff"/>
<rect x="128" y="56" width="48" height="6" rx="3" fill="#5b5bf0"/>
<rect x="128" y="68" width="64" height="5" rx="2.5" fill="#c7cbe8"/>
<rect x="128" y="78" width="40" height="5" rx="2.5" fill="#c7cbe8"/>
<rect x="128" y="90" width="30" height="9" rx="4.5" fill="#00b4a6"/>
</g>
<circle cx="92" cy="52" r="9" fill="#00b4a6"/>
<circle cx="228" cy="118" r="6" fill="#ffd166"/>
<path d="M236 40l4 8 8 4-8 4-4 8-4-8-8-4 8-4z" fill="#ffffff" opacity=".9"/>
</svg>
</div>
<div class="modal-body">
<div class="eyebrow">
<span class="dot"></span> First-run setup
</div>
<h1 class="dlg-title" id="dlgTitle">Welcome aboard, Rosa</h1>
<p class="dlg-desc" id="dlgDesc">
Let's get your Northwind workspace ready. Here's what you can do in the next two minutes.
</p>
<ul class="highlights" id="highlights">
<li class="hl">
<span class="hl-ic ic-brand" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3 4 7v5c0 4.4 3.3 7.9 8 9 4.7-1.1 8-4.6 8-9V7l-8-4Z"/><path d="m9 12 2 2 4-4"/></svg>
</span>
<div class="hl-txt">
<strong>Import your work in one click</strong>
<span>Bring boards, files, and people across from your old tools.</span>
</div>
</li>
<li class="hl">
<span class="hl-ic ic-accent" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.9M16 3.1A4 4 0 0 1 16 11"/></svg>
</span>
<div class="hl-txt">
<strong>Invite your team</strong>
<span>Share a space and start collaborating in real time.</span>
</div>
</li>
<li class="hl">
<span class="hl-ic ic-warn" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2 3 14h7l-1 8 10-12h-7l1-8Z"/></svg>
</span>
<div class="hl-txt">
<strong>Automate the busywork</strong>
<span>Set up flows so routine updates run themselves.</span>
</div>
</li>
</ul>
<!-- Step 2 (carousel layout only) -->
<div class="step2" id="step2" hidden>
<div class="eyebrow"><span class="dot dot-accent"></span> Step 2 of 2</div>
<h2 class="dlg-title sm">Pick your starting point</h2>
<p class="dlg-desc">Choose a template — you can change everything later.</p>
<div class="choices" role="radiogroup" aria-label="Starting template">
<button class="choice" role="radio" aria-checked="true" data-choice="Blank workspace">
<span class="choice-ic"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"><rect x="4" y="3" width="16" height="18" rx="2"/></svg></span>
Blank
</button>
<button class="choice" role="radio" aria-checked="false" data-choice="Sprint board">
<span class="choice-ic"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="6" height="16" rx="1.5"/><rect x="10.5" y="4" width="6" height="11" rx="1.5"/><rect x="18" y="4" width="3" height="7" rx="1.5"/></svg></span>
Sprint board
</button>
<button class="choice" role="radio" aria-checked="false" data-choice="Content calendar">
<span class="choice-ic"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="17" rx="2"/><path d="M3 9h18M8 2v4M16 2v4"/></svg></span>
Calendar
</button>
</div>
</div>
<div class="progress" id="progress" hidden>
<span class="step-dot is-active" data-step="0"></span>
<span class="step-dot" data-step="1"></span>
</div>
<div class="modal-actions">
<button class="link-btn" id="skipBtn" type="button">Skip for now</button>
<div class="action-right">
<button class="ghost-btn back" id="backBtn" type="button" hidden>Back</button>
<button class="primary-btn" id="primaryBtn" type="button">
<span id="primaryLabel">Get started</span>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m13 6 6 6-6 6"/></svg>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Variant switcher -->
<div class="variant-bar" role="group" aria-label="Demo variants">
<div class="variant-group">
<span class="variant-label">Flow</span>
<div class="seg" role="radiogroup" aria-label="Flow variant">
<button class="seg-btn is-active" role="radio" aria-checked="true" data-flow="single" type="button">Single screen</button>
<button class="seg-btn" role="radio" aria-checked="false" data-flow="carousel" type="button">2-step</button>
</div>
</div>
<div class="variant-group">
<span class="variant-label">Header</span>
<div class="seg" role="radiogroup" aria-label="Header variant">
<button class="seg-btn is-active" role="radio" aria-checked="true" data-header="illustration" type="button">Illustration</button>
<button class="seg-btn" role="radio" aria-checked="false" data-header="compact" type="button">Compact</button>
</div>
</div>
<button class="primary-btn sm" id="openDemoBtn" type="button">Open modal</button>
</div>
<div class="toast-wrap" id="toastWrap" aria-live="polite" aria-atomic="true"></div>
<script src="script.js"></script>
</body>
</html>Welcome / first-run modal
The classic first-run greeting, done properly. On load the dialog opens over a blurred workspace shell, welcomes Rosa by name, and lays out what she can do next in three icon-led highlight rows: import existing work, invite the team, and automate the busywork. A primary Get started button anchors the footer with a quieter Skip for now link beside it, and a replay button in the top bar reopens the modal at any time. Dismissal is tracked in an in-memory session flag so a real app could decide whether to show it again.
It behaves like an accessible modal should. The container is a role="dialog" with aria-modal, labelled and described by its own heading and intro copy. Focus moves to the primary action on open, a Tab focus trap keeps keyboard users inside the dialog, and Escape, the close button, the Skip link, or a backdrop click all dismiss it and restore focus to the element that opened it. A small toast() helper confirms each outcome through an aria-live region, and a prefers-reduced-motion block stills the entrance animations.
A floating switcher demonstrates the variants live. Flow swaps between a single-screen layout and a two-step carousel — the second step adds a template picker (Blank, Sprint board, Calendar) as a radiogroup with Back and Finish controls and animated progress dots — while Header toggles the gradient illustration banner against a compact header for denser surfaces. The layout collapses to a single column and a stacked control bar down to 360px.
Illustrative UI only — fictional names and data.