Hero heartbeat line, 500+ catalog strip, special order requests

- Animated ECG trace with a travelling pulse across the hero
- Catalog strip under the hero: 500+ products and a scrolling category list
- Special orders section and form; Apps Script writes them to a "Special orders" tab and emails NOTIFY, WhatsApp fallback until ENDPOINT is set
- Nav, hero nudge and FAQ point to special orders

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kirukib 2026-11-09 06:46:38 +03:00
parent e602d00b74
commit 53a9de007e
3 changed files with 135 additions and 6 deletions

View File

@ -12,6 +12,10 @@ Deploy it to any static host (Vercel, Netlify, nginx) with the repo root as the
The form takes a phone number (SMS, the default) or an email, then asks for a name. Signups go to a Google Sheet through `tools/waitlist-apps-script.gs`, which also emails a notification for each one. Until `ENDPOINT` in `index.html` is set, signups are only saved in the visitor's browser.
## Special orders
The special order form (item, quantity, name, phone, notes) posts to the same Apps Script endpoint with `type: 'special'`, which writes to a "Special orders" tab and emails `NOTIFY`. Until `ENDPOINT` is set, the request opens as a pre-filled WhatsApp message to `+251 930 099 850`. Redeploy the Apps Script after pulling this change.
## B2B onboarding
Institutions reach Gishen by calling `+251 930 099 850` or emailing `b2b@gishenpharmacy.org`. The email link comes with a pre-filled template. Setting up the inbox is tracked in [TASKS.md](TASKS.md).

View File

@ -87,6 +87,14 @@
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drift { from { translate: 0 0; } to { translate: 0 -12px; } }
/* heartbeat line: a dim trace with a bright pulse running along it */
.ecg { position: absolute; z-index: -1; left: 0; right: 0; bottom: 5%; width: 100%; height: 90px; pointer-events: none; color: var(--lime); }
.ecg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg .trace { opacity: .14; }
.ecg .pulse { stroke-dasharray: 9 91; animation: beat 4.5s linear infinite; filter: drop-shadow(0 0 6px rgba(168, 199, 58, .9)); }
@keyframes beat { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@media (max-width: 860px) { .ecg { bottom: 4%; height: 60px; } }
.pitch { max-width: 720px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.proof { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(11, 15, 10, .6); backdrop-filter: blur(8px); font-size: 14px; font-weight: 500; color: var(--ink-2); }
.proof .eth { color: var(--lime); font-weight: 600; }
@ -153,6 +161,38 @@
.collage { gap: 8px; } .pack { width: 92px; } .c4 { width: 112px; }
}
/* ---------- catalog marquee ---------- */
.catalog { display: flex; align-items: center; border-top: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.catalog .count { flex: none; display: flex; align-items: baseline; gap: 10px; padding: 18px clamp(16px, 4vw, 48px); border-right: 1px solid var(--line); background: var(--raise); position: relative; z-index: 1; }
.catalog .count b { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--lime); }
.catalog .count span { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.marquee { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee ul { display: flex; gap: 10px; width: max-content; margin: 0; padding: 0 10px; list-style: none; animation: slide 60s linear infinite; }
.marquee:hover ul { animation-play-state: paused; }
.marquee li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.marquee li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
@keyframes slide { to { transform: translateX(-50%); } }
@media (max-width: 600px) { .catalog .count span { display: none; } }
/* ---------- special orders ---------- */
.special { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.steps3 { list-style: none; counter-reset: s; margin: 32px 0 0; padding: 0; display: grid; gap: 18px; }
.steps3 li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; color: var(--ink-2); }
.steps3 li::before { content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(168, 199, 58, .14); color: var(--lime); font-weight: 700; font-size: 14px; }
.steps3 b { display: block; color: var(--ink); }
.sform { padding: clamp(20px, 3vw, 32px); border-radius: 28px; background: var(--raise); border: 1px solid var(--line); display: grid; gap: 14px; }
.sform label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sform label small { font-weight: 500; color: var(--ink-3); }
.sform input, .sform textarea { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); font: inherit; font-size: 16px; color: var(--ink); outline: none; resize: vertical; }
.sform input:focus, .sform textarea:focus { border-color: var(--line-2); box-shadow: 0 0 0 4px rgba(168, 199, 58, .1); }
.sform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sform .btn { width: 100%; }
.sform .fine, .sform .err { margin: 0; }
.sform .alt { text-align: center; font-size: 14px; color: var(--ink-3); margin: 0; }
.sform .alt a { color: var(--ink-2); font-weight: 600; text-underline-offset: 3px; }
@media (max-width: 860px) { .special { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .sform .two { grid-template-columns: 1fr; } }
/* ---------- stats ---------- */
.stats { border-block: 1px solid var(--line); background: var(--raise); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
@ -248,7 +288,7 @@
.legal a { color: var(--lime); }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; } .card { opacity: 1; } .reveal { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; } .marquee ul { animation: none; flex-wrap: wrap; width: auto; } .ecg .pulse { display: none; } .card { opacity: 1; } .reveal { opacity: 1; transform: none; } }
</style>
</head>
<body>
@ -257,6 +297,7 @@
<a class="brand" href="#" aria-label="Gishen Pharmacy home"><img src="/brand/gishen-logo.png" alt="Gishen Pharmacy — ግሸን መድሃኒት ቤት" width="500" height="117" /></a>
<nav class="links" aria-label="Sections">
<a href="#coming">What's coming</a>
<a href="#special">Special orders</a>
<a href="#b2b">For institutions</a>
<a href="#branches">Branches</a>
<a href="#faq">FAQ</a>
@ -266,6 +307,10 @@
<main>
<section class="hero">
<svg class="ecg" viewBox="0 0 1200 90" preserveAspectRatio="none" aria-hidden="true">
<path class="trace" d="M0 45 H110l10 -6l10 6H150l8 14l12 -52l12 58l8 -20H200l14 -10l14 10 H410l10 -6l10 6H450l8 14l12 -52l12 58l8 -20H500l14 -10l14 10 H710l10 -6l10 6H750l8 14l12 -52l12 58l8 -20H800l14 -10l14 10 H1010l10 -6l10 6H1050l8 14l12 -52l12 58l8 -20H1100l14 -10l14 10 H1200" />
<path class="pulse" pathLength="100" d="M0 45 H110l10 -6l10 6H150l8 14l12 -52l12 58l8 -20H200l14 -10l14 10 H410l10 -6l10 6H450l8 14l12 -52l12 58l8 -20H500l14 -10l14 10 H710l10 -6l10 6H750l8 14l12 -52l12 58l8 -20H800l14 -10l14 10 H1010l10 -6l10 6H1050l8 14l12 -52l12 58l8 -20H1100l14 -10l14 10 H1200" />
</svg>
<div class="collage" aria-hidden="true">
<div class="card pack c1"><img src="/products/panadol-advance.jpg" alt="" /><span>Pain relief</span></div>
<div class="card pack c2"><img src="/products/first-aid-plaster.jpg" alt="" /></div>
@ -286,7 +331,7 @@
<div class="pitch">
<span class="proof"><span class="live"></span><span class="eth">በቅርቡ</span><span id="waiting">Coming soon to Addis Ababa</span></span>
<h1>Your pharmacy, <em>at your door.</em></h1>
<p class="lead">Order medicines, send your prescription and get it delivered from Gishen, a pharmacy Addis has trusted since 1994. Join the waitlist and we'll tell you the day we open.</p>
<p class="lead">Order from 500+ medicines and health products, send your prescription and get it delivered from Gishen, a pharmacy Addis has trusted since 1994. Join the waitlist and we'll tell you the day we open.</p>
<div class="join" id="join">
<form id="form" novalidate>
@ -315,10 +360,15 @@
<p class="err" id="err" role="alert"></p>
</form>
</div>
<p class="b2b-nudge">Hospital, clinic or company? <a href="#b2b">Get onboarded as a B2B partner</a></p>
<p class="b2b-nudge">Can't find a medicine? <a href="#special">Request a special order</a> · Hospital or clinic? <a href="#b2b">Onboard as B2B</a></p>
</div>
</section>
<div class="catalog" aria-label="Launch catalog">
<div class="count"><b>500+</b><span>products in the launch catalog</span></div>
<div class="marquee"><ul><li>Pain &amp; fever</li><li>Vitamins &amp; supplements</li><li>Diabetes care</li><li>Heart &amp; blood pressure</li><li>Antibiotics (Rx)</li><li>Stomach &amp; digestion</li><li>Cold, cough &amp; flu</li><li>Baby &amp; mother care</li><li>Skin care</li><li>First aid</li><li>Medical devices</li><li>Gloves &amp; masks</li><li>Allergy</li><li>Eye &amp; ear care</li><li>Women's health</li><li>Personal hygiene</li><li aria-hidden="true">Pain &amp; fever</li><li aria-hidden="true">Vitamins &amp; supplements</li><li aria-hidden="true">Diabetes care</li><li aria-hidden="true">Heart &amp; blood pressure</li><li aria-hidden="true">Antibiotics (Rx)</li><li aria-hidden="true">Stomach &amp; digestion</li><li aria-hidden="true">Cold, cough &amp; flu</li><li aria-hidden="true">Baby &amp; mother care</li><li aria-hidden="true">Skin care</li><li aria-hidden="true">First aid</li><li aria-hidden="true">Medical devices</li><li aria-hidden="true">Gloves &amp; masks</li><li aria-hidden="true">Allergy</li><li aria-hidden="true">Eye &amp; ear care</li><li aria-hidden="true">Women's health</li><li aria-hidden="true">Personal hygiene</li></ul></div>
</div>
<div class="stats">
<div class="wrap">
<div class="stat"><b>1994</b><span>Serving Addis since</span></div>
@ -374,6 +424,34 @@
</div>
</section>
<section class="block" id="special" style="scroll-margin-top: 24px">
<div class="wrap special">
<div>
<span class="kicker reveal">Special orders</span>
<h2 class="reveal">Can't find it? <em>We'll source it.</em></h2>
<p class="intro reveal">Looking for a medicine, strength or supply that's hard to find in Addis? Tell us what you need. Our pharmacists will track it down through our suppliers.</p>
<ol class="steps3 reveal">
<li><span><b>Tell us what you need</b>Product name, strength and how many.</span></li>
<li><span><b>A pharmacist confirms</b>We call you back with availability, price and timing.</span></li>
<li><span><b>Pick up or get it delivered</b>From your nearest branch, or to your door.</span></li>
</ol>
</div>
<form class="sform reveal" id="sform" novalidate>
<label>Medicine or product<input id="sItem" name="item" maxlength="200" placeholder="e.g. Insulin glargine 100 IU/ml" required /></label>
<div class="two">
<label><span>Strength or quantity <small>(optional)</small></span><input id="sQty" name="qty" maxlength="100" placeholder="e.g. 3 pens" /></label>
<label>Your name<input id="sName" name="name" autocomplete="name" maxlength="120" placeholder="Full name" required /></label>
</div>
<label>Phone number<input id="sPhone" name="phone" type="tel" inputmode="tel" autocomplete="tel" placeholder="0911 234 567" required /></label>
<label><span>Notes <small>(optional)</small></span><textarea id="sNotes" name="notes" rows="3" maxlength="500" placeholder="Brand preference, prescription details, when you need it"></textarea></label>
<label class="hp" aria-hidden="true">Company <input id="sCompany" tabindex="-1" autocomplete="off" /></label>
<button class="btn" id="sSubmit" type="submit">Send request</button>
<p class="err" id="sErr" role="alert"></p>
<p class="alt">Prescription item? <a href="https://wa.me/251930099850" rel="noopener" target="_blank">Send a photo on WhatsApp</a></p>
</form>
</div>
</section>
<section class="block" id="b2b" style="scroll-margin-top: 24px">
<div class="wrap">
<div class="b2b reveal">
@ -431,6 +509,7 @@
<details open><summary>When does the online store open?</summary><p>We're in the final stretch. Everyone on the waitlist hears first, by SMS or email, the day orders open.</p></details>
<details><summary>Can I order prescription medicines?</summary><p>Yes. Upload a photo of your prescription and a licensed Gishen pharmacist reviews it before your order is prepared.</p></details>
<details><summary>Where do you deliver?</summary><p>We start across Addis Ababa, delivering from our seven branches. You can also pick up from your nearest branch.</p></details>
<details><summary>What if you don't stock what I need?</summary><p>Use the <a href="#special">special order form</a>. A pharmacist will source it through our suppliers and call you with the price and timing before anything is ordered.</p></details>
<details><summary>How do institutions get onboarded?</summary><p>Call +251 930 099 850 or email <a href="mailto:b2b@gishenpharmacy.org">b2b@gishenpharmacy.org</a> with your institution's details. We'll set up your B2B account before launch.</p></details>
<details><summary>What do you do with my details?</summary><p>We use them only to tell you when we open. We never sell or share them, and we'll delete them whenever you ask.</p></details>
</div>
@ -531,12 +610,12 @@
cc.addEventListener('change', () => { showCC(); $('phone').focus(); });
showCC();
// Returns E.164 or null. A pasted +number wins over the picker; a leading trunk 0 (0911…) is dropped.
function normPhone(p) {
function normPhone(p, country = cc.value) {
const d = digits(p);
if (/^\+\d{8,15}$/.test(d)) return d;
if (!/^\d+$/.test(d)) return null;
const n = d.replace(/^0/, ''), dial = dialOf[cc.value];
if (cc.value === 'ET') return /^[79]\d{8}$/.test(n) ? '+251' + n : null;
const n = d.replace(/^0/, ''), dial = dialOf[country];
if (country === 'ET') return /^[79]\d{8}$/.test(n) ? '+251' + n : null;
return n.length >= 4 && dial.length + n.length <= 15 ? '+' + dial + n : null;
}
@ -596,6 +675,34 @@
btn.disabled = false;
}
});
// Special orders: rows go to the "Special orders" sheet. Without an ENDPOINT the request opens in WhatsApp instead, so nothing is lost.
const sform = $('sform'), sErr = $('sErr'), sBtn = $('sSubmit');
sform.addEventListener('submit', async (e) => {
e.preventDefault(); sErr.textContent = '';
const v = (id) => $(id).value.trim();
const phone = normPhone(v('sPhone'), 'ET');
const bad = [['sItem', v('sItem').length < 2, 'Tell us which medicine or product you need.'], ['sName', v('sName').length < 2, 'Please enter your name.'], ['sPhone', !phone, 'Please enter a phone number, e.g. 0911 234 567, or +country code.']];
bad.forEach(([id, b]) => $(id).setAttribute('aria-invalid', String(b)));
const first = bad.find(([, b]) => b);
if (first) { sErr.textContent = first[2]; $(first[0]).focus(); return; }
const data = { type: 'special', item: v('sItem'), qty: v('sQty'), name: v('sName'), phone, notes: v('sNotes'), company: $('sCompany').value, page: location.href, createdAt: new Date().toISOString() };
if (!ENDPOINT) {
const msg = `Special order request\nItem: ${data.item}${data.qty ? `\nQuantity: ${data.qty}` : ''}\nName: ${data.name}\nPhone: ${phone}${data.notes ? `\nNotes: ${data.notes}` : ''}`;
open('https://wa.me/251930099850?text=' + encodeURIComponent(msg), '_blank', 'noopener');
return;
}
sBtn.disabled = true;
try {
const res = await fetch(ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'text/plain;charset=utf-8' }, body: JSON.stringify(data) });
const out = await res.json().catch(() => ({}));
if (!res.ok || !out.ok) throw new Error(out.error || res.status);
sform.innerHTML = `<div class="done" role="status"><div class="tick"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7"/></svg></div><div><h3>Request received.</h3><p>A Gishen pharmacist will call you within one working day.</p></div></div>`;
} catch {
sErr.textContent = 'Something went wrong. Please try again, or call us on +251 930 099 850.';
sBtn.disabled = false;
}
});
</script>
</body>
</html>

View File

@ -18,10 +18,28 @@ function doGet() {
return json_({ count: Math.max(sheet_().getLastRow() - 1, 0) });
}
const SPECIAL_HEADERS = ['createdAt', 'item', 'qty', 'name', 'phone', 'notes', 'page', 'status'];
// Special order requests live on their own tab, so the waitlist count (first tab) stays right.
function special_(d) {
const item = String(d.item || '').trim().slice(0, 200);
const name = String(d.name || '').trim().slice(0, 120);
const phone = /^\+\d{8,15}$/.test(d.phone || '') ? d.phone : '';
if (item.length < 2 || name.length < 2 || !phone) return json_({ ok: false, error: 'invalid' });
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sh = ss.getSheetByName('Special orders') || ss.insertSheet('Special orders');
if (sh.getLastRow() === 0) sh.appendRow(SPECIAL_HEADERS);
const qty = String(d.qty || '').slice(0, 100), notes = String(d.notes || '').slice(0, 500);
sh.appendRow([new Date(), item, qty, name, "'" + phone, notes, String(d.page || '').slice(0, 200), 'new']);
if (NOTIFY) MailApp.sendEmail(NOTIFY, 'Special order request: ' + item, [item, qty, name, phone, notes].filter(String).join('\n'));
return json_({ ok: true });
}
function doPost(e) {
try {
const d = JSON.parse(e.postData.contents || '{}');
if (d.company) return json_({ ok: true }); // honeypot: bots fill the hidden field
if (d.type === 'special') return special_(d);
const name = String(d.name || '').trim().slice(0, 120);
const phone = /^\+\d{8,15}$/.test(d.phone || '') ? d.phone : '';
const email = /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(d.email || '') ? String(d.email).toLowerCase().slice(0, 200) : '';