JasperOL commited on
Commit
5c6ddc6
·
verified ·
1 Parent(s): a637953

<!DOCTYPE html>

Browse files

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agent Activation Station</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="components/navbar.js"></script>
<script src="components/footer.js"></script>
</head>
<body class="bg-gray-50">
<custom-navbar></custom-navbar>
<main class="container mx-auto px-4 pt-2 pb-12 max-w-4xl">
<div class="text-center mb-4">
<p class="text-sm text-gray-600">Choose the agent you want to test</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 mb-12">
<!-- Quote Follow Up Agent -->
<div class="agent-card bg-gradient-to-br from-blue-50 to-blue-100"
data-agent="quote"
data-webhook="https://n8n.minimise.co.nz/webhook/d6770799-63da-4787-8b83-983f03b770ea">
<div class="agent-icon bg-blue-100 text-blue-600">
<i data-feather="file-text"></i>
</div>
<h3>Quote Follow Up</h3>
<p>Automatically follow up on sent quotes</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
Activate Agent
</button>
</div>
</div>

<!-- Invoice Follow Up Agent -->
<div class="agent-card bg-gradient-to-br from-purple-50 to-purple-100"
data-agent="invoice"
data-webhook="https://n8n.minimise.co.nz/webhook/YOUR-INVOICE-WEBHOOK-ID">
<div class="agent-icon bg-purple-100 text-purple-600">
<i data-feather="dollar-sign"></i>
</div>
<h3>Invoice Follow Up</h3>
<p>Gentle reminders for unpaid invoices</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors">
Activate Agent
</button>
</div>
</div>

<!-- Google Review Agent -->
<div class="agent-card bg-gradient-to-br from-green-50 to-green-100"
data-agent="review"
data-webhook="https://n8n.minimise.co.nz/webhook/YOUR-REVIEW-WEBHOOK-ID">
<div class="agent-icon bg-green-100 text-green-600">
<i data-feather="star"></i>
</div>
<h3>Google Review</h3>
<p>Collect customer reviews automatically</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors">
Activate Agent
</button>
</div>
</div>

<!-- Lead Reactivation Agent -->
<div class="agent-card bg-gradient-to-br from-yellow-50 to-yellow-100"
data-agent="lead"
data-webhook="https://n8n.minimise.co.nz/webhook/135d8631-9a9a-474d-8828-d2e75797ea3f">
<div class="agent-icon bg-yellow-100 text-yellow-600">
<i data-feather="refresh-cw"></i>
</div>
<h3>Lead Reactivation</h3>
<p>Re-engage cold leads with personalized messages</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 transition-colors">
Activate Agent
</button>
</div>
</div>

<!-- Conversational Agent -->
<div class="agent-card bg-gradient-to-br from-red-50 to-red-100"
data-agent="conversation"
data-webhook="https://n8n.minimise.co.nz/webhook/YOUR-CONVERSATION-WEBHOOK-ID">
<div class="agent-icon bg-red-100 text-red-600">
<i data-feather="message-square"></i>
</div>
<h3>Conversational</h3>
<p>Natural language customer interactions</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors">
Activate Agent
</button>
</div>
</div>

<!-- Speed to Lead Agent -->
<div class="agent-card bg-gradient-to-br from-indigo-50 to-indigo-100"
data-agent="speed-lead"
data-webhook="https://n8n.minimise.co.nz/webhook/YOUR-SPEED-LEAD-WEBHOOK-ID">
<div class="agent-icon bg-indigo-100 text-indigo-600">
<i data-feather="zap"></i>
</div>
<h3>Speed to Lead</h3>
<p>Instant response to new leads</p>
<div class="agent-form hidden mt-4">
<input type="tel" class="agent-phone w-full px-3 py-2 border border-gray-300 rounded-lg mb-2" placeholder="Enter phone number">
<button class="agent-activate-btn w-full px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors">
Activate Agent
</button>
</div>
</div>
</div>

<div id="confirmation" class="hidden mt-4 mx-auto p-4 bg-blue-50 text-blue-800 rounded-lg max-w-md text-center">
<i data-feather="check-circle" class="inline mr-2"></i>
<span>Agent activated successfully! You'll receive a confirmation shortly.</span>
</div>
</main>

<section class="contact-section">
<div class="container mx-auto px-4 text-center">
<h3 class="text-xl font-semibold">Need help?</h3>
<p>Call us directly and we'll assist you</p>
<a href="tel:+64212833378" class="inline-flex items-center px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors mt-4">
<i data-feather="phone" class="mr-2"></i>
021 283 3378
</a>
</div>
</section>

<custom-footer></custom-footer>

<script>
feather.replace();
</script>

<script>
// Agent Activation Script
document.addEventListener('DOMContentLoaded', function() {
const agentCards = document.querySelectorAll('.agent-card');

agentCards.forEach(card => {
// Toggle form visibility when card is clicked
card.addEventListener('click', function(e) {
// Don't toggle if clicking inside the form
if (!e.target.closest('.agent-form')) {
const form = this.querySelector('.agent-form');
// Close all other forms first
document.querySelectorAll('.agent-form').forEach(f => {
if (f !== form) f.classList.add('hidden');
});
form.classList.toggle('hidden');
}
});

// Handle activation button click
const activateBtn = card.querySelector('.agent-activate-btn');
if (activateBtn) {
activateBtn.addEventListener('click', async function(e) {
e.stopPropagation();

const phoneInput = card.querySelector('.agent-phone');
const phone = phoneInput.value.trim();
const agentType = card.dataset.agent;
const webhookUrl = card.dataset.webhook;

// Validation
if (!phone) {
alert('Please enter a phone number');
return;
}

if (!webhookUrl || webhookUrl.includes('YOUR-')) {
alert('Webhook URL not configured for this agent. Please contact support.');
return;
}

// Disable button during request
activateBtn.disabled = true;
activateBtn.textContent = 'Activating...';

try {
const response = await fetch(webhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent: agentType,

Files changed (3) hide show
  1. index.html +2 -0
  2. script.js +21 -28
  3. style.css +40 -2
index.html CHANGED
@@ -130,5 +130,7 @@
130
  </script>
131
  <script src="script.js"></script>
132
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
 
 
133
  </body>
134
  </html>
 
130
  </script>
131
  <script src="script.js"></script>
132
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
133
+ <script src="components/navbar.js"></script>
134
+ <script src="components/footer.js"></script>
135
  </body>
136
  </html>
script.js CHANGED
@@ -3,13 +3,25 @@ document.addEventListener('DOMContentLoaded', function() {
3
  const agentCards = document.querySelectorAll('.agent-card');
4
  const confirmation = document.getElementById('confirmation');
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  agentCards.forEach(card => {
7
  // Toggle form visibility when card is clicked
8
  card.addEventListener('click', function(e) {
9
- // Don't toggle if clicking inside the form
10
  if (!e.target.closest('.agent-form')) {
11
  const form = this.querySelector('.agent-form');
12
- // Close all other forms first
13
  document.querySelectorAll('.agent-form').forEach(f => {
14
  if (f !== form) f.classList.add('hidden');
15
  });
@@ -22,63 +34,44 @@ document.addEventListener('DOMContentLoaded', function() {
22
  if (activateBtn) {
23
  activateBtn.addEventListener('click', async function(e) {
24
  e.stopPropagation();
25
-
26
  const phoneInput = card.querySelector('.agent-phone');
27
  const phone = phoneInput.value.trim();
28
  const agentType = card.dataset.agent;
29
  const webhookUrl = card.dataset.webhook;
30
 
31
- // Validation
32
  if (!phone) {
33
- alert('Please enter a phone number');
34
  return;
35
  }
36
 
37
  if (!webhookUrl || webhookUrl.includes('YOUR-')) {
38
- alert('Webhook URL not configured for this agent. Please contact support.');
39
  return;
40
  }
41
 
42
- // Disable button during request
43
  activateBtn.disabled = true;
44
  activateBtn.textContent = 'Activating...';
45
 
46
  try {
47
  const response = await fetch(webhookUrl, {
48
  method: 'POST',
49
- headers: {
50
- 'Content-Type': 'application/json',
51
- },
52
- body: JSON.stringify({
53
- agent: agentType,
54
- phone: phone,
55
- timestamp: new Date().toISOString()
56
- })
57
  });
58
 
59
  if (response.ok) {
60
- // Show confirmation message
61
  confirmation.classList.remove('hidden');
62
-
63
- // Scroll to confirmation
64
  confirmation.scrollIntoView({ behavior: 'smooth', block: 'center' });
65
-
66
- // Clear input and hide form
67
  phoneInput.value = '';
68
  card.querySelector('.agent-form').classList.add('hidden');
69
-
70
- // Hide confirmation after 5 seconds
71
- setTimeout(() => {
72
- confirmation.classList.add('hidden');
73
- }, 5000);
74
  } else {
75
- alert('Failed to activate agent. Please try again or contact support.');
76
  }
77
  } catch (error) {
78
  console.error('Error:', error);
79
- alert('Error connecting to service. Please check your connection and try again.');
80
  } finally {
81
- // Re-enable button
82
  activateBtn.disabled = false;
83
  activateBtn.textContent = 'Activate Agent';
84
  }
 
3
  const agentCards = document.querySelectorAll('.agent-card');
4
  const confirmation = document.getElementById('confirmation');
5
 
6
+ function showToast(message, type = 'success') {
7
+ const toast = document.createElement('div');
8
+ toast.className = `fixed bottom-4 right-4 px-4 py-2 rounded-md shadow-lg text-white ${
9
+ type === 'success' ? 'bg-green-500' : 'bg-red-500'
10
+ }`;
11
+ toast.textContent = message;
12
+ document.body.appendChild(toast);
13
+
14
+ setTimeout(() => {
15
+ toast.classList.add('opacity-0', 'transition-opacity', 'duration-300');
16
+ setTimeout(() => toast.remove(), 300);
17
+ }, 3000);
18
+ }
19
+
20
  agentCards.forEach(card => {
21
  // Toggle form visibility when card is clicked
22
  card.addEventListener('click', function(e) {
 
23
  if (!e.target.closest('.agent-form')) {
24
  const form = this.querySelector('.agent-form');
 
25
  document.querySelectorAll('.agent-form').forEach(f => {
26
  if (f !== form) f.classList.add('hidden');
27
  });
 
34
  if (activateBtn) {
35
  activateBtn.addEventListener('click', async function(e) {
36
  e.stopPropagation();
 
37
  const phoneInput = card.querySelector('.agent-phone');
38
  const phone = phoneInput.value.trim();
39
  const agentType = card.dataset.agent;
40
  const webhookUrl = card.dataset.webhook;
41
 
 
42
  if (!phone) {
43
+ showToast('Please enter a phone number', 'error');
44
  return;
45
  }
46
 
47
  if (!webhookUrl || webhookUrl.includes('YOUR-')) {
48
+ showToast('Webhook URL not configured for this agent', 'error');
49
  return;
50
  }
51
 
 
52
  activateBtn.disabled = true;
53
  activateBtn.textContent = 'Activating...';
54
 
55
  try {
56
  const response = await fetch(webhookUrl, {
57
  method: 'POST',
58
+ headers: { 'Content-Type': 'application/json' },
59
+ body: JSON.stringify({ agent: agentType, phone, timestamp: new Date().toISOString() })
 
 
 
 
 
 
60
  });
61
 
62
  if (response.ok) {
 
63
  confirmation.classList.remove('hidden');
 
 
64
  confirmation.scrollIntoView({ behavior: 'smooth', block: 'center' });
 
 
65
  phoneInput.value = '';
66
  card.querySelector('.agent-form').classList.add('hidden');
67
+ setTimeout(() => confirmation.classList.add('hidden'), 5000);
 
 
 
 
68
  } else {
69
+ showToast('Failed to activate agent', 'error');
70
  }
71
  } catch (error) {
72
  console.error('Error:', error);
73
+ showToast('Connection error - please try again', 'error');
74
  } finally {
 
75
  activateBtn.disabled = false;
76
  activateBtn.textContent = 'Activate Agent';
77
  }
style.css CHANGED
@@ -3,12 +3,50 @@
3
  body {
4
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
5
  line-height: 1.6;
6
- background: linear-gradient(to bottom, #e6fffa, #0f766e);
7
  min-height: 100vh;
8
- color: #f0fdf4;
9
  margin: 0;
10
  padding: 0;
11
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /* Agent Cards */
13
  .agent-card {
14
  border-radius: 12px;
 
3
  body {
4
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
5
  line-height: 1.6;
6
+ background: linear-gradient(to bottom, #f0fdf4, #d1fae5);
7
  min-height: 100vh;
8
+ color: #064e3b;
9
  margin: 0;
10
  padding: 0;
11
  }
12
+
13
+ /* Toast notification */
14
+ .toast {
15
+ position: fixed;
16
+ bottom: 1rem;
17
+ right: 1rem;
18
+ padding: 0.75rem 1.5rem;
19
+ border-radius: 0.375rem;
20
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
21
+ z-index: 50;
22
+ animation: slideIn 0.3s ease-out;
23
+ }
24
+
25
+ .toast-success {
26
+ background-color: #10b981;
27
+ color: white;
28
+ }
29
+
30
+ .toast-error {
31
+ background-color: #ef4444;
32
+ color: white;
33
+ }
34
+
35
+ @keyframes slideIn {
36
+ from {
37
+ transform: translateY(100%);
38
+ opacity: 0;
39
+ }
40
+ to {
41
+ transform: translateY(0);
42
+ opacity: 1;
43
+ }
44
+ }
45
+
46
+ @keyframes fadeOut {
47
+ from { opacity: 1; }
48
+ to { opacity: 0; }
49
+ }
50
  /* Agent Cards */
51
  .agent-card {
52
  border-radius: 12px;