Spaces:
Running
Running
File size: 16,675 Bytes
1dd00b9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
<!DOCTYPE html>
<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> |