Spaces:
Running
Running
make it in a way that it can send emails to leads customized and automated like bot does research by using company name and send them custom email, and an option for me to tell him goal with that email - Follow Up Deployment
749b77e verified Download index.html from RahymSupari/lead-management: direct link, hf CLI and curl.
- Browser
- Download file 89 kB
-
https://huggingface.co/spaces/RahymSupari/lead-management/resolve/main/index.html
- Command line
-
hf download hf://spaces/RahymSupari/lead-management/index.html
-
curl -L -o index.html https://huggingface.co/spaces/RahymSupari/lead-management/resolve/main/index.html
89 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LeadGen Pro - AI-Powered Lead Management</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">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.chat-message {
max-width: 80%;
}
.lead-status-new {
background-color: #EFF6FF;
color: #3B82F6;
}
.lead-status-contacted {
background-color: #ECFDF5;
color: #10B981;
}
.lead-status-closed {
background-color: #FEF2F2;
color: #EF4444;
}
.lead-status-scheduled {
background-color: #F5F3FF;
color: #8B5CF6;
}
.lead-status-interested {
background-color: #FEF3C7;
color: #D97706;
}
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
position: absolute;
z-index: 50;
height: 100vh;
}
.sidebar.active {
transform: translateX(0);
}
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
<div class="p-4 border-b border-gray-200">
<h1 class="text-xl font-bold text-indigo-600">LeadGen Pro</h1>
<p class="text-xs text-gray-500">AI-Powered Lead Management</p>
</div>
<nav class="flex-1 overflow-y-auto p-4">
<div class="space-y-1">
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md bg-indigo-50 text-indigo-700">
<i class="fas fa-tachometer-alt mr-3 text-indigo-600"></i>
Dashboard
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-users mr-3 text-gray-500"></i>
Leads
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-envelope mr-3 text-gray-500"></i>
Email Campaigns
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fab fa-whatsapp mr-3 text-gray-500"></i>
WhatsApp
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-robot mr-3 text-gray-500"></i>
AI Assistant
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-chart-bar mr-3 text-gray-500"></i>
Reports
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-cog mr-3 text-gray-500"></i>
Settings
</a>
</div>
</nav>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<img class="w-8 h-8 rounded-full" src="https://randomuser.me/api/portraits/men/32.jpg" alt="User">
<div class="ml-3">
<p class="text-sm font-medium text-gray-700">John Doe</p>
<p class="text-xs text-gray-500">Admin</p>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex-1 overflow-auto">
<!-- Mobile header -->
<div class="lg:hidden bg-white border-b border-gray-200 p-4 flex items-center justify-between">
<button id="sidebarToggle" class="text-gray-500">
<i class="fas fa-bars"></i>
</button>
<h1 class="text-lg font-medium text-gray-800">Dashboard</h1>
<div class="w-6"></div> <!-- Spacer -->
</div>
<!-- Dashboard header -->
<div class="bg-white border-b border-gray-200 p-6">
<div class="flex justify-between items-center">
<div>
<h2 class="text-2xl font-bold text-gray-800">Lead Dashboard</h2>
<p class="text-gray-600">Manage and track your sales leads</p>
</div>
<button id="importLeadsBtn" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-md flex items-center">
<i class="fas fa-plus mr-2"></i>
Import Leads
</button>
</div>
</div>
<!-- Stats -->
<div class="p-6 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Total Leads</p>
<h3 class="text-2xl font-bold">1,248</h3>
</div>
<div class="bg-indigo-100 p-3 rounded-full">
<i class="fas fa-users text-indigo-600"></i>
</div>
</div>
<div class="mt-4">
<div class="h-2 bg-gray-200 rounded-full">
<div class="h-2 bg-indigo-600 rounded-full" style="width: 75%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">+12% from last month</p>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">New Leads</p>
<h3 class="text-2xl font-bold">342</h3>
</div>
<div class="bg-blue-100 p-3 rounded-full">
<i class="fas fa-user-plus text-blue-600"></i>
</div>
</div>
<div class="mt-4">
<div class="h-2 bg-gray-200 rounded-full">
<div class="h-2 bg-blue-600 rounded-full" style="width: 45%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">+8% from last month</p>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Contacted</p>
<h3 class="text-2xl font-bold">576</h3>
</div>
<div class="bg-green-100 p-3 rounded-full">
<i class="fas fa-comment-dots text-green-600"></i>
</div>
</div>
<div class="mt-4">
<div class="h-2 bg-gray-200 rounded-full">
<div class="h-2 bg-green-600 rounded-full" style="width: 65%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">+15% from last month</p>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Closed</p>
<h3 class="text-2xl font-bold">330</h3>
</div>
<div class="bg-purple-100 p-3 rounded-full">
<i class="fas fa-check-circle text-purple-600"></i>
</div>
</div>
<div class="mt-4">
<div class="h-2 bg-gray-200 rounded-full">
<div class="h-2 bg-purple-600 rounded-full" style="width: 30%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">+5% from last month</p>
</div>
</div>
</div>
<!-- Leads Page (hidden by default) -->
<div id="leadsPage" class="hidden p-6">
<div class="bg-white rounded-lg shadow">
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
<h3 class="font-medium text-gray-800">All Leads</h3>
<div class="flex space-x-2">
<div class="relative">
<input type="text" id="leadSearch" placeholder="Search leads..." class="pl-8 pr-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<select id="statusFilter" class="border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="all">All Status</option>
<option value="new">New</option>
<option value="contacted">Contacted</option>
<option value="interested">Interested</option>
<option value="scheduled">Scheduled</option>
<option value="closed">Closed</option>
</select>
<select id="sourceFilter" class="border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="all">All Sources</option>
<option value="website">Website</option>
<option value="referral">Referral</option>
<option value="social">Social Media</option>
<option value="event">Event</option>
</select>
<button id="exportLeads" class="bg-green-600 text-white px-3 py-2 rounded-md text-sm flex items-center">
<i class="fas fa-file-export mr-2"></i> Export
</button>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Source</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Contact</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="leadsTableBody" class="bg-white divide-y divide-gray-200">
<!-- Leads will be populated here -->
</tbody>
</table>
</div>
<div class="p-4 border-t border-gray-200 flex items-center justify-between">
<div class="text-sm text-gray-500">
Showing <span id="leadsCount" class="font-medium">0</span> leads
</div>
<div class="flex space-x-2">
<button id="prevPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50" disabled>
Previous
</button>
<button id="nextPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50" disabled>
Next
</button>
</div>
</div>
</div>
</div>
<!-- Dashboard Page -->
<div id="dashboardPage" class="p-6 grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Leads table -->
<div class="bg-white rounded-lg shadow col-span-2">
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
<h3 class="font-medium text-gray-800">Recent Leads</h3>
<div class="flex space-x-2">
<div class="relative">
<input type="text" placeholder="Search leads..." class="pl-8 pr-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<select class="border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option>All Status</option>
<option>New</option>
<option>Contacted</option>
<option>Interested</option>
<option>Scheduled</option>
<option>Closed</option>
</select>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 font-medium">JD</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">John Doe</div>
<div class="text-sm text-gray-500">Acme Corp</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">john.doe@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">+1 555-123-4567</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-new">New</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-pink-100 flex items-center justify-center">
<span class="text-pink-600 font-medium">AS</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Alice Smith</div>
<div class="text-sm text-gray-500">Tech Solutions</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">alice.smith@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">+1 555-987-6543</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-contacted">Contacted</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-yellow-100 flex items-center justify-center">
<span class="text-yellow-600 font-medium">RJ</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Robert Johnson</div>
<div class="text-sm text-gray-500">Global Inc</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">robert.j@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">+1 555-456-7890</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-interested">Interested</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-purple-100 flex items-center justify-center">
<span class="text-purple-600 font-medium">MB</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Maria Brown</div>
<div class="text-sm text-gray-500">Digital Agency</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">maria.b@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">+1 555-789-0123</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-scheduled">Scheduled</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-red-100 flex items-center justify-center">
<span class="text-red-600 font-medium">DW</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">David Wilson</div>
<div class="text-sm text-gray-500">Finance Group</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">david.w@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">+1 555-234-5678</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-closed">Closed</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="p-4 border-t border-gray-200 flex items-center justify-between">
<div class="text-sm text-gray-500">
Showing <span class="font-medium">1</span> to <span class="font-medium">5</span> of <span class="font-medium">1248</span> leads
</div>
<div class="flex space-x-2">
<button class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
Previous
</button>
<button class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
Next
</button>
</div>
</div>
</div>
<!-- Right sidebar -->
<div class="space-y-6">
<!-- Status distribution -->
<div class="bg-white rounded-lg shadow p-6">
<h3 class="font-medium text-gray-800 mb-4">Lead Status Distribution</h3>
<div class="h-64">
<canvas id="statusChart"></canvas>
</div>
</div>
<!-- Quick actions -->
<div class="bg-white rounded-lg shadow p-6">
<h3 class="font-medium text-gray-800 mb-4">Quick Actions</h3>
<div class="space-y-3">
<button class="w-full flex items-center justify-between px-4 py-3 bg-indigo-50 text-indigo-700 rounded-md hover:bg-indigo-100">
<span>Import Leads</span>
<i class="fas fa-file-import"></i>
</button>
<button class="w-full flex items-center justify-between px-4 py-3 bg-green-50 text-green-700 rounded-md hover:bg-green-100">
<span>Send Bulk WhatsApp</span>
<i class="fab fa-whatsapp"></i>
</button>
<button class="w-full flex items-center justify-between px-4 py-3 bg-blue-50 text-blue-700 rounded-md hover:bg-blue-100">
<span>Start AI Campaign</span>
<i class="fas fa-robot"></i>
</button>
<button class="w-full flex items-center justify-between px-4 py-3 bg-purple-50 text-purple-700 rounded-md hover:bg-purple-100">
<span>Generate Report</span>
<i class="fas fa-file-export"></i>
</button>
</div>
</div>
<!-- AI Assistant -->
<div class="bg-white rounded-lg shadow p-6">
<h3 class="font-medium text-gray-800 mb-4">AI Assistant</h3>
<div class="space-y-3">
<div class="flex items-start">
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="ml-3">
<p class="text-sm text-gray-700">I can help you engage with leads automatically. Would you like me to:</p>
</div>
</div>
<div class="space-y-2">
<button class="w-full text-left px-4 py-2 bg-gray-100 rounded-md hover:bg-gray-200 text-sm">
<i class="fas fa-comment-dots mr-2 text-blue-500"></i> Chat with new leads
</button>
<button class="w-full text-left px-4 py-2 bg-gray-100 rounded-md hover:bg-gray-200 text-sm">
<i class="fas fa-calendar-check mr-2 text-green-500"></i> Schedule meetings
</button>
<button class="w-full text-left px-4 py-2 bg-gray-100 rounded-md hover:bg-gray-200 text-sm">
<i class="fas fa-chart-line mr-2 text-purple-500"></i> Analyze lead data
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Lead details modal (hidden by default) -->
<div id="leadModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-3xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
<div class="flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title">Lead Details</h3>
<button id="closeModal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mt-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<div class="flex items-center mb-6">
<div class="flex-shrink-0 h-16 w-16 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 text-xl font-medium">JD</span>
</div>
<div class="ml-4">
<h4 class="text-lg font-medium text-gray-900">John Doe</h4>
<p class="text-gray-500">Acme Corp</p>
</div>
</div>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700">Email</label>
<p class="mt-1 text-sm text-gray-900">john.doe@example.com</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Phone</label>
<p class="mt-1 text-sm text-gray-900">+1 555-123-4567</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Source</label>
<p class="mt-1 text-sm text-gray-900">Website Form</p>
</div>
</div>
</div>
<div>
<div class="mb-6">
<label class="block text-sm font-medium text-gray-700">Status</label>
<select class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option>New</option>
<option selected>Contacted</option>
<option>Interested</option>
<option>Scheduled</option>
<option>Closed</option>
</select>
</div>
<div class="mb-6">
<label class="block text-sm font-medium text-gray-700">Notes</label>
<textarea rows="3" class="mt-1 block w-full shadow-sm sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 border border-gray-300 rounded-md">Interested in our premium plan. Wants to discuss pricing options.</textarea>
</div>
<div class="flex space-x-3">
<button class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<i class="fas fa-envelope mr-2"></i> Email
</button>
<button class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
<i class="fab fa-whatsapp mr-2"></i> WhatsApp
</button>
<button class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
<i class="fas fa-robot mr-2"></i> AI Chat
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:ml-3 sm:w-auto sm:text-sm">
Save Changes
</button>
<button id="cancelModal" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>
<!-- AI Chat modal (hidden by default) -->
<div id="chatModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
<div class="flex justify-between items-center">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-robot text-blue-600"></i>
</div>
<h3 class="ml-3 text-lg leading-6 font-medium text-gray-900">AI Assistant - John Doe</h3>
</div>
<button id="closeChatModal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mt-4">
<div class="h-96 overflow-y-auto p-4 bg-gray-50 rounded-lg">
<div class="space-y-4">
<!-- AI message -->
<div class="flex items-start">
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="ml-3">
<div class="bg-white p-3 rounded-lg shadow-sm chat-message">
<p class="text-sm text-gray-700">Hello John! I'm the AI assistant from LeadGen Pro. I understand you're interested in our services. How can I help you today?</p>
</div>
<p class="text-xs text-gray-500 mt-1">2 minutes ago</p>
</div>
</div>
<!-- User message -->
<div class="flex items-start justify-end">
<div class="ml-3">
<div class="bg-indigo-100 p-3 rounded-lg shadow-sm chat-message">
<p class="text-sm text-gray-700">Hi, I'd like to know more about your pricing plans.</p>
</div>
<p class="text-xs text-gray-500 mt-1 text-right">1 minute ago</p>
</div>
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 text-xs font-medium">JD</span>
</div>
</div>
<!-- AI message -->
<div class="flex items-start">
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="ml-3">
<div class="bg-white p-3 rounded-lg shadow-sm chat-message">
<p class="text-sm text-gray-700">We offer three pricing tiers: Basic ($29/month), Professional ($79/month), and Enterprise (custom pricing). Which one are you most interested in?</p>
</div>
<p class="text-xs text-gray-500 mt-1">Just now</p>
</div>
</div>
</div>
</div>
<div class="mt-4">
<div class="flex">
<input type="text" placeholder="Type your message..." class="flex-1 border border-gray-300 rounded-l-md px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<button class="bg-blue-600 text-white px-4 py-2 rounded-r-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
<i class="fas fa-paper-plane"></i>
</button>
</div>
<div class="mt-2 flex justify-between">
<button class="text-xs text-blue-600 hover:text-blue-800">
<i class="fas fa-calendar-alt mr-1"></i> Schedule Meeting
</button>
<button class="text-xs text-green-600 hover:text-green-800">
<i class="fab fa-whatsapp mr-1"></i> Switch to WhatsApp
</button>
<button class="text-xs text-gray-600 hover:text-gray-800">
<i class="fas fa-history mr-1"></i> View History
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Import leads modal (hidden by default) -->
<div id="importModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
<div class="flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">Import Leads</h3>
<button id="closeImportModal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mt-4">
<div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center">
<i class="fas fa-file-csv text-4xl text-indigo-600 mb-3"></i>
<p class="text-sm text-gray-600 mb-4">Drag and drop your CSV file here, or click to browse</p>
<input type="file" id="fileUpload" class="hidden" accept=".csv">
<label for="fileUpload" class="cursor-pointer inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<i class="fas fa-upload mr-2"></i> Select File
</label>
</div>
<div class="mt-4">
<p class="text-sm text-gray-500">Your CSV file should include columns for: Name, Email, Phone, Company (optional). <a href="#" class="text-indigo-600 hover:text-indigo-800">Download template</a></p>
</div>
<div class="mt-6">
<label class="block text-sm font-medium text-gray-700">Default Status</label>
<select class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option>New</option>
<option>Contacted</option>
<option>Interested</option>
<option>Scheduled</option>
<option>Closed</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:ml-3 sm:w-auto sm:text-sm">
Import Leads
</button>
<button id="cancelImportModal" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Page navigation
const leadsLink = document.getElementById('leadsLink');
const leadsPage = document.getElementById('leadsPage');
const dashboardPage = document.getElementById('dashboardPage');
leadsLink.addEventListener('click', function(e) {
e.preventDefault();
dashboardPage.classList.add('hidden');
leadsPage.classList.remove('hidden');
loadLeads();
document.querySelector('.sidebar').classList.remove('active');
});
// Sample leads data
const sampleLeads = [
{ id: 1, name: 'John Doe', email: 'john.doe@example.com', phone: '+1 555-123-4567', company: 'Acme Corp', status: 'new', source: 'website', lastContact: '2023-05-15' },
{ id: 2, name: 'Alice Smith', email: 'alice.smith@example.com', phone: '+1 555-987-6543', company: 'Tech Solutions', status: 'contacted', source: 'referral', lastContact: '2023-05-14' },
{ id: 3, name: 'Robert Johnson', email: 'robert.j@example.com', phone: '+1 555-456-7890', company: 'Global Inc', status: 'interested', source: 'social', lastContact: '2023-05-13' },
{ id: 4, name: 'Maria Brown', email: 'maria.b@example.com', phone: '+1 555-789-0123', company: 'Digital Agency', status: 'scheduled', source: 'event', lastContact: '2023-05-12' },
{ id: 5, name: 'David Wilson', email: 'david.w@example.com', phone: '+1 555-234-5678', company: 'Finance Group', status: 'closed', source: 'website', lastContact: '2023-05-11' },
{ id: 6, name: 'Sarah Davis', email: 'sarah.d@example.com', phone: '+1 555-345-6789', company: 'Marketing Pros', status: 'new', source: 'referral', lastContact: '2023-05-10' },
{ id: 7, name: 'Michael Miller', email: 'michael.m@example.com', phone: '+1 555-456-7890', company: 'Tech Innovators', status: 'contacted', source: 'social', lastContact: '2023-05-09' },
{ id: 8, name: 'Emily Wilson', email: 'emily.w@example.com', phone: '+1 555-567-8901', company: 'Creative Minds', status: 'interested', source: 'event', lastContact: '2023-05-08' }
];
// Filter and display leads
function loadLeads() {
const searchTerm = document.getElementById('leadSearch').value.toLowerCase();
const statusFilter = document.getElementById('statusFilter').value;
const sourceFilter = document.getElementById('sourceFilter').value;
const filteredLeads = sampleLeads.filter(lead => {
const matchesSearch =
lead.name.toLowerCase().includes(searchTerm) ||
lead.email.toLowerCase().includes(searchTerm) ||
lead.phone.includes(searchTerm) ||
lead.company.toLowerCase().includes(searchTerm);
const matchesStatus = statusFilter === 'all' || lead.status === statusFilter;
const matchesSource = sourceFilter === 'all' || lead.source === sourceFilter;
return matchesSearch && matchesStatus && matchesSource;
});
const tbody = document.getElementById('leadsTableBody');
tbody.innerHTML = '';
filteredLeads.forEach(lead => {
const initials = lead.name.split(' ').map(n => n[0]).join('').toUpperCase();
const row = document.createElement('tr');
row.className = 'cursor-pointer hover:bg-gray-50';
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 font-medium">${initials}</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">${lead.name}</div>
<div class="text-sm text-gray-500">${lead.company}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${lead.email}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${lead.phone}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-${lead.status}">
${lead.status.charAt(0).toUpperCase() + lead.status.slice(1)}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
${lead.source.charAt(0).toUpperCase() + lead.source.slice(1)}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
${new Date(lead.lastContact).toLocaleDateString()}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
</div>
</td>
`;
tbody.appendChild(row);
});
document.getElementById('leadsCount').textContent = filteredLeads.length;
}
// Event listeners for filters
document.getElementById('leadSearch').addEventListener('input', loadLeads);
document.getElementById('statusFilter').addEventListener('change', loadLeads);
document.getElementById('sourceFilter').addEventListener('change', loadLeads);
// Export functionality
document.getElementById('exportLeads').addEventListener('click', function() {
alert('Export functionality would be implemented here');
});
// Mobile sidebar toggle
document.getElementById('sidebarToggle').addEventListener('click', function() {
document.querySelector('.sidebar').classList.toggle('active');
});
// Lead modal
const leadModal = document.getElementById('leadModal');
const closeModal = document.getElementById('closeModal');
const cancelModal = document.getElementById('cancelModal');
// Show modal when clicking on a lead (for demo purposes)
document.querySelectorAll('table tbody tr').forEach(row => {
row.addEventListener('click', function() {
leadModal.classList.remove('hidden');
});
});
closeModal.addEventListener('click', function() {
leadModal.classList.add('hidden');
});
cancelModal.addEventListener('click', function() {
leadModal.classList.add('hidden');
});
// Chat modal
const chatModal = document.getElementById('chatModal');
const closeChatModal = document.getElementById('closeChatModal');
// Show chat modal when clicking on AI chat button (for demo purposes)
document.querySelectorAll('.fa-robot').forEach(icon => {
icon.closest('button').addEventListener('click', function(e) {
e.stopPropagation();
chatModal.classList.remove('hidden');
});
});
closeChatModal.addEventListener('click', function() {
chatModal.classList.add('hidden');
});
// Import modal
const importModal = document.getElementById('importModal');
const closeImportModal = document.getElementById('closeImportModal');
const cancelImportModal = document.getElementById('cancelImportModal');
// Show import modal when clicking on import button (for demo purposes)
document.querySelectorAll('button').forEach(btn => {
if (btn.textContent.includes('Import Leads')) {
btn.addEventListener('click', function() {
importModal.classList.remove('hidden');
});
}
});
closeImportModal.addEventListener('click', function() {
importModal.classList.add('hidden');
});
cancelImportModal.addEventListener('click', function() {
importModal.classList.add('hidden');
});
// Status chart
const statusCtx = document.getElementById('statusChart').getContext('2d');
const statusChart = new Chart(statusCtx, {
type: 'doughnut',
data: {
labels: ['New', 'Contacted', 'Interested', 'Scheduled', 'Closed'],
datasets: [{
data: [342, 576, 210, 98, 330],
backgroundColor: [
'#3B82F6',
'#10B981',
'#F59E0B',
'#8B5CF6',
'#EF4444'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
}
},
cutout: '70%'
}
});
// Enhanced import functionality
const importLeadsBtn = document.getElementById('importLeadsBtn');
const fileUpload = document.getElementById('fileUpload');
const importSubmitBtn = document.querySelector('#importModal button.bg-indigo-600');
const leadsTable = document.querySelector('table tbody');
// Show import modal
importLeadsBtn.addEventListener('click', function() {
importModal.classList.remove('hidden');
});
// Handle file import
importSubmitBtn.addEventListener('click', function() {
const file = fileUpload.files[0];
if (!file) {
alert('Please select a file first');
return;
}
const reader = new FileReader();
reader.onload = function(e) {
const contents = e.target.result;
const lines = contents.split('\n');
const statusSelect = document.querySelector('#importModal select');
const defaultStatus = statusSelect.value.toLowerCase();
// Skip header row and process each line
for (let i = 1; i < lines.length; i++) {
if (lines[i].trim() === '') continue;
const [name, email, phone, company] = lines[i].split(',');
if (!name || !email || !phone) continue;
// Generate initials for avatar
const initials = name.split(' ').map(n => n[0]).join('').toUpperCase();
// Create new table row
const newRow = document.createElement('tr');
newRow.className = 'cursor-pointer hover:bg-gray-50';
newRow.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 font-medium">${initials}</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">${name}</div>
<div class="text-sm text-gray-500">${company || 'No company'}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${email}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${phone}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full lead-status-${defaultStatus}">${defaultStatus.charAt(0).toUpperCase() + defaultStatus.slice(1)}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-envelope"></i></button>
<button class="text-green-600 hover:text-green-900"><i class="fab fa-whatsapp"></i></button>
<button class="text-blue-600 hover:text-blue-900"><i class="fas fa-robot"></i></button>
<button class="text-gray-600 hover:text-gray-900"><i class="fas fa-ellipsis-v"></i></button>
</div>
</td>
`;
// Add click handler to show details
newRow.addEventListener('click', function() {
// Update modal with new lead data
document.getElementById('modal-title').textContent = 'Lead Details - ' + name;
document.querySelector('#leadModal .text-indigo-600').textContent = initials;
document.querySelector('#leadModal .text-lg').textContent = name;
document.querySelector('#leadModal .text-gray-500').textContent = company || 'No company';
document.querySelector('#leadModal .text-sm.text-gray-900:nth-of-type(1)').textContent = email;
document.querySelector('#leadModal .text-sm.text-gray-900:nth-of-type(2)').textContent = phone;
document.querySelector('#leadModal select option[selected]').removeAttribute('selected');
document.querySelector(`#leadModal select option[value="${defaultStatus.charAt(0).toUpperCase() + defaultStatus.slice(1)}"]`).setAttribute('selected', 'selected');
leadModal.classList.remove('hidden');
});
leadsTable.prepend(newRow);
}
alert(`Successfully imported ${lines.length - 1} leads`);
importModal.classList.add('hidden');
fileUpload.value = '';
};
reader.readAsText(file);
});
// Handle drag and drop for file upload
const dropArea = document.querySelector('#importModal .border-dashed');
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
dropArea.addEventListener(eventName, preventDefaults, false);
});
function preventDefaults(e) {
e.preventDefault();
e.stopPropagation();
}
['dragenter', 'dragover'].forEach(eventName => {
dropArea.addEventListener(eventName, highlight, false);
});
['dragleave', 'drop'].forEach(eventName => {
dropArea.addEventListener(eventName, unhighlight, false);
});
function highlight() {
dropArea.classList.add('border-indigo-500', 'bg-indigo-50');
}
function unhighlight() {
dropArea.classList.remove('border-indigo-500', 'bg-indigo-50');
}
dropArea.addEventListener('drop', handleDrop, false);
function handleDrop(e) {
const dt = e.dataTransfer;
const files = dt.files;
fileUpload.files = files;
// Trigger change event
const event = new Event('change');
fileUpload.dispatchEvent(event);
}
// Simulate AI chat
const chatInput = document.querySelector('#chatModal input[type="text"]');
const chatSendBtn = document.querySelector('#chatModal button.bg-blue-600');
const chatContainer = document.querySelector('#chatModal .overflow-y-auto');
chatSendBtn.addEventListener('click', function() {
if (chatInput.value.trim() === '') return;
// Add user message
const userMessage = document.createElement('div');
userMessage.className = 'flex items-start justify-end';
userMessage.innerHTML = `
<div class="ml-3">
<div class="bg-indigo-100 p-3 rounded-lg shadow-sm chat-message">
<p class="text-sm text-gray-700">${chatInput.value}</p>
</div>
<p class="text-xs text-gray-500 mt-1 text-right">Just now</p>
</div>
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-indigo-100 flex items-center justify-center">
<span class="text-indigo-600 text-xs font-medium">JD</span>
</div>
`;
chatContainer.appendChild(userMessage);
// Simulate AI response after a delay
setTimeout(() => {
const aiMessage = document.createElement('div');
aiMessage.className = 'flex items-start';
aiMessage.innerHTML = `
<div class="flex-shrink-0 h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="ml-3">
<div class="bg-white p-3 rounded-lg shadow-sm chat-message">
<p class="text-sm text-gray-700">${getAIResponse(chatInput.value)}</p>
</div>
<p class="text-xs text-gray-500 mt-1">Just now</p>
</div>
`;
chatContainer.appendChild(aiMessage);
chatContainer.scrollTop = chatContainer.scrollHeight;
}, 1000);
chatInput.value = '';
chatContainer.scrollTop = chatContainer.scrollHeight;
});
function getAIResponse(message) {
const lowerMessage = message.toLowerCase();
if (lowerMessage.includes('pricing') || lowerMessage.includes('price') || lowerMessage.includes('cost')) {
return "We offer three pricing tiers: Basic ($29/month), Professional ($79/month), and Enterprise (custom pricing). Would you like me to schedule a call to discuss which option would be best for you?";
} else if (lowerMessage.includes('feature') || lowerMessage.includes('what does it do')) {
return "Our platform includes lead management, automated outreach, AI-powered conversations, and detailed analytics. The Professional plan adds team collaboration and advanced reporting. Would you like a demo?";
} else if (lowerMessage.includes('demo') || lowerMessage.includes('see it')) {
return "I can schedule a 30-minute demo with one of our product specialists. Would tomorrow at 2pm work for you?";
} else if (lowerMessage.includes('yes') || lowerMessage.includes('sure') || lowerMessage.includes('okay')) {
return "Great! I've scheduled a demo for tomorrow at 2pm. You'll receive a calendar invitation shortly. Is there anything else I can help with?";
} else if (lowerMessage.includes('no') || lowerMessage.includes('not now')) {
return "No problem! Feel free to reach out if you have any other questions. Have a great day!";
} else {
return "I'd be happy to help with that. Could you tell me more about what you're looking for in a lead management system?";
}
}
// Email Campaign Modal Functionality
const emailCampaignModal = document.getElementById('emailCampaignModal');
const emailCampaignsLink = document.getElementById('emailCampaignsLink');
const closeEmailModal = document.getElementById('closeEmailModal');
const generateTemplateBtn = document.getElementById('generateTemplateBtn');
const previewEmailBtn = document.getElementById('previewEmailBtn');
const sendTestEmailBtn = document.getElementById('sendTestEmailBtn');
const launchCampaignBtn = document.getElementById('launchCampaignBtn');
const campaignGoal = document.getElementById('campaignGoal');
const emailTemplate = document.getElementById('emailTemplate');
// Show email campaign modal
emailCampaignsLink.addEventListener('click', function(e) {
e.preventDefault();
emailCampaignModal.classList.remove('hidden');
});
// Close modal
closeEmailModal.addEventListener('click', function() {
emailCampaignModal.classList.add('hidden');
});
// Generate AI template
generateTemplateBtn.addEventListener('click', function() {
if (!campaignGoal.value.trim()) {
alert('Please enter a campaign goal first');
return;
}
// Show loading state
generateTemplateBtn.disabled = true;
generateTemplateBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
// Simulate AI processing
setTimeout(() => {
const goal = campaignGoal.value;
const sampleTemplate = `Subject: ${getSubjectLine(goal)}
Hi {FirstName},
${getOpeningLine(goal)}
${getBodyContent(goal)}
${getClosingLine(goal)}
Best regards,
{YourName}
{YourPosition}
${getCompanySignature()}`;
emailTemplate.value = sampleTemplate;
generateTemplateBtn.disabled = false;
generateTemplateBtn.innerHTML = '<i class="fas fa-robot mr-2"></i> Generate Template';
}, 2000);
});
// Helper functions for template generation
function getSubjectLine(goal) {
if (goal.toLowerCase().includes('demo')) return 'Let me show you how {Company} can help {TheirCompany}';
if (goal.toLowerCase().includes('feature')) return 'New feature that will help {TheirCompany}';
return `How {Company} can help {TheirCompany}`;
}
function getOpeningLine(goal) {
if (goal.toLowerCase().includes('demo')) return 'I noticed {TheirCompany} is in the {Industry} space and thought our solution might be a great fit.';
if (goal.toLowerCase().includes('feature')) return 'We recently launched a new feature that I believe could significantly benefit {TheirCompany}.';
return 'I wanted to reach out because I believe our solution could help {TheirCompany} with {PainPoint}.';
}
function getBodyContent(goal) {
if (goal.toLowerCase().includes('demo')) return 'Would you be available for a quick 30-minute demo this week? I can show you exactly how we help companies like yours with {ValueProposition}.';
if (goal.toLowerCase().includes('feature')) return 'Our new {FeatureName} helps companies in your industry by {Benefit}. Based on my research, this could help {TheirCompany} with {SpecificNeed}.';
return 'Our platform helps companies like yours by {ValueProposition}. I'd love to schedule a quick call to discuss how we can help {TheirCompany} specifically.';
}
function getClosingLine(goal) {
if (goal.toLowerCase().includes('demo')) return 'Let me know a time that works for you, or feel free to book directly on my calendar: {CalendarLink}';
if (goal.toLowerCase().includes('feature')) return 'I'd be happy to walk you through this in more detail if you're interested.';
return 'Looking forward to hearing your thoughts!';
}
function getCompanySignature() {
return '{CompanyWebsite}';
}
// Preview email
previewEmailBtn.addEventListener('click', function() {
if (!emailTemplate.value.trim()) {
alert('Please generate or enter an email template first');
return;
}
alert('This would show a preview of the email with sample personalization');
});
// Send test email
sendTestEmailBtn.addEventListener('click', function() {
if (!emailTemplate.value.trim()) {
alert('Please generate or enter an email template first');
return;
}
alert('Test email sent to your address!');
});
// Launch campaign
launchCampaignBtn.addEventListener('click', function() {
if (!emailTemplate.value.trim()) {
alert('Please generate or enter an email template first');
return;
}
const leadFilter = document.getElementById('leadFilter').value;
const personalization = document.getElementById('personalizationLevel').value;
const schedule = document.getElementById('emailSchedule').value;
const followUp = document.getElementById('followUpSetting').value;
alert(`Campaign launched!\n\nTarget: ${leadFilter}\nPersonalization: ${personalization}\nSchedule: ${schedule}\nFollow-up: ${followUp}`);
emailCampaignModal.classList.add('hidden');
});
</script>
<!-- Email Campaign Modal -->
<div id="emailCampaignModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
<div class="flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">AI-Powered Email Campaign</h3>
<button id="closeEmailModal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mt-4">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="col-span-2">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Campaign Goal</label>
<textarea id="campaignGoal" rows="2" class="mt-1 block w-full shadow-sm sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 border border-gray-300 rounded-md" placeholder="What do you want to achieve with this campaign? (e.g. Schedule demos, promote new feature, etc.)"></textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">AI-Generated Email Template</label>
<textarea id="emailTemplate" rows="8" class="mt-1 block w-full shadow-sm sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 border border-gray-300 rounded-md" placeholder="AI will generate this based on your goal and lead data"></textarea>
</div>
<div class="flex justify-between">
<button id="generateTemplateBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<i class="fas fa-robot mr-2"></i> Generate Template
</button>
<div class="flex space-x-2">
<button id="previewEmailBtn" class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md shadow-sm text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<i class="fas fa-eye mr-2"></i> Preview
</button>
<button id="sendTestEmailBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
<i class="fas fa-paper-plane mr-2"></i> Send Test
</button>
</div>
</div>
</div>
<div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Target Leads</label>
<select id="leadFilter" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option value="all">All Leads</option>
<option value="new">New Leads</option>
<option value="contacted">Contacted</option>
<option value="interested">Interested</option>
<option value="scheduled">Scheduled</option>
<option value="custom">Custom Filter</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Schedule</label>
<select id="emailSchedule" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option value="now">Send Immediately</option>
<option value="morning">Send Tomorrow Morning</option>
<option value="evening">Send Tomorrow Evening</option>
<option value="custom">Custom Schedule</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Personalization Level</label>
<select id="personalizationLevel" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option value="basic">Basic (Name/Company)</option>
<option value="moderate">Moderate (Industry Insights)</option>
<option value="high">High (Custom Research)</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Follow-up</label>
<select id="followUpSetting" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option value="none">No Follow-up</option>
<option value="3days">After 3 Days</option>
<option value="1week">After 1 Week</option>
<option value="custom">Custom Follow-up</option>
</select>
</div>
<button id="launchCampaignBtn" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-purple-600 text-base font-medium text-white hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500">
<i class="fas fa-rocket mr-2"></i> Launch Campaign
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<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=RahymSupari/lead-management" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LeadGen Pro - AI-Powered Lead Management</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">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.chat-message {
max-width: 80%;
}
.lead-status-new {
background-color: #EFF6FF;
color: #3B82F6;
}
.lead-status-contacted {
background-color: #ECFDF5;
color: #10B981;
}
.lead-status-closed {
background-color: #FEF2F2;
color: #EF4444;
}
.lead-status-scheduled {
background-color: #F5F3FF;
color: #8B5CF6;
}
.lead-status-interested {
background-color: #FEF3C7;
color: #D97706;
}
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
position: absolute;
z-index: 50;
height: 100vh;
}
.sidebar.active {
transform: translateX(0);
}
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
<div class="p-4 border-b border-gray-200">
<h1 class="text-xl font-bold text-indigo-600">LeadGen Pro</h1>
<p class="text-xs text-gray-500">AI-Powered Lead Management</p>
</div>
<nav class="flex-1 overflow-y-auto p-4">
<div class="space-y-1">
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md bg-indigo-50 text-indigo-700">
<i class="fas fa-tachometer-alt mr-3 text-indigo-600"></i>
Dashboard
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-users mr-3 text-gray-500"></i>
Leads
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-envelope mr-3 text-gray-500"></i>
Email Campaigns
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fab fa-whatsapp mr-3 text-gray-500"></i>
WhatsApp
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-robot mr-3 text-gray-500"></i>
AI Assistant
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-chart-bar mr-3 text-gray-500"></i>
Reports
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100">
<i class="fas fa-cog mr-3 text-gray-500"></i>
Settings
</a>
</div>
</nav>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<img class="w-8 h-8 rounded-full" src="https://randomuser.me/api/portraits/men/32.jpg" alt="User">
<div class="ml-3">
<p class="text-sm font-medium text-gray-700">John Doe</p>
<p class="text-xs text-gray-500">Admin</p>
</div>
</div>
</div>
</div>