Delivery — Grocery Delivery Landing
A wholesome, fresh-green grocery delivery landing page for the fictional FreshCart brand. Includes a produce-basket hero with an animated ZIP coverage checker, a twelve-aisle category grid, a freshness guarantee section with cold-chain promise cards, a monthly or yearly membership pricing switcher, a four-step how-it-works flow, an app download CTA with a live ETA phone mockup, plus mobile navigation, scroll reveals and toast feedback.
MCP
Code
:root {
/* Grocery delivery palette — fresh green + cream + orange */
--brand: #16a34a; /* fresh green */
--brand-d: #128040;
--brand-l: #22c55e;
--accent: #f97316; /* warm orange */
--accent-d: #ea580c;
--cream: #fdf8ee;
--cream-2: #f6efdf;
--ink: #14241a;
--ink-2: #3c4a40;
--muted: #6c7a70;
--bg: #fbfaf5;
--surface: #ffffff;
--line: rgba(20, 36, 26, 0.1);
--ok: #16a34a;
--warn: #e89422;
--danger: #d4493e;
--r-sm: 10px;
--r-md: 16px;
--r-lg: 24px;
--r-xl: 32px;
--shadow-s: 0 2px 8px rgba(20, 36, 26, 0.06);
--shadow-m: 0 10px 30px rgba(20, 36, 26, 0.1);
--shadow-l: 0 24px 60px rgba(20, 36, 26, 0.14);
--maxw: 1140px;
}
* { 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;
-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input { font-family: inherit; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.skip-link {
position: absolute; left: -999px; top: 8px; z-index: 100;
background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; }
/* Buttons */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--solid { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(22,163,74,.28); }
.btn--solid:hover { background: var(--brand-d); box-shadow: 0 10px 22px rgba(22,163,74,.34); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { background: var(--cream); border-color: var(--brand); color: var(--brand-d); }
/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px; }
.pill--leaf { background: rgba(22,163,74,.12); color: var(--brand-d); }
.pill--cream { background: var(--accent); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(22,163,74,.18); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(22,163,74,.18);} 50% { box-shadow: 0 0 0 7px rgba(22,163,74,.05);} }
/* ===== NAV ===== */
.nav {
position: sticky; top: 0; z-index: 40;
background: rgba(251,250,245,.82); backdrop-filter: saturate(160%) blur(12px);
border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 18px; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand__mark {
width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
background: linear-gradient(135deg, var(--brand-l), var(--brand-d)); color: #fff;
box-shadow: 0 5px 14px rgba(22,163,74,.3);
}
.brand__name span { color: var(--accent); }
.nav__links { display: flex; gap: 26px; margin-left: 14px; }
.nav__links a { font-weight: 600; font-size: 15px; color: var(--ink-2); position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--brand); transition: width .2s ease; border-radius: 2px; }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--line); align-items: center; justify-content: center; }
.nav__toggle span { width: 19px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* ===== HERO ===== */
.hero { background:
radial-gradient(900px 500px at 88% -10%, rgba(249,115,22,.1), transparent 60%),
radial-gradient(700px 600px at -5% 20%, rgba(22,163,74,.1), transparent 60%),
var(--cream);
padding: 64px 0 76px; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__copy h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; margin: 16px 0 14px; }
.hl { color: var(--brand-d); position: relative; }
.hl::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6%; height: 28%; background: rgba(249,115,22,.25); z-index: -1; border-radius: 4px; }
.hero__lede { font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-2); max-width: 50ch; }
.zip { margin: 26px 0 24px; max-width: 440px; }
.zip__label { display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.zip__row { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-s); transition: border-color .2s ease, box-shadow .2s ease; }
.zip__row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(22,163,74,.14); }
.zip__icon { font-size: 17px; }
.zip__row input { flex: 1; border: 0; outline: 0; font-size: 16px; background: transparent; color: var(--ink); min-width: 0; }
.zip__row input::placeholder { color: var(--muted); }
.zip__msg { margin-top: 9px; font-size: 14px; font-weight: 600; min-height: 18px; }
.zip__msg.is-ok { color: var(--brand-d); }
.zip__msg.is-err { color: var(--danger); }
.hero__stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 24px; font-weight: 800; }
.hero__stats span { font-size: 13px; color: var(--muted); }
/* Hero art */
.hero__art { position: relative; min-height: 420px; display: grid; place-items: center; }
.basket { position: relative; width: 280px; height: 280px; }
.basket__body {
position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
width: 230px; height: 150px; border-radius: 0 0 100px 100px / 0 0 70px 70px;
background: linear-gradient(160deg, #e6a35c, #c97f2e);
box-shadow: var(--shadow-l), inset 0 8px 0 rgba(255,255,255,.18);
overflow: hidden;
}
.basket__weave { position: absolute; inset: 0;
background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 16px),
repeating-linear-gradient(0deg, rgba(255,255,255,.1) 0 2px, transparent 2px 18px);
}
.basket__body::before { content: ""; position: absolute; top: 0; left: -8px; right: -8px; height: 26px; background: #b8742a; border-radius: 999px; box-shadow: 0 4px 8px rgba(0,0,0,.12); }
.produce { position: absolute; font-size: 46px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.15)); animation: bob 3.4s ease-in-out infinite; }
.produce--a { left: 30px; top: 70px; animation-delay: 0s; }
.produce--b { left: 96px; top: 40px; animation-delay: .4s; font-size: 40px; }
.produce--c { left: 160px; top: 72px; animation-delay: .8s; }
.produce--d { left: 70px; top: 118px; font-size: 38px; animation-delay: .2s; }
.produce--e { left: 150px; top: 122px; font-size: 40px; animation-delay: .6s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-9px) rotate(3deg);} }
.basket__steam { display: none; }
.card-float {
position: absolute; display: flex; align-items: center; gap: 11px;
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
padding: 11px 14px; box-shadow: var(--shadow-m); animation: floaty 5s ease-in-out infinite;
}
.card-float strong { display: block; font-size: 14px; }
.card-float small { display: block; font-size: 12px; color: var(--muted); }
.card-float--eta { top: 6px; right: -6px; }
.card-float--free { bottom: 20px; left: -18px; animation-delay: 1.5s; }
.card-float--free span { font-size: 22px; }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-8px);} }
/* ===== SECTIONS ===== */
.section { padding: 76px 0; }
.section__head { max-width: 640px; margin: 0 auto 42px; text-align: center; }
.section__head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin-bottom: 12px; }
.section__head p { color: var(--ink-2); font-size: 17px; }
/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile {
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
padding: 22px 14px; text-align: center; box-shadow: var(--shadow-s);
transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; cursor: pointer;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-m); border-color: rgba(22,163,74,.4); }
.tile__emoji { font-size: 38px; display: block; margin-bottom: 10px; transition: transform .25s ease; }
.tile:hover .tile__emoji { transform: scale(1.14) rotate(-6deg); }
.tile__name { font-weight: 700; font-size: 15px; }
.tile__count { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
/* Fresh guarantee */
.guarantee { background: linear-gradient(180deg, var(--cream), var(--cream-2)); }
.guarantee__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.guarantee__copy h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 14px 0 14px; }
.guarantee__copy p { color: var(--ink-2); font-size: 17px; margin-bottom: 20px; }
.checks { display: grid; gap: 12px; margin-bottom: 26px; }
.checks li { display: flex; align-items: flex-start; gap: 11px; font-weight: 500; color: var(--ink-2); }
.checks span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.guarantee__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guarantee__cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 18px; box-shadow: var(--shadow-s); transition: transform .2s ease; }
.guarantee__cards li:hover { transform: translateY(-4px); }
.g-emoji { font-size: 30px; display: block; margin-bottom: 10px; }
.guarantee__cards strong { display: block; font-size: 16px; margin-bottom: 4px; }
.guarantee__cards small { color: var(--muted); font-size: 13px; }
/* Pricing */
.toggle { display: inline-flex; gap: 4px; background: var(--cream-2); padding: 5px; border-radius: 999px; margin-top: 22px; border: 1px solid var(--line); }
.toggle__opt { padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; transition: background .2s ease, color .2s ease; }
.toggle__opt.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.save { font-size: 11px; font-weight: 700; background: rgba(249,115,22,.16); color: var(--accent-d); padding: 2px 7px; border-radius: 999px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
padding: 28px 26px; display: flex; flex-direction: column; box-shadow: var(--shadow-s);
transition: transform .2s ease, box-shadow .2s ease;
}
.plan:hover { transform: translateY(-5px); box-shadow: var(--shadow-m); }
.plan--featured { border-color: var(--brand); box-shadow: var(--shadow-m); position: relative; }
.plan--featured::before { content: "Most popular"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.plan__name { font-weight: 800; font-size: 19px; }
.plan__tag { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.plan__price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan__price .amt { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.plan__price .per { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan__sub { font-size: 13px; color: var(--brand-d); font-weight: 600; min-height: 18px; margin-bottom: 18px; }
.plan ul { display: grid; gap: 11px; margin: 0 0 24px; }
.plan ul li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); }
.plan ul li::before { content: "✓"; color: var(--brand); font-weight: 800; flex: none; }
.plan .btn { margin-top: auto; width: 100%; }
/* How it works */
.how { background: linear-gradient(180deg, var(--surface), var(--cream)); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px 22px; box-shadow: var(--shadow-s); position: relative; transition: transform .2s ease; }
.steps li:hover { transform: translateY(-4px); }
.steps__num { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--brand-l), var(--brand-d)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; margin-bottom: 14px; box-shadow: 0 6px 14px rgba(22,163,74,.28); }
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { font-size: 14px; color: var(--muted); }
/* App CTA */
.app { background: var(--ink); color: #fff; border-radius: 0; }
.app__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.app__copy h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 14px; color: #fff; }
.app__copy > p { color: rgba(255,255,255,.74); font-size: 17px; max-width: 46ch; margin-bottom: 24px; }
.store-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.store-btn { display: inline-flex; align-items: center; gap: 11px; background: #fff; color: var(--ink); padding: 11px 20px; border-radius: 14px; transition: transform .15s ease, box-shadow .2s ease; }
.store-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,.3); }
.store-btn > span:first-child { font-size: 22px; }
.store-btn__txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-btn__txt small { font-size: 11px; color: var(--muted); }
.store-btn__txt strong { font-size: 16px; }
.app__note { margin-top: 18px; color: var(--warn); font-weight: 600; font-size: 14px; }
.app__phone { display: grid; place-items: center; }
.phone { width: 250px; background: linear-gradient(160deg, #1d3326, #16241a); border-radius: 38px; padding: 12px; box-shadow: var(--shadow-l); border: 1px solid rgba(255,255,255,.08); position: relative; }
.phone__notch { width: 96px; height: 22px; background: #000; border-radius: 0 0 14px 14px; margin: 0 auto 8px; }
.phone__screen { background: var(--cream); border-radius: 28px; padding: 18px; color: var(--ink); }
.phone__bar { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; }
.phone__eta { text-align: center; margin: 14px 0 12px; }
.phone__eta small { display: block; color: var(--muted); font-size: 12px; }
.phone__eta strong { font-size: 36px; font-weight: 800; color: var(--brand-d); letter-spacing: -.02em; }
.phone__track { display: flex; gap: 6px; margin-bottom: 14px; }
.t-step { flex: 1; height: 6px; border-radius: 999px; background: var(--cream-2); }
.t-step.is-done { background: var(--brand); }
.t-step.is-active { background: var(--accent); animation: pulse2 1.4s infinite; }
@keyframes pulse2 { 0%,100% { opacity: 1;} 50% { opacity: .5;} }
.phone__status { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.phone__items { display: grid; gap: 7px; }
.phone__items span { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12px; font-weight: 600; }
/* ===== FOOTER ===== */
.footer { background: var(--cream-2); border-top: 1px solid var(--line); padding: 56px 0 24px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.4fr; gap: 30px; }
.footer__brand p { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 26ch; }
.footer nav h4, .footer__sub h4 { font-size: 14px; margin-bottom: 14px; }
.footer nav a { display: block; color: var(--ink-2); font-size: 14px; padding: 5px 0; transition: color .15s ease; }
.footer nav a:hover { color: var(--brand-d); }
.footer__sub p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.footer__sub-row { display: flex; gap: 8px; }
.footer__sub-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 14px; background: var(--surface); outline: 0; transition: border-color .2s ease; }
.footer__sub-row input:focus { border-color: var(--brand); }
.footer__sub-row .btn { padding: 10px 18px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.footer__bottom small { color: var(--muted); font-size: 13px; }
.footer__bottom a:hover { color: var(--brand-d); }
/* ===== TOAST ===== */
.toast {
position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%);
background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px;
font-size: 14px; font-weight: 600; box-shadow: var(--shadow-l); z-index: 90;
transition: transform .35s cubic-bezier(.2,.8,.3,1); max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); }
/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
.hero__grid, .guarantee__grid, .app__grid { grid-template-columns: 1fr; gap: 40px; }
.hero__art { order: -1; min-height: 320px; }
.tiles { grid-template-columns: repeat(3, 1fr); }
.plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
.steps { grid-template-columns: repeat(2, 1fr); }
.footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
.nav__links { display: none; }
.nav__toggle { display: flex; }
.nav__actions .btn--ghost { display: none; }
.nav__links.open {
display: flex; flex-direction: column; gap: 0;
position: absolute; top: 70px; left: 0; right: 0;
background: var(--surface); border-bottom: 1px solid var(--line);
padding: 8px 22px 18px; box-shadow: var(--shadow-m); margin-left: 0;
}
.nav__links.open a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.nav__links.open a::after { display: none; }
}
@media (max-width: 520px) {
.section { padding: 56px 0; }
.hero { padding: 40px 0 56px; }
.tiles { grid-template-columns: repeat(2, 1fr); }
.guarantee__cards { grid-template-columns: 1fr 1fr; }
.steps { grid-template-columns: 1fr; }
.footer__grid { grid-template-columns: 1fr; }
.hero__stats { gap: 22px; }
.zip__row { flex-wrap: wrap; }
.card-float--free { left: 0; }
.card-float--eta { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
* { animation: none !important; scroll-behavior: auto; }
.reveal { opacity: 1; transform: none; }
}(function () {
"use strict";
/* ---------- Toast helper ---------- */
var toastEl = document.getElementById("toast");
var toastTimer;
function toast(msg) {
if (!toastEl) return;
toastEl.textContent = msg;
toastEl.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("show");
}, 2800);
}
/* ---------- Mobile nav ---------- */
var toggle = document.getElementById("navToggle");
var navLinks = document.getElementById("primary-nav");
if (toggle && navLinks) {
toggle.addEventListener("click", function () {
var open = navLinks.classList.toggle("open");
toggle.setAttribute("aria-expanded", open ? "true" : "false");
toggle.setAttribute("aria-label", open ? "Close menu" : "Open menu");
});
navLinks.querySelectorAll("a").forEach(function (a) {
a.addEventListener("click", function () {
navLinks.classList.remove("open");
toggle.setAttribute("aria-expanded", "false");
});
});
}
/* ---------- ZIP check ---------- */
var zipForm = document.getElementById("hero-zip");
var zipInput = document.getElementById("zipInput");
var zipMsg = document.getElementById("zipMsg");
if (zipForm && zipInput && zipMsg) {
zipForm.addEventListener("submit", function (e) {
e.preventDefault();
var val = zipInput.value.trim();
zipMsg.classList.remove("is-ok", "is-err");
if (!/^\d{5}$/.test(val)) {
zipMsg.textContent = "Please enter a valid 5-digit ZIP code.";
zipMsg.classList.add("is-err");
zipInput.focus();
return;
}
// Fictional coverage: most ZIPs covered, a few are waitlist
var waitlist = val.charCodeAt(4) % 5 === 0;
if (waitlist) {
zipMsg.textContent = "We're not in " + val + " yet — you're on the waitlist! 🌱";
zipMsg.classList.add("is-ok");
toast("Added " + val + " to the waitlist");
} else {
var mins = 38 + (val.charCodeAt(2) % 22);
zipMsg.textContent = "Great news! We deliver to " + val + " in ~" + mins + " min. 🥕";
zipMsg.classList.add("is-ok");
toast("Delivery available in " + val + " 🎉");
}
});
}
/* ---------- Category tiles ---------- */
var cats = [
{ e: "🥬", n: "Produce", c: "1,240 items" },
{ e: "🥛", n: "Dairy & Eggs", c: "380 items" },
{ e: "🍞", n: "Bakery", c: "210 items" },
{ e: "🥩", n: "Meat & Fish", c: "460 items" },
{ e: "🥫", n: "Pantry", c: "1,900 items" },
{ e: "🧊", n: "Frozen", c: "540 items" },
{ e: "🥤", n: "Drinks", c: "720 items" },
{ e: "🍫", n: "Snacks", c: "880 items" },
{ e: "🧴", n: "Household", c: "640 items" },
{ e: "🌸", n: "Flowers", c: "120 items" },
{ e: "🐾", n: "Pet", c: "300 items" },
{ e: "🍼", n: "Baby", c: "260 items" }
];
var tilesEl = document.getElementById("tiles");
if (tilesEl) {
cats.forEach(function (c) {
var b = document.createElement("button");
b.className = "tile";
b.type = "button";
b.innerHTML =
'<span class="tile__emoji">' + c.e + "</span>" +
'<span class="tile__name">' + c.n + "</span>" +
'<span class="tile__count">' + c.c + "</span>";
b.addEventListener("click", function () {
toast("Browsing " + c.n + " — " + c.c);
});
tilesEl.appendChild(b);
});
}
/* ---------- Pricing ---------- */
var plans = [
{
name: "Pay as you go", tag: "No commitment",
monthly: 0, yearly: 0, free: true,
perks: ["$3.99 delivery per order", "Standard 1-hour windows", "Real-time order tracking", "Email support"],
cta: "Start free", featured: false
},
{
name: "FreshCart+", tag: "Best for weekly shoppers",
monthly: 9, yearly: 81,
perks: ["Free delivery over $35", "Priority 30-min windows", "Members-only weekly deals", "Free swaps & instant refunds", "Live shopper chat"],
cta: "Go FreshCart+", featured: true
},
{
name: "Family", tag: "Up to 5 members",
monthly: 15, yearly: 135,
perks: ["Everything in FreshCart+", "Shared family baskets", "5% back as FreshCash", "Recurring weekly orders", "Dedicated support line"],
cta: "Choose Family", featured: false
}
];
var plansEl = document.getElementById("plans");
var billYear = false;
function money(v) { return v === 0 ? "$0" : "$" + v; }
function renderPlans() {
if (!plansEl) return;
plansEl.innerHTML = "";
plans.forEach(function (p) {
var card = document.createElement("div");
card.className = "plan" + (p.featured ? " plan--featured" : "");
var price, per, sub;
if (p.free) {
price = "$0"; per = "/forever"; sub = "Always free to browse";
} else if (billYear) {
price = money(p.yearly); per = "/year";
var permo = (p.yearly / 12).toFixed(2);
sub = "≈ $" + permo + "/mo · save 25%";
} else {
price = money(p.monthly); per = "/month"; sub = "Billed monthly";
}
var lis = p.perks.map(function (x) { return "<li>" + x + "</li>"; }).join("");
card.innerHTML =
'<div class="plan__name">' + p.name + "</div>" +
'<div class="plan__tag">' + p.tag + "</div>" +
'<div class="plan__price"><span class="amt">' + price + '</span><span class="per">' + per + "</span></div>" +
'<div class="plan__sub">' + sub + "</div>" +
"<ul>" + lis + "</ul>" +
'<button class="btn ' + (p.featured ? "btn--solid" : "btn--ghost") + '" type="button">' + p.cta + "</button>";
card.querySelector("button").addEventListener("click", function () {
toast(p.free ? "Welcome to FreshCart!" : "Selected " + p.name + " — " + price + " " + per);
});
plansEl.appendChild(card);
});
}
renderPlans();
var billMonthly = document.getElementById("billMonthly");
var billYearly = document.getElementById("billYearly");
function setBilling(yearly) {
billYear = yearly;
if (billMonthly) { billMonthly.classList.toggle("is-active", !yearly); billMonthly.setAttribute("aria-pressed", String(!yearly)); }
if (billYearly) { billYearly.classList.toggle("is-active", yearly); billYearly.setAttribute("aria-pressed", String(yearly)); }
renderPlans();
}
if (billMonthly) billMonthly.addEventListener("click", function () { setBilling(false); });
if (billYearly) billYearly.addEventListener("click", function () { setBilling(true); });
/* ---------- App store buttons ---------- */
document.querySelectorAll(".store-btn").forEach(function (b) {
b.addEventListener("click", function () {
toast("Opening the FreshCart " + b.dataset.store + " app…");
});
});
/* ---------- Newsletter ---------- */
var subForm = document.getElementById("subForm");
var subEmail = document.getElementById("subEmail");
if (subForm && subEmail) {
subForm.addEventListener("submit", function (e) {
e.preventDefault();
var v = subEmail.value.trim();
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v)) {
toast("Please enter a valid email address");
subEmail.focus();
return;
}
subEmail.value = "";
toast("You're in! Weekly deals headed to your inbox 🥬");
});
}
/* ---------- Phone ETA countdown ---------- */
var phoneEta = document.getElementById("phoneEta");
if (phoneEta) {
var total = 11 * 60 + 42;
setInterval(function () {
total = total > 0 ? total - 1 : 11 * 60 + 42;
var m = Math.floor(total / 60);
var s = total % 60;
phoneEta.textContent = m + ":" + (s < 10 ? "0" : "") + s;
}, 1000);
}
/* ---------- Scroll reveal ---------- */
var revealEls = document.querySelectorAll(".reveal");
if ("IntersectionObserver" in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (en) {
if (en.isIntersecting) {
en.target.classList.add("in");
io.unobserve(en.target);
}
});
}, { threshold: 0.14 });
revealEls.forEach(function (el) { io.observe(el); });
} else {
revealEls.forEach(function (el) { el.classList.add("in"); });
}
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>FreshCart — Fresh groceries, delivered in an hour</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>
<a class="skip-link" href="#main">Skip to content</a>
<header class="nav" id="top">
<div class="wrap nav__inner">
<a class="brand" href="#top" aria-label="FreshCart home">
<span class="brand__mark" aria-hidden="true">
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="9" cy="20" r="1"/><circle cx="18" cy="20" r="1"/>
<path d="M2 3h2l2.4 12.4a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.6L21 7H6"/>
</svg>
</span>
<span class="brand__name">Fresh<span>Cart</span></span>
</a>
<nav class="nav__links" id="primary-nav" aria-label="Primary">
<a href="#categories">Shop</a>
<a href="#guarantee">Fresh guarantee</a>
<a href="#pricing">Membership</a>
<a href="#how">How it works</a>
</nav>
<div class="nav__actions">
<a class="btn btn--ghost" href="#app">Sign in</a>
<a class="btn btn--solid" href="#hero-zip">Start order</a>
<button class="nav__toggle" id="navToggle" aria-expanded="false" aria-controls="primary-nav" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</div>
</div>
</header>
<main id="main">
<!-- HERO -->
<section class="hero" id="hero">
<div class="wrap hero__grid">
<div class="hero__copy reveal">
<span class="pill pill--leaf">🌱 Locally sourced · 100% fresh</span>
<h1>Fresh groceries,<br/>delivered in <span class="hl">under an hour.</span></h1>
<p class="hero__lede">Hand-picked produce, pantry staples and weekly essentials brought to your door by FreshCart shoppers. No markups, no minimums — just real food, fast.</p>
<form class="zip" id="hero-zip" novalidate>
<label class="zip__label" for="zipInput">Check delivery in your area</label>
<div class="zip__row">
<span class="zip__icon" aria-hidden="true">📍</span>
<input id="zipInput" name="zip" inputmode="numeric" autocomplete="postal-code" placeholder="Enter your ZIP code" aria-describedby="zipMsg" />
<button class="btn btn--solid" type="submit">Check</button>
</div>
<p class="zip__msg" id="zipMsg" role="status" aria-live="polite"></p>
</form>
<ul class="hero__stats">
<li><strong>52 min</strong><span>avg. delivery</span></li>
<li><strong>8,400+</strong><span>fresh items</span></li>
<li><strong>4.9 ★</strong><span>shopper rating</span></li>
</ul>
</div>
<div class="hero__art reveal" aria-hidden="true">
<div class="basket">
<div class="basket__steam"></div>
<div class="produce produce--a">🥬</div>
<div class="produce produce--b">🍅</div>
<div class="produce produce--c">🥑</div>
<div class="produce produce--d">🥕</div>
<div class="produce produce--e">🍞</div>
<div class="basket__body">
<div class="basket__weave"></div>
</div>
</div>
<div class="card-float card-float--eta">
<span class="dot dot--ok"></span>
<div><strong>Arriving 6:48 PM</strong><small>Mara is picking your produce</small></div>
</div>
<div class="card-float card-float--free">
<span aria-hidden="true">🚚</span>
<div><strong>Free delivery</strong><small>on your first 3 orders</small></div>
</div>
</div>
</div>
</section>
<!-- CATEGORIES -->
<section class="section" id="categories">
<div class="wrap">
<header class="section__head reveal">
<h2>Shop by aisle</h2>
<p>Everything from crisp greens to weekend treats — tap an aisle to start your basket.</p>
</header>
<div class="tiles" id="tiles"></div>
</div>
</section>
<!-- FRESH GUARANTEE -->
<section class="section guarantee" id="guarantee">
<div class="wrap guarantee__grid">
<div class="guarantee__copy reveal">
<span class="pill pill--cream">Our promise</span>
<h2>The FreshCart freshness guarantee</h2>
<p>If anything shows up bruised, melted or short-dated, we refund it instantly — no photo, no phone call, no fuss. We pick like it's for our own kitchen.</p>
<ul class="checks">
<li><span aria-hidden="true">✓</span> Same-day picked produce, never warehouse stock</li>
<li><span aria-hidden="true">✓</span> Cold-chain bags keep dairy & frozen below 4°C</li>
<li><span aria-hidden="true">✓</span> One-tap refund if it isn't perfect</li>
</ul>
<a class="btn btn--solid" href="#app">Learn about our shoppers</a>
</div>
<ul class="guarantee__cards reveal">
<li><span class="g-emoji">🧊</span><strong>Cold-chain</strong><small>Insulated bags from store to step</small></li>
<li><span class="g-emoji">⏱️</span><strong>Picked today</strong><small>Avg. 41 min from shelf to door</small></li>
<li><span class="g-emoji">💚</span><strong>Ripe-checked</strong><small>Shoppers tap-test every avocado</small></li>
<li><span class="g-emoji">↩️</span><strong>Instant refund</strong><small>Credited before you finish dinner</small></li>
</ul>
</div>
</section>
<!-- MEMBERSHIP / PRICING -->
<section class="section" id="pricing">
<div class="wrap">
<header class="section__head reveal">
<h2>Membership that pays for itself</h2>
<p>Skip the per-order fees. Pick a plan and we'll waive delivery on every basket over $35.</p>
<div class="toggle" role="group" aria-label="Billing period">
<button class="toggle__opt is-active" id="billMonthly" aria-pressed="true">Monthly</button>
<button class="toggle__opt" id="billYearly" aria-pressed="false">Yearly <span class="save">save 25%</span></button>
</div>
</header>
<div class="plans" id="plans"></div>
</div>
</section>
<!-- HOW IT WORKS -->
<section class="section how" id="how">
<div class="wrap">
<header class="section__head reveal">
<h2>How FreshCart works</h2>
<p>From craving to countertop in four simple steps.</p>
</header>
<ol class="steps">
<li class="reveal"><span class="steps__num">1</span><h3>Fill your basket</h3><p>Browse local stores and add what you need — search, reorder or shop by recipe.</p></li>
<li class="reveal"><span class="steps__num">2</span><h3>Pick a slot</h3><p>Choose ASAP or schedule a window that fits your day, down to the half hour.</p></li>
<li class="reveal"><span class="steps__num">3</span><h3>We shop fresh</h3><p>A FreshCart shopper hand-picks each item and texts you about swaps.</p></li>
<li class="reveal"><span class="steps__num">4</span><h3>Doorstep drop</h3><p>Track your shopper live on the map and meet them at the door.</p></li>
</ol>
</div>
</section>
<!-- APP CTA -->
<section class="section app" id="app">
<div class="wrap app__grid">
<div class="app__copy reveal">
<h2>Your kitchen's new best friend</h2>
<p>Reorder favorites in two taps, track your shopper in real time and snag members-only deals — all from the FreshCart app.</p>
<div class="store-btns">
<button class="store-btn" data-store="iOS">
<span aria-hidden="true"></span>
<span class="store-btn__txt"><small>Download on the</small><strong>App Store</strong></span>
</button>
<button class="store-btn" data-store="Android">
<span aria-hidden="true">▶</span>
<span class="store-btn__txt"><small>Get it on</small><strong>Google Play</strong></span>
</button>
</div>
<p class="app__note">★★★★★ Loved by 312,000+ home cooks</p>
</div>
<div class="app__phone reveal" aria-hidden="true">
<div class="phone">
<div class="phone__notch"></div>
<div class="phone__screen">
<div class="phone__bar"><span>Order #FC-2048</span><span class="dot dot--ok"></span></div>
<div class="phone__eta"><small>Arriving in</small><strong id="phoneEta">11:42</strong></div>
<div class="phone__track">
<span class="t-step is-done"></span>
<span class="t-step is-done"></span>
<span class="t-step is-active"></span>
<span class="t-step"></span>
</div>
<p class="phone__status">Mara is on the way with 14 items 🥗</p>
<div class="phone__items">
<span>🥬 Romaine ×2</span><span>🍓 Strawberries</span><span>🥛 Oat milk</span>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="wrap footer__grid">
<div class="footer__brand">
<a class="brand" href="#top">
<span class="brand__mark" aria-hidden="true">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="20" r="1"/><circle cx="18" cy="20" r="1"/><path d="M2 3h2l2.4 12.4a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.6L21 7H6"/></svg>
</span>
<span class="brand__name">Fresh<span>Cart</span></span>
</a>
<p>Fresh groceries from local stores, delivered in under an hour.</p>
</div>
<nav aria-label="Company"><h4>Company</h4><a href="#">About us</a><a href="#">Careers</a><a href="#">Become a shopper</a><a href="#">Press</a></nav>
<nav aria-label="Shop"><h4>Shop</h4><a href="#categories">Produce</a><a href="#categories">Pantry</a><a href="#categories">Bakery</a><a href="#pricing">Membership</a></nav>
<nav aria-label="Support"><h4>Support</h4><a href="#">Help center</a><a href="#guarantee">Fresh guarantee</a><a href="#">Contact</a><a href="#">Track order</a></nav>
<form class="footer__sub" id="subForm" novalidate>
<h4>Weekly deals</h4>
<p>Get seasonal picks & member offers.</p>
<div class="footer__sub-row">
<input type="email" id="subEmail" placeholder="[email protected]" aria-label="Email address" />
<button class="btn btn--solid" type="submit">Join</button>
</div>
</form>
</div>
<div class="wrap footer__bottom">
<small>© 2026 FreshCart Markets. Fictional brand for demo purposes.</small>
<small><a href="#">Privacy</a> · <a href="#">Terms</a> · <a href="#">Cookies</a></small>
</div>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Grocery Delivery Landing
A full marketing landing page for FreshCart, a fictional one-hour grocery delivery service. The fresh-green, cream and warm-orange palette gives it a wholesome, farmers-market feel, set in rounded friendly sans (Inter). The hero pairs a bouncing produce-basket illustration and floating status cards with a ZIP coverage checker that validates input and returns a fictional ETA or waitlist message via an inline status line and a toast.
Below the hero, a twelve-tile “shop by aisle” grid, a freshness-guarantee section with cold-chain promise cards, and a membership pricing block let visitors explore the offer. The pricing cards are rendered from data and recalculate live when you flip the monthly/yearly toggle, surfacing the 25% annual saving. A four-step how-it-works flow and an app CTA — complete with a phone mockup whose ETA counts down each second — round out the page.
Everything is vanilla: a mobile hamburger nav, IntersectionObserver scroll reveals, a reusable toast() helper, and email/ZIP validation. It is responsive from wide desktop down to ~360px and respects prefers-reduced-motion.
Illustrative UI only — fictional brand, not a real delivery service.