Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- index.html +417 -326
index.html
CHANGED
|
@@ -1,31 +1,34 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
|
|
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
theme: {
|
| 25 |
extend: {
|
| 26 |
colors: {
|
| 27 |
brand: {
|
| 28 |
-
red: '#D90429',
|
| 29 |
dark: '#2B2D42',
|
| 30 |
light: '#EDF2F4',
|
| 31 |
gray: '#8D99AE'
|
|
@@ -38,141 +41,217 @@
|
|
| 38 |
}
|
| 39 |
}
|
| 40 |
}
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
</head>
|
|
|
|
| 93 |
<body class="text-gray-800 h-screen flex overflow-hidden">
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
</
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
|
| 105 |
-
|
| 106 |
<i class="fa-solid fa-chart-pie w-5"></i> Dashboard
|
| 107 |
</button>
|
| 108 |
-
|
| 109 |
<i class="fa-solid fa-pump-soap w-5"></i> Products
|
| 110 |
</button>
|
| 111 |
-
|
| 112 |
<i class="fa-solid fa-plus-circle w-5"></i> Add Product
|
| 113 |
</button>
|
| 114 |
-
|
| 115 |
-
<i class="fa-solid fa-
|
| 116 |
</button>
|
| 117 |
-
|
| 118 |
-
<i class="fa-solid fa-
|
| 119 |
</button>
|
| 120 |
-
|
| 121 |
<i class="fa-solid fa-headset w-5"></i> Support
|
| 122 |
</button>
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
</div>
|
| 132 |
-
</div>
|
| 133 |
</div>
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 159 |
-
|
| 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 |
-
<!--
|
| 168 |
-
<div id="
|
| 169 |
-
|
| 170 |
-
<span id="toast-msg">Operation successful</span>
|
| 171 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
const state = {
|
| 177 |
currentView: 'dashboard',
|
| 178 |
products: [
|
|
@@ -246,14 +325,109 @@
|
|
| 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 |
|
|
@@ -264,17 +438,17 @@
|
|
| 264 |
}
|
| 265 |
|
| 266 |
const content = document.getElementById('app-content');
|
| 267 |
-
content.innerHTML = '';
|
| 268 |
content.classList.remove('fade-in');
|
| 269 |
-
void content.offsetWidth;
|
| 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 |
}
|
|
@@ -285,6 +459,8 @@
|
|
| 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">
|
|
@@ -311,29 +487,29 @@
|
|
| 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">
|
| 315 |
-
<h3 class="text-3xl font-bold text-
|
| 316 |
</div>
|
| 317 |
-
<div class="w-12 h-12 bg-
|
| 318 |
-
<i class="fa-solid fa-
|
| 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">
|
| 324 |
-
<h3 class="text-3xl font-bold text-
|
| 325 |
</div>
|
| 326 |
-
<div class="w-12 h-12 bg-
|
| 327 |
-
<i class="fa-solid fa-
|
| 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-
|
| 334 |
</div>
|
| 335 |
-
<div class="w-12 h-12 bg-
|
| 336 |
-
<i class="fa-solid fa-
|
| 337 |
</div>
|
| 338 |
</div>
|
| 339 |
</div>
|
|
@@ -345,29 +521,23 @@
|
|
| 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">
|
| 349 |
<div class="space-y-4">
|
| 350 |
-
|
| 351 |
-
<div class="
|
| 352 |
-
|
| 353 |
-
<
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
| 371 |
</div>
|
| 372 |
</div>
|
| 373 |
</div>
|
|
@@ -375,7 +545,6 @@
|
|
| 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, {
|
|
@@ -420,7 +589,6 @@
|
|
| 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 |
`;
|
|
@@ -484,7 +652,6 @@
|
|
| 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>
|
|
@@ -505,8 +672,11 @@
|
|
| 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 |
-
<
|
|
|
|
|
|
|
|
|
|
| 510 |
</div>
|
| 511 |
</div>
|
| 512 |
|
|
@@ -545,12 +715,14 @@
|
|
| 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">
|
| 549 |
-
<
|
|
|
|
|
|
|
| 550 |
</div>
|
| 551 |
<div class="space-y-2">
|
| 552 |
-
<label class="text-sm font-bold text-gray-700">
|
| 553 |
-
<input type="text" name="
|
| 554 |
</div>
|
| 555 |
<div class="space-y-2">
|
| 556 |
<label class="text-sm font-bold text-gray-700">Expiry Date</label>
|
|
@@ -581,14 +753,12 @@
|
|
| 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]";
|
|
@@ -609,11 +779,11 @@
|
|
| 609 |
category: formData.get('category'),
|
| 610 |
skinType: formData.get('skinType'),
|
| 611 |
price: parseFloat(formData.get('price')),
|
| 612 |
-
stock: 0,
|
| 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",
|
| 617 |
expiry: formData.get('expiry'),
|
| 618 |
pao: formData.get('pao')
|
| 619 |
};
|
|
@@ -623,162 +793,83 @@
|
|
| 623 |
router('products');
|
| 624 |
}
|
| 625 |
|
| 626 |
-
|
| 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 |
-
|
| 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="
|
| 667 |
-
<div class="
|
| 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 |
-
<
|
| 677 |
-
<p class="text-gray-
|
| 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 |
-
|
| 696 |
-
|
| 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 |
-
<
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 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="
|
| 721 |
-
<
|
| 722 |
-
<
|
| 723 |
-
<option>Regulatory Inquiry</option>
|
| 724 |
-
<option>Technical Support</option>
|
| 725 |
-
<option>Account Issue</option>
|
| 726 |
-
</select>
|
| 727 |
</div>
|
| 728 |
-
<div class="
|
| 729 |
-
<
|
| 730 |
-
<
|
| 731 |
</div>
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 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 |
-
|
| 741 |
-
|
|
|
|
|
|
|
| 742 |
</button>
|
| 743 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 744 |
</div>
|
| 745 |
`;
|
| 746 |
document.getElementById('app-content').innerHTML = html;
|
| 747 |
}
|
| 748 |
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 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 |
-
|
| 783 |
-
<
|
| 784 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>ARIA COSMETIC | CMS</title>
|
| 8 |
+
|
| 9 |
+
<!-- Tailwind CSS -->
|
| 10 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 11 |
+
|
| 12 |
+
<!-- Google Fonts -->
|
| 13 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 14 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 15 |
+
<link
|
| 16 |
+
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"
|
| 17 |
+
rel="stylesheet">
|
| 18 |
+
|
| 19 |
+
<!-- Font Awesome -->
|
| 20 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 21 |
+
|
| 22 |
+
<!-- Chart.js -->
|
| 23 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 24 |
+
|
| 25 |
+
<script>
|
| 26 |
+
tailwind.config = {
|
| 27 |
theme: {
|
| 28 |
extend: {
|
| 29 |
colors: {
|
| 30 |
brand: {
|
| 31 |
+
red: '#D90429',
|
| 32 |
dark: '#2B2D42',
|
| 33 |
light: '#EDF2F4',
|
| 34 |
gray: '#8D99AE'
|
|
|
|
| 41 |
}
|
| 42 |
}
|
| 43 |
}
|
| 44 |
+
</script>
|
| 45 |
+
|
| 46 |
+
<style>
|
| 47 |
+
body {
|
| 48 |
+
font-family: 'DM Sans', sans-serif;
|
| 49 |
+
background-color: #f8f9fa;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
h1,
|
| 53 |
+
h2,
|
| 54 |
+
h3,
|
| 55 |
+
h4,
|
| 56 |
+
h5,
|
| 57 |
+
h6,
|
| 58 |
+
.font-serif {
|
| 59 |
+
font-family: 'Playfair Display', serif;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.glass-panel {
|
| 63 |
+
background: rgba(255, 255, 255, 0.95);
|
| 64 |
+
backdrop-filter: blur(10px);
|
| 65 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.nav-item.active {
|
| 69 |
+
background-color: #D90429;
|
| 70 |
+
color: white;
|
| 71 |
+
box-shadow: 0 4px 6px -1px rgba(217, 4, 41, 0.3);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.fade-in {
|
| 75 |
+
animation: fadeIn 0.5s ease-in-out;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
@keyframes fadeIn {
|
| 79 |
+
from {
|
| 80 |
+
opacity: 0;
|
| 81 |
+
transform: translateY(10px);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
to {
|
| 85 |
+
opacity: 1;
|
| 86 |
+
transform: translateY(0);
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
::-webkit-scrollbar {
|
| 91 |
+
width: 8px;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
::-webkit-scrollbar-track {
|
| 95 |
+
background: #f1f1f1;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
::-webkit-scrollbar-thumb {
|
| 99 |
+
background: #D90429;
|
| 100 |
+
border-radius: 4px;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
::-webkit-scrollbar-thumb:hover {
|
| 104 |
+
background: #b10322;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.loader {
|
| 108 |
+
border-top-color: #D90429;
|
| 109 |
+
-webkit-animation: spinner 1.5s linear infinite;
|
| 110 |
+
animation: spinner 1.5s linear infinite;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
@keyframes spinner {
|
| 114 |
+
0% {
|
| 115 |
+
transform: rotate(0deg);
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
100% {
|
| 119 |
+
transform: rotate(360deg);
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.company-card {
|
| 124 |
+
transition: all 0.3s ease;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.company-card:hover {
|
| 128 |
+
transform: translateY(-4px);
|
| 129 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.tab-active {
|
| 133 |
+
border-bottom: 2px solid #D90429;
|
| 134 |
+
color: #D90429;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.animate-pulse-slow {
|
| 138 |
+
animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
@keyframes pulse {
|
| 142 |
+
0%, 100% {
|
| 143 |
+
opacity: 1;
|
| 144 |
+
}
|
| 145 |
+
50% {
|
| 146 |
+
opacity: .7;
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
</style>
|
| 150 |
</head>
|
| 151 |
+
|
| 152 |
<body class="text-gray-800 h-screen flex overflow-hidden">
|
| 153 |
|
| 154 |
+
<!-- Sidebar -->
|
| 155 |
+
<aside class="w-64 bg-white border-r border-gray-200 flex-col hidden md:flex z-20 shadow-lg">
|
| 156 |
+
<div class="h-20 flex items-center justify-center border-b border-gray-100">
|
| 157 |
+
<div class="flex items-center gap-2">
|
| 158 |
+
<div
|
| 159 |
+
class="w-8 h-8 bg-brand-red rounded-full flex items-center justify-center text-white font-serif font-bold text-xl">
|
| 160 |
+
A</div>
|
| 161 |
+
<span class="font-serif text-2xl font-bold text-gray-900 tracking-tight">ARIA <span class="text-brand-red">CMS</span></span>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
|
| 165 |
+
<nav class="flex-1 py-6 px-3 space-y-1 overflow-y-auto">
|
| 166 |
+
<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">
|
| 167 |
<i class="fa-solid fa-chart-pie w-5"></i> Dashboard
|
| 168 |
</button>
|
| 169 |
+
<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">
|
| 170 |
<i class="fa-solid fa-pump-soap w-5"></i> Products
|
| 171 |
</button>
|
| 172 |
+
<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">
|
| 173 |
<i class="fa-solid fa-plus-circle w-5"></i> Add Product
|
| 174 |
</button>
|
| 175 |
+
<button onclick="router('companies')" id="nav-companies" 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">
|
| 176 |
+
<i class="fa-solid fa-building w-5"></i> Companies
|
| 177 |
</button>
|
| 178 |
+
<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">
|
| 179 |
+
<i class="fa-solid fa-certificate w-5"></i> Certificates
|
| 180 |
</button>
|
| 181 |
+
<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">
|
| 182 |
<i class="fa-solid fa-headset w-5"></i> Support
|
| 183 |
</button>
|
| 184 |
+
</nav>
|
| 185 |
+
|
| 186 |
+
<div class="p-4 border-t border-gray-100">
|
| 187 |
+
<div class="flex items-center gap-3">
|
| 188 |
+
<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">
|
| 189 |
+
<div>
|
| 190 |
+
<p class="text-sm font-bold text-gray-900">Admin User</p>
|
| 191 |
+
<p class="text-xs text-gray-500">Regulatory Manager</p>
|
|
|
|
|
|
|
| 192 |
</div>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
</aside>
|
| 196 |
+
|
| 197 |
+
<!-- Main Content -->
|
| 198 |
+
<main class="flex-1 flex flex-col h-screen overflow-hidden relative">
|
| 199 |
+
<!-- Top Header -->
|
| 200 |
+
<header class="h-20 bg-white border-b border-gray-200 flex items-center justify-between px-6 lg:px-10 z-10">
|
| 201 |
+
<div class="flex items-center gap-4 md:hidden">
|
| 202 |
+
<button class="text-gray-600 hover:text-brand-red"><i class="fa-solid fa-bars text-xl"></i></button>
|
| 203 |
+
<span class="font-serif font-bold text-xl">ARIA</span>
|
| 204 |
+
</div>
|
| 205 |
+
|
| 206 |
+
<div
|
| 207 |
+
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">
|
| 208 |
+
<i class="fa-solid fa-search mr-3"></i>
|
| 209 |
+
<input type="text" id="global-search" placeholder="Search products, companies, ingredients..." class="bg-transparent border-none outline-none text-sm w-full text-gray-700 placeholder-gray-400">
|
| 210 |
+
</div>
|
| 211 |
+
|
| 212 |
+
<div class="flex items-center gap-4">
|
| 213 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank"
|
| 214 |
+
class="hidden lg:block text-xs font-medium text-gray-500 hover:text-brand-red transition-colors">
|
| 215 |
+
Built with anycoder
|
| 216 |
+
</a>
|
| 217 |
+
<button class="relative p-2 text-gray-400 hover:text-brand-red transition-colors">
|
| 218 |
<i class="fa-solid fa-bell text-xl"></i>
|
| 219 |
<span class="absolute top-1 right-1 w-2 h-2 bg-brand-red rounded-full border border-white"></span>
|
| 220 |
</button>
|
| 221 |
+
</div>
|
| 222 |
+
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
+
<!-- Dynamic Content Area -->
|
| 225 |
+
<div id="app-content" class="flex-1 overflow-y-auto p-6 lg:p-10 bg-gray-50 relative">
|
| 226 |
+
<!-- Views will be injected here -->
|
|
|
|
| 227 |
</div>
|
| 228 |
+
</main>
|
| 229 |
+
|
| 230 |
+
<!-- Toast Notification -->
|
| 231 |
+
<div id="toast"
|
| 232 |
+
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">
|
| 233 |
+
<i class="fa-solid fa-check-circle text-green-400"></i>
|
| 234 |
+
<span id="toast-msg">Operation successful</span>
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
<!-- Company Modal -->
|
| 238 |
+
<div id="company-modal" class="fixed inset-0 bg-black/50 backdrop-blur-sm z-50 hidden items-center justify-center p-4">
|
| 239 |
+
<div class="bg-white rounded-2xl shadow-2xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
|
| 240 |
+
<div class="sticky top-0 bg-white border-b border-gray-100 p-6 flex justify-between items-center">
|
| 241 |
+
<h3 class="text-2xl font-serif font-bold text-gray-900" id="modal-title">Add New Company</h3>
|
| 242 |
+
<button onclick="closeCompanyModal()" class="text-gray-400 hover:text-gray-600 transition">
|
| 243 |
+
<i class="fa-solid fa-xmark text-2xl"></i>
|
| 244 |
+
</button>
|
| 245 |
+
</div>
|
| 246 |
+
<div class="p-6" id="modal-content">
|
| 247 |
+
<!-- Form content injected here -->
|
| 248 |
+
</div>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
|
| 252 |
+
<!-- JavaScript Application Logic -->
|
| 253 |
+
<script>
|
| 254 |
+
// --- Mock Data & State ---
|
| 255 |
const state = {
|
| 256 |
currentView: 'dashboard',
|
| 257 |
products: [
|
|
|
|
| 325 |
{ id: 2, name: "Vegan Society Certified", authority: "The Vegan Society", date: "2023-06-20", type: "img" },
|
| 326 |
{ id: 3, name: "Leaping Bunny Approved", authority: "CCIC", date: "2023-03-10", type: "pdf" },
|
| 327 |
{ id: 4, name: "ECOCERT Organic", authority: "ECOCERT", date: "2022-11-05", type: "img" }
|
| 328 |
+
],
|
| 329 |
+
companies: [
|
| 330 |
+
{
|
| 331 |
+
id: 1,
|
| 332 |
+
name: "ARIA Cosmetic EU GmbH",
|
| 333 |
+
legalName: "ARIA Cosmetic Europe GmbH",
|
| 334 |
+
type: "Responsible Person",
|
| 335 |
+
registrationNumber: "HRB 123456",
|
| 336 |
+
vatNumber: "DE123456789",
|
| 337 |
+
establishedDate: "2018-03-15",
|
| 338 |
+
website: "https://aria-cosmetic.eu",
|
| 339 |
+
email: "regulatory@aria-cosmetic.eu",
|
| 340 |
+
phone: "+49 30 12345678",
|
| 341 |
+
address: {
|
| 342 |
+
street: "Friedrichstraße 123",
|
| 343 |
+
city: "Berlin",
|
| 344 |
+
postalCode: "10117",
|
| 345 |
+
country: "Germany"
|
| 346 |
+
},
|
| 347 |
+
regulatoryContact: {
|
| 348 |
+
name: "Dr. Sarah Mueller",
|
| 349 |
+
email: "s.mueller@aria-cosmetic.eu",
|
| 350 |
+
phone: "+49 30 12345679"
|
| 351 |
+
},
|
| 352 |
+
certifications: ["ISO 22716", "GMP Certified"],
|
| 353 |
+
status: "active",
|
| 354 |
+
logo: "https://ui-avatars.com/api/?name=ARIA+EU&background=D90429&color=fff&size=128",
|
| 355 |
+
description: "European headquarters and Responsible Person for ARIA Cosmetic products in the EU market.",
|
| 356 |
+
documents: [
|
| 357 |
+
{ name: "Business Registration", type: "pdf", date: "2018-03-15" },
|
| 358 |
+
{ name: "ISO 22716 Certificate", type: "pdf", date: "2023-01-15" }
|
| 359 |
+
]
|
| 360 |
+
},
|
| 361 |
+
{
|
| 362 |
+
id: 2,
|
| 363 |
+
name: "ARIA Cosmetic Korea Ltd.",
|
| 364 |
+
legalName: "아리아 코스메틱 주식회사",
|
| 365 |
+
type: "Manufacturer",
|
| 366 |
+
registrationNumber: "123-45-67890",
|
| 367 |
+
vatNumber: "KR1234567890",
|
| 368 |
+
establishedDate: "2015-06-20",
|
| 369 |
+
website: "https://aria-cosmetic.kr",
|
| 370 |
+
email: "info@aria-cosmetic.kr",
|
| 371 |
+
phone: "+82 2 1234 5678",
|
| 372 |
+
address: {
|
| 373 |
+
street: "Gangnam-daero 123",
|
| 374 |
+
city: "Seoul",
|
| 375 |
+
postalCode: "06234",
|
| 376 |
+
country: "South Korea"
|
| 377 |
+
},
|
| 378 |
+
regulatoryContact: {
|
| 379 |
+
name: "Kim Min-jae",
|
| 380 |
+
email: "minjae.kim@aria-cosmetic.kr",
|
| 381 |
+
phone: "+82 2 1234 5679"
|
| 382 |
+
},
|
| 383 |
+
certifications: ["KFDA", "CGMP", "ISO 22716"],
|
| 384 |
+
status: "active",
|
| 385 |
+
logo: "https://ui-avatars.com/api/?name=ARIA+KR&background=2B2D42&color=fff&size=128",
|
| 386 |
+
description: "Primary manufacturing facility and R&D center for ARIA Cosmetic products.",
|
| 387 |
+
documents: [
|
| 388 |
+
{ name: "KFDA Registration", type: "pdf", date: "2023-06-20" },
|
| 389 |
+
{ name: "Manufacturing License", type: "pdf", date: "2023-01-10" }
|
| 390 |
+
]
|
| 391 |
+
},
|
| 392 |
+
{
|
| 393 |
+
id: 3,
|
| 394 |
+
name: "ARIA Cosmetic USA Inc.",
|
| 395 |
+
legalName: "ARIA Cosmetic USA Inc.",
|
| 396 |
+
type: "Distributor",
|
| 397 |
+
registrationNumber: "DE1234567",
|
| 398 |
+
vatNumber: "US12-3456789",
|
| 399 |
+
establishedDate: "2020-01-10",
|
| 400 |
+
website: "https://aria-cosmetic.us",
|
| 401 |
+
email: "contact@aria-cosmetic.us",
|
| 402 |
+
phone: "+1 212 555 0123",
|
| 403 |
+
address: {
|
| 404 |
+
street: "5th Avenue 789",
|
| 405 |
+
city: "New York",
|
| 406 |
+
postalCode: "10001",
|
| 407 |
+
country: "United States"
|
| 408 |
+
},
|
| 409 |
+
regulatoryContact: {
|
| 410 |
+
name: "Jennifer Walsh",
|
| 411 |
+
email: "j.walsh@aria-cosmetic.us",
|
| 412 |
+
phone: "+1 212 555 0124"
|
| 413 |
+
},
|
| 414 |
+
certifications: ["FDA Registered", "cGMP"],
|
| 415 |
+
status: "active",
|
| 416 |
+
logo: "https://ui-avatars.com/api/?name=ARIA+US&background=8D99AE&color=fff&size=128",
|
| 417 |
+
description: "US distribution center handling North American market operations.",
|
| 418 |
+
documents: [
|
| 419 |
+
{ name: "FDA Registration", type: "pdf", date: "2023-03-15" },
|
| 420 |
+
{ name: "US Agent Agreement", type: "pdf", date: "2020-01-10" }
|
| 421 |
+
]
|
| 422 |
+
}
|
| 423 |
+
],
|
| 424 |
+
editingCompany: null
|
| 425 |
};
|
| 426 |
|
| 427 |
// --- Router ---
|
| 428 |
function router(view) {
|
| 429 |
state.currentView = view;
|
| 430 |
|
|
|
|
| 431 |
document.querySelectorAll('.nav-item').forEach(el => el.classList.remove('active', 'bg-brand-red', 'text-white', 'shadow-lg'));
|
| 432 |
document.querySelectorAll('.nav-item').forEach(el => el.classList.add('text-gray-600'));
|
| 433 |
|
|
|
|
| 438 |
}
|
| 439 |
|
| 440 |
const content = document.getElementById('app-content');
|
| 441 |
+
content.innerHTML = '';
|
| 442 |
content.classList.remove('fade-in');
|
| 443 |
+
void content.offsetWidth;
|
| 444 |
content.classList.add('fade-in');
|
| 445 |
|
| 446 |
switch(view) {
|
| 447 |
case 'dashboard': renderDashboard(); break;
|
| 448 |
case 'products': renderProducts(); break;
|
| 449 |
case 'add-product': renderAddProduct(); break;
|
| 450 |
+
case 'companies': renderCompanies(); break;
|
| 451 |
case 'certificates': renderCertificates(); break;
|
|
|
|
| 452 |
case 'support': renderSupport(); break;
|
| 453 |
default: renderDashboard();
|
| 454 |
}
|
|
|
|
| 459 |
function renderDashboard() {
|
| 460 |
const totalProducts = state.products.length;
|
| 461 |
const lowStock = state.products.filter(p => p.stock < 50).length;
|
| 462 |
+
const totalCompanies = state.companies.length;
|
| 463 |
+
const activeCompanies = state.companies.filter(c => c.status === 'active').length;
|
| 464 |
|
| 465 |
const html = `
|
| 466 |
<div class="space-y-8">
|
|
|
|
| 487 |
</div>
|
| 488 |
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 489 |
<div>
|
| 490 |
+
<p class="text-sm text-gray-500 font-medium">Companies</p>
|
| 491 |
+
<h3 class="text-3xl font-bold text-blue-600 mt-1">${totalCompanies}</h3>
|
| 492 |
</div>
|
| 493 |
+
<div class="w-12 h-12 bg-blue-50 rounded-full flex items-center justify-center text-blue-600 text-xl">
|
| 494 |
+
<i class="fa-solid fa-building"></i>
|
| 495 |
</div>
|
| 496 |
</div>
|
| 497 |
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 498 |
<div>
|
| 499 |
+
<p class="text-sm text-gray-500 font-medium">Low Stock Alerts</p>
|
| 500 |
+
<h3 class="text-3xl font-bold text-brand-red mt-1">${lowStock}</h3>
|
| 501 |
</div>
|
| 502 |
+
<div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl">
|
| 503 |
+
<i class="fa-solid fa-triangle-exclamation"></i>
|
| 504 |
</div>
|
| 505 |
</div>
|
| 506 |
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between">
|
| 507 |
<div>
|
| 508 |
<p class="text-sm text-gray-500 font-medium">Active Certs</p>
|
| 509 |
+
<h3 class="text-3xl font-bold text-green-600 mt-1">${state.certificates.length}</h3>
|
| 510 |
</div>
|
| 511 |
+
<div class="w-12 h-12 bg-green-50 rounded-full flex items-center justify-center text-green-600 text-xl">
|
| 512 |
+
<i class="fa-solid fa-shield-check"></i>
|
| 513 |
</div>
|
| 514 |
</div>
|
| 515 |
</div>
|
|
|
|
| 521 |
<canvas id="inventoryChart" height="100"></canvas>
|
| 522 |
</div>
|
| 523 |
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100">
|
| 524 |
+
<h3 class="font-serif font-bold text-lg mb-4">Companies Overview</h3>
|
| 525 |
<div class="space-y-4">
|
| 526 |
+
${state.companies.slice(0, 3).map(c => `
|
| 527 |
+
<div class="flex items-center gap-3 p-3 rounded-xl hover:bg-gray-50 transition cursor-pointer" onclick="router('companies')">
|
| 528 |
+
<img src="${c.logo}" class="w-10 h-10 rounded-lg" alt="${c.name}">
|
| 529 |
+
<div class="flex-1 min-w-0">
|
| 530 |
+
<p class="text-sm font-bold text-gray-900 truncate">${c.name}</p>
|
| 531 |
+
<p class="text-xs text-gray-500">${c.type} • ${c.address.country}</p>
|
| 532 |
+
</div>
|
| 533 |
+
<span class="px-2 py-1 text-xs font-medium rounded-full ${c.status === 'active' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'}">
|
| 534 |
+
${c.status}
|
| 535 |
+
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
</div>
|
| 537 |
+
`).join('')}
|
| 538 |
+
<button onclick="router('companies')" 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">
|
| 539 |
+
View All Companies
|
| 540 |
+
</button>
|
| 541 |
</div>
|
| 542 |
</div>
|
| 543 |
</div>
|
|
|
|
| 545 |
`;
|
| 546 |
document.getElementById('app-content').innerHTML = html;
|
| 547 |
|
|
|
|
| 548 |
setTimeout(() => {
|
| 549 |
const ctx = document.getElementById('inventoryChart').getContext('2d');
|
| 550 |
new Chart(ctx, {
|
|
|
|
| 589 |
</div>
|
| 590 |
|
| 591 |
<div id="product-grid" class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6">
|
|
|
|
| 592 |
</div>
|
| 593 |
</div>
|
| 594 |
`;
|
|
|
|
| 652 |
|
| 653 |
<form id="product-form" onsubmit="handleProductSubmit(event)" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 space-y-6">
|
| 654 |
|
|
|
|
| 655 |
<div class="bg-blue-50 border border-blue-100 rounded-xl p-4 flex items-start gap-4 mb-6">
|
| 656 |
<div class="bg-blue-100 p-2 rounded-lg text-blue-600">
|
| 657 |
<i class="fa-solid fa-wand-magic-sparkles"></i>
|
|
|
|
| 672 |
<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">
|
| 673 |
</div>
|
| 674 |
<div class="space-y-2">
|
| 675 |
+
<label class="text-sm font-bold text-gray-700">Company/Brand</label>
|
| 676 |
+
<select name="brand" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 677 |
+
${state.companies.map(c => `<option value="${c.name}">${c.name}</option>`).join('')}
|
| 678 |
+
<option value="ARIA">ARIA (Default)</option>
|
| 679 |
+
</select>
|
| 680 |
</div>
|
| 681 |
</div>
|
| 682 |
|
|
|
|
| 715 |
<h3 class="font-serif font-bold text-lg mb-4 text-gray-800">Regulatory Information</h3>
|
| 716 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 717 |
<div class="space-y-2">
|
| 718 |
+
<label class="text-sm font-bold text-gray-700">Responsible Person (Company)</label>
|
| 719 |
+
<select name="rp" class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white">
|
| 720 |
+
${state.companies.filter(c => c.type === 'Responsible Person').map(c => `<option value="${c.name}">${c.name}</option>`).join('')}
|
| 721 |
+
</select>
|
| 722 |
</div>
|
| 723 |
<div class="space-y-2">
|
| 724 |
+
<label class="text-sm font-bold text-gray-700">CPNP Number</label>
|
| 725 |
+
<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">
|
| 726 |
</div>
|
| 727 |
<div class="space-y-2">
|
| 728 |
<label class="text-sm font-bold text-gray-700">Expiry Date</label>
|
|
|
|
| 753 |
const input = document.getElementById('ai-input').value;
|
| 754 |
if(!input) return showToast('Please enter a product name first', 'error');
|
| 755 |
|
|
|
|
| 756 |
const btn = document.querySelector('button[onclick="generateAIContent()"]');
|
| 757 |
const originalText = btn.innerText;
|
| 758 |
btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>';
|
| 759 |
btn.disabled = true;
|
| 760 |
|
| 761 |
setTimeout(() => {
|
|
|
|
| 762 |
const form = document.getElementById('product-form');
|
| 763 |
form.name.value = input;
|
| 764 |
form.inci.value = "Aqua, Glycerin, Niacinamide, Hyaluronic Acid, [AI Generated Base]";
|
|
|
|
| 779 |
category: formData.get('category'),
|
| 780 |
skinType: formData.get('skinType'),
|
| 781 |
price: parseFloat(formData.get('price')),
|
| 782 |
+
stock: 0,
|
| 783 |
inci: formData.get('inci'),
|
| 784 |
cpnp: formData.get('cpnp'),
|
| 785 |
rp: formData.get('rp'),
|
| 786 |
+
image: "https://images.unsplash.com/photo-1608248597279-f99d160bfbc8?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80",
|
| 787 |
expiry: formData.get('expiry'),
|
| 788 |
pao: formData.get('pao')
|
| 789 |
};
|
|
|
|
| 793 |
router('products');
|
| 794 |
}
|
| 795 |
|
| 796 |
+
// --- Companies Management ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 797 |
|
| 798 |
+
function renderCompanies() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 799 |
const html = `
|
| 800 |
+
<div class="space-y-6">
|
| 801 |
+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 802 |
<div>
|
| 803 |
+
<h2 class="text-3xl font-serif font-bold text-gray-900">Companies</h2>
|
| 804 |
+
<p class="text-gray-500 mt-1">Manage your business entities, manufacturers, and responsible persons.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 805 |
</div>
|
| 806 |
+
<button onclick="openCompanyModal()" class="bg-brand-red text-white px-6 py-2.5 rounded-lg hover:bg-red-700 transition shadow-lg shadow-red-200 flex items-center gap-2">
|
| 807 |
+
<i class="fa-solid fa-plus"></i> Add Company
|
| 808 |
+
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 809 |
</div>
|
| 810 |
|
| 811 |
+
<!-- Company Stats -->
|
| 812 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
| 813 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
| 814 |
+
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Total Companies</p>
|
| 815 |
+
<p class="text-2xl font-bold text-gray-900 mt-1">${state.companies.length}</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 816 |
</div>
|
| 817 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
| 818 |
+
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Responsible Persons</p>
|
| 819 |
+
<p class="text-2xl font-bold text-blue-600 mt-1">${state.companies.filter(c => c.type === 'Responsible Person').length}</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 820 |
</div>
|
| 821 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
| 822 |
+
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Manufacturers</p>
|
| 823 |
+
<p class="text-2xl font-bold text-purple-600 mt-1">${state.companies.filter(c => c.type === 'Manufacturer').length}</p>
|
| 824 |
</div>
|
| 825 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
| 826 |
+
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Active</p>
|
| 827 |
+
<p class="text-2xl font-bold text-green-600 mt-1">${state.companies.filter(c => c.status === 'active').length}</p>
|
|
|
|
|
|
|
|
|
|
| 828 |
</div>
|
| 829 |
+
</div>
|
| 830 |
|
| 831 |
+
<!-- Filters -->
|
| 832 |
+
<div class="flex flex-wrap gap-3">
|
| 833 |
+
<button onclick="filterCompanies('all')" class="filter-btn active px-4 py-2 rounded-lg text-sm font-medium transition-all bg-brand-red text-white" data-filter="all">
|
| 834 |
+
All Companies
|
| 835 |
</button>
|
| 836 |
+
<button onclick="filterCompanies('Responsible Person')" class="filter-btn px-4 py-2 rounded-lg text-sm font-medium transition-all bg-white text-gray-600 hover:bg-gray-50" data-filter="Responsible Person">
|
| 837 |
+
Responsible Persons
|
| 838 |
+
</button>
|
| 839 |
+
<button onclick="filterCompanies('Manufacturer')" class="filter-btn px-4 py-2 rounded-lg text-sm font-medium transition-all bg-white text-gray-600 hover:bg-gray-50" data-filter="Manufacturer">
|
| 840 |
+
Manufacturers
|
| 841 |
+
</button>
|
| 842 |
+
<button onclick="filterCompanies('Distributor')" class="filter-btn px-4 py-2 rounded-lg text-sm font-medium transition-all bg-white text-gray-600 hover:bg-gray-50" data-filter="Distributor">
|
| 843 |
+
Distributors
|
| 844 |
+
</button>
|
| 845 |
+
</div>
|
| 846 |
+
|
| 847 |
+
<!-- Companies Grid -->
|
| 848 |
+
<div id="companies-grid" class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6">
|
| 849 |
+
${renderCompanyCards(state.companies)}
|
| 850 |
+
</div>
|
| 851 |
</div>
|
| 852 |
`;
|
| 853 |
document.getElementById('app-content').innerHTML = html;
|
| 854 |
}
|
| 855 |
|
| 856 |
+
function renderCompanyCards(companies) {
|
| 857 |
+
if(companies.length === 0) {
|
| 858 |
+
return `<div class="col-span-full text-center py-20 text-gray-500">
|
| 859 |
+
<i class="fa-solid fa-building text-4xl mb-4 text-gray-300"></i>
|
| 860 |
+
<p>No companies found matching your criteria.</p>
|
| 861 |
+
</div>`;
|
| 862 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
|
| 864 |
+
return companies.map(c => `
|
| 865 |
+
<div class="company-card bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
| 866 |
+
<div class="p-6">
|
| 867 |
+
<div class="flex items-start justify-between mb-4">
|
| 868 |
+
<div class="flex items-center gap-4">
|
| 869 |
+
<img src="${c.logo}" class="w-16 h-16 rounded-xl shadow-sm" alt="${c.name}">
|
| 870 |
+
<div>
|
| 871 |
+
<h3 class="font-serif font-bold text-lg text-gray-900 leading-tight">${c.name}</h3>
|
| 872 |
+
<p class="text-xs text-gray-500">${c.legalName}</p>
|
| 873 |
+
</div>
|
| 874 |
+
</div>
|
| 875 |
+
<div class="flex gap-2
|