{"id":106,"date":"2025-02-02T13:53:40","date_gmt":"2025-02-02T12:53:40","guid":{"rendered":"https:\/\/www.299precision.com\/?page_id=106"},"modified":"2025-03-31T14:08:22","modified_gmt":"2025-03-31T12:08:22","slug":"contact","status":"publish","type":"page","link":"https:\/\/www.299precision.com\/index.php\/contact\/","title":{"rendered":"Contact"},"content":{"rendered":"\n<div style=\"height:1rem\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div style=\"background-color: var(--wp--preset--color--background, #edebe6); padding: 1.5rem; 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    <h2 style=\"font-size: 1.625rem; color: var(--wp--preset--color--foreground, #ffbd59); font-weight: bold; margin-bottom: 0.5rem; font-family: 'Bai Jamjuree'\">Contact Us<\/h2>\n    <p style=\"font-size: 1rem; color: var(--wp--preset--color--text-light, #555); line-height: 1.5; margin-bottom: 1rem; font-family: 'Bai Jamjuree'\">Have questions? Reach out to us and we&#8217;ll get back to you soon.<\/p>\n\n    <form id=\"contact-form\" action=\"\/form_handler.php\" method=\"POST\" style=\"margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; font-family: 'Bai Jamjuree', sans-serif;\" onsubmit=\"return submitForm(event)\">\n        <input type=\"hidden\" name=\"form_type\" value=\"contact_form\">\n\n        <input type=\"email\" id=\"email\" name=\"email\" placeholder=\"Your Email Address\" required autocomplete=\"email\" required style=\"width: 90%; max-width: 20rem; padding: 0.5rem; margin: 0; border: 1px solid var(--wp--preset--color--border, #ccc); border-radius: 0.5rem; font-size: 0.875rem; text-align: center;\">\n\n        <textarea id=\"message\" name=\"message\" placeholder=\"Your Message\" required style=\"width: 90%; max-width: 20rem; height: 6.25rem; padding: 0.5rem; margin: 0; border: 1px solid var(--wp--preset--color--border, #ccc); border-radius: 0.5rem; font-size: 0.875rem; text-align: center; resize: vertical;\"><\/textarea>\n\n        <div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.25rem;\">\n            <input type=\"checkbox\" id=\"gdpr_consent\" name=\"gdpr_consent\" required style=\"accent-color: var(--wp--preset--color--primary, #ffbd59);\">\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 data being used to respond to my inquiry.\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        <button type=\"submit\" style=\"background-color: var(--wp--preset--color--primary, #ffbd59); color: var(--wp--preset--color--background, #303030); padding: 0.5rem 1rem; border: none; border-radius: 0.5rem; cursor: pointer; font-size: 0.9rem; transition: background-color 0.3s ease; font-family: 'Bai Jamjuree'\">\n            Send Message\n        <\/button>\n    <\/form>\n<\/div>\n\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: 1rem; 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 id=\"popup-message\" style=\"font-size: 1.5rem; font-weight: bold; color: var(--wp--preset--color--primary, #ffbd59); margin-bottom: 0.5rem;font-family: 'Bai Jamjuree'\">Thank you for reaching out!<\/p>\n    <button onclick=\"closePopup()\" style=\"background-color: var(--wp--preset--color--primary, #ffbd59); color: var(--wp--preset--color--background, white); padding: 0.5rem 1rem; border: none; border-radius: 0.75rem; cursor: pointer;\">Close<\/button>\n<\/div>\n\n<script defer>\n    function submitForm(event) {\n        event.preventDefault();\n\n        const form = document.getElementById('contact-form');\n        const popup = document.getElementById('success-popup');\n        const popupMessage = document.getElementById('popup-message');\n        const formData = new FormData(form);\n\n        fetch(form.action, {\n            method: 'POST',\n            body: formData\n        })\n        .then(response => response.json())\n        .then(data => {\n            if (data.status === 'success') {\n                popupMessage.innerText = 'Thank you for reaching out!';\n                popup.style.display = 'block';\n                form.reset();\n            } else if (data.status === 'error' && data.message.includes('Daily submission limit reached')) {\n                popupMessage.innerText = 'You have reached your daily submission limit. Try again tomorrow!';\n                popup.style.display = 'block';\n            } else {\n                alert(data.message);\n            }\n        })\n        .catch(error => console.error('Error:', error));\n    }\n\n    function closePopup() {\n        document.getElementById('success-popup').style.display = 'none';\n    }\n<\/script>","protected":false},"excerpt":{"rendered":"<p>Contact Us Have questions? Reach out to us and we&#8217;ll get back to you soon. I consent to my data being used to respond to my inquiry. Send Message Thank you for reaching out! Close<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-no-title","meta":{"footnotes":""},"class_list":["post-106","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/106","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=106"}],"version-history":[{"count":30,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/106\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/pages\/106\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/www.299precision.com\/index.php\/wp-json\/wp\/v2\/media?parent=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}