@nhakhungthep | joy.link
@nhakhungthep from joy.link

@nhakhungthep

function loadIframelyEmbedJs() { //- Replace 'iframe.ly' with your custom CDN if available. if (document.querySelectorAll("[data-iframely-url]").length === 0 && document.querySelectorAll("iframe[src*='https://cdn.iframe.ly/embed.js?key=0c381087375598a04f485992cf6c2e58']").length === 0) return; var iframely = window.iframely = window.iframely || {}; if (iframely.load) { iframely.load(); } else { var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true; ifs.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//cdn.iframe.ly/embed.js?key=0c381087375598a04f485992cf6c2e58'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ifs, s); } } //- Run after DOM ready. loadIframelyEmbedJs(); var imageKitOptimisation = 0 var pageBackgroundUrl = 'theme-2560-explodeline.svg' var inputPreview = '' var inputHomepagePreview = '' // var bgImageUrlBase = 'https://ik.imagekit.io/sagflko8bo/backgroundPic/'+pageBackgroundUrl //- only do this in nonhomepage if (!inputHomepagePreview) { $( document ).ready(function() { //- if (inputPreview) { //- var screenHeight = 812 //- var screenWidth = 375 //- } else { var screenHeight = screen.height var screenWidth = screen.width //- } var pageHeight = $(document).height() var pageWidth = $(document).width() console.log("Your screen resolution is: " + screenWidth + "x" + screenHeight); console.log("page resolution" + pageWidth + " " + pageHeight) if(imageKitOptimisation && screenHeight && screenWidth){ var bgImageUrlBase = 'https://asset.joy.link/backgroundPic/'+screenWidth+'x'+screenHeight+'/'+pageBackgroundUrl //-$('#wrapper').css('background-image',`url(${bgImageUrlBase}?tr=w-${pageWidth},h-${pageHeight},q-50,f-jpg,pr-true)`).css('background-size','cover') //- $('#wrapper').css('background-image',`url(${bgImageUrlBase}`).css('background-size','cover') $('#wrapper').css('background-image',`url(${bgImageUrlBase}`).css('background-attachment','fixed').css('background-size','cover').css('background-repeat','no-repeat').css('background-position','center') } else{ //-bgImageUrlBase = 'https://ik.imagekit.io/sagflko8bo/backgroundPic/'+pageBackgroundUrl var bgImageUrlBase = 'https://asset.joy.link/backgroundPic/'+pageBackgroundUrl // $('#wrapper').css('background-image',`url(${bgImageUrlBase}`).css('background-size','cover') $('#wrapper').css('background-image',`url(${bgImageUrlBase}`).css('background-attachment','fixed').css('background-size','cover').css('background-repeat','no-repeat').css('background-position','center') } }); }
x server