Steps with progress bar
Dark framed section. A step list opens one step at a time with a thin auto-advancing progress line, and a textured panel shifts its glow per step.
snippet.html102 lines
<section class="stp">
<div class="stp__frame" data-stp>
<div class="stp__left">
<span class="stp__tag">How it works</span>
<h2 class="stp__title">Four steps.<br>One afternoon of setup.</h2>
<ol class="stp__list">
<li class="stp__item is-on">
<button type="button" class="stp__head" aria-expanded="true"><i></i>Scope</button>
<div class="stp__body">
<h3>Map your shelves</h3>
<p>We ask what you sell, which spreadsheets you keep, and who counts stock, then lay out what moves over and what stays behind.</p>
<div class="stp__bar"><span></span></div>
</div>
</li>
<li class="stp__item">
<button type="button" class="stp__head" aria-expanded="false"><i></i>Import</button>
<div class="stp__body">
<h3>Bring in your data</h3>
<p>Upload your product list and past orders. We match names and fix duplicates as we go.</p>
<div class="stp__bar"><span></span></div>
</div>
</li>
<li class="stp__item">
<button type="button" class="stp__head" aria-expanded="false"><i></i>Check</button>
<div class="stp__body">
<h3>Test on a quiet day</h3>
<p>Ring up a few sales and receive a delivery, while someone from our team watches for gaps.</p>
<div class="stp__bar"><span></span></div>
</div>
</li>
<li class="stp__item">
<button type="button" class="stp__head" aria-expanded="false"><i></i>Launch</button>
<div class="stp__body">
<h3>Switch over</h3>
<p>Your old till goes quiet and the new one takes over. We stay on call for the first week.</p>
<div class="stp__bar"><span></span></div>
</div>
</li>
</ol>
</div>
<div class="stp__right" aria-hidden="true"><div class="stp__glow"></div></div>
</div>
</section>
<style>
.stp { --stp-dim: rgba(255,255,255,0.55); --stp-line: rgba(255,255,255,0.14); box-sizing: border-box; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); background: #0b0b0b; color: #fff; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.stp *, .stp *::before, .stp *::after { box-sizing: border-box; }
.stp__frame { max-width: 1296px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(255,255,255,0.3); }
.stp__left { padding: clamp(1.5rem, 4vw, 3rem); background: #101010; }
.stp__tag { display: inline-block; padding: 0.3rem 0.5rem; border: 1px dashed rgba(255,255,255,0.4); font: 0.625rem/1 ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stp-dim); }
.stp__title { margin: 1.25rem 0 clamp(2rem, 6vw, 4.5rem); font: 400 clamp(1.9rem, 3.6vw, 2.75rem)/1.05 Georgia, "Times New Roman", serif; letter-spacing: -0.03em; }
.stp__list { list-style: none; margin: 0; padding: 0; }
.stp__item { border-top: 1px solid var(--stp-line); }
.stp__head { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 1.4rem 0; border: 0; background: none; color: var(--stp-dim); font: 0.75rem/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; cursor: pointer; transition: color 0.2s; }
.stp__head:hover { color: #fff; }
.stp__head:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.stp__head i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stp__item.is-on .stp__head { color: #fff; padding-bottom: 0.9rem; }
.stp__item.is-on .stp__head i { background: #3ddcc4; }
.stp__body { display: none; padding-bottom: 1.5rem; }
.stp__item.is-on .stp__body { display: block; }
.stp__body h3 { margin: 0 0 0.75rem; font: 400 2rem/1.1 Georgia, "Times New Roman", serif; letter-spacing: -0.025em; }
.stp__body p { margin: 0 0 1.5rem; max-width: 32rem; font-size: 0.9375rem; line-height: 1.7; color: var(--stp-dim); }
.stp__bar { height: 2px; background: var(--stp-line); }
.stp__bar span { display: block; height: 100%; width: 0; background: #8ab8f0; }
.stp__item.is-on .stp__bar span { animation: stp-fill 6s linear forwards; }
@keyframes stp-fill { to { width: 100%; } }
.stp__right { position: relative; overflow: hidden; border-left: 1px solid rgba(255,255,255,0.3); background: #1a1a1a repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 5px); }
.stp__right::before { content: ""; position: absolute; inset: 7% 5%; border: 1px dashed rgba(255,255,255,0.15); }
.stp__glow { position: absolute; inset: auto -10% -35% -10%; height: 70%; background: radial-gradient(closest-side, rgba(61,138,240,0.55), transparent); transition: transform 0.8s ease; }
.stp[data-step="1"] .stp__glow { transform: translateX(-25%); }
.stp[data-step="2"] .stp__glow { transform: translateX(25%); }
.stp[data-step="3"] .stp__glow { transform: translateY(-15%) scale(1.2); }
@media (max-width: 760px) { .stp__frame { grid-template-columns: 1fr; } .stp__right { min-height: 200px; border-left: 0; border-top: 1px solid rgba(255,255,255,0.3); } }
@media (prefers-reduced-motion: reduce) { .stp__item.is-on .stp__bar span { animation: none; width: 100%; } .stp__glow { transition: none; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-stp]");
if (!root) return;
var sec = root.closest(".stp");
var items = [].slice.call(root.querySelectorAll(".stp__item"));
var cur = 0;
function show(i) {
cur = i;
items.forEach(function (li, n) {
var on = n === i;
li.classList.toggle("is-on", on);
li.querySelector(".stp__head").setAttribute("aria-expanded", on);
if (on) { var s = li.querySelector(".stp__bar span"); s.style.animation = "none"; void s.offsetWidth; s.style.animation = ""; }
});
sec.dataset.step = i;
}
items.forEach(function (li, i) {
li.querySelector(".stp__head").addEventListener("click", function () { show(i); });
li.querySelector(".stp__bar span").addEventListener("animationend", function () { if (cur === i) show((i + 1) % items.length); });
});
show(0);
})();
</script>