Gate Studio frontend by workspace and isolate browser catalog state

This commit is contained in:
khondokartowsif171
2026-10-19 01:20:55 +06:00
parent 07f711ff2d
commit 6db99f96df
10 changed files with 350 additions and 259 deletions
+42 -62
View File
@@ -22,6 +22,17 @@
<link rel="stylesheet" href="style.css?v=6">
</head>
<body>
<section id="studioWorkspaceGate" role="dialog" aria-modal="true" aria-labelledby="workspaceTitle" style="position:fixed;inset:0;z-index:99999;background:#0b1020;color:#eef2ff;padding:10vh 8vw;overflow:auto">
<h1 id="workspaceTitle">Aura Studio</h1>
<p id="workspaceStatus" role="status">আপনার workspace যাচাই হচ্ছে…</p>
<a id="workspaceLogin" class="pill-btn primary" hidden>Login করুন</a>
<form id="workspaceForm" hidden>
<label for="workspaceTenant">Client workspace ID</label>
<input id="workspaceTenant" name="tenant" maxlength="256" required autocomplete="off" placeholder="আপনার client workspace ID">
<button type="submit" class="pill-btn primary">Workspace খুলুন</button>
</form>
<button id="workspaceRetry" type="button" class="pill-btn">আবার চেষ্টা করুন</button>
</section>
<!-- Top App Header -->
<header class="app-header">
@@ -246,16 +257,7 @@
<option value="1:1" selected>Square (1:1 • 1080x1080) — Facebook/Instagram Feed</option>
<option value="9:16">Portrait (9:16 • 1080x1920) — Stories & Reels</option>
</select>
<select id="brandWatermarkSelect">
<option value="glamourstouch" selected>✨ Glamour's Touch (Cosmetics & K-Beauty)</option>
<option value="snehalata">👗 Snehalata (Fashion, Saree & Lifestyle)</option>
<option value="panjabi">👑 Aura Heritage (Royal Designer Panjabi & Kabli)</option>
<option value="techvolt">📱 TechVolt (Gadgets & Smart Electronics)</option>
<option value="organic">🍯 Pranon Organic (Pure Honey & Natural Food)</option>
<option value="sneakerlab">👟 SneakerLab (Footwear & Streetwear)</option>
<option value="royale">💎 Aura Royale (Luxury Jewelry & Fragrance)</option>
<option value="custom">🛍️ Universal E-Commerce Merchant</option>
</select>
<select id="brandWatermarkSelect"><option value="workspace">আপনার workspace</option></select>
</div>
</div>
@@ -277,37 +279,29 @@
<!-- Trending Google Search Suggestions -->
<div class="form-group">
<label style="display:flex; justify-content:space-between; align-items:center;">
<span data-i18n="trends_label">🔥 গুগল ট্রেন্ডিং সার্চ (Google Trends 1-Click Load):</span>
<span style="font-size:10.5px; color:var(--primary); font-weight:600;" data-i18n="trends_badge">Realtime BD Trends</span>
<span data-i18n="trends_label">🛍️ আপনার catalog থেকে বাছুন:</span>
<span style="font-size:10.5px; color:var(--primary); font-weight:600;" data-i18n="trends_badge">Workspace catalog</span>
</label>
<div class="trending-chips-bar" id="trendingPosterChips">
<button type="button" class="trend-chip active" data-brand="glamourstouch" data-title="Medicube Collagen Jelly Cream" data-price="৳ ১,০৬০ (৳ ১,৪৭০) 28% OFF" data-badge="🛡️ 100% Authentic Korean Seal">✨ K-Beauty Cream</button>
<button type="button" class="trend-chip" data-brand="panjabi" data-title="Royal Platinum Silk Designer Panjabi" data-price="৳ ২,৯৫০ (৳ ৩,৮০০) 22% OFF" data-badge="👑 100% Pre-Shrunk Weave">👑 Royal Panjabi</button>
<button type="button" class="trend-chip" data-brand="snehalata" data-title="Katan Silk Handloom Party Saree" data-price="৳ ৩,৪৫০ (৳ ৪,৫০০) 23% OFF" data-badge="👗 Authentic Handloom Weave">👗 Silk Saree</button>
<button type="button" class="trend-chip" data-brand="techvolt" data-title="T900 Ultra Smartwatch Series 9" data-price="৳ ১,৬৫০ (৳ ২,২০০) 25% OFF" data-badge="⚡ 1 Year Official Warranty">⚡ Smartwatch</button>
<button type="button" class="trend-chip" data-brand="organic" data-title="Sundarban Pure Raw Khalsi Honey 1kg" data-price="৳ ১,২৫০ (৳ ১,৫০০) 16% OFF" data-badge="🍯 100% Pure Lab Tested">🍯 Pure Honey</button>
<button type="button" class="trend-chip" data-brand="sneakerlab" data-title="Air Cushion Streetwear Sneaker 2026" data-price="৳ ২,৪৫০ (৳ ৩,২০০) 23% OFF" data-badge="👟 Memory Foam Cushion">👟 Street Sneaker</button>
<button type="button" class="trend-chip" data-brand="royale" data-title="Oud Al Layl 24h Signature Perfume 100ml" data-price="৳ ৩,২০০ (৳ ৪,০০০) 20% OFF" data-badge="💎 24h Long Lasting Sillage">💎 Luxury Perfume</button>
</div>
<div class="trending-chips-bar" id="trendingPosterChips"></div>
</div>
<div class="form-group" style="position: relative;">
<label for="productInput" style="display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px;">
<span data-i18n="product_input_label">প্রডাক্ট লিংক বা নাম (Product Link or Name):</span>
<button type="button" id="openCatalogModalBtn" class="pill-btn primary" style="padding:4px 10px; font-size:11px; cursor:pointer;" data-i18n="open_catalog_btn">🛍️ GT ক্যাটালগ লিস্ট (560+)</button>
<button type="button" id="openCatalogModalBtn" class="pill-btn primary" style="padding:4px 10px; font-size:11px; cursor:pointer;" data-i18n="open_catalog_btn">🛍️ আপনার catalog</button>
</label>
<input type="text" id="productInput" data-i18n-ph="product_input_ph" placeholder="e.g. Silk Saree, Smartwatch, Pure Honey, Sneaker or Skincare" value="Medicube Collagen Jelly Cream" autocomplete="off">
<input type="text" id="productInput" data-i18n-ph="product_input_ph" placeholder="e.g. Silk Saree, Smartwatch, Pure Honey, Sneaker or Skincare" value="" autocomplete="off">
<div id="productAutocompleteList" class="autocomplete-dropdown hidden"></div>
</div>
<div class="form-row">
<div class="form-group">
<label for="productPrice" data-i18n="product_price_label">মূল্য ও অফার (Price & Discount):</label>
<input type="text" id="productPrice" data-i18n-ph="product_price_ph" placeholder="e.g. ৳ ১,০৬০ (৳ ১,৪৭০) 28% OFF" value="৳ ১,০৬০ (৳ ১,৪৭০) 28% OFF">
<input type="text" id="productPrice" data-i18n-ph="product_price_ph" placeholder="e.g. ৳ ১,০৬০ (৳ ১,৪৭০) 28% OFF" value="">
</div>
<div class="form-group">
<label for="customBadgeInput" data-i18n="product_badge_label">কাস্টম ব্যাজ টেক্সট (Trust Badge):</label>
<input type="text" id="customBadgeInput" data-i18n-ph="product_badge_ph" placeholder="e.g. 🛡️ 100% Original Guarantee" value="🛡️ 100% Original Guarantee">
<input type="text" id="customBadgeInput" data-i18n-ph="product_badge_ph" placeholder="e.g. 🛡️ 100% Original Guarantee" value="">
</div>
</div>
@@ -348,13 +342,7 @@
<span data-i18n="multi_combos_label">🎁 ট্রেন্ডিং মাল্টি-প্যাক কম্বো (1-Click Multi Combos):</span>
<span style="font-size:10.5px; color:var(--primary); font-weight:600;" data-i18n="multi_combos_badge">Full Catalog Combos</span>
</label>
<div class="trending-chips-bar" id="multiComboChips">
<button type="button" class="trend-chip active" data-combo="kbeauty_4">🌸 K-Beauty 4-Pack</button>
<button type="button" class="trend-chip" data-combo="panjabi_3">👑 Royal Panjabi Trio</button>
<button type="button" class="trend-chip" data-combo="tech_3">📱 TechVolt Trio</button>
<button type="button" class="trend-chip" data-combo="organic_3">🍯 Pure Nature Trio</button>
<button type="button" class="trend-chip" data-combo="sneaker_4">👟 SneakerLab 4-Pack</button>
</div>
<div class="trending-chips-bar" id="multiComboChips"></div>
</div>
<!-- 4 Interactive Product Slots -->
@@ -370,10 +358,10 @@
<span id="slotPlaceholder1" style="font-size:11px; color:#64748B;" data-i18n="slot_placeholder_text">ছবি সিলেক্ট করুন</span>
</div>
<div class="slot-inputs-row">
<input type="text" id="slotTitle1" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="Medicube Collagen Jelly Cream">
<input type="text" id="slotPrice1" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="৳ ১,০৬০">
<input type="text" id="slotTitle1" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="">
<input type="text" id="slotPrice1" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="">
</div>
<input type="text" id="slotBadge1" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="🛡️ 100% Original">
<input type="text" id="slotBadge1" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="">
</div>
<!-- SLOT 2 -->
@@ -387,10 +375,10 @@
<span id="slotPlaceholder2" style="font-size:11px; color:#64748B;" data-i18n="slot_placeholder_text">ছবি সিলেক্ট করুন</span>
</div>
<div class="slot-inputs-row">
<input type="text" id="slotTitle2" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="Anua Heartleaf 77% Toner">
<input type="text" id="slotPrice2" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="৳ ১,৪৮০">
<input type="text" id="slotTitle2" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="">
<input type="text" id="slotPrice2" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="">
</div>
<input type="text" id="slotBadge2" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="🌿 Soothing Care">
<input type="text" id="slotBadge2" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="">
</div>
<!-- SLOT 3 -->
@@ -404,10 +392,10 @@
<span id="slotPlaceholder3" style="font-size:11px; color:#64748B;" data-i18n="slot_placeholder_text">ছবি সিলেক্ট করুন</span>
</div>
<div class="slot-inputs-row">
<input type="text" id="slotTitle3" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="COSRX Snail 96 Mucin Essence">
<input type="text" id="slotPrice3" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="৳ ১,৩৫০">
<input type="text" id="slotTitle3" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="">
<input type="text" id="slotPrice3" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="">
</div>
<input type="text" id="slotBadge3" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="✨ Glass Skin Glow">
<input type="text" id="slotBadge3" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="">
</div>
<!-- SLOT 4 -->
@@ -421,10 +409,10 @@
<span id="slotPlaceholder4" style="font-size:11px; color:#64748B;" data-i18n="slot_placeholder_text">ছবি সিলেক্ট করুন</span>
</div>
<div class="slot-inputs-row">
<input type="text" id="slotTitle4" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="Beauty of Joseon Sun Relief">
<input type="text" id="slotPrice4" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="৳ ১,১৫০">
<input type="text" id="slotTitle4" class="slot-input" data-i18n-ph="slot_title_ph" placeholder="প্রোডাক্ট নাম" value="">
<input type="text" id="slotPrice4" class="slot-input" data-i18n-ph="slot_price_ph" placeholder="মূল্য" value="">
</div>
<input type="text" id="slotBadge4" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="☀️ SPF50+ PA++++">
<input type="text" id="slotBadge4" class="slot-input" data-i18n-ph="slot_badge_ph" placeholder="ব্যাজ" value="">
</div>
</div>
</div>
@@ -649,11 +637,11 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
<div class="form-row">
<div class="form-group">
<label for="ugcProductName" data-i18n="ugc_prod_label">প্রডাক্টের নাম ও ব্র্যান্ড (Product):</label>
<input type="text" id="ugcProductName" data-i18n-ph="ugc_prod_ph" placeholder="e.g. Medicube Collagen Jelly Cream" value="Medicube Collagen Jelly Cream">
<input type="text" id="ugcProductName" data-i18n-ph="ugc_prod_ph" placeholder="e.g. Medicube Collagen Jelly Cream" value="">
</div>
<div class="form-group">
<label for="ugcTargetAudience" data-i18n="ugc_aud_label">টার্গেট অডিয়েন্স ও সমস্যা (Audience/Problem):</label>
<input type="text" id="ugcTargetAudience" data-i18n-ph="ugc_aud_ph" placeholder="e.g. যাদের ত্বক খসখসে ও রোদে পোড়া দাগ রয়েছে" value="যাদের ত্বক খসখসে ও রোদে পোড়া দাগ রয়েছে">
<input type="text" id="ugcTargetAudience" data-i18n-ph="ugc_aud_ph" placeholder="e.g. যাদের ত্বক খসখসে ও রোদে পোড়া দাগ রয়েছে" value="">
</div>
</div>
@@ -777,7 +765,7 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
<div class="form-group">
<label for="inboxStoreContext" data-i18n="inbox_store_label">দোকানের পলিসি ও হটলাইন (Store Info):</label>
<input type="text" id="inboxStoreContext" data-i18n-ph="inbox_store_ph" value="Store: Glamour's Touch (glamourstouch.com), Hotline: 01712-426871, 100% Authentic Korean Skincare, Delivery: Dhaka ৳70, Outside Dhaka ৳130, Free delivery on ৳2000+">
<input type="text" id="inboxStoreContext" data-i18n-ph="inbox_store_ph" value="">
</div>
<button id="generateInboxReplyBtn" class="btn-primary">
@@ -856,8 +844,8 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
<div class="form-group">
<label for="n8nWebhookInput" data-i18n="settings_webhook_label">n8n Auto-Post Webhook URL (Aura Ajentic AI):</label>
<input type="text" id="n8nWebhookInput" placeholder="https://n8n.auraajenticai.cloud/webhook/gt-auto-post" value="https://n8n.auraajenticai.cloud/webhook/gt-auto-post">
<small class="hint-text" data-i18n="settings_webhook_hint">Pre-configured with your n8n cloud instance at n8n.auraajenticai.cloud</small>
<input type="text" id="n8nWebhookInput" placeholder="আপনার অনুমোদিত n8n webhook URL" value="">
<small class="hint-text" data-i18n="settings_webhook_hint">নিজের workspace-এর অনুমোদিত webhook URL দিন।</small>
</div>
<button id="saveApiKeyBtn" class="btn-primary" data-i18n="btn_save_settings">
@@ -983,15 +971,7 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
</div>
<!-- Store Switcher Box Tabs -->
<div class="store-switcher-bar" id="storeSwitcherBar">
<button type="button" class="store-chip-btn active" data-store-id="glamourstouch">
<span>✨</span> Glamour's Touch (563)
</button>
<!-- Synced Store chips will be injected here -->
<button type="button" class="store-chip-btn add-store-btn" id="toggleSyncPanelBtn">
<span>➕</span> <span data-i18n="btn_sync_new_store">নতুন ক্লায়েন্ট স্টোর সিঙ্ক</span>
</button>
</div>
<div class="store-switcher-bar" id="storeSwitcherBar"></div>
<!-- Client URL Sync Input Panel (Collapsible) -->
<div id="storeSyncPanel" class="store-sync-panel hidden">
@@ -1024,11 +1004,11 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
<div id="storeInfoBanner" class="store-info-banner">
<div class="store-info-left">
<span id="activeStoreIcon">✨</span>
<strong id="activeStoreTitle">Glamour's Touch (GT)</strong>
<span id="activeStoreBadge" class="store-badge-tag">KOREAN COSMETICS</span>
<strong id="activeStoreTitle">আপনার workspace</strong>
<span id="activeStoreBadge" class="store-badge-tag">CATALOG</span>
</div>
<div style="display:flex; align-items:center; gap:8px;">
<a id="activeStoreUrlLink" href="https://glamourstouch.com" target="_blank" style="font-size:11px; color:#38BDF8; text-decoration:none;">🔗 Visit Store</a>
<a id="activeStoreUrlLink" target="_blank" rel="noopener noreferrer" style="font-size:11px; color:#38BDF8; text-decoration:none;">🔗 Visit Store</a>
<button type="button" id="deleteCurrentStoreBtn" class="btn-delete-store hidden" data-i18n="btn_delete_store">🗑️ মুছুন</button>
</div>
</div>
@@ -1052,7 +1032,7 @@ Format with clear bullet points, emojis, and a call-to-action.</textarea>
<!-- Hidden container for generating QR code SVG/Canvas -->
<div id="qrcodeHidden" style="display:none;"></div>
<script src="app.js?v=8"></script>
<script src="workspace.js?v=1"></script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {