Spaces:
Running
Running
https://huggingface.co/spaces/charanKompala/business-analyst-gpt - Initial Deployment
1dd00b9
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Business Analyst GPT</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> | |
| /* Custom scrollbar */ | |
| .custom-scrollbar::-webkit-scrollbar { | |
| width: 6px; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-track { | |
| background: #f1f1f1; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-thumb { | |
| background: #888; | |
| border-radius: 3px; | |
| } | |
| .custom-scrollbar::-webkit-scrollbar-thumb:hover { | |
| background: #555; | |
| } | |
| /* Chat bubble animation */ | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(10px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .chat-message { | |
| animation: fadeIn 0.3s ease-out; | |
| } | |
| /* Pulse animation for loading */ | |
| @keyframes pulse { | |
| 0%, 100% { opacity: 1; } | |
| 50% { opacity: 0.5; } | |
| } | |
| .animate-pulse { | |
| animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen flex flex-col"> | |
| <!-- Header --> | |
| <header class="bg-indigo-700 text-white shadow-md"> | |
| <div class="container mx-auto px-4 py-4 flex justify-between items-center"> | |
| <div class="flex items-center space-x-3"> | |
| <i class="fas fa-chart-line text-2xl"></i> | |
| <h1 class="text-xl md:text-2xl font-bold">Business Analyst GPT</h1> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <button class="hidden md:block bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded-lg transition"> | |
| <i class="fas fa-history mr-2"></i>History | |
| </button> | |
| <button class="hidden md:block bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded-lg transition"> | |
| <i class="fas fa-cog mr-2"></i>Settings | |
| </button> | |
| <div class="w-10 h-10 rounded-full bg-indigo-600 flex items-center justify-center cursor-pointer"> | |
| <i class="fas fa-user"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="flex-1 container mx-auto px-4 py-6 flex flex-col md:flex-row gap-6"> | |
| <!-- Sidebar (hidden on mobile) --> | |
| <aside class="hidden md:block w-64 bg-white rounded-lg shadow-md p-4 h-fit"> | |
| <h2 class="font-bold text-lg mb-4 text-gray-700">Quick Actions</h2> | |
| <ul class="space-y-2"> | |
| <li> | |
| <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center"> | |
| <i class="fas fa-file-invoice-dollar mr-3"></i> Financial Analysis | |
| </button> | |
| </li> | |
| <li> | |
| <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center"> | |
| <i class="fas fa-chart-pie mr-3"></i> Market Research | |
| </button> | |
| </li> | |
| <li> | |
| <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center"> | |
| <i class="fas fa-project-diagram mr-3"></i> SWOT Analysis | |
| </button> | |
| </li> | |
| <li> | |
| <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center"> | |
| <i class="fas fa-lightbulb mr-3"></i> Business Ideas | |
| </button> | |
| </li> | |
| </ul> | |
| <div class="mt-6"> | |
| <h2 class="font-bold text-lg mb-4 text-gray-700">Recent Chats</h2> | |
| <ul class="space-y-2"> | |
| <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate"> | |
| <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Q2 Revenue forecast | |
| </li> | |
| <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate"> | |
| <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Competitor analysis | |
| </li> | |
| <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate"> | |
| <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Pricing strategy | |
| </li> | |
| </ul> | |
| </div> | |
| </aside> | |
| <!-- Chat Area --> | |
| <div class="flex-1 flex flex-col bg-white rounded-lg shadow-md overflow-hidden"> | |
| <!-- Chat Header --> | |
| <div class="border-b p-4 bg-gray-50"> | |
| <div class="flex justify-between items-center"> | |
| <h2 class="font-bold text-gray-700">New Conversation</h2> | |
| <div class="flex space-x-2"> | |
| <button class="p-2 text-gray-500 hover:text-indigo-600 hover:bg-gray-100 rounded-full transition"> | |
| <i class="fas fa-ellipsis-v"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Messages Container --> | |
| <div id="messages" class="flex-1 p-4 overflow-y-auto custom-scrollbar space-y-4"> | |
| <!-- Welcome Message --> | |
| <div class="chat-message"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center"> | |
| <i class="fas fa-robot"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <div class="bg-gray-100 rounded-lg p-4 max-w-3xl"> | |
| <h3 class="font-bold text-indigo-700 mb-1">Business Analyst GPT</h3> | |
| <p class="text-gray-700">Hello! I'm your AI Business Analyst assistant. How can I help you today? Here are some things I can do:</p> | |
| <ul class="list-disc pl-5 mt-2 space-y-1 text-gray-700"> | |
| <li>Analyze financial data and create reports</li> | |
| <li>Generate market research insights</li> | |
| <li>Help with business strategy and planning</li> | |
| <li>Create visualizations from your data</li> | |
| </ul> | |
| </div> | |
| <div class="text-xs text-gray-500 mt-1">Today at <span id="current-time"></span></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Input Area --> | |
| <div class="border-t p-4 bg-gray-50"> | |
| <form id="chat-form" class="flex items-center space-x-2"> | |
| <div class="flex-1 relative"> | |
| <textarea id="message-input" rows="1" class="w-full border rounded-lg pl-4 pr-12 py-3 focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-none" placeholder="Ask me anything about business analysis..."></textarea> | |
| <div class="absolute right-2 bottom-2 flex space-x-1"> | |
| <button type="button" class="p-1 text-gray-500 hover:text-indigo-600 rounded-full transition"> | |
| <i class="fas fa-paperclip"></i> | |
| </button> | |
| <button type="button" class="p-1 text-gray-500 hover:text-indigo-600 rounded-full transition"> | |
| <i class="fas fa-microphone"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg p-3 transition"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </form> | |
| <p class="text-xs text-gray-500 mt-2 text-center">Business Analyst GPT may produce inaccurate information. Verify critical information.</p> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Mobile Bottom Navigation --> | |
| <nav class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t shadow-lg"> | |
| <div class="flex justify-around"> | |
| <button class="p-4 text-indigo-600"> | |
| <i class="fas fa-comment-dots text-xl"></i> | |
| </button> | |
| <button class="p-4 text-gray-500"> | |
| <i class="fas fa-history text-xl"></i> | |
| </button> | |
| <button class="p-4 text-gray-500"> | |
| <i class="fas fa-chart-line text-xl"></i> | |
| </button> | |
| <button class="p-4 text-gray-500"> | |
| <i class="fas fa-cog text-xl"></i> | |
| </button> | |
| </div> | |
| </nav> | |
| <script> | |
| // Set current time in welcome message | |
| const now = new Date(); | |
| const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); | |
| document.getElementById('current-time').textContent = timeString; | |
| // Auto-resize textarea | |
| const textarea = document.getElementById('message-input'); | |
| textarea.addEventListener('input', function() { | |
| this.style.height = 'auto'; | |
| this.style.height = (this.scrollHeight) + 'px'; | |
| }); | |
| // Chat functionality | |
| const chatForm = document.getElementById('chat-form'); | |
| const messagesContainer = document.getElementById('messages'); | |
| chatForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const message = textarea.value.trim(); | |
| if (message) { | |
| // Add user message | |
| addMessage(message, 'user'); | |
| textarea.value = ''; | |
| textarea.style.height = 'auto'; | |
| // Show loading indicator | |
| const loadingId = 'loading-' + Date.now(); | |
| addLoadingIndicator(loadingId); | |
| // Simulate AI response after a delay | |
| setTimeout(() => { | |
| // Remove loading indicator | |
| const loadingElement = document.getElementById(loadingId); | |
| if (loadingElement) loadingElement.remove(); | |
| // Add AI response | |
| const response = getAIResponse(message); | |
| addMessage(response, 'ai'); | |
| // Scroll to bottom | |
| messagesContainer.scrollTop = messagesContainer.scrollHeight; | |
| }, 1500); | |
| } | |
| }); | |
| function addMessage(content, sender) { | |
| const now = new Date(); | |
| const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); | |
| const messageDiv = document.createElement('div'); | |
| messageDiv.className = 'chat-message'; | |
| if (sender === 'user') { | |
| messageDiv.innerHTML = ` | |
| <div class="flex items-start justify-end"> | |
| <div class="ml-3"> | |
| <div class="bg-indigo-100 rounded-lg p-4 max-w-3xl"> | |
| <p class="text-gray-800">${content}</p> | |
| </div> | |
| <div class="text-xs text-gray-500 mt-1 text-right">${timeString}</div> | |
| </div> | |
| <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-600 text-white flex items-center justify-center"> | |
| <i class="fas fa-user"></i> | |
| </div> | |
| </div> | |
| `; | |
| } else { | |
| messageDiv.innerHTML = ` | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center"> | |
| <i class="fas fa-robot"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <div class="bg-gray-100 rounded-lg p-4 max-w-3xl"> | |
| <h3 class="font-bold text-indigo-700 mb-1">Business Analyst GPT</h3> | |
| <p class="text-gray-700">${content}</p> | |
| </div> | |
| <div class="text-xs text-gray-500 mt-1">${timeString}</div> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| messagesContainer.appendChild(messageDiv); | |
| messagesContainer.scrollTop = messagesContainer.scrollHeight; | |
| } | |
| function addLoadingIndicator(id) { | |
| const loadingDiv = document.createElement('div'); | |
| loadingDiv.id = id; | |
| loadingDiv.className = 'chat-message'; | |
| loadingDiv.innerHTML = ` | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center"> | |
| <i class="fas fa-robot"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <div class="bg-gray-100 rounded-lg p-4 max-w-3xl"> | |
| <div class="flex space-x-2"> | |
| <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse"></div> | |
| <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.2s"></div> | |
| <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.4s"></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| messagesContainer.appendChild(loadingDiv); | |
| messagesContainer.scrollTop = messagesContainer.scrollHeight; | |
| } | |
| function getAIResponse(message) { | |
| // This is a simplified version - in a real app, you'd call an API | |
| const responses = [ | |
| `Based on your question about "${message}", I would recommend analyzing the key metrics first. Would you like me to generate a report template for this analysis?`, | |
| `That's an interesting business question. To properly assess "${message}", we should consider both quantitative and qualitative factors. I can help structure this analysis.`, | |
| `For "${message}", the standard approach would involve: 1) Market sizing 2) Competitive landscape 3) Financial projections. Would you like me to elaborate on any of these aspects?`, | |
| `I can provide insights about "${message}". First, let me ask: do you have any specific data you'd like me to analyze, or should I provide general industry benchmarks?`, | |
| `Regarding "${message}", the answer depends on several business factors. I can walk you through a framework to evaluate this properly. Would that be helpful?` | |
| ]; | |
| return responses[Math.floor(Math.random() * responses.length)]; | |
| } | |
| </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=Bencolliss/testrun1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |