Spaces:
Running
Running
Add 3 files
Browse filesFiles changed (3)
- README.md+7-5
- index.html+941-19
- prompts.txtAdded+1
12345678910---title: Admagicemoji: 🏆colorFrom: graycolorTo: redsdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112---title: admagicemoji: 🐳colorFrom: purplecolorTo: purplesdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>AdMagic - Transform Your Product Images</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>.dropzone {border: 2px dashed #ccc;transition: all 0.3s;}.dropzone.active {border-color: #4f46e5;background-color: rgba(79, 70, 229, 0.05);}.template-card:hover {transform: translateY(-5px);box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);}.color-option {width: 30px;height: 30px;cursor: pointer;transition: transform 0.2s;}.color-option:hover {transform: scale(1.1);}.color-option.selected {border: 2px solid #000;transform: scale(1.1);}.preview-container {perspective: 1000px;}.preview-device {transition: all 0.3s;}.preview-device:hover {transform: translateY(-5px);}#adPreview {transition: all 0.3s;}.slider {-webkit-appearance: none;width: 100%;height: 8px;border-radius: 4px;background: #ddd;outline: none;}.slider::-webkit-slider-thumb {-webkit-appearance: none;appearance: none;width: 18px;height: 18px;border-radius: 50%;background: #4f46e5;cursor: pointer;}.slider::-moz-range-thumb {width: 18px;height: 18px;border-radius: 50%;background: #4f46e5;cursor: pointer;}.step-indicator {width: 30px;height: 30px;border-radius: 50%;display: flex;align-items: center;justify-content: center;font-weight: bold;}.step-indicator.active {background-color: #4f46e5;color: white;}.step-indicator.completed {background-color: #10b981;color: white;}</style></head><body class="bg-gray-50"><div class="container mx-auto px-4 py-8 max-w-7xl"><!-- Header --><header class="mb-10 text-center"><h1 class="text-4xl font-bold text-indigo-700 mb-2">AdMagic</h1><p class="text-lg text-gray-600">Transform your product images into captivating advertisements in minutes</p></header><!-- Progress Steps --><div class="flex justify-between items-center mb-10 px-10 relative"><div class="absolute top-1/2 left-0 right-0 h-1 bg-gray-200 -z-10"></div><div class="flex flex-col items-center"><div id="step1Indicator" class="step-indicator active">1</div><span class="mt-2 text-sm font-medium">Upload Image</span></div><div class="flex flex-col items-center"><div id="step2Indicator" class="step-indicator">2</div><span class="mt-2 text-sm font-medium">Choose Template</span></div><div class="flex flex-col items-center"><div id="step3Indicator" class="step-indicator">3</div><span class="mt-2 text-sm font-medium">Customize</span></div><div class="flex flex-col items-center"><div id="step4Indicator" class="step-indicator">4</div><span class="mt-2 text-sm font-medium">Branding</span></div><div class="flex flex-col items-center"><div id="step5Indicator" class="step-indicator">5</div><span class="mt-2 text-sm font-medium">Export</span></div></div><!-- Main Content Area --><div class="grid grid-cols-1 lg:grid-cols-3 gap-8"><!-- Left Panel - Controls --><div class="lg:col-span-1 bg-white rounded-xl shadow-md p-6 h-fit sticky top-6"><div id="step1" class="step-content"><h2 class="text-xl font-semibold mb-4">Upload Your Product Image</h2><div id="dropzone" class="dropzone rounded-lg p-8 text-center mb-4"><i class="fas fa-cloud-upload-alt text-4xl text-indigo-500 mb-3"></i><p class="mb-2">Drag & drop your image here</p><p class="text-sm text-gray-500 mb-4">or</p><label for="fileUpload" class="bg-indigo-600 text-white px-4 py-2 rounded-md cursor-pointer hover:bg-indigo-700 transition">Browse Files</label><input type="file" id="fileUpload" accept="image/*" class="hidden"></div><div id="imagePreviewContainer" class="hidden mb-4"><h3 class="font-medium mb-2">Image Preview</h3><div class="border rounded-lg overflow-hidden"><img id="imagePreview" src="" alt="Preview" class="w-full"></div></div><div id="enhancementControls" class="hidden"><h3 class="font-medium mb-2">Image Enhancement</h3><div class="space-y-4"><div><label class="block text-sm font-medium mb-1">Brightness</label><input type="range" min="0" max="200" value="100" class="slider" id="brightnessSlider"><div class="flex justify-between text-xs text-gray-500"><span>0%</span><span>100%</span><span>200%</span></div></div><div><label class="block text-sm font-medium mb-1">Contrast</label><input type="range" min="0" max="200" value="100" class="slider" id="contrastSlider"><div class="flex justify-between text-xs text-gray-500"><span>0%</span><span>100%</span><span>200%</span></div></div><div><label class="block text-sm font-medium mb-1">Saturation</label><input type="range" min="0" max="200" value="100" class="slider" id="saturationSlider"><div class="flex justify-between text-xs text-gray-500"><span>0%</span><span>100%</span><span>200%</span></div></div><div class="flex space-x-2"><button id="autoEnhanceBtn" class="flex-1 bg-indigo-100 text-indigo-700 px-3 py-1 rounded text-sm hover:bg-indigo-200">Auto Enhance</button><button id="resetEnhancementBtn" class="flex-1 bg-gray-100 text-gray-700 px-3 py-1 rounded text-sm hover:bg-gray-200">Reset</button></div></div></div><button id="nextStep1Btn" class="w-full bg-indigo-600 text-white py-2 rounded-md mt-4 hover:bg-indigo-700 disabled:bg-indigo-300 disabled:cursor-not-allowed" disabled>Next: Choose Template</button></div><div id="step2" class="step-content hidden"><h2 class="text-xl font-semibold mb-4">Choose a Template</h2><div class="mb-4"><label class="block text-sm font-medium mb-1">Industry</label><select id="industrySelect" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500"><option value="all">All Industries</option><option value="fashion">Fashion</option><option value="food">Food & Beverage</option><option value="electronics">Electronics</option><option value="beauty">Beauty & Cosmetics</option><option value="home">Home & Living</option></select></div><div class="grid grid-cols-2 gap-3 mb-4" id="templateGallery"><!-- Templates will be loaded here --></div><div class="flex space-x-2"><button id="backStep2Btn" class="flex-1 bg-gray-200 text-gray-700 py-2 rounded-md hover:bg-gray-300">Back</button><button id="nextStep2Btn" class="flex-1 bg-indigo-600 text-white py-2 rounded-md hover:bg-indigo-700 disabled:bg-indigo-300 disabled:cursor-not-allowed" disabled>Next: Customize</button></div></div><div id="step3" class="step-content hidden"><h2 class="text-xl font-semibold mb-4">Customize Your Ad</h2><div class="mb-4"><label class="block text-sm font-medium mb-1">Headline</label><input type="text" id="headlineInput" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Enter catchy headline"><div class="mt-1 flex flex-wrap gap-1" id="suggestedHeadlines"><span class="text-xs bg-gray-100 px-2 py-1 rounded cursor-pointer hover:bg-gray-200">Summer Sale!</span><span class="text-xs bg-gray-100 px-2 py-1 rounded cursor-pointer hover:bg-gray-200">Limited Time Offer</span><span class="text-xs bg-gray-100 px-2 py-1 rounded cursor-pointer hover:bg-gray-200">New Collection</span></div></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Description</label><textarea id="descriptionInput" rows="3" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Enter product description"></textarea></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Call to Action</label><input type="text" id="ctaInput" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="e.g. Shop Now, Learn More"></div><div class="flex space-x-2"><button id="backStep3Btn" class="flex-1 bg-gray-200 text-gray-700 py-2 rounded-md hover:bg-gray-300">Back</button><button id="nextStep3Btn" class="flex-1 bg-indigo-600 text-white py-2 rounded-md hover:bg-indigo-700">Next: Branding</button></div></div><div id="step4" class="step-content hidden"><h2 class="text-xl font-semibold mb-4">Add Your Branding</h2><div class="mb-4"><label class="block text-sm font-medium mb-1">Upload Logo</label><div class="flex items-center"><div id="logoPreview" class="w-16 h-16 border rounded-md flex items-center justify-center bg-gray-100 mr-3 overflow-hidden"><i class="fas fa-camera text-gray-400"></i></div><label for="logoUpload" class="bg-gray-100 text-gray-700 px-3 py-1 rounded text-sm hover:bg-gray-200 cursor-pointer">Choose File</label><input type="file" id="logoUpload" accept="image/*" class="hidden"></div></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Brand Colors</label><div class="flex flex-wrap gap-2 mt-2"><div class="color-option bg-indigo-600 rounded-full selected" data-color="#4f46e5"></div><div class="color-option bg-red-600 rounded-full" data-color="#dc2626"></div><div class="color-option bg-green-600 rounded-full" data-color="#16a34a"></div><div class="color-option bg-yellow-500 rounded-full" data-color="#eab308"></div><div class="color-option bg-pink-600 rounded-full" data-color="#db2777"></div><div class="color-option bg-purple-600 rounded-full" data-color="#9333ea"></div><div class="color-option bg-blue-600 rounded-full" data-color="#2563eb"></div><div class="color-option bg-gray-800 rounded-full" data-color="#1f2937"></div></div><div class="mt-2"><label class="inline-flex items-center"><input type="checkbox" id="customColorToggle" class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"><span class="ml-2 text-sm">Use custom color</span></label><div id="customColorPicker" class="mt-2 hidden"><input type="color" id="brandColorPicker" class="w-full h-10"></div></div></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Font Style</label><select id="fontSelect" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500"><option value="'Inter', sans-serif">Inter (Modern)</option><option value="'Playfair Display', serif">Playfair Display (Elegant)</option><option value="'Roboto', sans-serif">Roboto (Clean)</option><option value="'Montserrat', sans-serif">Montserrat (Bold)</option><option value="'Open Sans', sans-serif">Open Sans (Friendly)</option></select></div><div class="flex space-x-2"><button id="backStep4Btn" class="flex-1 bg-gray-200 text-gray-700 py-2 rounded-md hover:bg-gray-300">Back</button><button id="nextStep4Btn" class="flex-1 bg-indigo-600 text-white py-2 rounded-md hover:bg-indigo-700">Next: Export</button></div></div><div id="step5" class="step-content hidden"><h2 class="text-xl font-semibold mb-4">Export Your Ad</h2><div class="mb-4"><label class="block text-sm font-medium mb-1">Format</label><div class="flex space-x-2"><label class="flex-1 border rounded-md px-3 py-2 text-center cursor-pointer hover:bg-gray-50"><input type="radio" name="exportFormat" value="png" class="mr-1" checked> PNG</label><label class="flex-1 border rounded-md px-3 py-2 text-center cursor-pointer hover:bg-gray-50"><input type="radio" name="exportFormat" value="jpg" class="mr-1"> JPG</label><label class="flex-1 border rounded-md px-3 py-2 text-center cursor-pointer hover:bg-gray-50"><input type="radio" name="exportFormat" value="pdf" class="mr-1"> PDF</label></div></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Quality</label><select id="qualitySelect" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500"><option value="high">High (Recommended)</option><option value="medium">Medium</option><option value="low">Low</option></select></div><div class="mb-6"><label class="block text-sm font-medium mb-1">Size</label><select id="sizeSelect" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500"><option value="original">Original Size</option><option value="instagram">Instagram Post (1080x1080)</option><option value="facebook">Facebook Ad (1200x628)</option><option value="twitter">Twitter Post (1200x675)</option><option value="pinterest">Pinterest Pin (1000x1500)</option></select></div><div class="flex space-x-2"><button id="backStep5Btn" class="flex-1 bg-gray-200 text-gray-700 py-2 rounded-md hover:bg-gray-300">Back</button><button id="exportBtn" class="flex-1 bg-green-600 text-white py-2 rounded-md hover:bg-green-700 flex items-center justify-center"><i class="fas fa-download mr-2"></i> Export</button></div><div class="mt-4"><p class="text-sm font-medium mb-2">Share directly:</p><div class="flex space-x-2"><button class="bg-blue-500 text-white p-2 rounded-full hover:bg-blue-600"><i class="fab fa-facebook-f"></i></button><button class="bg-blue-400 text-white p-2 rounded-full hover:bg-blue-500"><i class="fab fa-twitter"></i></button><button class="bg-pink-600 text-white p-2 rounded-full hover:bg-pink-700"><i class="fab fa-instagram"></i></button><button class="bg-red-600 text-white p-2 rounded-full hover:bg-red-700"><i class="fab fa-pinterest-p"></i></button></div></div></div></div><!-- Right Panel - Preview --><div class="lg:col-span-2"><div class="bg-white rounded-xl shadow-md p-6 mb-6"><h2 class="text-xl font-semibold mb-4">Ad Preview</h2><div class="preview-container"><div class="flex justify-center space-x-4 mb-6"><button class="preview-device bg-gray-100 px-4 py-2 rounded-lg text-sm font-medium" data-size="desktop"><i class="fas fa-desktop mr-1"></i> Desktop</button><button class="preview-device bg-gray-100 px-4 py-2 rounded-lg text-sm font-medium" data-size="tablet"><i class="fas fa-tablet-alt mr-1"></i> Tablet</button><button class="preview-device bg-gray-100 px-4 py-2 rounded-lg text-sm font-medium active" data-size="mobile"><i class="fas fa-mobile-alt mr-1"></i> Mobile</button></div><div class="flex justify-center"><div id="previewFrame" class="border-8 border-gray-800 rounded-3xl w-full max-w-md bg-gray-800 p-1"><div id="adPreview" class="bg-white w-full aspect-[9/16] overflow-hidden relative"><!-- Ad content will be rendered here --><div class="absolute inset-0 flex items-center justify-center text-gray-400"><div class="text-center"><i class="fas fa-ad text-4xl mb-2"></i><p>Your ad preview will appear here</p></div></div></div></div></div></div></div><!-- Feedback Section --><div class="bg-white rounded-xl shadow-md p-6"><h2 class="text-xl font-semibold mb-4">Help Us Improve</h2><p class="text-gray-600 mb-4">We'd love to hear your feedback about AdMagic. What features would you like to see?</p><div class="mb-4"><label class="block text-sm font-medium mb-1">Your Feedback</label><textarea id="feedbackInput" rows="3" class="w-full border rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Share your thoughts..."></textarea></div><div class="mb-4"><label class="block text-sm font-medium mb-1">Rating</label><div class="flex space-x-1"><button class="text-gray-400 hover:text-yellow-500 feedback-star" data-rating="1"><i class="far fa-star text-2xl"></i></button><button class="text-gray-400 hover:text-yellow-500 feedback-star" data-rating="2"><i class="far fa-star text-2xl"></i></button><button class="text-gray-400 hover:text-yellow-500 feedback-star" data-rating="3"><i class="far fa-star text-2xl"></i></button><button class="text-gray-400 hover:text-yellow-500 feedback-star" data-rating="4"><i class="far fa-star text-2xl"></i></button><button class="text-gray-400 hover:text-yellow-500 feedback-star" data-rating="5"><i class="far fa-star text-2xl"></i></button></div></div><button id="submitFeedbackBtn" class="bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700">Submit Feedback</button></div></div></div></div><script>document.addEventListener('DOMContentLoaded', function() {// Step managementlet currentStep = 1;// DOM elementsconst stepContents = document.querySelectorAll('.step-content');const stepIndicators = [document.getElementById('step1Indicator'),document.getElementById('step2Indicator'),document.getElementById('step3Indicator'),document.getElementById('step4Indicator'),document.getElementById('step5Indicator')];// Navigation buttonsconst nextButtons = [document.getElementById('nextStep1Btn'),document.getElementById('nextStep2Btn'),document.getElementById('nextStep3Btn'),document.getElementById('nextStep4Btn')];const backButtons = [document.getElementById('backStep2Btn'),document.getElementById('backStep3Btn'),document.getElementById('backStep4Btn'),document.getElementById('backStep5Btn')];// Initialize template galleryinitializeTemplates();// Initialize event listenerssetupEventListeners();function setupEventListeners() {// File uploadconst dropzone = document.getElementById('dropzone');const fileUpload = document.getElementById('fileUpload');['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {dropzone.addEventListener(eventName, preventDefaults, false);});['dragenter', 'dragover'].forEach(eventName => {dropzone.addEventListener(eventName, highlight, false);});['dragleave', 'drop'].forEach(eventName => {dropzone.addEventListener(eventName, unhighlight, false);});dropzone.addEventListener('drop', handleDrop, false);fileUpload.addEventListener('change', handleFileSelect, false);// Image enhancement controlsconst brightnessSlider = document.getElementById('brightnessSlider');const contrastSlider = document.getElementById('contrastSlider');const saturationSlider = document.getElementById('saturationSlider');const autoEnhanceBtn = document.getElementById('autoEnhanceBtn');const resetEnhancementBtn = document.getElementById('resetEnhancementBtn');brightnessSlider.addEventListener('input', updateImageEnhancement);contrastSlider.addEventListener('input', updateImageEnhancement);saturationSlider.addEventListener('input', updateImageEnhancement);autoEnhanceBtn.addEventListener('click', autoEnhanceImage);resetEnhancementBtn.addEventListener('click', resetEnhancement);// NavigationnextButtons.forEach((btn, index) => {btn.addEventListener('click', () => goToStep(index + 2));});backButtons.forEach((btn, index) => {btn.addEventListener('click', () => goToStep(index + 1));});// Template selectiondocument.getElementById('industrySelect').addEventListener('change', filterTemplates);// Brandingdocument.getElementById('logoUpload').addEventListener('change', handleLogoUpload);document.querySelectorAll('.color-option').forEach(option => {option.addEventListener('click', selectBrandColor);});document.getElementById('customColorToggle').addEventListener('change', toggleCustomColorPicker);document.getElementById('brandColorPicker').addEventListener('input', updateCustomBrandColor);document.getElementById('fontSelect').addEventListener('change', updateFontStyle);// Suggested headlinesdocument.querySelectorAll('#suggestedHeadlines span').forEach(span => {span.addEventListener('click', applySuggestedHeadline);});// Text inputsdocument.getElementById('headlineInput').addEventListener('input', updateAdPreview);document.getElementById('descriptionInput').addEventListener('input', updateAdPreview);document.getElementById('ctaInput').addEventListener('input', updateAdPreview);// Preview devicesdocument.querySelectorAll('.preview-device').forEach(btn => {btn.addEventListener('click', switchPreviewDevice);});// Exportdocument.getElementById('exportBtn').addEventListener('click', exportAd);// Feedbackdocument.querySelectorAll('.feedback-star').forEach(star => {star.addEventListener('click', rateApp);});document.getElementById('submitFeedbackBtn').addEventListener('click', submitFeedback);}function preventDefaults(e) {e.preventDefault();e.stopPropagation();}function highlight() {dropzone.classList.add('active');}function unhighlight() {dropzone.classList.remove('active');}function handleDrop(e) {const dt = e.dataTransfer;const files = dt.files;handleFiles(files);}function handleFileSelect(e) {const files = e.target.files;handleFiles(files);}function handleFiles(files) {if (files.length > 0) {const file = files[0];if (file.type.match('image.*')) {const reader = new FileReader();reader.onload = function(e) {const imagePreview = document.getElementById('imagePreview');const imagePreviewContainer = document.getElementById('imagePreviewContainer');const enhancementControls = document.getElementById('enhancementControls');const nextStep1Btn = document.getElementById('nextStep1Btn');imagePreview.src = e.target.result;imagePreviewContainer.classList.remove('hidden');enhancementControls.classList.remove('hidden');nextStep1Btn.disabled = false;// Store original image for reset functionalityoriginalImageSrc = e.target.result;// Update ad previewupdateAdPreview();};reader.readAsDataURL(file);} else {alert('Please upload an image file.');}}}function handleLogoUpload(e) {const files = e.target.files;if (files.length > 0) {const file = files[0];if (file.type.match('image.*')) {const reader = new FileReader();reader.onload = function(e) {const logoPreview = document.getElementById('logoPreview');logoPreview.innerHTML = `<img src="${e.target.result}" class="w-full h-full object-contain">`;// Update ad preview with logoupdateAdPreview();};reader.readAsDataURL(file);}}}let originalImageSrc = '';function updateImageEnhancement() {const imagePreview = document.getElementById('imagePreview');const brightness = document.getElementById('brightnessSlider').value;const contrast = document.getElementById('contrastSlider').value;const saturation = document.getElementById('saturationSlider').value;imagePreview.style.filter = `brightness(${brightness}%) contrast(${contrast}%) saturate(${saturation}%)`;// Update ad previewupdateAdPreview();}function autoEnhanceImage() {// Simulate auto-enhance by setting "optimal" valuesdocument.getElementById('brightnessSlider').value = 110;document.getElementById('contrastSlider').value = 120;document.getElementById('saturationSlider').value = 115;updateImageEnhancement();}function resetEnhancement() {document.getElementById('brightnessSlider').value = 100;document.getElementById('contrastSlider').value = 100;document.getElementById('saturationSlider').value = 100;updateImageEnhancement();}function initializeTemplates() {const templateGallery = document.getElementById('templateGallery');// Sample templates data (in a real app, this would come from a database)const templates = [{ id: 1, name: 'Modern', industry: 'all', thumbnail: 'https://via.placeholder.com/150/4f46e5/ffffff?text=Modern' },{ id: 2, name: 'Elegant', industry: 'fashion', thumbnail: 'https://via.placeholder.com/150/db2777/ffffff?text=Elegant' },{ id: 3, name: 'Bold', industry: 'electronics', thumbnail: 'https://via.placeholder.com/150/1f2937/ffffff?text=Bold' },{ id: 4, name: 'Fresh', industry: 'food', thumbnail: 'https://via.placeholder.com/150/16a34a/ffffff?text=Fresh' },{ id: 5, name: 'Minimal', industry: 'all', thumbnail: 'https://via.placeholder.com/150/ffffff/1f2937?text=Minimal' },{ id: 6, name: 'Vibrant', industry: 'beauty', thumbnail: 'https://via.placeholder.com/150/eab308/ffffff?text=Vibrant' }];// Render templatestemplates.forEach(template => {const templateCard = document.createElement('div');templateCard.className = 'template-card border rounded-lg overflow-hidden cursor-pointer transition';templateCard.dataset.id = template.id;templateCard.dataset.industry = template.industry;templateCard.innerHTML = `<img src="${template.thumbnail}" alt="${template.name}" class="w-full h-24 object-cover"><div class="p-2 text-center"><p class="text-sm font-medium">${template.name}</p></div>`;templateCard.addEventListener('click', () => selectTemplate(template.id));templateGallery.appendChild(templateCard);});}function filterTemplates() {const industry = document.getElementById('industrySelect').value;const templates = document.querySelectorAll('.template-card');templates.forEach(template => {if (industry === 'all' || template.dataset.industry === industry) {template.style.display = 'block';} else {template.style.display = 'none';}});}let selectedTemplateId = null;function selectTemplate(id) {selectedTemplateId = id;// Highlight selected templatedocument.querySelectorAll('.template-card').forEach(card => {if (card.dataset.id == id) {card.classList.add('ring-2', 'ring-indigo-500');} else {card.classList.remove('ring-2', 'ring-indigo-500');}});// Enable next buttondocument.getElementById('nextStep2Btn').disabled = false;// Update ad previewupdateAdPreview();}function applySuggestedHeadline(e) {document.getElementById('headlineInput').value = e.target.textContent;updateAdPreview();}let selectedBrandColor = '#4f46e5';function selectBrandColor(e) {selectedBrandColor = e.target.dataset.color;// Update color selection UIdocument.querySelectorAll('.color-option').forEach(option => {option.classList.remove('selected');});e.target.classList.add('selected');// Hide custom color picker if it's visibledocument.getElementById('customColorToggle').checked = false;document.getElementById('customColorPicker').classList.add('hidden');// Update ad previewupdateAdPreview();}function toggleCustomColorPicker(e) {const picker = document.getElementById('customColorPicker');if (e.target.checked) {picker.classList.remove('hidden');} else {picker.classList.add('hidden');}}function updateCustomBrandColor(e) {selectedBrandColor = e.target.value;// Update ad previewupdateAdPreview();}function updateFontStyle() {const font = document.getElementById('fontSelect').value;// In a real app, you would load the font dynamicallyupdateAdPreview();}function switchPreviewDevice(e) {const previewFrame = document.getElementById('previewFrame');const size = e.target.dataset.size;// Update active buttondocument.querySelectorAll('.preview-device').forEach(btn => {btn.classList.remove('active', 'bg-indigo-100', 'text-indigo-700');btn.classList.add('bg-gray-100');});e.target.classList.remove('bg-gray-100');e.target.classList.add('active', 'bg-indigo-100', 'text-indigo-700');// Update preview frameif (size === 'desktop') {previewFrame.classList.remove('border-8', 'rounded-3xl', 'max-w-md');previewFrame.classList.add('border', 'rounded-lg', 'max-w-4xl');previewFrame.querySelector('#adPreview').classList.remove('aspect-[9/16]');previewFrame.querySelector('#adPreview').classList.add('aspect-[16/9]');} else if (size === 'tablet') {previewFrame.classList.remove('border-8', 'rounded-3xl', 'max-w-md');previewFrame.classList.add('border-4', 'rounded-xl', 'max-w-lg');previewFrame.querySelector('#adPreview').classList.remove('aspect-[9/16]');previewFrame.querySelector('#adPreview').classList.add('aspect-[4/3]');} else { // mobilepreviewFrame.classList.remove('border', 'rounded-lg', 'max-w-4xl');previewFrame.classList.add('border-8', 'rounded-3xl', 'max-w-md');previewFrame.querySelector('#adPreview').classList.remove('aspect-[16/9]', 'aspect-[4/3]');previewFrame.querySelector('#adPreview').classList.add('aspect-[9/16]');}}function updateAdPreview() {const adPreview = document.getElementById('adPreview');const imagePreview = document.getElementById('imagePreview');const headline = document.getElementById('headlineInput').value;const description = document.getElementById('descriptionInput').value;const cta = document.getElementById('ctaInput').value;const logoPreview = document.getElementById('logoPreview').querySelector('img');// Clear previous contentadPreview.innerHTML = '';// Add background (image or color)if (imagePreview.src) {const bgDiv = document.createElement('div');bgDiv.className = 'absolute inset-0 overflow-hidden';const bgImg = document.createElement('img');bgImg.src = imagePreview.src;bgImg.style.filter = imagePreview.style.filter;bgImg.className = 'w-full h-full object-cover';bgDiv.appendChild(bgImg);adPreview.appendChild(bgDiv);// Add overlay for better text visibilityconst overlay = document.createElement('div');overlay.className = 'absolute inset-0 bg-black bg-opacity-30';adPreview.appendChild(overlay);} else {adPreview.style.backgroundColor = selectedBrandColor;}// Add content based on template (simplified for demo)const contentDiv = document.createElement('div');contentDiv.className = 'relative z-10 h-full flex flex-col p-6 text-white';// Add logo if uploadedif (logoPreview) {const logoDiv = document.createElement('div');logoDiv.className = 'mb-4';const logoImg = document.createElement('img');logoImg.src = logoPreview.src;logoImg.className = 'h-10 object-contain';logoDiv.appendChild(logoImg);contentDiv.appendChild(logoDiv);}// Add headline if providedif (headline) {const headlineDiv = document.createElement('h2');headlineDiv.className = 'text-3xl font-bold mb-2';headlineDiv.textContent = headline;contentDiv.appendChild(headlineDiv);}// Add description if providedif (description) {const descDiv = document.createElement('p');descDiv.className = 'text-lg mb-4';descDiv.textContent = description;contentDiv.appendChild(descDiv);}// Add CTA button if providedif (cta) {const ctaDiv = document.createElement('div');ctaDiv.className = 'mt-auto';const ctaBtn = document.createElement('button');ctaBtn.className = 'bg-white text-indigo-700 px-6 py-2 rounded-full font-medium shadow-lg hover:bg-gray-100 transition';ctaBtn.textContent = cta;ctaDiv.appendChild(ctaBtn);contentDiv.appendChild(ctaDiv);}adPreview.appendChild(contentDiv);}function goToStep(step) {// Hide current stepdocument.getElementById(`step${currentStep}`).classList.add('hidden');stepIndicators[currentStep - 1].classList.remove('active', 'completed');// Update current stepcurrentStep = step;// Show new stepdocument.getElementById(`step${currentStep}`).classList.remove('hidden');// Update step indicatorsfor (let i = 0; i < stepIndicators.length; i++) {if (i < currentStep - 1) {stepIndicators[i].classList.add('completed');stepIndicators[i].classList.remove('active');} else if (i === currentStep - 1) {stepIndicators[i].classList.add('active');stepIndicators[i].classList.remove('completed');} else {stepIndicators[i].classList.remove('active', 'completed');}}// Scroll to top of controlsdocument.querySelector('.lg\\:col-span-1').scrollTo(0, 0);}function exportAd() {// In a real app, this would use a library like html2canvas to export the adalert('Your ad has been exported! (This is a demo - in a real app, the ad would be downloaded)');// Show success messageconst exportBtn = document.getElementById('exportBtn');const originalText = exportBtn.innerHTML;exportBtn.innerHTML = '<i class="fas fa-check mr-2"></i> Success!';exportBtn.classList.remove('bg-green-600', 'hover:bg-green-700');exportBtn.classList.add('bg-green-500');// Reset button after delaysetTimeout(() => {exportBtn.innerHTML = originalText;exportBtn.classList.remove('bg-green-500');exportBtn.classList.add('bg-green-600', 'hover:bg-green-700');}, 2000);}function rateApp(e) {const rating = parseInt(e.target.dataset.rating);const stars = document.querySelectorAll('.feedback-star');stars.forEach((star, index) => {if (index < rating) {star.innerHTML = '<i class="fas fa-star text-2xl text-yellow-500"></i>';} else {star.innerHTML = '<i class="far fa-star text-2xl text-gray-400"></i>';}});}function submitFeedback() {const feedback = document.getElementById('feedbackInput').value;const stars = document.querySelectorAll('.feedback-star i.fas.fa-star').length;if (feedback || stars > 0) {// In a real app, this would send the feedback to a serveralert('Thank you for your feedback!');document.getElementById('feedbackInput').value = '';// Reset starsdocument.querySelectorAll('.feedback-star').forEach(star => {star.innerHTML = '<i class="far fa-star text-2xl text-gray-400"></i>';});} else {alert('Please provide feedback or a rating before submitting.');}}});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=frederic54/admagic" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>
1You are a digital advertising app developer. Your task is to create an application that transforms simple product images into captivating advertisements. The process involves the following steps: 1: Automatically enhance the quality of the uploaded product image using filters and adjustments to brightness, contrast, and saturation. 2: Provide users with a variety of customizable advertisement templates that cater to different industries (e.g., fashion, food, electronics). 3: Allow users to add eye-catching slogans or descriptions. Offer an option to suggest popular phrases based on the product type to enhance marketing appeal. 4: Incorporate features that allow users to upload their logos and brand colors to create a cohesive advertisement. 5: Enable users to preview their advertisement in various formats and make adjustments to layout, colors, and fonts in real-time. 6: Facilitate exporting the final advertisement in multiple formats (JPEG, PNG, etc.) and provide sharing options for social media platforms or direct downloads. Your goal is to build a user-friendly interface that guides users through these steps seamlessly. Think through each feature and how it contributes to the overall user experience. Collect feedback from potential users to refine the app furtherREADME.md+7-5
index.html+941-19
prompts.txtAdded+1