DjayChucko commited on
Commit
f41dae3
·
verified ·
1 Parent(s): 5ffa1a3

When clicked this button should take all data and arrange in as identical format as is possible in PDF

Browse files
Files changed (1) hide show
  1. value-mapper.html +64 -19
value-mapper.html CHANGED
@@ -9,8 +9,10 @@
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
  <script src="https://unpkg.com/feather-icons"></script>
 
 
12
  <script>
13
- tailwind.config = {
14
  darkMode: 'class',
15
  theme: {
16
  extend: {
@@ -152,8 +154,8 @@ Identify pain points and frame conversations around Scaleway's key values:
152
  </div>
153
  </div>
154
  <div class="text-center pt-4 no-print">
155
- <button onclick="exportToSheets()" class="px-8 py-3 bg-gradient-to-r from-[#9B5CEB] to-[#8B5CF6] text-white font-semibold rounded-xl shadow-lg hover:from-[#8B5CF6] hover:to-[#7B4BEB] transition-all duration-300 transform hover:scale-105">
156
- Export to Sheets
157
  </button>
158
  </div>
159
  </div>
@@ -367,8 +369,8 @@ dq2: "When you look at your overall rendering and distribution pipeline, where a
367
  document.getElementById('initial-message').classList.add('hidden');
368
  document.getElementById('dynamic-area').classList.remove('hidden');
369
  }
370
- // Function to export data to Google Sheets
371
- function exportToSheets() {
372
  const industry = document.getElementById('industry-selector').value;
373
  const valueDrivers = document.getElementById('value-drivers').textContent;
374
  const dq1 = document.getElementById('dq1').textContent;
@@ -376,22 +378,65 @@ dq2: "When you look at your overall rendering and distribution pipeline, where a
376
  const dq2 = document.getElementById('dq2').textContent;
377
  const pbo2 = document.getElementById('pbo2').textContent;
378
 
379
- const data = {
380
- industry,
381
- valueDrivers,
382
- discoveryQuestion1: dq1,
383
- permissionBasedOpener1: pbo1,
384
- discoveryQuestion2: dq2,
385
- permissionBasedOpener2: pbo2,
386
- timestamp: new Date().toISOString()
387
- };
388
 
389
- // In a real implementation, you would send this data to your backend
390
- // which would then push it to Google Sheets via their API
391
- alert(`Exporting data to Google Sheets:\n\nIndustry: ${industry}\n\nValue Drivers:\n${valueDrivers}\n\nDiscovery Questions & Openers:\n1. ${dq1}\nOpener: ${pbo1}\n\n2. ${dq2}\nOpener: ${pbo2}`);
 
392
 
393
- // TODO: Implement actual Google Sheets API integration
394
- console.log('Data to export:', data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  }
396
  // Initialize to ensure the hidden/shown states are correct on load
397
  window.onload = updateContent;
 
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
  <script src="https://unpkg.com/feather-icons"></script>
12
+ <!-- Add jsPDF library for PDF generation -->
13
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
14
  <script>
15
+ tailwind.config = {
16
  darkMode: 'class',
17
  theme: {
18
  extend: {
 
154
  </div>
155
  </div>
156
  <div class="text-center pt-4 no-print">
157
+ <button onclick="exportToPDF()" class="px-8 py-3 bg-gradient-to-r from-[#9B5CEB] to-[#8B5CF6] text-white font-semibold rounded-xl shadow-lg hover:from-[#8B5CF6] hover:to-[#7B4BEB] transition-all duration-300 transform hover:scale-105">
158
+ Export to PDF
159
  </button>
160
  </div>
161
  </div>
 
369
  document.getElementById('initial-message').classList.add('hidden');
370
  document.getElementById('dynamic-area').classList.remove('hidden');
371
  }
372
+ // Function to export data as PDF
373
+ function exportToPDF() {
374
  const industry = document.getElementById('industry-selector').value;
375
  const valueDrivers = document.getElementById('value-drivers').textContent;
376
  const dq1 = document.getElementById('dq1').textContent;
 
378
  const dq2 = document.getElementById('dq2').textContent;
379
  const pbo2 = document.getElementById('pbo2').textContent;
380
 
381
+ // Create PDF document
382
+ const { jsPDF } = window.jspdf;
383
+ const doc = new jsPDF();
 
 
 
 
 
 
384
 
385
+ // Add title
386
+ doc.setFontSize(20);
387
+ doc.setTextColor(85, 33, 148); // #552194
388
+ doc.text(`Pod Value Mapper - ${industry}`, 105, 20, { align: 'center' });
389
 
390
+ // Add subtitle
391
+ doc.setFontSize(14);
392
+ doc.setTextColor(121, 45, 212); // #792DD4
393
+ doc.text('Your essential tool for qualification and value articulation', 105, 30, { align: 'center' });
394
+
395
+ // Add value drivers section
396
+ doc.setFontSize(16);
397
+ doc.setTextColor(85, 33, 148);
398
+ doc.text('Value Proposition & Product Focus', 15, 45);
399
+
400
+ doc.setFontSize(12);
401
+ doc.setTextColor(0, 0, 0);
402
+ const valueLines = doc.splitTextToSize(valueDrivers, 180);
403
+ doc.text(valueLines, 15, 55);
404
+
405
+ // Add discovery questions
406
+ doc.setFontSize(16);
407
+ doc.setTextColor(85, 33, 148);
408
+ doc.text('Discovery Questions & Openers', 15, 110);
409
+
410
+ // Question 1
411
+ doc.setFontSize(14);
412
+ doc.text('Discovery Question 1:', 15, 120);
413
+ doc.setFont('italic');
414
+ doc.setFontSize(12);
415
+ doc.text(dq1, 15, 130);
416
+
417
+ doc.setFont('normal');
418
+ doc.text('Permission-Based Opener 1:', 15, 140);
419
+ doc.setFont('bold');
420
+ doc.text(pbo1, 15, 150);
421
+
422
+ // Question 2
423
+ doc.setFont('normal');
424
+ doc.text('Discovery Question 2:', 15, 165);
425
+ doc.setFont('italic');
426
+ doc.text(dq2, 15, 175);
427
+
428
+ doc.setFont('normal');
429
+ doc.text('Permission-Based Opener 2:', 15, 185);
430
+ doc.setFont('bold');
431
+ doc.text(pbo2, 15, 195);
432
+
433
+ // Footer
434
+ doc.setFontSize(10);
435
+ doc.setTextColor(100, 100, 100);
436
+ doc.text('Generated by McGPT - Navigating your sales success with AI', 105, 285, { align: 'center' });
437
+
438
+ // Save the PDF
439
+ doc.save(`McGPT_ValueMapper_${industry.replace(/\s+/g, '_')}.pdf`);
440
  }
441
  // Initialize to ensure the hidden/shown states are correct on load
442
  window.onload = updateContent;