index.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. {% include '/common/meta_tags.html' %}
  5. <meta name="theme-color" content="#e90000">
  6. <title>{{title}}</title>
  7. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,300italic,700italic">
  8. <link rel="stylesheet" href="{{image_path}}/assets/main.min.css">
  9. <link rel="stylesheet" href="{{image_path}}/assets/survey.min.css">
  10. </head>
  11. <body>
  12. <header>
  13. <div class="logo">
  14. <img src="{{image_path}}/assets/icon.min.svg" width="33.3281" height="" draggable="false">
  15. <div class="name">
  16. <span class="domain">{{site_name}}</span>
  17. <span class="extension">.com</span>
  18. </div>
  19. </div>
  20. <h1>Find the Credit Card <span class="emphasis">that's Right for You!</span></h1>
  21. </header>
  22. <section class="content">
  23. <div class="wrapper">
  24. <div class="box profile" data-copyright="{{domain_name}} &copy; {{year}}, All Rights Reserved">
  25. <div class="survey--status">Survey Status</div>
  26. <div class="survey--progress-wrapper">
  27. <div class="survey--progress-bar" style="width: 14.2857%;"></div>
  28. </div>
  29. <div class="page" data-id="0" style="display: block;"></div>
  30. </div>
  31. </div>
  32. </section>
  33. {% include '/common/htmlshiv.html' %}
  34. <script>
  35. function showPage(page_id) {
  36. var current_page = document.querySelector('.page[style="display: block;"]');
  37. var new_page = document.querySelector('.page[data-id="' + (page_id || 1) + '"]');
  38. current_page.style.display = 'none';
  39. new_page.style.display = 'block';
  40. }
  41. function trackCoreg(coregArray){
  42. fetch('/?action=ajaxsubmit&id={{id}}',{
  43. method: 'POST',
  44. headers: {
  45. 'Accept': 'application/json',
  46. 'Content-Type': 'application/x-www-form-urlencoded'
  47. },
  48. body: "coregs="+coregArray.join(",")
  49. }).then(function(response) {
  50. return response.json();
  51. }).then(function(data) {
  52. console.log(data);
  53. if(data.redirect){
  54. window.location = "/?id=" + data.next;
  55. }
  56. var fragment = document.createDocumentFragment();
  57. var div = document.createElement('div');
  58. div.innerHTML = data.html;
  59. fragment.appendChild(div.children[0]);
  60. var current_page = document.querySelector('.page[style="display: block;"]');
  61. current_page.parentElement.insertBefore(fragment, current_page.nextSibling);
  62. showPage(data.next);
  63. });
  64. }
  65. document.addEventListener('DOMContentLoaded', function(){
  66. trackCoreg([]);
  67. }, false);
  68. </script>
  69. </body>
  70. </html>