{"id":511,"date":"2025-10-16T16:50:18","date_gmt":"2025-10-16T16:50:18","guid":{"rendered":"https:\/\/gerdygamingcz.com\/?page_id=511"},"modified":"2025-10-16T17:19:44","modified_gmt":"2025-10-16T17:19:44","slug":"review-page-for-games","status":"publish","type":"page","link":"https:\/\/gerdygamingcz.com\/?page_id=511","title":{"rendered":"review page for games"},"content":{"rendered":"    <div id=\"scr-wrapper\">\r\n      <div id=\"scr-form\" class=\"wp-customer-review\">\r\n        <h3>Leave Your Review<\/h3>\r\n        <div class=\"stars\" id=\"scr-stars\">\r\n          <span data-value=\"1\">\u2605<\/span>\r\n          <span data-value=\"2\">\u2605<\/span>\r\n          <span data-value=\"3\">\u2605<\/span>\r\n          <span data-value=\"4\">\u2605<\/span>\r\n          <span data-value=\"5\">\u2605<\/span>\r\n        <\/div>\r\n        <input type=\"hidden\" id=\"scr-rating\" value=\"0\">\r\n        <textarea id=\"scr-text\" placeholder=\"Write your review...\" rows=\"4\"><\/textarea>\r\n        <button id=\"scr-submit\">Submit Review<\/button>\r\n        <p id=\"scr-thankyou\" style=\"display:none;color:green;margin-top:10px;\">Thank you for your review!<\/p>\r\n      <\/div>\r\n\r\n      <div id=\"scr-reviews\">\r\n        <h3>Customer Reviews<\/h3>\r\n        <div class=\"scr-reviews-container\">\r\n                      <p>No reviews yet. Be the first to write one!<\/p>\r\n                  <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <style>\r\n    .wp-customer-review {\r\n      max-width: 500px;\r\n      border: 1px solid #ddd;\r\n      border-radius: 10px;\r\n      padding: 16px;\r\n      background: #fff;\r\n      font-family: system-ui, sans-serif;\r\n      margin-bottom: 20px;\r\n    }\r\n    .wp-customer-review .stars {\r\n      font-size: 28px;\r\n      color: #ccc;\r\n      cursor: pointer;\r\n      user-select: none;\r\n    }\r\n    .wp-customer-review .stars span.active { color: #ffb400; }\r\n    .wp-customer-review textarea {\r\n      width: 100%; margin-top: 10px; padding: 8px;\r\n      border: 1px solid #ccc; border-radius: 6px; resize: vertical;\r\n    }\r\n    .wp-customer-review button {\r\n      margin-top: 12px; background: #0073aa; color: white;\r\n      border: none; border-radius: 6px; padding: 10px 16px; cursor: pointer;\r\n    }\r\n    .wp-customer-review button:hover { background: #005f8d; }\r\n    .scr-reviews-container { border-top: 1px solid #eee; padding-top: 10px; }\r\n    .scr-review-item { border-bottom: 1px solid #eee; padding: 10px 0; }\r\n    .scr-review-item .scr-stars { color: #ffb400; font-size: 20px; }\r\n    <\/style>\r\n\r\n    <script>\r\n    \/\/ ========== Frontend Review Script ==========\r\n    document.addEventListener('DOMContentLoaded', function() {\r\n      const stars = document.querySelectorAll('#scr-stars span');\r\n      const ratingInput = document.getElementById('scr-rating');\r\n      const submitBtn = document.getElementById('scr-submit');\r\n      const thankYou = document.getElementById('scr-thankyou');\r\n      const reviewText = document.getElementById('scr-text');\r\n      const reviewsContainer = document.querySelector('.scr-reviews-container');\r\n\r\n      if (!stars.length) return;\r\n\r\n      stars.forEach(star => {\r\n        star.addEventListener('click', () => {\r\n          const rating = parseInt(star.dataset.value);\r\n          ratingInput.value = rating;\r\n          stars.forEach(s => s.classList.toggle('active', parseInt(s.dataset.value) <= rating));\r\n        });\r\n      });\r\n\r\n      submitBtn.addEventListener('click', () => {\r\n        const rating = ratingInput.value;\r\n        const text = reviewText.value.trim();\r\n\r\n        if (!rating || rating == 0) return alert('Please select a star rating.');\r\n        if (!text) return alert('Please type your review.');\r\n\r\n        const data = new URLSearchParams();\r\n        data.append('action', 'scr_save_review');\r\n        data.append('rating', rating);\r\n        data.append('review_text', text);\r\n        data.append('nonce', 'efecea6399');\r\n\r\n        fetch('https:\/\/gerdygamingcz.com\/wp-admin\/admin-ajax.php', {\r\n          method: 'POST',\r\n          headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\r\n          body: data.toString()\r\n        })\r\n        .then(res => res.json())\r\n        .then(res => {\r\n          if (res.success) {\r\n            thankYou.style.display = 'block';\r\n            reviewText.value = '';\r\n            ratingInput.value = 0;\r\n            stars.forEach(s => s.classList.remove('active'));\r\n            reviewsContainer.insertAdjacentHTML('afterbegin', res.data.html);\r\n          } else {\r\n            alert(res.data?.message || 'Error saving review.');\r\n          }\r\n        })\r\n        .catch(err => console.error(err));\r\n      });\r\n    });\r\n    <\/script>\r\n    \n\n\n\n<p><strong>that I only own<br><br>1.deleted any comments that are not great any way<br>2.deleted any commets about other games<\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>that I only own 1.deleted any comments that are not great any way2.deleted any commets about other games<\/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-511","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/pages\/511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=511"}],"version-history":[{"count":5,"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/pages\/511\/revisions"}],"predecessor-version":[{"id":520,"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=\/wp\/v2\/pages\/511\/revisions\/520"}],"wp:attachment":[{"href":"https:\/\/gerdygamingcz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}