| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>ARIA COSMETIC | CMS</title> |
| |
| |
| <script src="https://cdn.tailwindcss.com"></script> |
| |
| |
| <link rel="preconnect" href="https://fonts.googleapis.com"> |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| <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"> |
| |
| |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
|
|
| |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> |
|
|
| <script> |
| tailwind.config = { |
| theme: { |
| extend: { |
| colors: { |
| brand: { |
| red: '#D90429', |
| dark: '#2B2D42', |
| light: '#EDF2F4', |
| gray: '#8D99AE' |
| } |
| }, |
| fontFamily: { |
| serif: ['"Playfair Display"', 'serif'], |
| sans: ['"DM Sans"', 'sans-serif'], |
| } |
| } |
| } |
| } |
| </script> |
|
|
| <style> |
| body { |
| font-family: 'DM Sans', sans-serif; |
| background-color: #f8f9fa; |
| } |
| h1, h2, h3, h4, h5, h6, .font-serif { |
| font-family: 'Playfair Display', serif; |
| } |
| .glass-panel { |
| background: rgba(255, 255, 255, 0.95); |
| backdrop-filter: blur(10px); |
| border: 1px solid rgba(255, 255, 255, 0.2); |
| } |
| .nav-item.active { |
| background-color: #D90429; |
| color: white; |
| box-shadow: 0 4px 6px -1px rgba(217, 4, 41, 0.3); |
| } |
| .fade-in { |
| animation: fadeIn 0.5s ease-in-out; |
| } |
| @keyframes fadeIn { |
| from { opacity: 0; transform: translateY(10px); } |
| to { opacity: 1; transform: translateY(0); } |
| } |
| |
| ::-webkit-scrollbar { |
| width: 8px; |
| } |
| ::-webkit-scrollbar-track { |
| background: #f1f1f1; |
| } |
| ::-webkit-scrollbar-thumb { |
| background: #D90429; |
| border-radius: 4px; |
| } |
| ::-webkit-scrollbar-thumb:hover { |
| background: #b10322; |
| } |
| .loader { |
| border-top-color: #D90429; |
| -webkit-animation: spinner 1.5s linear infinite; |
| animation: spinner 1.5s linear infinite; |
| } |
| @keyframes spinner { |
| 0% { transform: rotate(0deg); } |
| 100% { transform: rotate(360deg); } |
| } |
| </style> |
| </head> |
| <body class="text-gray-800 h-screen flex overflow-hidden"> |
|
|
| |
| <aside class="w-64 bg-white border-r border-gray-200 flex-col hidden md:flex z-20 shadow-lg"> |
| <div class="h-20 flex items-center justify-center border-b border-gray-100"> |
| <div class="flex items-center gap-2"> |
| <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> |
| <span class="font-serif text-2xl font-bold text-gray-900 tracking-tight">ARIA <span class="text-brand-red">CMS</span></span> |
| </div> |
| </div> |
|
|
| <nav class="flex-1 py-6 px-3 space-y-1 overflow-y-auto"> |
| <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"> |
| <i class="fa-solid fa-chart-pie w-5"></i> Dashboard |
| </button> |
| <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"> |
| <i class="fa-solid fa-pump-soap w-5"></i> Products |
| </button> |
| <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"> |
| <i class="fa-solid fa-plus-circle w-5"></i> Add Product |
| </button> |
| <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"> |
| <i class="fa-solid fa-certificate w-5"></i> Certificates |
| </button> |
| <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"> |
| <i class="fa-solid fa-building w-5"></i> Company |
| </button> |
| <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"> |
| <i class="fa-solid fa-headset w-5"></i> Support |
| </button> |
| </nav> |
|
|
| <div class="p-4 border-t border-gray-100"> |
| <div class="flex items-center gap-3"> |
| <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"> |
| <div> |
| <p class="text-sm font-bold text-gray-900">Admin User</p> |
| <p class="text-xs text-gray-500">Regulatory Manager</p> |
| </div> |
| </div> |
| </div> |
| </aside> |
|
|
| |
| <main class="flex-1 flex flex-col h-screen overflow-hidden relative"> |
| |
| <header class="h-20 bg-white border-b border-gray-200 flex items-center justify-between px-6 lg:px-10 z-10"> |
| <div class="flex items-center gap-4 md:hidden"> |
| <button class="text-gray-600 hover:text-brand-red"><i class="fa-solid fa-bars text-xl"></i></button> |
| <span class="font-serif font-bold text-xl">ARIA</span> |
| </div> |
| |
| <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"> |
| <i class="fa-solid fa-search mr-3"></i> |
| <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"> |
| </div> |
|
|
| <div class="flex items-center gap-4"> |
| <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"> |
| Built with anycoder |
| </a> |
| <button class="relative p-2 text-gray-400 hover:text-brand-red transition-colors"> |
| <i class="fa-solid fa-bell text-xl"></i> |
| <span class="absolute top-1 right-1 w-2 h-2 bg-brand-red rounded-full border border-white"></span> |
| </button> |
| </div> |
| </header> |
|
|
| |
| <div id="app-content" class="flex-1 overflow-y-auto p-6 lg:p-10 bg-gray-50 relative"> |
| |
| </div> |
| </main> |
|
|
| |
| <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"> |
| <i class="fa-solid fa-check-circle text-green-400"></i> |
| <span id="toast-msg">Operation successful</span> |
| </div> |
|
|
| |
| <script> |
| // --- Mock Data & State --- |
| const state = { |
| currentView: 'dashboard', |
| products: [ |
| { |
| id: 1, |
| name: "Angel's Liquid Red Serum", |
| brand: "ARIA", |
| series: "Premium", |
| category: "Serum", |
| skinType: "All", |
| price: 45.00, |
| stock: 120, |
| inci: "Water, Niacinamide, Hyaluronic Acid, Red Ginseng Extract", |
| cpnp: "CPNP-2023-001", |
| rp: "ARIA Cosmetic EU GmbH", |
| image: "https://images.unsplash.com/photo-1620916566398-39f1143ab7be?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", |
| expiry: "2025-12-01", |
| pao: "12M" |
| }, |
| { |
| id: 2, |
| name: "Hydra Glow Moisturizer", |
| brand: "ARIA", |
| series: "Daily", |
| category: "Moisturizer", |
| skinType: "Dry", |
| price: 32.50, |
| stock: 85, |
| inci: "Aqua, Glycerin, Ceramide NP, Squalane", |
| cpnp: "CPNP-2023-042", |
| rp: "ARIA Cosmetic EU GmbH", |
| image: "https://images.unsplash.com/photo-1556228720-19875c4b84b2?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", |
| expiry: "2026-05-15", |
| pao: "6M" |
| }, |
| { |
| id: 3, |
| name: "Pure Clean Foaming Wash", |
| brand: "ARIA", |
| series: "Daily", |
| category: "Cleanser", |
| skinType: "Oily", |
| price: 24.00, |
| stock: 200, |
| inci: "Water, Coco-Glucoside, Salicylic Acid, Tea Tree Oil", |
| cpnp: "CPNP-2023-089", |
| rp: "ARIA Cosmetic EU GmbH", |
| image: "https://images.unsplash.com/photo-1556228578-0d85b1a4d571?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", |
| expiry: "2025-08-20", |
| pao: "12M" |
| }, |
| { |
| id: 4, |
| name: "Midnight Repair Cream", |
| brand: "ARIA", |
| series: "Night", |
| category: "Cream", |
| skinType: "Mature", |
| price: 58.00, |
| stock: 45, |
| inci: "Retinol, Peptides, Shea Butter, Jojoba Oil", |
| cpnp: "CPNP-2024-010", |
| rp: "ARIA Cosmetic EU GmbH", |
| image: "https://images.unsplash.com/photo-1616683693504-3ea7e9ad6fec?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", |
| expiry: "2025-11-30", |
| pao: "6M" |
| } |
| ], |
| certificates: [ |
| { id: 1, name: "ISO 22716 (GMP)", authority: "Bureau Veritas", date: "2023-01-15", type: "pdf" }, |
| { id: 2, name: "Vegan Society Certified", authority: "The Vegan Society", date: "2023-06-20", type: "img" }, |
| { id: 3, name: "Leaping Bunny Approved", authority: "CCIC", date: "2023-03-10", type: "pdf" }, |
| { id: 4, name: "ECOCERT Organic", authority: "ECOCERT", date: "2022-11-05", type: "img" } |
| ] |
| }; |
| |
| // --- Router --- |
| function router(view) { |
| state.currentView = view; |
| |
| // Update Nav UI |
| document.querySelectorAll('.nav-item').forEach(el => el.classList.remove('active', 'bg-brand-red', 'text-white', 'shadow-lg')); |
| document.querySelectorAll('.nav-item').forEach(el => el.classList.add('text-gray-600')); |
| |
| const activeNav = document.getElementById(`nav-${view}`); |
| if(activeNav) { |
| activeNav.classList.add('active'); |
| activeNav.classList.remove('text-gray-600'); |
| } |
| |
| const content = document.getElementById('app-content'); |
| content.innerHTML = ''; // Clear current view |
| content.classList.remove('fade-in'); |
| void content.offsetWidth; // Trigger reflow |
| content.classList.add('fade-in'); |
| |
| switch(view) { |
| case 'dashboard': renderDashboard(); break; |
| case 'products': renderProducts(); break; |
| case 'add-product': renderAddProduct(); break; |
| case 'certificates': renderCertificates(); break; |
| case 'about': renderAbout(); break; |
| case 'support': renderSupport(); break; |
| default: renderDashboard(); |
| } |
| } |
| |
| // --- Render Functions --- |
| |
| function renderDashboard() { |
| const totalProducts = state.products.length; |
| const lowStock = state.products.filter(p => p.stock < 50).length; |
| |
| const html = ` |
| <div class="space-y-8"> |
| <div class="flex justify-between items-end"> |
| <div> |
| <h2 class="text-3xl font-serif font-bold text-gray-900">Dashboard</h2> |
| <p class="text-gray-500 mt-1">Welcome back, here's what's happening today.</p> |
| </div> |
| <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"> |
| <i class="fa-solid fa-plus"></i> New Product |
| </button> |
| </div> |
| |
| |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between"> |
| <div> |
| <p class="text-sm text-gray-500 font-medium">Total Products</p> |
| <h3 class="text-3xl font-bold text-gray-900 mt-1">${totalProducts}</h3> |
| </div> |
| <div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl"> |
| <i class="fa-solid fa-box-open"></i> |
| </div> |
| </div> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between"> |
| <div> |
| <p class="text-sm text-gray-500 font-medium">Low Stock Alerts</p> |
| <h3 class="text-3xl font-bold text-brand-red mt-1">${lowStock}</h3> |
| </div> |
| <div class="w-12 h-12 bg-red-50 rounded-full flex items-center justify-center text-brand-red text-xl"> |
| <i class="fa-solid fa-triangle-exclamation"></i> |
| </div> |
| </div> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between"> |
| <div> |
| <p class="text-sm text-gray-500 font-medium">Compliance Rate</p> |
| <h3 class="text-3xl font-bold text-green-600 mt-1">100%</h3> |
| </div> |
| <div class="w-12 h-12 bg-green-50 rounded-full flex items-center justify-center text-green-600 text-xl"> |
| <i class="fa-solid fa-shield-check"></i> |
| </div> |
| </div> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 flex items-center justify-between"> |
| <div> |
| <p class="text-sm text-gray-500 font-medium">Active Certs</p> |
| <h3 class="text-3xl font-bold text-blue-600 mt-1">${state.certificates.length}</h3> |
| </div> |
| <div class="w-12 h-12 bg-blue-50 rounded-full flex items-center justify-center text-blue-600 text-xl"> |
| <i class="fa-solid fa-award"></i> |
| </div> |
| </div> |
| </div> |
| |
| |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 lg:col-span-2"> |
| <h3 class="font-serif font-bold text-lg mb-4">Inventory Distribution</h3> |
| <canvas id="inventoryChart" height="100"></canvas> |
| </div> |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100"> |
| <h3 class="font-serif font-bold text-lg mb-4">Recent Activity</h3> |
| <div class="space-y-4"> |
| <div class="flex items-start gap-3"> |
| <div class="w-2 h-2 mt-2 rounded-full bg-brand-red"></div> |
| <div> |
| <p class="text-sm font-medium text-gray-900">Added "Midnight Repair Cream"</p> |
| <p class="text-xs text-gray-500">2 hours ago</p> |
| </div> |
| </div> |
| <div class="flex items-start gap-3"> |
| <div class="w-2 h-2 mt-2 rounded-full bg-gray-300"></div> |
| <div> |
| <p class="text-sm font-medium text-gray-900">Updated ISO Certificate</p> |
| <p class="text-xs text-gray-500">Yesterday</p> |
| </div> |
| </div> |
| <div class="flex items-start gap-3"> |
| <div class="w-2 h-2 mt-2 rounded-full bg-gray-300"></div> |
| <div> |
| <p class="text-sm font-medium text-gray-900">Stock check: Serum Series</p> |
| <p class="text-xs text-gray-500">3 days ago</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| |
| // Initialize Chart |
| setTimeout(() => { |
| const ctx = document.getElementById('inventoryChart').getContext('2d'); |
| new Chart(ctx, { |
| type: 'bar', |
| data: { |
| labels: state.products.map(p => p.name), |
| datasets: [{ |
| label: 'Stock Level', |
| data: state.products.map(p => p.stock), |
| backgroundColor: '#D90429', |
| borderRadius: 6, |
| }] |
| }, |
| options: { |
| responsive: true, |
| scales: { |
| y: { beginAtZero: true, grid: { display: false } }, |
| x: { grid: { display: false } } |
| }, |
| plugins: { legend: { display: false } } |
| } |
| }); |
| }, 100); |
| } |
| |
| function renderProducts() { |
| let html = ` |
| <div class="space-y-6"> |
| <div class="flex flex-col md:flex-row justify-between items-center gap-4"> |
| <h2 class="text-3xl font-serif font-bold text-gray-900">Product Inventory</h2> |
| <div class="flex gap-3 w-full md:w-auto"> |
| <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"> |
| <option value="All">All Categories</option> |
| <option value="Serum">Serum</option> |
| <option value="Moisturizer">Moisturizer</option> |
| <option value="Cleanser">Cleanser</option> |
| </select> |
| <button onclick="router('add-product')" class="bg-brand-red text-white px-4 py-2 rounded-lg hover:bg-red-700 transition shadow-md"> |
| <i class="fa-solid fa-plus"></i> Add |
| </button> |
| </div> |
| </div> |
| |
| <div id="product-grid" class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6"> |
| |
| </div> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| renderProductGrid(state.products); |
| } |
| |
| function renderProductGrid(products) { |
| const grid = document.getElementById('product-grid'); |
| if(products.length === 0) { |
| grid.innerHTML = `<div class="col-span-full text-center py-20 text-gray-500">No products found matching your criteria.</div>`; |
| return; |
| } |
| |
| grid.innerHTML = products.map(p => ` |
| <div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden hover:shadow-xl transition-all duration-300 group"> |
| <div class="h-48 overflow-hidden relative"> |
| <img src="${p.image}" alt="${p.name}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"> |
| <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"> |
| ${p.category} |
| </div> |
| </div> |
| <div class="p-5"> |
| <div class="flex justify-between items-start mb-2"> |
| <div> |
| <p class="text-xs text-brand-red font-bold uppercase tracking-wider">${p.brand}</p> |
| <h3 class="font-serif text-xl font-bold text-gray-900 leading-tight">${p.name}</h3> |
| </div> |
| <span class="font-sans font-bold text-gray-900">$${p.price.toFixed(2)}</span> |
| </div> |
| |
| <div class="flex flex-wrap gap-2 my-3"> |
| <span class="px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded-md">${p.skinType} Skin</span> |
| <span class="px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded-md">PAO: ${p.pao}</span> |
| </div> |
| |
| <div class="border-t border-gray-100 pt-4 mt-2"> |
| <div class="flex justify-between items-center text-xs text-gray-500 mb-2"> |
| <span>Stock: <b class="${p.stock < 50 ? 'text-brand-red' : 'text-green-600'}">${p.stock} units</b></span> |
| <span>CPNP: ${p.cpnp}</span> |
| </div> |
| <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"> |
| View Details |
| </button> |
| </div> |
| </div> |
| </div> |
| `).join(''); |
| } |
| |
| function filterProducts() { |
| const cat = document.getElementById('filter-category').value; |
| const filtered = cat === 'All' ? state.products : state.products.filter(p => p.category === cat); |
| renderProductGrid(filtered); |
| } |
| |
| function renderAddProduct() { |
| const html = ` |
| <div class="max-w-4xl mx-auto"> |
| <h2 class="text-3xl font-serif font-bold text-gray-900 mb-6">Add New Product</h2> |
| |
| <form id="product-form" onsubmit="handleProductSubmit(event)" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 space-y-6"> |
| |
| |
| <div class="bg-blue-50 border border-blue-100 rounded-xl p-4 flex items-start gap-4 mb-6"> |
| <div class="bg-blue-100 p-2 rounded-lg text-blue-600"> |
| <i class="fa-solid fa-wand-magic-sparkles"></i> |
| </div> |
| <div class="flex-1"> |
| <h4 class="font-bold text-blue-900 text-sm">AI Assistant</h4> |
| <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> |
| <div class="flex gap-2"> |
| <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"> |
| <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> |
| </div> |
| </div> |
| </div> |
| |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Product Name</label> |
| <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"> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Brand</label> |
| <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"> |
| </div> |
| </div> |
| |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Category</label> |
| <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"> |
| <option>Serum</option> |
| <option>Moisturizer</option> |
| <option>Cleanser</option> |
| <option>Cream</option> |
| </select> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Skin Type</label> |
| <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"> |
| <option>All</option> |
| <option>Dry</option> |
| <option>Oily</option> |
| <option>Sensitive</option> |
| <option>Mature</option> |
| </select> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Price ($)</label> |
| <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"> |
| </div> |
| </div> |
| |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">INCI Ingredients (Comma separated)</label> |
| <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> |
| </div> |
| |
| <div class="border-t border-gray-100 pt-6 mt-6"> |
| <h3 class="font-serif font-bold text-lg mb-4 text-gray-800">Regulatory Information</h3> |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">CPNP Number</label> |
| <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"> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Responsible Person (RP)</label> |
| <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"> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Expiry Date</label> |
| <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"> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Period After Opening (PAO)</label> |
| <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"> |
| <option>6M</option> |
| <option>12M</option> |
| <option>24M</option> |
| </select> |
| </div> |
| </div> |
| </div> |
| |
| <div class="pt-6 flex justify-end gap-4"> |
| <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> |
| <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> |
| </div> |
| </form> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| } |
| |
| function generateAIContent() { |
| const input = document.getElementById('ai-input').value; |
| if(!input) return showToast('Please enter a product name first', 'error'); |
| |
| // Simulate AI Loading |
| const btn = document.querySelector('button[onclick="generateAIContent()"]'); |
| const originalText = btn.innerText; |
| btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>'; |
| btn.disabled = true; |
| |
| setTimeout(() => { |
| // Mock AI Response |
| const form = document.getElementById('product-form'); |
| form.name.value = input; |
| form.inci.value = "Aqua, Glycerin, Niacinamide, Hyaluronic Acid, [AI Generated Base]"; |
| |
| showToast('AI generated content applied!'); |
| btn.innerText = originalText; |
| btn.disabled = false; |
| }, 1500); |
| } |
| |
| function handleProductSubmit(e) { |
| e.preventDefault(); |
| const formData = new FormData(e.target); |
| const newProduct = { |
| id: Date.now(), |
| name: formData.get('name'), |
| brand: formData.get('brand'), |
| category: formData.get('category'), |
| skinType: formData.get('skinType'), |
| price: parseFloat(formData.get('price')), |
| stock: 0, // Default |
| inci: formData.get('inci'), |
| cpnp: formData.get('cpnp'), |
| rp: formData.get('rp'), |
| image: "https://images.unsplash.com/photo-1608248597279-f99d160bfbc8?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80", // Placeholder |
| expiry: formData.get('expiry'), |
| pao: formData.get('pao') |
| }; |
| |
| state.products.unshift(newProduct); |
| showToast('Product added successfully!'); |
| router('products'); |
| } |
| |
| function renderCertificates() { |
| const html = ` |
| <div class="space-y-8"> |
| <div class="flex justify-between items-center"> |
| <h2 class="text-3xl font-serif font-bold text-gray-900">Certifications</h2> |
| <button class="bg-brand-red text-white px-4 py-2 rounded-lg hover:bg-red-700 transition shadow-md"> |
| <i class="fa-solid fa-upload"></i> Upload New |
| </button> |
| </div> |
| |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> |
| ${state.certificates.map(cert => ` |
| <div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:border-brand-red transition-colors group cursor-pointer"> |
| <div class="flex items-start justify-between mb-4"> |
| <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"> |
| <i class="fa-solid ${cert.type === 'pdf' ? 'fa-file-pdf' : 'fa-image'}"></i> |
| </div> |
| <span class="text-xs font-bold text-gray-400 bg-gray-50 px-2 py-1 rounded">${cert.date}</span> |
| </div> |
| <h3 class="font-serif font-bold text-lg text-gray-900 mb-1">${cert.name}</h3> |
| <p class="text-sm text-gray-500 mb-4">Issued by: <span class="font-medium text-gray-700">${cert.authority}</span></p> |
| <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"> |
| View Document |
| </button> |
| </div> |
| `).join('')} |
| |
| |
| <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]"> |
| <i class="fa-solid fa-plus text-3xl mb-2"></i> |
| <span class="font-medium">Add Certificate</span> |
| </div> |
| </div> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| } |
| |
| function renderAbout() { |
| const html = ` |
| <div class="max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden"> |
| <div class="h-48 bg-gray-900 relative"> |
| <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"> |
| <div class="absolute bottom-0 left-0 p-8 text-white"> |
| <h2 class="text-4xl font-serif font-bold">ARIA COSMETIC</h2> |
| <p class="text-red-200 font-medium tracking-widest text-sm mt-2">PREMIUM K-BEAUTY SOLUTIONS</p> |
| </div> |
| </div> |
| <div class="p-8 md:p-12 space-y-8"> |
| <div> |
| <h3 class="text-xl font-bold text-gray-900 mb-3">Our Mission</h3> |
| <p class="text-gray-600 leading-relaxed"> |
| At ARIA COSMETIC, we bridge the gap between nature and science. Inspired by the pristine beauty of Korea, |
| we formulate products that respect your skin's natural barrier while delivering potent, clinically-proven results. |
| Our commitment to "Clean Beauty" ensures every drop is free from harmful chemicals and cruelty-free. |
| </p> |
| </div> |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-8"> |
| <div class="bg-gray-50 p-6 rounded-xl"> |
| <i class="fa-solid fa-leaf text-brand-red text-2xl mb-3"></i> |
| <h4 class="font-bold text-gray-900">Sustainability</h4> |
| <p class="text-sm text-gray-600 mt-2">100% recyclable packaging and ethically sourced ingredients.</p> |
| </div> |
| <div class="bg-gray-50 p-6 rounded-xl"> |
| <i class="fa-solid fa-flask text-brand-red text-2xl mb-3"></i> |
| <h4 class="font-bold text-gray-900">Innovation</h4> |
| <p class="text-sm text-gray-600 mt-2">State-of-the-art R&D labs in Seoul and Paris.</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| } |
| |
| function renderSupport() { |
| const html = ` |
| <div class="max-w-2xl mx-auto"> |
| <div class="text-center mb-10"> |
| <h2 class="text-3xl font-serif font-bold text-gray-900">Support Center</h2> |
| <p class="text-gray-500 mt-2">Need help with regulatory filings or product data? We're here.</p> |
| </div> |
| |
| <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"> |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Name</label> |
| <input type="text" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none"> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Email</label> |
| <input type="email" required class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none"> |
| </div> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Subject</label> |
| <select class="w-full border border-gray-300 rounded-lg px-4 py-2.5 focus:border-brand-red outline-none bg-white"> |
| <option>Regulatory Inquiry</option> |
| <option>Technical Support</option> |
| <option>Account Issue</option> |
| </select> |
| </div> |
| <div class="space-y-2"> |
| <label class="text-sm font-bold text-gray-700">Message</label> |
| <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> |
| </div> |
| |
| |
| <div class="border border-gray-300 bg-gray-50 p-4 rounded-lg flex items-center gap-3 w-max"> |
| <input type="checkbox" required class="w-5 h-5 text-brand-red rounded focus:ring-brand-red"> |
| <span class="text-sm text-gray-600">I'm not a robot</span> |
| <img src="https://www.gstatic.com/recaptcha/api2/logo_48.png" class="h-8 ml-4 opacity-50"> |
| </div> |
| |
| <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"> |
| Send Message |
| </button> |
| </form> |
| </div> |
| `; |
| document.getElementById('app-content').innerHTML = html; |
| } |
| |
| // --- Utilities --- |
| function showToast(message, type = 'success') { |
| const toast = document.getElementById('toast'); |
| const msg = document.getElementById('toast-msg'); |
| msg.innerText = message; |
| |
| toast.classList.remove('translate-y-20', 'opacity-0'); |
| |
| setTimeout(() => { |
| toast.classList.add('translate-y-20', 'opacity-0'); |
| }, 3000); |
| } |
| |
| // --- Initialization --- |
| document.addEventListener('DOMContentLoaded', () => { |
| router('dashboard'); |
| |
| // Global Search Listener |
| document.getElementById('global-search').addEventListener('input', (e) => { |
| const term = e.target.value.toLowerCase(); |
| if(state.currentView === 'products') { |
| const filtered = state.products.filter(p => |
| p.name.toLowerCase().includes(term) || |
| p.inci.toLowerCase().includes(term) |
| ); |
| renderProductGrid(filtered); |
| } else if (term.length > 2) { |
| // Optional: Auto-switch to products on search |
| // router('products'); |
| } |
| }); |
| }); |
| |
| </script> |
| </body> |
| </html> |