Natural Reclaimed Stone | Stone Curators (2024)

'; } }, { "sTitle": "SDT###", "mData": "sdm_id", "sWidth": "15%", "bSortable": true, }, { "sTitle": "Date/time", "mData": "filetime", "sWidth": "25%", "bSortable": true, }, { "sTitle": "", "mData": null, "sWidth": "10%", "bSortable": false, "mRender": function(data, type, full) { return '

'; } } ], 'autoWidth': false, "bDestroy": true } ) } }); $("#tblJsonFiles").on('click', 'tbody .delete-json-file', function(e) { document.getElementById('originFileName').value = $(this).attr('id'); document.getElementById('rowIndex').value = $(this).closest('tr').index(); elementorProFrontend.modules.popup.showPopup({id: parseInt(58808)}); /* Close this popup */ elementorProFrontend.modules.popup.closePopup({}, e); }); $("#tblJsonFiles").on('click', 'tbody .json-file', function(e) { const fileName = e.target.innerHTML; console.log("click SDT json file aaaa", e.target.innerHTML, $(this).attr('id'), e.target); const pathJsonFile = $(this).attr('id'); console.log("pathJsonFile", pathJsonFile); $.get(pathJsonFile).success(function(data){ let ugly = JSON.stringify(data[0].data); let obj = JSON.parse(ugly); let pretty = JSON.stringify(obj, undefined, 4); document.getElementById('paramData').value = pretty; document.getElementById('originFileName').value = e.target.innerHTML; let artx = document.getElementById("artx").contentWindow; artx.postMessage({type:"loadParams", data: JSON.parse(pretty)},"*"); artx.postMessage("getTextureData","*"); $('#download-json').prop('disabled', false); $('#download-texture').prop('disabled', false); $('#download-json-texture').prop('disabled', false); $('#get-json').prop('disabled', false); $('#draw-json').prop('disabled', false); elementorProFrontend.modules.popup.closePopup({}, e); }); }) }); })(jQuery)

Natural Reclaimed Stone | Stone Curators (1)

VISUALIZER PROTOTYPE

Change Building Scene
Change Building Material
Change Design Pattern
Adjust Joint Style

'; scenes += '

'; if (index % 3 === 2) { scenes += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdSceneResult.length - 1 === index) { scenes += '

'; } } } scenes += "

"; $("#scenes").append(scenes); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show Scene popup elementorProFrontend.modules.popup.showPopup({id: parseInt(59789)}); }) //material $('#change-building-material').on('click', function(event) { console.log("change-building-material"); const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; $.ajax({ type:"GET", url: URL_API_SD_MATERIAL_IMAGES_BY_COLLECTION_ID, contentType: 'application/json', success: function(sdMaterialResult) { // console.log("sdMaterialResult", sdMaterialResult); // Append Material data appendHtmlMaterialData(sdMaterialResult); // Add reorder image dropdown selection const reOrderImageEl = $("#reorder-image"); if (reOrderImageEl.length > 0) { reOrderImageEl.empty().append( `

Sort:

` ); } }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61125)}); }) //pattern $('#change-building-design-pattern').on('click', function(event) { const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; const pattern_id_value = document.getElementById("pattern_id").value !== "" ? document.getElementById("pattern_id").value : ''; const tile_width_value = document.getElementById("tile_width").value !== "" ? document.getElementById("tile_width").value : ''; const visualizer_type = document.getElementById("sc_visualizer_type").value console.log("change-building-pattern-texture", URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type); $.ajax({ type:"GET", url: URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type, contentType: 'application/json', success: function(sdMaterialTextureResult) { // console.log("sdMaterialTextureResult", sdMaterialTextureResult); let pattern = '

'; if (sdMaterialTextureResult.length > 0) { console.log("sdMaterialTextureResult.length", sdMaterialTextureResult.length); for (let index = 0; index < sdMaterialTextureResult.length; index++) { const element = sdMaterialTextureResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 27px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id) && parseInt(pattern_id_value) === parseInt(element.patternId) && parseInt(tile_width_value) === parseInt(element.tile_width)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 4px;"; } if (index % 3 === 0) { pattern += '

'; } pattern += '

'; const image_filename = element.image_location_300 || element.image_location_full; pattern += '

'; pattern += '

' +element.sd_design_pattern_id + '

'; pattern += '

'; pattern += '

'; if (index % 3 === 2) { pattern += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdMaterialTextureResult.length - 1 === index) { pattern += '

'; } } } pattern += "

"; $("#material_pattern_textures").append(pattern); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61501)}); }) //joint Style $('#change-joint-material').on('click', function(event) { const sdajm_id_value = document.getElementById("jointID").value; $.ajax({ type:"GET", url: URL_API_GET_SD_JOINT_MATERIALS + "?id=" + sdajm_id_value, contentType: 'application/json', success: function(sdJointMaterialsResult) { let jointMaterial = '

'; if (sdJointMaterialsResult.length > 0) { for (let index = 0; index < sdJointMaterialsResult.length; index++) { // console.log("index 11111111111", index, index % 3); const element = sdJointMaterialsResult[index]; const icon_filename = element.icon_filename_300 || element.icon_filename; const borderTyle = parseInt(sdajm_id_value) === parseInt(element.sdajm_id) ? "outline: solid #000 6px" : ""; if (index % 3 === 0) { jointMaterial += '

'; } jointMaterial += '

'; if (index % 3 === 2) { jointMaterial += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdJointMaterialsResult.length - 1 === index) { jointMaterial += '

'; } } } jointMaterial += "

"; $("#joint-materials").append(jointMaterial); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show Joint Materials popup elementorProFrontend.modules.popup.showPopup({id: parseInt(67077)}); }) // Download Image $('#download-texture').on('click', function(event) { if (document.getElementById("isLoaded").value === "true") { const userInfo = getLocalStorage("user_info"); console.log("download-texture clicked", getCookie("email")); if (userInfo) { let artx = document.getElementById("artx").contentWindow; artx.postMessage("getTextureData","*"); artx.postMessage({ type: "getTexture", data: { size: 2000, quality: 0.6, format: "jpg" } },"*"); } else { // login autoDownloadConfirmation(true); elementorProFrontend.modules.popup.showPopup({id: parseInt(22870)}); } } }) // share-texture $('#share-texture').on('click', function(event) { if (document.getElementById("isLoaded").value === "true") { const userInfo = getLocalStorage("user_info"); console.log("share-texture clicked", getCookie("email")); if (userInfo) { // share elementorProFrontend.modules.popup.showPopup({id: parseInt(67228)}); } else { // login autoDownloadConfirmation(true, true, 2); elementorProFrontend.modules.popup.showPopup({id: parseInt(22870)}); } } }) // Sorting function $(document).on('change', '#sortingDropdown', function(e) { // Warm: image_warm | Cool: image_cool | Dark/Light: gs_average if (sdMaterialResultObj && sdMaterialResultObj.length > 0) { const selectedSorting = $(this).val() ? +$(this).val() : 0; let sortingObj = sdMaterialResultObj.sort((a, b) => { switch (selectedSorting) { // Default: Light -> Dark => gs_average value ASCENDING | 1 case 1: return b.gs_average - a.gs_average; // Dark -> Light => gs_average value DESCENDING | 2 case 2: return a.gs_average - b.gs_average; // Warm -> Cool => Warm value DESCENDING | 3 case 3: return b.image_warm - a.image_warm; // Cool -> Warm => Cool value DESCENDING | 4 case 4: return b.image_cool - a.image_cool; default: return 0; } }); appendHtmlMaterialData(sortingObj); } }) function appendHtmlMaterialData(sdMaterialResult) { let materials = '

'; if (sdMaterialResult && sdMaterialResult.length > 0) { sdMaterialResultObj = sdMaterialResult; // Add global object for Material Result data const sdam_id_value = document.getElementById("sdam_id") && document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; // console.log("sdMaterialResult.length", sdMaterialResult.length); for (let index = 0; index < sdMaterialResult.length; index++) { const element = sdMaterialResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 28px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 4px;"; } if (index % 3 === 0) { materials += '

'; } materials += '

'; const image_filename = element.image_location_300 || element.image_location_full; materials += '

'; materials += '

' +element.sd_pm_type + element.sd_pm_number + '

'; materials += '

'; materials += '

' + element.sd_public_texture_name + '

'; materials += '

'; if (index % 3 === 2) { materials += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdMaterialResult.length - 1 === index) { materials += '

'; } } } materials += "

"; const materialsEL = $("#materials"); if (materialsEL && materialsEL.length > 0) { materialsEL.empty().append(materials); } } }); function getLocalStorage(cname) { return JSON.parse(localStorage.getItem(cname)); } function getCookie(name) { let nameEQ = name + "="; let ca = document.cookie.split(';'); for(let i=0;i < ca.length;i++) { let c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } })(jQuery)

Natural Reclaimed Stone | Stone Curators (5)

VISUALIZER PROTOTYPE

Change Building Scene
Change Building Material
Change Design Pattern
Adjust Joint Style

` ); } }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61125)}); }) //pattern $('#change-building-design-pattern').on('click', function(event) { document.getElementById("popupOpen").value = 3; document.getElementById("displayCols").value = detectColsByDevice(); const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; const visualizer_type = document.getElementById("sc_visualizer_type").value // const pattern_id_value = document.getElementById("pattern_id").value !== "" ? document.getElementById("pattern_id").value : ''; // const tile_width_value = document.getElementById("tile_width").value !== "" ? document.getElementById("tile_width").value : ''; console.log("change-building-pattern-texture", URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type); $.ajax({ type:"GET", url: URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type, contentType: 'application/json', success: function(sdMaterialTextureResult) { console.log("sdMaterialTextureResult aaaaaaaaaaaaa", sdMaterialTextureResult); sdMaterialTextureResultObj = sdMaterialTextureResult; drawDesignPattern(sdMaterialTextureResult); // console.log("sdMaterialTextureResult", sdMaterialTextureResult); // let pattern = '

'; // if (sdMaterialTextureResult.length > 0) { // // console.log("sdMaterialTextureResult.length", sdMaterialTextureResult.length); // for (let index = 0; index < sdMaterialTextureResult.length; index++) { // const element = sdMaterialTextureResult[index]; // let borderTyle = ""; // let imageStyle = "position: absolute;height: 35px;right: 27px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 7px;"; // if (parseInt(sdam_id_value) === parseInt(element.sdam_id) && parseInt(pattern_id_value) === parseInt(element.patternId) && parseInt(tile_width_value) === parseInt(element.tile_width)) { // borderTyle = "outline: solid #000 6px"; // imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 4px;"; // } // if (index % 3 === 0) { // pattern += '

'; // } // pattern += '

'; // const image_filename = element.image_location_300 || element.image_location_full; // pattern += '

'; // pattern += '

' +element.sd_design_pattern_id + '

'; // pattern += '

'; // pattern += '

'; // if (index % 3 === 2) { // pattern += '

'; // } // if ((index % 3 === 0 || index % 3 === 1) && sdMaterialTextureResult.length - 1 === index) { // pattern += '

'; // } // } // } // pattern += "

"; // $("#material_pattern_textures").append(pattern); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61501)}); }) //joint Style $('#change-joint-material').on('click', function(event) { document.getElementById("popupOpen").value = 4; document.getElementById("displayCols").value = detectColsByDevice(); const sdajm_id_value = document.getElementById("jointID").value; $.ajax({ type:"GET", url: URL_API_GET_SD_JOINT_MATERIALS + "?id=" + sdajm_id_value, contentType: 'application/json', success: function(sdJointMaterialsResult) { sdJointMaterialsResultObj = sdJointMaterialsResult; drawJointMaterials(sdJointMaterialsResult); // let jointMaterial = '

'; // if (sdJointMaterialsResult.length > 0) { // for (let index = 0; index < sdJointMaterialsResult.length; index++) { // // console.log("index 11111111111", index, index % 3); // const element = sdJointMaterialsResult[index]; // const icon_filename = element.icon_filename_300 || element.icon_filename; // const borderTyle = parseInt(sdajm_id_value) === parseInt(element.sdajm_id) ? "outline: solid #000 6px" : ""; // if (index % 3 === 0) { // jointMaterial += '

'; // } // jointMaterial += '

'; // jointMaterial += '

'; // jointMaterial += '

' + element.name + '

'; // jointMaterial += '

'; // if (index % 3 === 2) { // jointMaterial += '

'; // } // if ((index % 3 === 0 || index % 3 === 1) && sdJointMaterialsResult.length - 1 === index) { // jointMaterial += '

'; // } // } // } // jointMaterial += "

"; // $("#joint-materials").append(jointMaterial); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show Joint Materials popup elementorProFrontend.modules.popup.showPopup({id: parseInt(67077)}); }) // Download Image $('#download-texture').on('click', function(event) { if (document.getElementById("isLoaded").value === "true") { const userInfo = getLocalStorage("user_info"); console.log("download-texture clicked", getCookie("email")); if (userInfo) { let artx = document.getElementById("artx").contentWindow; artx.postMessage("getTextureData","*"); artx.postMessage({ type: "getTexture", data: { size: 2000, quality: 0.6, format: "jpg" } },"*"); } else { // login autoDownloadConfirmation(true, true, '1'); elementorProFrontend.modules.popup.showPopup({id: parseInt(22870)}); } } }) // share-texture $('#share-texture').on('click', function(event) { // if (document.getElementById("isLoaded").value === "true") { // const userInfo = getLocalStorage("user_info"); // console.log("share-texture clicked", getCookie("email")); // if (userInfo) { // // share // elementorProFrontend.modules.popup.showPopup({id: parseInt(67228)}); // } else { // // login // autoDownloadConfirmation(true, true, '2'); // elementorProFrontend.modules.popup.showPopup({id: parseInt(22870)}); // } // } console.log("share-texture clicked"); elementorProFrontend.modules.popup.showPopup({id: parseInt(67228)}); }) // Sorting function $(document).on('change', '#sortingDropdown', function(e) { // Warm: image_warm | Cool: image_cool | Dark/Light: gs_average if (sdMaterialResultObj && sdMaterialResultObj.length > 0) { const selectedSorting = $(this).val() ? +$(this).val() : 0; let sortingObj = sdMaterialResultObj.sort((a, b) => { switch (selectedSorting) { // Default: Light -> Dark => gs_average value ASCENDING | 1 case 1: return b.gs_average - a.gs_average; // Dark -> Light => gs_average value DESCENDING | 2 case 2: return a.gs_average - b.gs_average; // Warm -> Cool => Warm value DESCENDING | 3 case 3: return b.image_warm - a.image_warm; // Cool -> Warm => Cool value DESCENDING | 4 case 4: return b.image_cool - a.image_cool; default: return 0; } }); appendHtmlMaterialData(sortingObj); } }) function drawScenes(sdSceneResult) { displayCols = document.getElementById("displayCols") ? document.getElementById("displayCols").value : 3; const scene_id_value = document.getElementById("scene_id") && document.getElementById("scene_id").value !== "" ? document.getElementById("scene_id").value : 8; let scenes = '

'; if (sdSceneResult && sdSceneResult.length > 0) { for (let index = 0; index < sdSceneResult.length; index++) { const element = sdSceneResult[index]; const borderTyle = parseInt(scene_id_value) === parseInt(element.sdas_id) ? "outline: solid #000 6px" : ""; if (index % displayCols === 0) { scenes += '

'; } scenes += '

'; const icon_filename = element.icon_filename_300 || element.icon_filename; scenes += '

'; scenes += '

'; if (index % displayCols === (displayCols-1)) { scenes += '

'; } if ((index % displayCols === 0 || index % displayCols === 1) && sdSceneResult.length - 1 === index) { scenes += '

'; } } } scenes += "

"; // $("#scenes").append(scenes); const scenesEL = $("#scenes"); if (scenesEL && scenesEL.length > 0) { scenesEL.empty().append(scenes); } } function appendHtmlMaterialData(sdMaterialResult) { displayCols = document.getElementById("displayCols") ? document.getElementById("displayCols").value : 3; let materials = '

'; if (sdMaterialResult && sdMaterialResult.length > 0) { sdMaterialResultObj = sdMaterialResult; // Add global object for Material Result data const sdam_id_value = document.getElementById("sdam_id") && document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; // console.log("sdMaterialResult.length", sdMaterialResult.length); for (let index = 0; index < sdMaterialResult.length; index++) { const element = sdMaterialResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 28px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 4px;"; } if (index % displayCols === 0) { materials += '

'; } materials += '

'; const image_filename = element.image_location_300 || element.image_location_full; materials += '

'; materials += '

' +element.sd_pm_type + element.sd_pm_number + '

'; materials += '

'; materials += '

' + element.sd_public_texture_name + '

'; materials += '

'; if (index % displayCols === (displayCols-1)) { materials += '

'; } if ((index % displayCols === 0 || index % displayCols === 1) && sdMaterialResult.length - 1 === index) { materials += '

'; } } } materials += "

"; const materialsEL = $("#materials"); if (materialsEL && materialsEL.length > 0) { materialsEL.empty().append(materials); } } function drawDesignPattern(sdMaterialTextureResult) { displayCols = document.getElementById("displayCols") ? document.getElementById("displayCols").value : 3; const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; const pattern_id_value = document.getElementById("pattern_id").value !== "" ? document.getElementById("pattern_id").value : ''; const tile_width_value = document.getElementById("tile_width").value !== "" ? document.getElementById("tile_width").value : ''; let pattern = '

'; if (sdMaterialTextureResult && sdMaterialTextureResult.length > 0) { console.log("sdMaterialTextureResult.length", sdMaterialTextureResult, sdMaterialTextureResult.length); for (let index = 0; index < sdMaterialTextureResult.length; index++) { const element = sdMaterialTextureResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 27px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id) && parseInt(pattern_id_value) === parseInt(element.patternId) && parseInt(tile_width_value) === parseInt(element.tile_width)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 4px;"; } if (index % displayCols === 0) { pattern += '

'; } pattern += '

'; const image_filename = element.image_location_300 || element.image_location_full; pattern += '

'; pattern += '

' +element.sd_design_pattern_id + '

'; pattern += '

'; pattern += '

'; if (index % displayCols === (displayCols-1)) { pattern += '

'; } if ((index % displayCols === 0 || index % displayCols === 1) && sdMaterialTextureResult.length - 1 === index) { pattern += '

'; } } } pattern += "

"; // $("#material_pattern_textures").append(pattern); const designPatternEL = $("#material_pattern_textures"); if (designPatternEL && designPatternEL.length > 0) { designPatternEL.empty().append(pattern); } } function drawJointMaterials(sdJointMaterialsResult) { displayCols = document.getElementById("displayCols") ? document.getElementById("displayCols").value : 3; const sdajm_id_value = document.getElementById("jointID").value; let jointMaterial = '

'; if (sdJointMaterialsResult && sdJointMaterialsResult.length > 0) { for (let index = 0; index < sdJointMaterialsResult.length; index++) { // console.log("index 11111111111", index, index % 3); const element = sdJointMaterialsResult[index]; const icon_filename = element.icon_filename_300 || element.icon_filename; const borderTyle = parseInt(sdajm_id_value) === parseInt(element.sdajm_id) ? "outline: solid #000 6px" : ""; if (index % displayCols === 0) { jointMaterial += '

'; } jointMaterial += '

'; jointMaterial += '

'; jointMaterial += '

' + element.name + '

'; jointMaterial += '

'; if (index % displayCols === (displayCols-1)) { jointMaterial += '

'; } if ((index % displayCols === 0 || index % displayCols === 1) && sdJointMaterialsResult.length - 1 === index) { jointMaterial += '

'; } } } jointMaterial += "

"; // $("#joint-materials").append(jointMaterial); const jointMaterialEL = $("#joint-materials"); if (jointMaterialEL && jointMaterialEL.length > 0) { jointMaterialEL.empty().append(jointMaterial); } } function detectColsByDevice() { let displayCols = 3; const device = getDevice(); console.log("popup detectColsByDevice=", device, document.getElementById("popupOpen").value); if (device === "tablet") { if (document.getElementById("popupOpen") && document.getElementById("popupOpen").value === '4'){ console.log("popup tablet doc 4"); displayCols = 4; } else { if (Math.abs(window.orientation) === 0) { console.log("popup tablet doc 2"); displayCols = 2; } else { console.log("popup tablet ngang 3"); displayCols = 3; } } } else if (device === "mobile") { if (document.getElementById("popupOpen") && document.getElementById("popupOpen").value === '4'){ console.log("popup mobile doc 2"); displayCols = 2; } else { if (Math.abs(window.orientation) === 0) { console.log("popup mobile doc"); displayCols = 1; } else { console.log("popup mobile ngang"); displayCols = 2; } } } console.log("popup", displayCols); return displayCols; } /* get Device */ function getDevice() { let width = Math.max(window.screen.width, window.innerWidth); let ua = window.navigator.userAgent.toLowerCase(); console.log("getDevice ua", width, ua); // let isTablet = // ua.indexOf("sm-t") > -1 // || ua.indexOf("ipad") > -1 // || (ua.indexOf("macintosh") > -1 && width >= 768 && width <= 1366) // || (ua.indexOf("android") > -1 && "ontouchend" in document); // let isPhone = // ua.indexOf("iphone") > -1 // || ua.indexOf("sm-g") > -1 // || (ua.indexOf("sm-n") > -1 && "ontouchend" in document); let isTablet = ua.indexOf("sm-t") > -1 || ua.indexOf("ipad") > -1 || (ua.indexOf("macintosh") > -1 && width >= 768 && width <= 1366) || (ua.indexOf("android") > -1 && width >= 519 && "ontouchend" in document); let isPhone = ua.indexOf("iphone") > -1 || ua.indexOf("sm-g") > -1 || (ua.indexOf("sm-n") > -1 && "ontouchend" in document) || ua.indexOf("android") > -1 && width < 519; if (isTablet && !isPhone) { // console.log("device is tablet"); return "tablet"; } else if (isPhone){ // console.log("device is mobile"); return "mobile"; } else { // console.log("device is desktop"); return "desktop"; } } function getLocalStorage(cname) { return JSON.parse(localStorage.getItem(cname)); } function getCookie(name) { let nameEQ = name + "="; let ca = document.cookie.split(';'); for(let i=0;i < ca.length;i++) { let c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } }); })(jQuery)

Natural Reclaimed Stone | Stone Curators (12)

VISUALIZER PROTOTYPE

Change Building Scene
Change Building Material
Change Design Pattern

'; scenes += '

'; if (index % 3 === 2) { scenes += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdSceneResult.length - 1 === index) { scenes += '

'; } } } scenes += "

"; $("#scenes").append(scenes); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show Scene popup elementorProFrontend.modules.popup.showPopup({id: parseInt(59789)}); }) //material $('#change-building-material').on('click', function(event) { console.log("change-building-material"); const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; $.ajax({ type:"GET", url: URL_API_SD_MATERIAL_IMAGES_BY_COLLECTION_ID, contentType: 'application/json', success: function(sdMaterialResult) { // console.log("sdMaterialResult", sdMaterialResult); // Append Material data appendHtmlMaterialData(sdMaterialResult); // Add reorder image dropdown selection const reOrderImageEl = $("#reorder-image"); if (reOrderImageEl.length > 0) { reOrderImageEl.empty().append( `

Sort:

` ); } }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61125)}); }) //pattern $('#change-building-design-pattern').on('click', function(event) { const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; const pattern_id_value = document.getElementById("pattern_id").value !== "" ? document.getElementById("pattern_id").value : ''; const tile_width_value = document.getElementById("tile_width").value !== "" ? document.getElementById("tile_width").value : ''; const visualizer_type = document.getElementById("sc_visualizer_type").value console.log("change-building-pattern-texture", URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type); $.ajax({ type:"GET", url: URL_API_GET_MATERIAL_BY_TEXTURE_MATERIAL_ID + "?materialId=" + sdam_id_value + "&visualizer_type=" + visualizer_type, contentType: 'application/json', success: function(sdMaterialTextureResult) { // console.log("sdMaterialTextureResult", sdMaterialTextureResult); let pattern = '

'; if (sdMaterialTextureResult.length > 0) { // console.log("sdMaterialTextureResult.length", sdMaterialTextureResult.length); for (let index = 0; index < sdMaterialTextureResult.length; index++) { const element = sdMaterialTextureResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 27px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id) && parseInt(pattern_id_value) === parseInt(element.patternId) && parseInt(tile_width_value) === parseInt(element.tile_width)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px; bottom: 4px;"; } if (index % 3 === 0) { pattern += '

'; } pattern += '

'; const image_filename = element.image_location_300 || element.image_location_full; pattern += '

'; pattern += '

' +element.sd_design_pattern_id + '

'; pattern += '

'; pattern += '

'; if (index % 3 === 2) { pattern += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdMaterialTextureResult.length - 1 === index) { pattern += '

'; } } } pattern += "

"; $("#material_pattern_textures").append(pattern); }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR.status); } }) // show material popup elementorProFrontend.modules.popup.showPopup({id: parseInt(61501)}); }) // Download Image $('#download-texture').on('click', function(event) { if (document.getElementById("isLoaded").value === "true") { console.log("download-texture clicked"); let artx = document.getElementById("artx").contentWindow; artx.postMessage("getTextureData","*"); artx.postMessage({ type: "getTexture", data: { size: 2000, quality: 0.6, format: "jpg" } },"*"); } }) // Sorting function $(document).on('change', '#sortingDropdown', function(e) { // Warm: image_warm | Cool: image_cool | Dark/Light: gs_average if (sdMaterialResultObj && sdMaterialResultObj.length > 0) { const selectedSorting = $(this).val() ? +$(this).val() : 0; let sortingObj = sdMaterialResultObj.sort((a, b) => { switch (selectedSorting) { // Default: Light -> Dark => gs_average value ASCENDING | 1 case 1: return b.gs_average - a.gs_average; // Dark -> Light => gs_average value DESCENDING | 2 case 2: return a.gs_average - b.gs_average; // Warm -> Cool => Warm value DESCENDING | 3 case 3: return b.image_warm - a.image_warm; // Cool -> Warm => Cool value DESCENDING | 4 case 4: return b.image_cool - a.image_cool; default: return 0; } }); appendHtmlMaterialData(sortingObj); } }) function appendHtmlMaterialData(sdMaterialResult) { let materials = '

'; if (sdMaterialResult && sdMaterialResult.length > 0) { sdMaterialResultObj = sdMaterialResult; // Add global object for Material Result data const sdam_id_value = document.getElementById("sdam_id").value !== "" ? document.getElementById("sdam_id").value : 729; // console.log("sdMaterialResult.length", sdMaterialResult.length); for (let index = 0; index < sdMaterialResult.length; index++) { const element = sdMaterialResult[index]; let borderTyle = ""; let imageStyle = "position: absolute;height: 35px;right: 28px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 7px;"; if (parseInt(sdam_id_value) === parseInt(element.sdam_id)) { borderTyle = "outline: solid #000 6px"; imageStyle = "position: absolute;height: 35px;right: 22px;display: inline-block;width: 90px;background-color: #000;color: #fff;text-align: center;line-height: 35px;bottom: 4px;"; } if (index % 3 === 0) { materials += '

'; } materials += '

'; const image_filename = element.image_location_300 || element.image_location_full; materials += '

'; materials += '

' +element.sd_pm_type + element.sd_pm_number + '

'; materials += '

'; materials += '

' + element.sd_public_texture_name + '

'; materials += '

'; if (index % 3 === 2) { materials += '

'; } if ((index % 3 === 0 || index % 3 === 1) && sdMaterialResult.length - 1 === index) { materials += '

'; } } } materials += "

"; const materialsEL = $("#materials"); if (materialsEL && materialsEL.length > 0) { materialsEL.empty().append(materials); } } }); })(jQuery)

'; } }, { "sTitle": "SDM###", "mData": "sdm_id", "sWidth": "15%", "bSortable": true, }, { "sTitle": "Date/time", "mData": "filetime", "sWidth": "25%", "bSortable": true, }, { "sTitle": "", "mData": null, "sWidth": "10%", "bSortable": false, "mRender": function(data, type, full) { return '

'; } } ], 'autoWidth': false, "bDestroy": true } ) } }); $("#tblJsonFiles").on('click', 'tbody .delete-json-file', function(e) { document.getElementById('originFileName').value = $(this).attr('id'); document.getElementById('rowIndex').value = $(this).closest('tr').index(); elementorProFrontend.modules.popup.showPopup({id: parseInt(58808)}); /* Close this popup */ elementorProFrontend.modules.popup.closePopup({}, e); }); $("#tblJsonFiles").on('click', 'tbody .json-file', function(e) { const fileName = e.target.innerHTML; // console.log("click aaaa", e.target.innerHTML, $(this).attr('id'), e.target); const pathJsonFile = $(this).attr('id'); $.get(pathJsonFile).success(function(data){ let ugly = JSON.stringify(data[0].data); let obj = JSON.parse(ugly); let pretty = JSON.stringify(obj, undefined, 4); document.getElementById('paramData').value = pretty; document.getElementById('originFileName').value = e.target.innerHTML; let artx = document.getElementById("artx").contentWindow; artx.postMessage({type:"loadParams", data: JSON.parse(pretty)},"*"); artx.postMessage("getTextureData","*"); $('#download-json').prop('disabled', false); $('#download-texture').prop('disabled', false); $('#download-json-texture').prop('disabled', false); $('#get-json').prop('disabled', false); $('#draw-json').prop('disabled', false); elementorProFrontend.modules.popup.closePopup({}, e); }); }) }); })(jQuery)

Natural Reclaimed Stone | Stone Curators (2024)
Top Articles
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5847

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.