<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GBP Automation System – Momentum 360</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&family=Open+Sans:wght@400;600&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--navy: #0d1b2e;
--navy-light: #162236;
--gold: #d4a017;
--gold-bright: #f0b429;
--white: #ffffff;
--off-white: #f8f6f0;
--gray: #6b7280;
--border: #e5e7eb;
}
body {
font-family: 'Open Sans', sans-serif;
background: var(--white);
color: #1a1a2e;
}
/* NAV */
nav {
background: var(--navy);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32px;
height: 72px;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.nav-logo {
display: flex;
align-items: center;
gap: 10px;
text-decoration: none;
}
.nav-logo-icon {
width: 48px;
height: 48px;
background: linear-gradient(135deg, #1a3a6e, #0d1b2e);
border: 2px solid var(--gold);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Montserrat', sans-serif;
font-weight: 900;
font-size: 20px;
color: var(--gold);
}
.nav-logo-text { line-height: 1.1; }
.nav-logo-text .brand { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 18px; color: var(--white); }
.nav-logo-text .sub { font-size: 10px; color: #aab; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: #ccd; text-decoration: none; font-size: 14px; font-weight: 600; font-family: 'Montserrat', sans-serif; }
.nav-links a:hover { color: var(--gold); }
.nav-ctas { display: flex; gap: 10px; }
.btn-outline { border: 2px solid var(--gold); color: var(--gold); background: transparent; padding: 9px 20px; border-radius: 6px; font-weight: 700; font-size: 13px; font-family: 'Montserrat', sans-serif; cursor: pointer; transition: all .2s; }
.btn-outline:hover { background: var(--gold); color: var(--navy); }
.btn-solid { background: var(--gold); color: var(--navy); border: none; padding: 11px 22px; border-radius: 6px; font-weight: 700; font-size: 13px; font-family: 'Montserrat', sans-serif; cursor: pointer; transition: all .2s; }
.btn-solid:hover { background: var(--gold-bright); }
/* HERO */
.hero {
background: var(--navy);
text-align: center;
padding: 90px 24px 80px;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute; inset: 0;
background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,160,23,0.08) 0%, transparent 70%);
pointer-events: none;
}
.hero-badge {
display: inline-block;
background: rgba(212,160,23,0.15);
border: 1px solid var(--gold);
color: var(--gold);
font-size: 12px;
font-weight: 700;
font-family: 'Montserrat', sans-serif;
letter-spacing: .08em;
padding: 6px 18px;
border-radius: 999px;
margin-bottom: 28px;
}
.hero h1 {
font-family: 'Montserrat', sans-serif;
font-weight: 900;
font-size: clamp(36px, 6vw, 64px);
color: var(--white);
line-height: 1.1;
margin-bottom: 20px;
}
.hero h1 span { color: var(--gold); }
.hero p {
color: #aab8cc;
font-size: 18px;
max-width: 540px;
margin: 0 auto 36px;
line-height: 1.6;
}
.hero-pills { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pill {
border: 1.5px solid rgba(255,255,255,0.25);
color: var(--white);
padding: 10px 22px;
border-radius: 999px;
font-size: 14px;
font-weight: 600;
font-family: 'Montserrat', sans-serif;
cursor: pointer;
transition: all .2s;
background: rgba(255,255,255,0.04);
}
.pill:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,160,23,0.08); }
.trust-bar {
background: #f0ece3;
text-align: center;
padding: 14px;
font-size: 12px;
font-weight: 700;
font-family: 'Montserrat', sans-serif;
letter-spacing: .06em;
color: #555;
}
.trust-bar span { color: var(--gold); }
/* SECTIONS */
section { padding: 72px 24px; }
.container { max-width: 960px; margin: 0 auto; }
.section-title {
font-family: 'Montserrat', sans-serif;
font-weight: 800;
font-size: 28px;
color: var(--navy);
margin-bottom: 24px;
display: flex;
align-items: center;
gap: 10px;
}
/* PROJECT OVERVIEW */
.overview-box {
border: 2px solid var(--gold);
border-radius: 12px;
padding: 32px;
}
.overview-desc { color: #444; font-size: 15px; line-height: 1.7; margin-bottom: 28px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media(max-width:640px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 16px;
font-size: 14px;
font-weight: 600;
color: #333;
font-family: 'Montserrat', sans-serif;
display: flex;
align-items: center;
gap: 10px;
background: #fff;
transition: border-color .2s;
}
.feature-card:hover { border-color: var(--gold); }
.feature-card .icon { font-size: 20px; }
/* GENERATOR */
.generator-section { background: var(--off-white); }
.generator-box {
background: var(--navy);
border-radius: 16px;
padding: 48px 40px;
text-align: center;
max-width: 780px;
margin: 0 auto;
}
.generator-box h2 {
font-family: 'Montserrat', sans-serif;
font-weight: 800;
font-size: 26px;
color: var(--gold);
margin-bottom: 10px;
}
.generator-box p { color: #aab8cc; font-size: 15px; margin-bottom: 32px; }
.form-inner { background: #fff; border-radius: 10px; padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media(max-width:560px) { .form-row { grid-template-columns: 1fr; } }
.field-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-group label { font-size: 13px; font-weight: 700; font-family: 'Montserrat', sans-serif; color: #333; }
.field-group input, .field-group textarea {
border: 1.5px solid #ddd;
border-radius: 6px;
padding: 12px 14px;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
color: #333;
outline: none;
transition: border-color .2s;
resize: none;
}
.field-group input:focus, .field-group textarea:focus { border-color: var(--gold); }
.field-group select:focus { border-color: var(--gold); outline: none; }
.field-group.full { grid-column: 1 / -1; }
.btn-generate {
width: 100%;
background: var(--gold);
color: var(--navy);
border: none;
padding: 16px;
border-radius: 8px;
font-size: 15px;
font-weight: 800;
font-family: 'Montserrat', sans-serif;
cursor: pointer;
transition: all .2s;
margin-top: 8px;
letter-spacing: .04em;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.btn-generate:hover { background: var(--gold-bright); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,160,23,0.35); }
.btn-generate:disabled { opacity: .6; cursor: not-allowed; transform: none; }
/* RESULT */
.result-area {
display: none;
margin-top: 24px;
background: #fff;
border-radius: 10px;
padding: 28px;
border: 2px solid var(--gold);
text-align: left;
animation: fadeIn .4s ease;
}
.result-area.show { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result-label {
font-size: 11px;
font-weight: 700;
font-family: 'Montserrat', sans-serif;
letter-spacing: .1em;
color: var(--gold);
text-transform: uppercase;
margin-bottom: 12px;
}
.result-post {
font-size: 15px;
line-height: 1.75;
color: #222;
white-space: pre-wrap;
}
.result-meta {
display: flex;
gap: 16px;
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid #eee;
}
.meta-chip {
background: var(--off-white);
border: 1px solid #ddd;
border-radius: 6px;
padding: 8px 14px;
font-size: 12px;
font-weight: 600;
font-family: 'Montserrat', sans-serif;
color: #444;
}
/* MULTI POST CARDS */
.posts-grid { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.post-card { background: #fff; border-radius: 10px; border: 2px solid #eee; overflow: hidden; text-align: left; animation: fadeIn .4s ease both; }
.post-card:nth-child(2) { animation-delay: .1s; }
.post-card:nth-child(3) { animation-delay: .2s; }
.post-card:nth-child(4) { animation-delay: .3s; }
.post-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #f0f0f0; }
.post-card-type { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; font-family: 'Montserrat', sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.type-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.type-seasonal { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.type-offer { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.type-event { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.type-update { background: #f3e5f5; color: #4a148c; border: 1px solid #ce93d8; }
.copy-btn { background: transparent; border: 1.5px solid #ddd; border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 700; font-family: 'Montserrat', sans-serif; color: #555; cursor: pointer; transition: all .2s; }
.copy-btn:hover { border-color: var(--gold); color: var(--gold); }
.copy-btn.copied { border-color: #2e7d32; color: #2e7d32; }
.post-card-body { padding: 20px; }
.post-card-body .post-text { font-size: 14px; line-height: 1.8; color: #222; white-space: pre-wrap; }
.post-card-body .post-text strong { color: var(--navy); }
.post-card-footer { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid #f0f0f0; background: #fafafa; }
.meta-chip { background: var(--off-white); border: 1px solid #ddd; border-radius: 6px; padding: 5px 12px; font-size: 11px; font-weight: 600; font-family: 'Montserrat', sans-serif; color: #444; }
.season-banner { display: flex; align-items: center; gap: 8px; background: rgba(212,160,23,0.12); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; font-size: 13px; font-weight: 600; font-family: 'Montserrat', sans-serif; color: var(--navy); }
.loading-dots span {
display: inline-block;
animation: bounce .8s infinite;
font-size: 22px;
line-height: 1;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
/* WORKFLOW */
.workflow-box {
border: 2px solid var(--gold);
border-radius: 12px;
padding: 32px;
background: #fdfbf5;
max-width: 780px;
margin: 0 auto;
}
.step {
display: flex;
align-items: flex-start;
gap: 20px;
padding: 20px;
background: #fff;
border-radius: 10px;
border: 1px solid #eee;
transition: border-color .2s;
}
.step:hover { border-color: var(--gold); }
.step-num {
width: 40px;
height: 40px;
border-radius: 50%;
background: var(--gold);
color: var(--navy);
font-weight: 900;
font-family: 'Montserrat', sans-serif;
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.step-content {}
.step-title { font-weight: 700; font-family: 'Montserrat', sans-serif; color: #1a1a2e; font-size: 15px; margin-bottom: 4px; }
.step-desc { font-size: 14px; color: #555; line-height: 1.5; }
.step-arrow { text-align: center; color: var(--gold); font-size: 20px; padding: 6px 0; }
.result-callout {
margin-top: 20px;
font-size: 14px;
font-weight: 700;
font-family: 'Montserrat', sans-serif;
color: var(--gold);
}
/* FOOTER CTA */
.footer-cta {
background: var(--navy);
text-align: center;
padding: 60px 24px;
}
.footer-cta h2 { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 32px; color: #fff; margin-bottom: 12px; }
.footer-cta p { color: #aab8cc; font-size: 16px; margin-bottom: 28px; }
.footer-cta .btn-solid { font-size: 15px; padding: 14px 36px; }
</style>
</head>
<body>
<!-- NAV -->
<nav>
<a class="nav-logo" href="#">
<div class="nav-logo-icon">M</div>
<div class="nav-logo-text">
<div class="brand">Momentum 360</div>
<div class="sub">Photo, Video, Digital Marketing Services</div>
</div>
</a>
<div class="nav-links">
<a href="#">Services</a>
<a href="#">About</a>
<a href="#">Case Studies</a>
<a href="#">Locations</a>
<a href="#">📞 (215) 607-6482</a>
</div>
<div class="nav-ctas">
<button class="btn-outline">SPEAK WITH AN EXPERT</button>
<button class="btn-solid">BOOK A SHOOT</button>
</div>
</nav>
<!-- HERO -->
<div class="hero">
<div class="hero-badge">Momentum 360 · New Service Offering</div>
<h1>GBP Automation <span>System</span></h1>
<p>AI-powered content generation, video creation, and automated posting to Google Business Profile. Hands-free.</p>
<div class="hero-pills">
<div class="pill">Auto-Post to GBP</div>
<div class="pill">AI Video Generation</div>
<div class="pill">Smart Scheduling</div>
<div class="pill">Analytics Dashboard</div>
</div>
</div>
<div class="trust-bar">
TRUSTED BY THOUSANDS OF CLIENTS · <span>GOOGLE STREET VIEW TRUSTED AGENCY</span> · MATTERPORT PARTNER · INC. 5000
</div>
<!-- PROJECT OVERVIEW -->
<section>
<div class="container">
<div class="section-title">📋 Project Overview</div>
<div class="overview-box">
<p class="overview-desc">An end-to-end AI system that keeps Google Business Profiles active, engaging, and optimized without manual effort. Built to integrate with Momentum 360's existing content services.</p>
<div class="features-grid">
<div class="feature-card"><span class="icon">🤖</span> Auto-generate and post content</div>
<div class="feature-card"><span class="icon">🎬</span> AI-created videos for engagement</div>
<div class="feature-card"><span class="icon">📅</span> Optimal timing and scheduling</div>
<div class="feature-card"><span class="icon">📍</span> Multi-location support</div>
<div class="feature-card"><span class="icon">📊</span> Performance analytics</div>
<div class="feature-card"><span class="icon">🔗</span> Integrates with virtual tour assets</div>
</div>
</div>
</div>
</section>
<!-- LIVE CONTENT GENERATOR -->
<section class="generator-section">
<div class="container">
<div class="section-title">🚀 Try It Now: Live Content Generator</div>
<div class="generator-box">
<h2>See What the AI Generates for YOUR Business</h2>
<p>Enter your business info and watch our AI create ready-to-post GBP content in seconds — seasonally aware, every time.</p>
<div class="form-inner">
<div class="form-row">
<div class="field-group">
<label>Business Name *</label>
<input type="text" id="bizName" placeholder="e.g. Joe's Pizza">
</div>
<div class="field-group">
<label>Business Type *</label>
<input type="text" id="bizType" placeholder="e.g. Italian Restaurant">
</div>
</div>
<div class="form-row">
<div class="field-group">
<label>Current Promotion (optional)</label>
<input type="text" id="bizPromo" placeholder="e.g. 20% off all large pizzas this week">
</div>
<div class="field-group">
<label>Post Type *</label>
<select id="postType" style="border:1.5px solid #ddd;border-radius:6px;padding:12px 14px;font-size:14px;font-family:'Open Sans',sans-serif;color:#333;outline:none;transition:border-color .2s;background:#fff;cursor:pointer;">
<option value="seasonal_update">🍂 Seasonal Update Post</option>
<option value="offer">🎯 Promotional Offer Post</option>
<option value="event">📅 Event / News Post</option>
<option value="update">📢 Business Update Post</option>
<option value="all">⚡ Generate All Types</option>
</select>
</div>
</div>
<button class="btn-generate" id="generateBtn" onclick="generateContent()">
🎯 GENERATE SAMPLE GBP CONTENT
</button>
</div>
<div class="result-area" id="resultArea">
<div id="resultInner"></div>
</div>
</div>
</div>
</section>
<!-- AUTOMATED WORKFLOW -->
<section>
<div class="container">
<div class="section-title">⚡ Automated Daily Workflow</div>
<div style="margin-bottom:16px;color:#555;font-size:14px;font-style:italic;">Example: Restaurant Client Use Case</div>
<div class="workflow-box">
<div class="step">
<div class="step-num">1</div>
<div class="step-content">
<div class="step-title">8:00 AM · AI Analyzes Data</div>
<div class="step-desc">System checks the client's calendar, special offers, and trending topics</div>
</div>
</div>
<div class="step-arrow">↓</div>
<div class="step">
<div class="step-num">2</div>
<div class="step-content">
<div class="step-title">9:00 AM · Content Generation</div>
<div class="step-desc">AI creates post: "Taco Tuesday Special! 🌮 Get 2-for-1 on all tacos 5-8pm tonight"</div>
</div>
</div>
<div class="step-arrow">↓</div>
<div class="step">
<div class="step-num">3</div>
<div class="step-content">
<div class="step-title">9:15 AM · Video Creation</div>
<div class="step-desc">AI generates a 30-second video with text overlay and background music</div>
</div>
</div>
<div class="step-arrow">↓</div>
<div class="step">
<div class="step-num">4</div>
<div class="step-content">
<div class="step-title">10:00 AM · Auto-Post to GBP</div>
<div class="step-desc">Content and video published directly to their Google Business Profile</div>
</div>
</div>
<div class="step-arrow">↓</div>
<div class="step">
<div class="step-num">5</div>
<div class="step-content">
<div class="step-title">All Day · Analytics</div>
<div class="step-desc">System tracks views, clicks, and engagement automatically</div>
</div>
</div>
<div class="result-callout">⚡ Result: Active, engaging GBP without the client lifting a finger!</div>
</div>
</div>
</section>
<!-- FOOTER CTA -->
<div class="footer-cta">
<h2>Ready to Automate Your GBP?</h2>
<p>Let Momentum 360 handle your Google Business Profile — hands-free, every day.</p>
<button class="btn-solid">SPEAK WITH AN EXPERT</button>
</div>
<script>
// ── Season detection ──────────────────────────────────────────────────────────
function getSeason() {
const m = new Date().getMonth(); // 0-based
if (m >= 2 && m <= 4) return { name: 'Spring', emoji: '🌸', hints: 'spring renewal, fresh starts, spring cleaning, Mother\'s Day, Easter, warmer weather, outdoor activities' };
if (m >= 5 && m <= 7) return { name: 'Summer', emoji: '☀️', hints: 'summer heat, vacations, outdoor fun, BBQs, back-to-school prep, Fourth of July, long days, beat the heat' };
if (m >= 8 && m <= 10) return { name: 'Fall', emoji: '🍂', hints: 'fall vibes, cozy season, Halloween, Thanksgiving, back-to-school, harvest, pumpkin season, cooler weather' };
return { name: 'Winter', emoji: '❄️', hints: 'holiday season, Christmas, New Year, cozy indoors, winter warmth, gift-giving, year-end reflection' };
}
// ── Post type config ──────────────────────────────────────────────────────────
const POST_TYPES = {
seasonal_update: { label: 'Seasonal Update', emoji: '🍂', badgeClass: 'type-seasonal' },
offer: { label: 'Promotional Offer', emoji: '🎯', badgeClass: 'type-offer' },
event: { label: 'Event / News', emoji: '📅', badgeClass: 'type-event' },
update: { label: 'Business Update', emoji: '📢', badgeClass: 'type-update' },
};
// ── Build prompt for one post type ───────────────────────────────────────────
function buildPrompt(bizName, bizType, bizPromo, season, type) {
const promoLine = bizPromo ? `- Current Promotion: ${bizPromo}` : '- No current promotion';
const typeInstructions = {
seasonal_update: `Write a SEASONAL UPDATE GBP post. The current season is ${season.name} ${season.emoji}.
Weave in seasonal themes naturally: ${season.hints}.
Connect the season to why customers should visit or engage with this business RIGHT NOW.
Post type tag: "What's New" or "Update".`,
offer: `Write a PROMOTIONAL OFFER GBP post.
If a promotion was provided, feature it prominently. If not, invent a compelling but realistic limited-time offer.
Include urgency language. Post type tag: "Offer".`,
event: `Write an EVENT or NEWS announcement GBP post.
Create a compelling upcoming event, milestone, or newsworthy moment for this business (workshop, anniversary, community event, award, etc.).
Make it timely and exciting. Post type tag: "Event".`,
update: `Write a BUSINESS UPDATE GBP post — this is the standard "What's New" update type on Google.
Share something fresh: new hours, new menu item, new service, new staff, renovation, new partnership, etc.
Keep it informative and warm. Post type tag: "Update".`,
};
return `You are an expert Google Business Profile (GBP) content creator for Momentum 360, a top-tier digital marketing agency.
Business details:
- Business Name: ${bizName}
- Business Type: ${bizType}
${promoLine}
- Current Season: ${season.name} ${season.emoji}
- Seasonal context: ${season.hints}
TASK: ${typeInstructions[type]}
Requirements:
- Title on line 1, wrapped in ** (e.g. **Your Title Here**)
- 150-180 words, natural and engaging tone
- 3-5 relevant emojis woven in naturally
- One clear call-to-action
- 3-5 relevant hashtags at the end
- Do NOT be robotic or generic — make it feel like a real local business owner wrote it
After the post write exactly:
---META---
Best time to post: [specific time e.g. "Tuesday 9 AM"]
Engagement forecast: [High / Medium / Low]
GBP post type: [Update / Offer / Event]
Seasonal tie-in: [one sentence on how it uses the season]`;
}
// ── Copy helper ───────────────────────────────────────────────────────────────
function copyPost(btn, text) {
navigator.clipboard.writeText(text).then(() => {
btn.textContent = '✅ Copied!';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = '📋 Copy'; btn.classList.remove('copied'); }, 2000);
});
}
// ── Render one post card ──────────────────────────────────────────────────────
function renderCard(rawText, type) {
const config = POST_TYPES[type];
const parts = rawText.split('---META---');
const postRaw = parts[0].trim();
const metaRaw = parts[1] ? parts[1].trim() : '';
const postHtml = postRaw.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>').replace(/\n/g, '<br>');
const metaChips = metaRaw
? metaRaw.split('\n').filter(l => l.includes(':')).map(l => `<span class="meta-chip">${l.trim()}</span>`).join('')
: '';
const plainText = postRaw.replace(/\*\*(.*?)\*\*/g, '$1');
return `
<div class="post-card">
<div class="post-card-header">
<div class="post-card-type">
<span class="type-badge ${config.badgeClass}">${config.emoji} ${config.label}</span>
</div>
<button class="copy-btn" onclick="copyPost(this, \`${plainText.replace(/`/g,'\\`')}\`)">📋 Copy</button>
</div>
<div class="post-card-body">
<div class="post-text">${postHtml}</div>
</div>
${metaChips ? `<div class="post-card-footer">${metaChips}</div>` : ''}
</div>`;
}
// ── Main generate function ────────────────────────────────────────────────────
async function generateContent() {
const bizName = document.getElementById('bizName').value.trim();
const bizType = document.getElementById('bizType').value.trim();
const bizPromo = document.getElementById('bizPromo').value.trim();
const postType = document.getElementById('postType').value;
if (!bizName || !bizType) {
alert('Please enter your Business Name and Business Type.');
return;
}
const btn = document.getElementById('generateBtn');
const resultArea = document.getElementById('resultArea');
const inner = document.getElementById('resultInner');
const season = getSeason();
btn.disabled = true;
btn.innerHTML = '<span class="loading-dots"><span>•</span><span>•</span><span>•</span></span> Generating...';
resultArea.classList.remove('show');
inner.innerHTML = '';
const typesToGenerate = postType === 'all'
? ['seasonal_update', 'offer', 'event', 'update']
: [postType];
try {
const seasonBanner = `<div class="season-banner">${season.emoji} <strong>Season Detected: ${season.name}</strong> — AI is weaving in seasonal context automatically</div>`;
inner.innerHTML = seasonBanner + '<div class="posts-grid" id="postsGrid"></div>';
resultArea.classList.add('show');
const grid = document.getElementById('postsGrid');
// Fire all requests in parallel for speed
const requests = typesToGenerate.map(type =>
fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "claude-sonnet-4-20250514",
max_tokens: 800,
messages: [{ role: "user", content: buildPrompt(bizName, bizType, bizPromo, season, type) }]
})
}).then(r => r.json()).then(data => ({
type,
text: data.content.map(c => c.text || '').join('')
}))
);
// Stream cards in as each resolves
const results = await Promise.allSettled(requests);
results.forEach(r => {
if (r.status === 'fulfilled') {
const div = document.createElement('div');
div.innerHTML = renderCard(r.value.text, r.value.type);
grid.appendChild(div.firstElementChild);
}
});
} catch (err) {
inner.innerHTML = `<div class="post-card" style="padding:20px;color:#c00;">Something went wrong: ${err.message}. Please check your API key.</div>`;
resultArea.classList.add('show');
}
btn.disabled = false;
btn.innerHTML = '🎯 GENERATE SAMPLE GBP CONTENT';
}
</script>
</body>
</html>