{"id":305,"date":"2025-02-07T09:21:58","date_gmt":"2025-02-07T08:21:58","guid":{"rendered":"https:\/\/www.299precision.com\/?page_id=305"},"modified":"2025-03-31T14:08:53","modified_gmt":"2025-03-31T12:08:53","slug":"sign-up","status":"publish","type":"page","link":"https:\/\/www.299precision.com\/index.php\/sign-up\/","title":{"rendered":"Sign-up"},"content":{"rendered":"\n<div style=\"height:1rem\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<!-- CTA Signup Form Block -->\n<div style=\"background-color: var(--wp--preset--color--background, #edebe6); padding: 2rem; border-radius: 0.75rem; text-align: center; max-width: 25rem; margin: auto; box-shadow: var(--wp--preset--shadow--natural, 0 0.25rem 0.5rem rgba(0,0,0,0.1)); font-family: 'Bai Jamjuree', sans-serif;\">\n  \n  <!-- Header Section -->\n  <h2 style=\"font-size: 1.625rem; color: var(--wp--preset--color--foreground, #ffbd59); font-weight: bold; margin-bottom: 0.5rem; font-family: 'Bai Jamjuree', sans-serif;\">\n  Join Us\n<\/h2>\n  <p style=\"font-size: 1rem; color: var(--wp--preset--color--text-light, #555); line-height: 1.5; margin-bottom: 1.25rem;\">Sign up to stay updated and be the first to know about exclusive offers.<\/p>\n\n  <!-- Form Section -->\n  <form id=\"cta-signup-form\" action=\"\/form_handler.php\" method=\"POST\" style=\"margin-top: 1rem; display: flex; flex-direction: column; align-items: center;\">\n    <input type=\"hidden\" name=\"form_type\" value=\"cta_signup\">\n    <input type=\"hidden\" id=\"cta_source\" name=\"cta_source\">\n\n    <!-- Email Input -->\n    <input type=\"email\" id=\"email\" name=\"email\" placeholder=\"Your Email Address\" required autocomplete=\"email\" required style=\"width: 90%; max-width: 20rem; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid var(--wp--preset--color--border, #ccc); border-radius: 0.5rem; font-size: 0.875rem; text-align: center; font-family: 'Bai Jamjuree', sans-serif;\">\n\n    <!-- GDPR Consent Checkbox -->\n    <div style=\"display: flex; flex-direction: column; align-items: center; margin-top: 1rem;\">\n      <input type=\"checkbox\" id=\"gdpr_consent\" name=\"gdpr_consent\" required style=\"accent-color: var(--wp--preset--color--primary, #ffbd59); margin-bottom: 0.5rem;\">\n      <label for=\"gdpr_consent\" style=\"font-size: 0.7rem; color: var(--wp--preset--color--foreground, #555); max-width: 90%; text-align: center; text-transform: uppercase;\">\n        I consent to my email being used to send me updates.\n      <\/label>\n    <\/div>\n\n<!-- Honeypot field to trap bots (hidden from users) -->\n<input type=\"text\" name=\"website\" style=\"display:none\" tabindex=\"-1\" autocomplete=\"off\">\n\n\n    <!-- Submit Button -->\n    <button type=\"submit\" style=\"background-color: var(--wp--preset--color--primary, #ffbd59); color: var(--wp--preset--color--background, #303030); padding: 0.75rem 1.5rem; border: none; border-radius: 0.5rem; cursor: pointer; font-size: 0.9rem; transition: background-color 0.3s ease; font-family: 'Bai Jamjuree', sans-serif;\">\n      Sign Up\n    <\/button>\n  <\/form>\n<\/div>\n\n<!-- Success Popup -->\n<div id=\"success-popup\" style=\"display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: var(--wp--preset--color--background, #edebe6); color: var(--wp--preset--color--foreground, #333); padding: 1.5rem; border-radius: 1rem; box-shadow: 0 1rem 2rem rgba(0,0,0,0.3); text-align: center; z-index: 1000; max-width: 90%; font-family: 'Bai Jamjuree', sans-serif;\">\n  <p style=\"font-size: 1.5rem; font-weight: bold; color: var(--wp--preset--color--primary, #ffbd59); margin-bottom: 1rem;\">Thank you for signing up!<\/p>\n  <button onclick=\"closePopup()\" style=\"background-color: var(--wp--preset--color--primary, #ffbd59); color: var(--wp--preset--color--background, white); padding: 0.75rem 1.5rem; border: none; border-radius: 0.75rem; cursor: pointer;\">Close<\/button>\n<\/div>\n\n<script defer>\n  document.addEventListener('DOMContentLoaded', () => {\n    \/\/ Capture CTA Source (Header\/Footer)\n    document.getElementById('cta_source').value = sessionStorage.getItem('cta_source') || 'unknown';\n\n    \/\/ Form Submission with AJAX\n    const form = document.getElementById('cta-signup-form');\n    form.addEventListener('submit', function(event) {\n      event.preventDefault();\n\n      const formData = new FormData(this);\n\n      fetch(this.action, {\n        method: 'POST',\n        body: formData\n      })\n      .then(response => response.json())\n      .then(data => {\n        if (data.status === 'success') {\n          document.getElementById('success-popup').style.display = 'block';\n          form.reset();\n        } else {\n          alert(data.message);\n        }\n      })\n      .catch(error => console.error('Error:', error));\n    });\n\n    \/\/ Close popup function\n    window.closePopup = function() {\n      document.getElementById('success-popup').style.display = 'none';\n    };\n  });\n<\/script>\n\n<!-- Load Bai Jamjuree Font -->\n<link href=\"https:\/\/fonts.googleapis.com\/css2?family=Bai+Jamjuree:wght@300;400;600&#038;display=swap\" rel=\"stylesheet\">","protected":false},"excerpt":{"rendered":"<p>Join Us Sign up to stay updated and be the first to know about exclusive offers. I consent to my email being used to send me updates. Sign Up Thank you for signing up! Close<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-305","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":6,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/305\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/305\/revisions\/363"}],"wp:attachment":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/media?parent=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}