const cdg_urlParams = new URLSearchParams(window.location.search); const cdg_quickAR = cdg_urlParams.get('quick-ar-open'); const button = document.querySelector("[data-threedy-web-id]"); const target = button.getAttribute("data-threedy-web-id"); if (target) { const encodedId = btoa(target.toString()); fetch('https://ncr.preqservices.com/ajax/models/get-models.php?action=checkstatus&modelid=' + encodedId) .then(response => response.json()) .then(data => { if (data.status === 'Active') { button.style.display = 'block'; document.querySelector('.threedy-3d-btn').style.display = 'block'; console.log('model is changed'); if (cdg_quickAR === "1") { const cdg_view_3d_btn = document.querySelector("[data-threedy-web-id]"); if (cdg_view_3d_btn) { cdg_view_3d_btn.click(); } else { console.warn("No .threed_button found on the page!"); } } } else { target.style.display = 'none'; } }) .catch(error => { console.error("Error fetching model status:", error); }); } const style = document.createElement("style"); style.textContent = `.threedy-embed-btn { display: inline-block; height: 50px; padding: 12px 32px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; font-size: 18px; line-height: 26px; text-align: center; color: #ffffff; background: linear-gradient(90deg, #0038a8 0%, #4a57c8 100%); border-radius: 8px; cursor: pointer; border: none; } .threedy-embed-btn:hover { background-color: #0056b3 } .cdg-custom-modal { display: none; position: fixed; z-index: 9999; inset: 0; background-color: rgb(0 0 0 / .6); justify-content: center; align-items: center } .cdg-ar-custom-modal { display: none; position: fixed; z-index: 9999; inset: 0; background-color: rgb(0 0 0 / .6); justify-content: center; align-items: center } .cdg-modal-box { background: #fff; width: 100%; max-width: 75%; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; height: 90%; overflow: auto; } .cdg-modal-header { display: flex; justify-content: flex-end; padding: 10px } .cdg-close-btn { font-size: 28px; cursor: pointer; border: none; background: none } model-viewer { width: 100%; height: 85%; } .cdg-model-id { text-align: center; padding: 10px 0; font-weight: 700; font-size: 16px; color: #007bff } .cdg-modal-footer { display: flex; justify-content: space-around; padding: 10px; border-top: 1px solid #ccc; background-color: #fff; font-size: 14px } .cdg-instructions { display: flex; justify-content: space-around; margin: 70px 0; } .cdg-instruction { max-width: 100%; } .cdg-icon{ height: 125px; } .cdg-instruction_button { background-color: #2c3150; color: white; border: none; padding: 12px 30px; border-radius: 6px; cursor: pointer; font-size: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); width: 250px; } .cdg-instruction_button:hover { background-color: #1f2237; } .cdg-instruction_text{ color: #353E5A; font-size: 16px; font-weight: 400; line-height: 22px; text-decoration: none solid rgb(53, 62, 90); text-align: center; word-spacing: 0px; } .cdg-instruction_head{ font-size: 20px; font-weight: 800; line-height: 26px; color: #353E31; text-decoration: none solid rgb(53, 62, 90); text-align: center; word-spacing: 0px; } .cdg_d-none{ display: none; } .cdg-footer-icon { text-align: center; color: #333; cursor: pointer } .cdg-footer-icon span { display: block; font-size: 12px; margin-top: 4px } /* Popups */ .cdg-popup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); padding: 30px; z-index: 9999; width: 300px; text-align: center; } .cdg-popup.show { display: block; } .cdg-popup-content h2 { margin-top: 0; font-size: 24px; margin-bottom: 15px; } .cdg-popup-content p { font-size: 16px; margin-bottom: 25px; } .cdg-popup-close-btn { padding: 8px 20px; background-color: #e74c3c; color: white; border: none; border-radius: 6px; cursor: pointer; } .cdg-popup-close-btn:hover { background-color: #c0392b; } .cdg-popup-content h2 { color: #0c163f; margin-bottom: 10px; } .cdg-popup-content p { color: #555; margin-bottom: 20px; font-size: 14px; } .cdg-share-link { background: #f1f1f5; padding: 10px; border-radius: 6px; color: #333; margin-bottom: 20px; font-size: 14px; overflow-x: auto; } .cdg-link-copy-button { background: #2c3150; color: white; border: none; padding: 12px; width: 100%; border-radius: 8px; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.2); } .cdg-link-copy-button:hover { background: #1e2238; } .cdg-link-copy-icon { font-size: 18px; } .cdg-back-btn { padding: 10px 15px; margin: 5px; border: none; cursor: pointer; background: #eee; border-radius: 5px; width: 100%; } .cdg-back-btn.cdg-active { background: #007bff; color: #fff; } .cdg-popup-content_h2 { font-size: 22px; margin-bottom: 20px; color: #1d1f2b; } .cdg-popup-content_p { font-size: 15px; color: #555; margin-bottom: 15px; line-height: 1.4; } .cdg-qr-container { margin: 20px 0; } .cdg-qr-container img { width: 180px; height: 180px; object-fit: contain; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 8px; } .cdg-note-box { background: #f5f5f7; padding: 12px; border-radius: 10px; margin: 20px 0; font-size: 12px; color: #666; text-align: center; } .cdg-note-box p { margin: 4px 0; } .cdg-got-it-close-btn { margin-top: 20px; padding: 10px 30px; background-color: #1d1f2b; color: #ffffff; font-size: 16px; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; } .cdg-got-it-close-btn:hover { background-color: #333647; } /* ar model */ .cdg-ar-model { display: block; background: white; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); padding: 15px; width: auto; text-align: center; max-height: 90%; overflow: auto; } .cdg-ar-model-close-btn { font-size: 28px; cursor: pointer; border: none; background: none } .cdg-ar-popup-content_h2 { font-size: 22px; margin-bottom: 20px; color: #1d1f2b; } .cdg-ar-popup-content_p { font-size: 15px; color: #555; margin-bottom: 15px; line-height: 1.4; } .cdg-ar-qr-container { margin: 20px 0; } .cdg-ar-qr-container img { width: 180px; height: 180px; object-fit: contain; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 8px; } .cdg-ar-note-box { background: #f5f5f7; padding: 12px; border-radius: 10px; margin: 20px 0; font-size: 12px; color: #666; text-align: center; } .cdg-ar-note-box p { margin: 4px 0; } .cdg-ar-got-it-close-btn { margin-top: 20px; padding: 10px 30px; background-color: #1d1f2b; color: #ffffff; font-size: 16px; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; } .cdg-ar-got-it-close-btn:hover { background-color: #333647; } .mobile-insctructions { padding: 20px; position: relative; text-align: center; } .mobile-insctructions h2 { font-size: 30px; margin-bottom: 16px; color: #333; } .mobile-insctructions img.main-img { width: 100%; max-height: 150px; object-fit: contain; margin-bottom: 12px; } .mobile-insctructions p { font-size: 25px; color: #555; margin-bottom: 20px; } .mobile-insctructions-ar-actions { display: flex; justify-content: space-between; gap: 10px; } .mobile-insctructions-ar-box { flex: 1; border: 1px solid #ddd; border-radius: 8px; padding: 10px; } .mobile-insctructions-ar-box img { width: 30px; height: 30px; margin-bottom: 6px; } .mobile-insctructions-ar-box span { display: block; font-size: 13px; color: #333; } .desktop-insctructions { display: block; } .mobile-insctructions { display: none; } @media screen and (max-width: 767px) { .desktop-insctructions { display: none; } .mobile-insctructions { display: block; } } `; document.head.appendChild(style); const script = document.createElement("script"); script.type = "module"; script.src = "https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"; document.head.appendChild(script); const meta_1 = document.createElement("meta"); meta_1.charset = "UTF-8"; document.head.appendChild(meta_1); const meta_2 = document.createElement("meta"); meta_2.name = "viewport"; meta_2.content = "width=device-width, initial-scale=1.0"; document.head.appendChild(meta_2); const cdg_modal = document.createElement("div"); cdg_modal.className = "cdg-custom-modal"; cdg_modal.style.display = "none"; cdg_modal.innerHTML = `
Loading...
Hold click and drag your mouse to rotate the object 360*
To zoom in and out, scroll your mouse wheel or use the zoom tool.
Hold CTRL and drag your mouse to pan the object.
Aim your camera at the floor or a flat surface to anchor your object.
Press and drag the object to rotate it 360. Pinch and expand to zoom in and out.
Use your mobile device camera app to scan the code below.
Tap the code that appears to launch this object in Augmented Reality.
Use your mobile device camera app to scan the code below.
Tap the code that appears to launch this object in Augmented Reality.