chris 50680a323f Major overhaul: shared nav, admin improvements, email enhancements, routing fixes
Navigation & layout
- Replace per-page hardcoded nav/footer with shared nav.js (client-side injection)
- Add nginx reverse proxy back to docker-compose for clean localhost routing
- Rename /color-picker/ to /color/ across nav, directory, and references

eStore admin
- Add variation hiding controls (mirrors existing modifier hiding)
- Add delivery rate editor (base fee + per-mile per tier, persisted to data/)
- Fix all missing BASE prefix on fetch calls (admin PATCH/DELETE, availability, slots, colors)
- Mount estore/data/ as a Docker volume so admin config survives rebuilds

Booking & calendar
- Set pickup calendar events to TRANSPARENT (free) so they don't block delivery slots
- Skip CANCELLED events in busy-time calculation
- Re-check slot availability at checkout before charging (409 on conflict)

Phone & email validation
- Auto-format phone as (XXX) XXX-XXXX as user types
- Require exactly 10 digits; tighten email regex

Confirmation emails (store alert + customer)
- Full item detail per line: name, price, add-ons, colors, note
- Charges breakdown: subtotal, delivery fee, tax, total
- Delivery window: simplified M/D/YY h:mm – h:mm AM/PM format
- .ics calendar attachment on customer confirmation

Delivery rates
- Extract configurable rates to delivery-rates.ts (server-only, no fs in client bundle)
- calcDelivery() accepts optional rates param; delivery-quote route passes configured rates

Content
- Change all "40+ latex colors" references to "70+"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 21:14:06 -04:00

78 lines
3.6 KiB
JavaScript

(function () {
var path = window.location.pathname;
var links = [
{ label: 'Home', href: '/' },
{ label: 'Shop', href: '/shop' },
{ label: 'About Us', href: '/about/' },
{ label: 'FAQ', href: '/faq/' },
{ label: 'Gallery', href: '/gallery/' },
{ label: 'Colors', href: '/color/' },
{ label: 'Contact', href: '/contact/' },
];
function isActive(href) {
if (href === '/') return path === '/';
return path === href || path.startsWith(href);
}
var items = links.map(function (l) {
var active = isActive(l.href) ? ' is-tab is-active' : '';
return '<a class="navbar-item' + active + '" href="' + l.href + '">' + l.label + '</a>';
}).join('\n ');
var navHTML = '<nav class="navbar is-info is-spaced has-shadow" role="navigation" aria-label="main navigation">\n' +
' <div class="navbar-brand is-size-1">\n' +
' <a class="navbar-item" href="/">\n' +
' <img style="background-color:white" src="/assets/logo/BeachPartyBalloons-logo.webp" alt="Beach Party Balloons logo">\n' +
' </a>\n' +
' <a role="button" class="navbar-burger" id="site-burger" aria-label="menu" aria-expanded="false" data-target="site-navbar-menu">\n' +
' <span aria-hidden="true"></span>\n' +
' <span aria-hidden="true"></span>\n' +
' <span aria-hidden="true"></span>\n' +
' <span aria-hidden="true"></span>\n' +
' </a>\n' +
' </div>\n' +
' <div id="site-navbar-menu" class="navbar-menu has-text-right">\n' +
' <div class="navbar-end">\n' +
' ' + items + '\n' +
' </div>\n' +
' </div>\n' +
'</nav>';
var footerHTML = '<footer class="footer has-background-primary-light">\n' +
' <div class="content has-text-centered">\n' +
' <div>\n' +
' <a target="_blank" rel="noopener noreferrer" href="https://mastodon.social/@beachpartyballoons@mastodon.social"><i class="fa-brands fa-mastodon is-size-2"></i></a>\n' +
' <a target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/beachpartyballoons"><i class="fa-brands fa-facebook-f is-size-2"></i></a>\n' +
' <a target="_blank" rel="noopener noreferrer" href="https://www.instagram.com/beachpartyballoons/"><i class="fa-brands fa-instagram is-size-2"></i></a>\n' +
' <a target="_blank" rel="noopener noreferrer" href="https://bsky.app/profile/beachpartyballoons.bsky.social"><i class="fa-brands fa-bluesky is-size-2"></i></a>\n' +
' </div>\n' +
' <p>Copyright &copy; ' + new Date().getFullYear() + ' Beach Party Balloons</p>\n' +
' <p>All images &amp; content are property of Beach Party Balloons. Use of images without written permission is prohibited.</p>\n' +
' <p style="font-size:0.8rem;margin-top:0.5rem">\n' +
' <a href="/privacy/">Privacy Policy</a>\n' +
' &nbsp;&middot;&nbsp;\n' +
' <a href="/terms/">Terms of Service</a>\n' +
' &nbsp;&middot;&nbsp;\n' +
' <a href="/refund/">Refund &amp; Cancellation Policy</a>\n' +
' </p>\n' +
' </div>\n' +
'</footer>';
var navEl = document.getElementById('site-nav');
if (navEl) navEl.outerHTML = navHTML;
var footerEl = document.getElementById('site-footer');
if (footerEl) footerEl.outerHTML = footerHTML;
// Burger toggle
document.addEventListener('click', function (e) {
var burger = e.target.closest('.navbar-burger');
if (!burger) return;
var target = document.getElementById(burger.dataset.target);
burger.classList.toggle('is-active');
if (target) target.classList.toggle('is-active');
});
})();