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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>ARIA COSMETIC | CMS</title>
|
| 7 |
+
|
| 8 |
+
<!-- Tailwind CSS -->
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
|
| 11 |
+
<!-- Google Fonts -->
|
| 12 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 13 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 14 |
+
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap" rel="stylesheet">
|
| 15 |
+
|
| 16 |
+
<!-- Font Awesome -->
|
| 17 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 18 |
+
|
| 19 |
+
<!-- Chart.js -->
|
| 20 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 21 |
+
|
| 22 |
+
<script>
|
| 23 |
+
tailwind.config = {
|
| 24 |
+
theme: {
|
| 25 |
+
extend: {
|
| 26 |
+
colors: {
|
| 27 |
+
brand: {
|
| 28 |
+
red: '#D90429', // Angel's Liquid Red
|
| 29 |
+
dark: '#2B2D42',
|
| 30 |
+
light: '#EDF2F4',
|
| 31 |
+
gray: '#8D99AE'
|
| 32 |
+
}
|
| 33 |
+
},
|
| 34 |
+
fontFamily: {
|
| 35 |
+
serif: ['"Playfair Display"', 'serif'],
|
| 36 |
+
sans: ['"DM Sans"', 'sans-serif'],
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
</script>
|
| 42 |
+
|
| 43 |
+
<style>
|
| 44 |
+
body {
|
| 45 |
+
font-family: 'DM Sans', sans-serif;
|
| 46 |
+
background-color: #f8f9fa;
|
| 47 |
+
}
|
| 48 |
+
h1, h2, h3, h4, h5, h6, .font-serif {
|
| 49 |
+
font-family: 'Playfair Display', serif;
|
| 50 |
+
}
|
| 51 |
+
.glass-panel {
|
| 52 |
+
background: rgba(255, 255, 255, 0.95);
|
| 53 |
+
backdrop-filter: blur(10px);
|
| 54 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 55 |
+
}
|
| 56 |
+
.nav-item.active {
|
| 57 |
+
background-color: #D90429;
|
| 58 |
+
color: white;
|
| 59 |
+
box-shadow: 0 4px 6px -1px rgba(217, 4, 41, 0.3);
|
| 60 |
+
}
|
| 61 |
+
.fade-in {
|
| 62 |
+
animation: fadeIn 0.5s ease-in-out;
|
| 63 |
+
}
|
| 64 |
+
@keyframes fadeIn {
|
| 65 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 66 |
+
to { opacity: 1; transform: translateY(0); }
|
| 67 |
+
}
|
| 68 |
+
/* Custom Scrollbar */
|
| 69 |
+
::-webkit-scrollbar {
|
| 70 |
+
width: 8px;
|
| 71 |
+
}
|
| 72 |
+
::-webkit-scrollbar-track {
|
| 73 |
+
background: #f1f1f1;
|
| 74 |
+
}
|
| 75 |
+
::-webkit-scrollbar-thumb {
|
| 76 |
+
background: #D90429;
|
| 77 |
+
border-radius: 4px;
|
| 78 |
+
}
|
| 79 |
+
::-webkit-scrollbar-thumb:hover {
|
| 80 |
+
background: #b10322;
|
| 81 |
+
}
|
| 82 |
+
.loader {
|
| 83 |
+
border-top-color: #D90429;
|
| 84 |
+
-webkit-animation: spinner 1.5s linear infinite;
|
| 85 |
+
animation: spinner 1.5s linear infinite;
|
| 86 |
+
}
|
| 87 |
+
@keyframes spinner {
|
| 88 |
+
0% { transform: rotate(0deg); }
|
| 89 |
+
100% { transform: rotate(360deg); }
|
| 90 |
+
}
|
| 91 |
+
</style>
|
| 92 |
+
</head>
|
| 93 |
+
<body class="text-gray-800 h-screen flex overflow-hidden">
|
| 94 |
+
|
| 95 |
+
<!-- Sidebar -->
|
| 96 |
+
<aside class="w-64 bg-white border-r border-gray-200 flex-col hidden md:flex z-20 shadow-lg">
|
| 97 |
+
<div class="h-20 flex items-center justify-center border-b border-gray-100">
|
| 98 |
+
<div class="flex items-center gap-2">
|
| 99 |
+
<div class="w-8 h-8 bg-brand-red rounded-full flex items-center justify-center text-white font-serif font-bold text-xl">A</div>
|
| 100 |
+
<span class="font-serif text-2xl font-bold text-gray-900 tracking-tight">ARIA <span class="text-brand-red">CMS</span></span>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<nav class="flex-1 py-6 px-3 space-y-1 overflow-y-auto">
|
| 105 |
+
<button onclick="router('dashboard')" id="nav-dashboard" class="nav-item active w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 106 |
+
<i class="fa-solid fa-chart-pie w-5"></i> Dashboard
|
| 107 |
+
</button>
|
| 108 |
+
<button onclick="router('products')" id="nav-products" class="nav-item w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 109 |
+
<i class="fa-solid fa-pump-soap w-5"></i> Products
|
| 110 |
+
</button>
|
| 111 |
+
<button onclick="router('add-product')" id="nav-add-product" class="nav-item w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 112 |
+
<i class="fa-solid fa-plus-circle w-5"></i> Add Product
|
| 113 |
+
</button>
|
| 114 |
+
<button onclick="router('certificates')" id="nav-certificates" class="nav-item w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 115 |
+
<i class="fa-solid fa-certificate w-5"></i> Certificates
|
| 116 |
+
</button>
|
| 117 |
+
<button onclick="router('about')" id="nav-about" class="nav-item w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 118 |
+
<i class="fa-solid fa-building w-5"></i> Company
|
| 119 |
+
</button>
|
| 120 |
+
<button onclick="router('support')" id="nav-support" class="nav-item w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-xl transition-all duration-200 text-gray-600 hover:bg-gray-50 hover:text-brand-red">
|
| 121 |
+
<i class="fa-solid fa-headset w-5"></i> Support
|
| 122 |
+
</button>
|
| 123 |
+
</nav>
|
| 124 |
+
|
| 125 |
+
<div class="p-4 border-t border-gray-100">
|
| 126 |
+
<div class="flex items-center gap-3">
|
| 127 |
+
<img src="https://ui-avatars.com/api/?name=Admin+User&background=D90429&color=fff" class="w-10 h-10 rounded-full border-2 border-white shadow-sm" alt="Admin">
|
| 128 |
+
<div>
|
| 129 |
+
<p class="text-sm font-bold text-gray-900">Admin User</p>
|
| 130 |
+
<p class="text-xs text-gray-500">Regulatory Manager</p>
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
</aside>
|
| 135 |
+
|
| 136 |
+
<!-- Main Content -->
|
| 137 |
+
<main class="flex-1 flex flex-col h-screen overflow-hidden relative">
|
| 138 |
+
<!-- Top Header (Mobile Toggle & Search) -->
|
| 139 |
+
<header class="h-20 bg-white border-b border-gray-200 flex items-center justify-between px-6 lg:px-10 z-10">
|
| 140 |
+
<div class="flex items-center gap-4 md:hidden">
|
| 141 |
+
<button class="text-gray-600 hover:text-brand-red"><i class="fa-solid fa-bars text-xl"></i></button>
|
| 142 |
+
<span class="font-serif font-bold text-xl">ARIA</span>
|
| 143 |
+
</div>
|
| 144 |
+
|
| 145 |
+
<div class="hidden md:flex items-center text-gray-400 bg-gray-50 px-4 py-2 rounded-full w-96 border border-gray-200 focus-within:border-brand-red focus-within:ring-1 focus-within:ring-brand-red transition-all">
|
| 146 |
+
<i class="fa-solid fa-search mr-3"></i>
|
| 147 |
+
<input type="text" id="global-search" placeholder="Search products, ingredients..." class="bg-transparent border-none outline-none text-sm w-full text-gray-700 placeholder-gray-400">
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<div class="flex items-center gap-4">
|
| 151 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="hidden lg:block text-xs font-medium text-gray-500 hover:text-brand-red transition-colors">
|
| 152 |
+
Built with anycoder
|
| 153 |
+
</a>
|
| 154 |
+
<button class="relative p-2 text-gray-400 hover:text-brand-red transition-colors">
|
| 155 |
+
<i class="fa-solid fa-bell text-xl"></i>
|
| 156 |
+
<span class="absolute top-1 right-1 w-2 h-2 bg-brand-red rounded-full border border-white"></span>
|
| 157 |
+
</button>
|
| 158 |
+
</div>
|
| 159 |
+
</header>
|
| 160 |
+
|
| 161 |
+
<!-- Dynamic Content Area -->
|
| 162 |
+
<div id="app-content" class="flex-1 overflow-y-auto p-6 lg:p-10 bg-gray-50 relative">
|
| 163 |
+
<!-- Views will be injected here -->
|
| 164 |
+
</div>
|
| 165 |
+
</main>
|
| 166 |
+
|
| 167 |
+
<!-- Toast Notification -->
|
| 168 |
+
<div id="toast" class="fixed bottom-5 right-5 bg-gray-900 text-white px-6 py-4 rounded-lg shadow-2xl transform translate-y-20 opacity-0 transition-all duration-300 z-50 flex items-center gap-3">
|
| 169 |
+
<i class="fa-solid fa-check-circle text-green-400"></i>
|
| 170 |
+
<span id="toast-msg">Operation successful</span>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<!-- JavaScript Application Logic -->
|
| 174 |
+
<script>
|
| 175 |
+
// --- Mock Data & State ---
|
| 176 |
+
const state = {
|
| 177 |
+
currentView: 'dashboard',
|
| 178 |
+
products: [
|
| 179 |
+
{
|
| 180 |
+
id: 1,
|
| 181 |
+
name: "Angel's Liquid Red Serum",
|
| 182 |
+
brand: "ARIA",
|
| 183 |
+
series: "Premium",
|
| 184 |
+
category: "Serum",
|
| 185 |
+
skinType: "All",
|
| 186 |
+
price: 45.00,
|
| 187 |
+
stock: 120,
|
| 188 |
+
inci: "Water, Niacinamide, Hyaluronic Acid, Red Ginseng Extract",
|
| 189 |
+
cpnp: "CPNP-2023-001",
|
| 190 |
+
rp: "ARIA Cosmetic EU GmbH",
|
| 191 |
+
image: "https://images.unsplash.com/photo-1620916566398-39f1143ab7be?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80",
|
| 192 |
+
expiry: "2025-12-01",
|
| 193 |
+
pao: "12M"
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
id: 2,
|
| 197 |
+
name: "Hydra Glow Moisturizer",
|
| 198 |
+
brand: "ARIA",
|
| 199 |
+
series: "Daily",
|
| 200 |
+
category: "Moisturizer",
|
| 201 |
+
skinType: "Dry",
|
| 202 |
+
price: 32.50,
|
| 203 |
+
stock: 85,
|
| 204 |
+
inci: "Aqua, Glycerin, Ceramide NP, Squalane",
|
| 205 |
+
cpnp: "CPNP-2023-042",
|
| 206 |
+
rp: "ARIA Cosmetic EU GmbH",
|
| 207 |
+
image: "https://images.unsplash.com/photo-1556228720-19875c4b84b2?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80",
|
| 208 |
+
expiry: "2026-05-15",
|
| 209 |
+
pao: "6M"
|
| 210 |
+
},
|
| 211 |
+
{
|
| 212 |
+
id: 3,
|
| 213 |
+
name: "Pure Clean Foaming Wash",
|
| 214 |
+
brand: "ARIA",
|
| 215 |
+
series: "Daily",
|
| 216 |
+
category: "Cleanser",
|
| 217 |
+
skinType: "Oily",
|
| 218 |
+
price: 24.00,
|
| 219 |
+
stock: 200,
|
| 220 |
+
inci: "Water, Coco-Glucoside, Salicylic Acid, Tea Tree Oil",
|
| 221 |
+
cpnp: "CPNP-2023-089",
|
| 222 |
+
rp: "ARIA Cosmetic EU GmbH",
|
| 223 |
+
image: "https://images.unsplash.com/photo-1556228578-0d85b1a4d571?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80",
|
| 224 |
+
expiry: "2025-08-20",
|
| 225 |
+
pao: "12M"
|
| 226 |
+
},
|
| 227 |
+
{
|
| 228 |
+
id: 4,
|
| 229 |
+
name: "Midnight Repair Cream",
|
| 230 |
+
brand: "ARIA",
|
| 231 |
+
series: "Night",
|
| 232 |
+
category: "Cream",
|
| 233 |
+
skinType: "Mature",
|
| 234 |
+
price: 58.00,
|
| 235 |
+
stock: 45,
|
| 236 |
+
inci: "Retinol, Peptides, Shea Butter, Jojoba Oil",
|
| 237 |
+
cpnp: "CPNP-2024-010",
|
| 238 |
+
rp: "ARIA Cosmetic EU GmbH",
|
| 239 |
+
image: "https://images.unsplash.com/photo-1616683693504-3ea7e9ad6fec?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80",
|
| 240 |
+
expiry: "2025-11-30",
|
| 241 |
+
pao: "6M"
|
| 242 |
+
}
|
| 243 |
+
],
|
| 244 |
+
certificates: [
|
| 245 |
+
{ id: 1, name: "ISO 22716 (GMP)", authority: "Bureau Veritas", date: "2023-01-15", type: "pdf" },
|
| 246 |
+
{ id: 2, name: "Vegan Society Certified", authority: "The Vegan Society", date: "2023-06-20", type: "img" },
|
| 247 |
+
{ id: 3, name: "Leaping Bunny Approved", authority: "CCIC", date: "2023-03-10", type: "pdf" },
|
| 248 |
+
{ id: 4, name: "ECOCERT Organic", authority: "ECOCERT", date: "2022-11-05", type: "img" }
|
| 249 |
+
]
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
+
// --- Router ---
|
| 253 |
+
function router(view) {
|
| 254 |
+
state.currentView = view;
|
| 255 |
+
|
| 256 |
+
// Update Nav UI
|
| 257 |
+
document.querySelectorAll('.nav-item').forEach(el => el.classList.remove('active', 'bg-brand-red', 'text-white', 'shadow-lg'));
|
| 258 |
+
document.querySelectorAll('.nav-item').forEach(el => el.classList.add('text-gray-600'));
|
| 259 |
+
|
| 260 |
+
const activeNav = document.getElementById(`nav-${view}`);
|
| 261 |
+
if(activeNav) {
|
| 262 |
+
activeNav.classList.add('active');
|
| 263 |
+
activeNav.classList.remove('text-gray-600');
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
const content = document.getElementById('app-content');
|
| 267 |
+
content.innerHTML = ''; // Clear current view
|
| 268 |
+
content.classList.remove('fade-in');
|
| 269 |
+
void content.offsetWidth; // Trigger reflow
|
| 270 |
+
content.classList.add('fade-in');
|
| 271 |
+
|
| 272 |
+
switch(view) {
|
| 273 |
+
case 'dashboard': renderDashboard(); break;
|
| 274 |
+
case 'products': renderProducts(); break;
|
| 275 |
+
case 'add-product': renderAddProduct(); break;
|
| 276 |
+
case 'certificates': renderCertificates(); break;
|
| 277 |
+
case 'about': renderAbout(); break;
|
| 278 |
+
case 'support': renderSupport(); break;
|
| 279 |
+
default: renderDashboard();
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
// --- Render Functions ---
|
| 284 |
+
|
| 285 |
+
function renderDashboard() {
|
| 286 |
+
const totalProducts = state.products.length;
|
| 287 |
+
const lowStock = state.products.filter(p => p.stock < 50).length;
|
| 288 |
+
|
| 289 |
+
const html = `
|
| 290 |
+
<div class="space-y-8">
|
| 291 |
+
<div class="flex justify-between items-end">
|
| 292 |
+
<div>
|
| 293 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900">Dashboard</h2>
|
| 294 |
+
<p class="text-gray-500 mt-1">Welcome back, here's what's happening today.</p>
|
| 295 |
+
</div>
|
| 296 |
+
<button onclick="router('add-product')" class="bg-brand-red hover:bg-red-700 text-white px-6 py-2.5 rounded-lg shadow-lg shadow-red-200 transition-all flex items-center gap-2">
|
| 297 |
+
<i class="fa-solid fa-plus"></i> New Product
|
| 298 |
+
</button>
|
| 299 |
+
</div>
|
| 300 |
+
|
| 301 |
+
<!-- Stats Grid -->
|
| 302 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
| 303 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 304 |
+
<div>
|
| 305 |
+
<p class="text-sm text-gray-500 font-medium">Total Products</p>
|
| 306 |
+
<h3 class="text-3xl font-bold text-gray-900 mt-1">${totalProducts}</h3>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl">
|
| 309 |
+
<i class="fa-solid fa-box-open"></i>
|
| 310 |
+
</div>
|
| 311 |
+
</div>
|
| 312 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 313 |
+
<div>
|
| 314 |
+
<p class="text-sm text-gray-500 font-medium">Low Stock Alerts</p>
|
| 315 |
+
<h3 class="text-3xl font-bold text-brand-red mt-1">${lowStock}</h3>
|
| 316 |
+
</div>
|
| 317 |
+
<div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl">
|
| 318 |
+
<i class="fa-solid fa-triangle-exclamation"></i>
|
| 319 |
+
</div>
|
| 320 |
+
</div>
|
| 321 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 322 |
+
<div>
|
| 323 |
+
<p class="text-sm text-gray-500 font-medium">Compliance Rate</p>
|
| 324 |
+
<h3 class="text-3xl font-bold text-green-600 mt-1">100%</h3>
|
| 325 |
+
</div>
|
| 326 |
+
<div class="w-12 h-12 bg-green-50 rounded-full flex items-center justify-center text-green-600 text-xl">
|
| 327 |
+
<i class="fa-solid fa-shield-check"></i>
|
| 328 |
+
</div>
|
| 329 |
+
</div>
|
| 330 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 331 |
+
<div>
|
| 332 |
+
<p class="text-sm text-gray-500 font-medium">Active Certs</p>
|
| 333 |
+
<h3 class="text-3xl font-bold text-blue-600 mt-1">${state.certificates.length}</h3>
|
| 334 |
+
</div>
|
| 335 |
+
<div class="w-12 h-12 bg-blue-50 rounded-full flex items-center justify-center text-blue-600 text-xl">
|
| 336 |
+
<i class="fa-solid fa-award"></i>
|
| 337 |
+
</div>
|
| 338 |
+
</div>
|
| 339 |
+
</div>
|
| 340 |
+
|
| 341 |
+
<!-- Charts Section -->
|
| 342 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 343 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 lg:col-span-2">
|
| 344 |
+
<h3 class="font-serif font-bold text-lg mb-4">Inventory Distribution</h3>
|
| 345 |
+
<canvas id="inventoryChart" height="100"></canvas>
|
| 346 |
+
</div>
|
| 347 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100">
|
| 348 |
+
<h3 class="font-serif font-bold text-lg mb-4">Recent Activity</h3>
|
| 349 |
+
<div class="space-y-4">
|
| 350 |
+
<div class="flex items-start gap-3">
|
| 351 |
+
<div class="w-2 h-2 mt-2 rounded-full bg-brand-red"></div>
|
| 352 |
+
<div>
|
| 353 |
+
<p class="text-sm font-medium text-gray-900">Added "Midnight Repair Cream"</p>
|
| 354 |
+
<p class="text-xs text-gray-500">2 hours ago</p>
|
| 355 |
+
</div>
|
| 356 |
+
</div>
|
| 357 |
+
<div class="flex items-start gap-3">
|
| 358 |
+
<div class="w-2 h-2 mt-2 rounded-full bg-gray-300"></div>
|
| 359 |
+
<div>
|
| 360 |
+
<p class="text-sm font-medium text-gray-900">Updated ISO Certificate</p>
|
| 361 |
+
<p class="text-xs text-gray-500">Yesterday</p>
|
| 362 |
+
</div>
|
| 363 |
+
</div>
|
| 364 |
+
<div class="flex items-start gap-3">
|
| 365 |
+
<div class="w-2 h-2 mt-2 rounded-full bg-gray-300"></div>
|
| 366 |
+
<div>
|
| 367 |
+
<p class="text-sm font-medium text-gray-900">Stock check: Serum Series</p>
|
| 368 |
+
<p class="text-xs text-gray-500">3 days ago</p>
|
| 369 |
+
</div>
|
| 370 |
+
</div>
|
| 371 |
+
</div>
|
| 372 |
+
</div>
|
| 373 |
+
</div>
|
| 374 |
+
</div>
|
| 375 |
+
`;
|
| 376 |
+
document.getElementById('app-content').innerHTML = html;
|
| 377 |
+
|
| 378 |
+
// Initialize Chart
|
| 379 |
+
setTimeout(() => {
|
| 380 |
+
const ctx = document.getElementById('inventoryChart').getContext('2d');
|
| 381 |
+
new Chart(ctx, {
|
| 382 |
+
type: 'bar',
|
| 383 |
+
data: {
|
| 384 |
+
labels: state.products.map(p => p.name),
|
| 385 |
+
datasets: [{
|
| 386 |
+
label: 'Stock Level',
|
| 387 |
+
data: state.products.map(p => p.stock),
|
| 388 |
+
backgroundColor: '#D90429',
|
| 389 |
+
borderRadius: 6,
|
| 390 |
+
}]
|
| 391 |
+
},
|
| 392 |
+
options: {
|
| 393 |
+
responsive: true,
|
| 394 |
+
scales: {
|
| 395 |
+
y: { beginAtZero: true, grid: { display: false } },
|
| 396 |
+
x: { grid: { display: false } }
|
| 397 |
+
},
|
| 398 |
+
plugins: { legend: { display: false } }
|
| 399 |
+
}
|
| 400 |
+
});
|
| 401 |
+
}, 100);
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
function renderProducts() {
|
| 405 |
+
let html = `
|
| 406 |
+
<div class="space-y-6">
|
| 407 |
+
<div class="flex flex-col md:flex-row justify-between items-center gap-4">
|
| 408 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900">Product Inventory</h2>
|
| 409 |
+
<div class="flex gap-3 w-full md:w-auto">
|
| 410 |
+
<select id="filter-category" onchange="filterProducts()" class="bg-white border border-gray-300 text-gray-700 text-sm rounded-lg focus:ring-brand-red focus:border-brand-red block p-2.5">
|
| 411 |
+
<option value="All">All Categories</option>
|
| 412 |
+
<option value="Serum">Serum</option>
|
| 413 |
+
<option value="Moisturizer">Moisturizer</option>
|
| 414 |
+
<option value="Cleanser">Cleanser</option>
|
| 415 |
+
</select>
|
| 416 |
+
<button onclick="router('add-product')" class="bg-brand-red text-white px-4 py-2 rounded-lg hover:bg-red-700 transition shadow-md">
|
| 417 |
+
<i class="fa-solid fa-plus"></i> Add
|
| 418 |
+
</button>
|
| 419 |
+
</div>
|
| 420 |
+
</div>
|
| 421 |
+
|
| 422 |
+
<div id="product-grid" class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6">
|
| 423 |
+
<!-- Products injected here -->
|
| 424 |
+
</div>
|
| 425 |
+
</div>
|
| 426 |
+
`;
|
| 427 |
+
document.getElementById('app-content').innerHTML = html;
|
| 428 |
+
renderProductGrid(state.products);
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
function renderProductGrid(products) {
|
| 432 |
+
const grid = document.getElementById('product-grid');
|
| 433 |
+
if(products.length === 0) {
|
| 434 |
+
grid.innerHTML = `<div class="col-span-full text-center py-20 text-gray-500">No products found matching your criteria.</div>`;
|
| 435 |
+
return;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
grid.innerHTML = products.map(p => `
|
| 439 |
+
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden hover:shadow-xl transition-all duration-300 group">
|
| 440 |
+
<div class="h-48 overflow-hidden relative">
|
| 441 |
+
<img src="${p.image}" alt="${p.name}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
|
| 442 |
+
<div class="absolute top-3 right-3 bg-white/90 backdrop-blur px-2 py-1 rounded-md text-xs font-bold text-gray-800 shadow-sm">
|
| 443 |
+
${p.category}
|
| 444 |
+
</div>
|
| 445 |
+
</div>
|
| 446 |
+
<div class="p-5">
|
| 447 |
+
<div class="flex justify-between items-start mb-2">
|
| 448 |
+
<div>
|
| 449 |
+
<p class="text-xs text-brand-red font-bold uppercase tracking-wider">${p.brand}</p>
|
| 450 |
+
<h3 class="font-serif text-xl font-bold text-gray-900 leading-tight">${p.name}</h3>
|
| 451 |
+
</div>
|
| 452 |
+
<span class="font-sans font-bold text-gray-900">$${p.price.toFixed(2)}</span>
|
| 453 |
+
</div>
|
| 454 |
+
|
| 455 |
+
<div class="flex flex-wrap gap-2 my-3">
|
| 456 |
+
<span class="px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded-md">${p.skinType} Skin</span>
|
| 457 |
+
<span class="px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded-md">PAO: ${p.pao}</span>
|
| 458 |
+
</div>
|
| 459 |
+
|
| 460 |
+
<div class="border-t border-gray-100 pt-4 mt-2">
|
| 461 |
+
<div class="flex justify-between items-center text-xs text-gray-500 mb-2">
|
| 462 |
+
<span>Stock: <b class="${p.stock < 50 ? 'text-brand-red' : 'text-green-600'}">${p.stock} units</b></span>
|
| 463 |
+
<span>CPNP: ${p.cpnp}</span>
|
| 464 |
+
</div>
|
| 465 |
+
<button onclick="alert('View details for ${p.name}')" class="w-full py-2 border border-gray-200 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-brand-red transition-colors">
|
| 466 |
+
View Details
|
| 467 |
+
</button>
|
| 468 |
+
</div>
|
| 469 |
+
</div>
|
| 470 |
+
</div>
|
| 471 |
+
`).join('');
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
function filterProducts() {
|
| 475 |
+
const cat = document.getElementById('filter-category').value;
|
| 476 |
+
const filtered = cat === 'All' ? state.products : state.products.filter(p => p.category === cat);
|
| 477 |
+
renderProductGrid(filtered);
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
function renderAddProduct() {
|
| 481 |
+
const html = `
|
| 482 |
+
<div class="max-w-4xl mx-auto">
|
| 483 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900 mb-6">Add New Product</h2>
|
| 484 |
+
|
| 485 |
+
<form id="product-form" onsubmit="handleProductSubmit(event)" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 space-y-6">
|
| 486 |
+
|
| 487 |
+
<!-- AI Assistant -->
|
| 488 |
+
<div class="bg-blue-50 border border-blue-100 rounded-xl p-4 flex items-start gap-4 mb-6">
|
| 489 |
+
<div class="bg-blue-100 p-2 rounded-lg text-blue-600">
|
| 490 |
+
<i class="fa-solid fa-wand-magic-sparkles"></i>
|
| 491 |
+
</div>
|
| 492 |
+
<div class="flex-1">
|
| 493 |
+
<h4 class="font-bold text-blue-900 text-sm">AI Assistant</h4>
|
| 494 |
+
<p class="text-xs text-blue-700 mb-2">Enter the product name below and click "Generate" to auto-create SEO title, description, and regulatory warnings.</p>
|
| 495 |
+
<div class="flex gap-2">
|
| 496 |
+
<input type="text" id="ai-input" placeholder="e.g. Vitamin C Brightening Serum" class="flex-1 text-sm border-blue-200 rounded-md px-3 py-1.5 focus:ring-2 focus:ring-blue-400 outline-none">
|
| 497 |
+
<button type="button" onclick="generateAIContent()" class="bg-blue-600 text-white text-xs px-4 py-1.5 rounded-md hover:bg-blue-700 transition">Generate</button>
|
| 498 |
+
</div>
|
| 499 |
+
</div>
|
| 500 |
+
</div>
|
| 501 |
+
|
| 502 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 503 |
+
<div class="space-y-2">
|
| 504 |
+
<label class="text-sm font-bold text-gray-700">Product Name</label>
|
| 505 |
+
<input type="text" name="name" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red focus:ring-1 focus:ring-brand-red outline-none transition">
|
| 506 |
+
</div>
|
| 507 |
+
<div class="space-y-2">
|
| 508 |
+
<label class="text-sm font-bold text-gray-700">Brand</label>
|
| 509 |
+
<input type="text" name="brand" value="ARIA" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red focus:ring-1 focus:ring-brand-red outline-none transition">
|
| 510 |
+
</div>
|
| 511 |
+
</div>
|
| 512 |
+
|
| 513 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 514 |
+
<div class="space-y-2">
|
| 515 |
+
<label class="text-sm font-bold text-gray-700">Category</label>
|
| 516 |
+
<select name="category" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 517 |
+
<option>Serum</option>
|
| 518 |
+
<option>Moisturizer</option>
|
| 519 |
+
<option>Cleanser</option>
|
| 520 |
+
<option>Cream</option>
|
| 521 |
+
</select>
|
| 522 |
+
</div>
|
| 523 |
+
<div class="space-y-2">
|
| 524 |
+
<label class="text-sm font-bold text-gray-700">Skin Type</label>
|
| 525 |
+
<select name="skinType" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 526 |
+
<option>All</option>
|
| 527 |
+
<option>Dry</option>
|
| 528 |
+
<option>Oily</option>
|
| 529 |
+
<option>Sensitive</option>
|
| 530 |
+
<option>Mature</option>
|
| 531 |
+
</select>
|
| 532 |
+
</div>
|
| 533 |
+
<div class="space-y-2">
|
| 534 |
+
<label class="text-sm font-bold text-gray-700">Price ($)</label>
|
| 535 |
+
<input type="number" name="price" step="0.01" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 536 |
+
</div>
|
| 537 |
+
</div>
|
| 538 |
+
|
| 539 |
+
<div class="space-y-2">
|
| 540 |
+
<label class="text-sm font-bold text-gray-700">INCI Ingredients (Comma separated)</label>
|
| 541 |
+
<textarea name="inci" rows="2" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none text-sm"></textarea>
|
| 542 |
+
</div>
|
| 543 |
+
|
| 544 |
+
<div class="border-t border-gray-100 pt-6 mt-6">
|
| 545 |
+
<h3 class="font-serif font-bold text-lg mb-4 text-gray-800">Regulatory Information</h3>
|
| 546 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 547 |
+
<div class="space-y-2">
|
| 548 |
+
<label class="text-sm font-bold text-gray-700">CPNP Number</label>
|
| 549 |
+
<input type="text" name="cpnp" placeholder="e.g. CPNP-2024-XXX" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 550 |
+
</div>
|
| 551 |
+
<div class="space-y-2">
|
| 552 |
+
<label class="text-sm font-bold text-gray-700">Responsible Person (RP)</label>
|
| 553 |
+
<input type="text" name="rp" value="ARIA Cosmetic EU GmbH" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 554 |
+
</div>
|
| 555 |
+
<div class="space-y-2">
|
| 556 |
+
<label class="text-sm font-bold text-gray-700">Expiry Date</label>
|
| 557 |
+
<input type="date" name="expiry" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 558 |
+
</div>
|
| 559 |
+
<div class="space-y-2">
|
| 560 |
+
<label class="text-sm font-bold text-gray-700">Period After Opening (PAO)</label>
|
| 561 |
+
<select name="pao" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 562 |
+
<option>6M</option>
|
| 563 |
+
<option>12M</option>
|
| 564 |
+
<option>24M</option>
|
| 565 |
+
</select>
|
| 566 |
+
</div>
|
| 567 |
+
</div>
|
| 568 |
+
</div>
|
| 569 |
+
|
| 570 |
+
<div class="pt-6 flex justify-end gap-4">
|
| 571 |
+
<button type="button" onclick="router('products')" class="px-6 py-2.5 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 font-medium transition">Cancel</button>
|
| 572 |
+
<button type="submit" class="px-6 py-2.5 bg-brand-red text-white rounded-lg hover:bg-red-700 font-medium shadow-lg shadow-red-200 transition transform active:scale-95">Save Product</button>
|
| 573 |
+
</div>
|
| 574 |
+
</form>
|
| 575 |
+
</div>
|
| 576 |
+
`;
|
| 577 |
+
document.getElementById('app-content').innerHTML = html;
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
function generateAIContent() {
|
| 581 |
+
const input = document.getElementById('ai-input').value;
|
| 582 |
+
if(!input) return showToast('Please enter a product name first', 'error');
|
| 583 |
+
|
| 584 |
+
// Simulate AI Loading
|
| 585 |
+
const btn = document.querySelector('button[onclick="generateAIContent()"]');
|
| 586 |
+
const originalText = btn.innerText;
|
| 587 |
+
btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>';
|
| 588 |
+
btn.disabled = true;
|
| 589 |
+
|
| 590 |
+
setTimeout(() => {
|
| 591 |
+
// Mock AI Response
|
| 592 |
+
const form = document.getElementById('product-form');
|
| 593 |
+
form.name.value = input;
|
| 594 |
+
form.inci.value = "Aqua, Glycerin, Niacinamide, Hyaluronic Acid, [AI Generated Base]";
|
| 595 |
+
|
| 596 |
+
showToast('AI generated content applied!');
|
| 597 |
+
btn.innerText = originalText;
|
| 598 |
+
btn.disabled = false;
|
| 599 |
+
}, 1500);
|
| 600 |
+
}
|
| 601 |
+
|
| 602 |
+
function handleProductSubmit(e) {
|
| 603 |
+
e.preventDefault();
|
| 604 |
+
const formData = new FormData(e.target);
|
| 605 |
+
const newProduct = {
|
| 606 |
+
id: Date.now(),
|
| 607 |
+
name: formData.get('name'),
|
| 608 |
+
brand: formData.get('brand'),
|
| 609 |
+
category: formData.get('category'),
|
| 610 |
+
skinType: formData.get('skinType'),
|
| 611 |
+
price: parseFloat(formData.get('price')),
|
| 612 |
+
stock: 0, // Default
|
| 613 |
+
inci: formData.get('inci'),
|
| 614 |
+
cpnp: formData.get('cpnp'),
|
| 615 |
+
rp: formData.get('rp'),
|
| 616 |
+
image: "https://images.unsplash.com/photo-1608248597279-f99d160bfbc8?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", // Placeholder
|
| 617 |
+
expiry: formData.get('expiry'),
|
| 618 |
+
pao: formData.get('pao')
|
| 619 |
+
};
|
| 620 |
+
|
| 621 |
+
state.products.unshift(newProduct);
|
| 622 |
+
showToast('Product added successfully!');
|
| 623 |
+
router('products');
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
function renderCertificates() {
|
| 627 |
+
const html = `
|
| 628 |
+
<div class="space-y-8">
|
| 629 |
+
<div class="flex justify-between items-center">
|
| 630 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900">Certifications</h2>
|
| 631 |
+
<button class="bg-brand-red text-white px-4 py-2 rounded-lg hover:bg-red-700 transition shadow-md">
|
| 632 |
+
<i class="fa-solid fa-upload"></i> Upload New
|
| 633 |
+
</button>
|
| 634 |
+
</div>
|
| 635 |
+
|
| 636 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 637 |
+
${state.certificates.map(cert => `
|
| 638 |
+
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:border-brand-red transition-colors group cursor-pointer">
|
| 639 |
+
<div class="flex items-start justify-between mb-4">
|
| 640 |
+
<div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl group-hover:scale-110 transition-transform">
|
| 641 |
+
<i class="fa-solid ${cert.type === 'pdf' ? 'fa-file-pdf' : 'fa-image'}"></i>
|
| 642 |
+
</div>
|
| 643 |
+
<span class="text-xs font-bold text-gray-400 bg-gray-50 px-2 py-1 rounded">${cert.date}</span>
|
| 644 |
+
</div>
|
| 645 |
+
<h3 class="font-serif font-bold text-lg text-gray-900 mb-1">${cert.name}</h3>
|
| 646 |
+
<p class="text-sm text-gray-500 mb-4">Issued by: <span class="font-medium text-gray-700">${cert.authority}</span></p>
|
| 647 |
+
<button class="w-full py-2 text-sm text-brand-red border border-brand-red/20 rounded-lg hover:bg-brand-red hover:text-white transition-colors">
|
| 648 |
+
View Document
|
| 649 |
+
</button>
|
| 650 |
+
</div>
|
| 651 |
+
`).join('')}
|
| 652 |
+
|
| 653 |
+
<!-- Add New Placeholder -->
|
| 654 |
+
<div class="border-2 border-dashed border-gray-300 rounded-2xl flex flex-col items-center justify-center p-6 text-gray-400 hover:border-brand-red hover:text-brand-red transition-colors cursor-pointer min-h-[250px]">
|
| 655 |
+
<i class="fa-solid fa-plus text-3xl mb-2"></i>
|
| 656 |
+
<span class="font-medium">Add Certificate</span>
|
| 657 |
+
</div>
|
| 658 |
+
</div>
|
| 659 |
+
</div>
|
| 660 |
+
`;
|
| 661 |
+
document.getElementById('app-content').innerHTML = html;
|
| 662 |
+
}
|
| 663 |
+
|
| 664 |
+
function renderAbout() {
|
| 665 |
+
const html = `
|
| 666 |
+
<div class="max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
| 667 |
+
<div class="h-48 bg-gray-900 relative">
|
| 668 |
+
<img src="https://images.unsplash.com/photo-1556761175-5973dc0f32e7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80" class="w-full h-full object-cover opacity-50">
|
| 669 |
+
<div class="absolute bottom-0 left-0 p-8 text-white">
|
| 670 |
+
<h2 class="text-4xl font-serif font-bold">ARIA COSMETIC</h2>
|
| 671 |
+
<p class="text-red-200 font-medium tracking-widest text-sm mt-2">PREMIUM K-BEAUTY SOLUTIONS</p>
|
| 672 |
+
</div>
|
| 673 |
+
</div>
|
| 674 |
+
<div class="p-8 md:p-12 space-y-8">
|
| 675 |
+
<div>
|
| 676 |
+
<h3 class="text-xl font-bold text-gray-900 mb-3">Our Mission</h3>
|
| 677 |
+
<p class="text-gray-600 leading-relaxed">
|
| 678 |
+
At ARIA COSMETIC, we bridge the gap between nature and science. Inspired by the pristine beauty of Korea,
|
| 679 |
+
we formulate products that respect your skin's natural barrier while delivering potent, clinically-proven results.
|
| 680 |
+
Our commitment to "Clean Beauty" ensures every drop is free from harmful chemicals and cruelty-free.
|
| 681 |
+
</p>
|
| 682 |
+
</div>
|
| 683 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 684 |
+
<div class="bg-gray-50 p-6 rounded-xl">
|
| 685 |
+
<i class="fa-solid fa-leaf text-brand-red text-2xl mb-3"></i>
|
| 686 |
+
<h4 class="font-bold text-gray-900">Sustainability</h4>
|
| 687 |
+
<p class="text-sm text-gray-600 mt-2">100% recyclable packaging and ethically sourced ingredients.</p>
|
| 688 |
+
</div>
|
| 689 |
+
<div class="bg-gray-50 p-6 rounded-xl">
|
| 690 |
+
<i class="fa-solid fa-flask text-brand-red text-2xl mb-3"></i>
|
| 691 |
+
<h4 class="font-bold text-gray-900">Innovation</h4>
|
| 692 |
+
<p class="text-sm text-gray-600 mt-2">State-of-the-art R&D labs in Seoul and Paris.</p>
|
| 693 |
+
</div>
|
| 694 |
+
</div>
|
| 695 |
+
</div>
|
| 696 |
+
</div>
|
| 697 |
+
`;
|
| 698 |
+
document.getElementById('app-content').innerHTML = html;
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
function renderSupport() {
|
| 702 |
+
const html = `
|
| 703 |
+
<div class="max-w-2xl mx-auto">
|
| 704 |
+
<div class="text-center mb-10">
|
| 705 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900">Support Center</h2>
|
| 706 |
+
<p class="text-gray-500 mt-2">Need help with regulatory filings or product data? We're here.</p>
|
| 707 |
+
</div>
|
| 708 |
+
|
| 709 |
+
<form onsubmit="event.preventDefault(); showToast('Message sent! We will reply shortly.'); this.reset();" class="bg-white p-8 rounded-2xl shadow-sm border border-gray-100 space-y-6">
|
| 710 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 711 |
+
<div class="space-y-2">
|
| 712 |
+
<label class="text-sm font-bold text-gray-700">Name</label>
|
| 713 |
+
<input type="text" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 714 |
+
</div>
|
| 715 |
+
<div class="space-y-2">
|
| 716 |
+
<label class="text-sm font-bold text-gray-700">Email</label>
|
| 717 |
+
<input type="email" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none">
|
| 718 |
+
</div>
|
| 719 |
+
</div>
|
| 720 |
+
<div class="space-y-2">
|
| 721 |
+
<label class="text-sm font-bold text-gray-700">Subject</label>
|
| 722 |
+
<select class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 723 |
+
<option>Regulatory Inquiry</option>
|
| 724 |
+
<option>Technical Support</option>
|
| 725 |
+
<option>Account Issue</option>
|
| 726 |
+
</select>
|
| 727 |
+
</div>
|
| 728 |
+
<div class="space-y-2">
|
| 729 |
+
<label class="text-sm font-bold text-gray-700">Message</label>
|
| 730 |
+
<textarea rows="4" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none"></textarea>
|
| 731 |
+
</div>
|
| 732 |
+
|
| 733 |
+
<!-- Fake reCAPTCHA visual -->
|
| 734 |
+
<div class="border border-gray-300 bg-gray-50 p-4 rounded-lg flex items-center gap-3 w-max">
|
| 735 |
+
<input type="checkbox" required class="w-5 h-5 text-brand-red rounded focus:ring-brand-red">
|
| 736 |
+
<span class="text-sm text-gray-600">I'm not a robot</span>
|
| 737 |
+
<img src="https://www.gstatic.com/recaptcha/api2/logo_48.png" class="h-8 ml-4 opacity-50">
|
| 738 |
+
</div>
|
| 739 |
+
|
| 740 |
+
<button type="submit" class="w-full bg-brand-red text-white font-bold py-3 rounded-lg hover:bg-red-700 transition shadow-lg shadow-red-200">
|
| 741 |
+
Send Message
|
| 742 |
+
</button>
|
| 743 |
+
</form>
|
| 744 |
+
</div>
|
| 745 |
+
`;
|
| 746 |
+
document.getElementById('app-content').innerHTML = html;
|
| 747 |
+
}
|
| 748 |
+
|
| 749 |
+
// --- Utilities ---
|
| 750 |
+
function showToast(message, type = 'success') {
|
| 751 |
+
const toast = document.getElementById('toast');
|
| 752 |
+
const msg = document.getElementById('toast-msg');
|
| 753 |
+
msg.innerText = message;
|
| 754 |
+
|
| 755 |
+
toast.classList.remove('translate-y-20', 'opacity-0');
|
| 756 |
+
|
| 757 |
+
setTimeout(() => {
|
| 758 |
+
toast.classList.add('translate-y-20', 'opacity-0');
|
| 759 |
+
}, 3000);
|
| 760 |
+
}
|
| 761 |
+
|
| 762 |
+
// --- Initialization ---
|
| 763 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 764 |
+
router('dashboard');
|
| 765 |
+
|
| 766 |
+
// Global Search Listener
|
| 767 |
+
document.getElementById('global-search').addEventListener('input', (e) => {
|
| 768 |
+
const term = e.target.value.toLowerCase();
|
| 769 |
+
if(state.currentView === 'products') {
|
| 770 |
+
const filtered = state.products.filter(p =>
|
| 771 |
+
p.name.toLowerCase().includes(term) ||
|
| 772 |
+
p.inci.toLowerCase().includes(term)
|
| 773 |
+
);
|
| 774 |
+
renderProductGrid(filtered);
|
| 775 |
+
} else if (term.length > 2) {
|
| 776 |
+
// Optional: Auto-switch to products on search
|
| 777 |
+
// router('products');
|
| 778 |
+
}
|
| 779 |
+
});
|
| 780 |
+
});
|
| 781 |
+
|
| 782 |
+
</script>
|
| 783 |
+
</body>
|
| 784 |
+
</html>
|