05-tilda-export-backup/Tilda_ Давид Гримм_files/tilda-fonts.min.js

2 lines
2.4 KiB
JavaScript
Raw Permalink Normal View History

2025-10-29 16:50:39 +00:00
!function(){var e=0,t=0;function n(){++e>9||("undefined"!=typeof TildaFonts?a():setTimeout(n,20))}function i(){clearTimeout(t),o(),window.tildafonts_loaded=!0}function o(){var e=document.getElementById("tildafonts-loading");void 0!==e&&null!=e&&e.parentNode.removeChild(e)}function a(){window.tildafonts_loaded=!1;var e=document.head||document.getElementsByTagName("head")[0],n=window.location.hostname.split(".");if("tilda"!==n[n.length-2]){var i=document.createElement("style");i.innerHTML="body *{color:transparent!important;}",i.setAttribute("id","tildafonts-loading"),e.insertBefore(i,e.firstChild),t=setTimeout((function(){o()}),"y"===window.tildafontsswap?50:3e3)}var a=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase(),s={opera:"version",firefox:"firefox",safari:"version",msie:"msie"},d=["linux","windows","iphone","mac os"],f="default",l=0,c=-1,u="default",w="woff",m="y"===window.tildafontsswap?"&display=swap":"",p=/^Mozilla\/5\.0 \(.+[^)]+\) AppleWebKit\/[\d.]+ \(KHTML, like Gecko\) C[hrome|riOS]+\/(\d+)[\d.]+[ Mobile]*[/15E148]*[\sYaBrowser/[\d.]+]?[\sYowser/[\d.]+]? Safari\/[\d.]+[\sEdg/[\d.]+]?[\sOPR/[\d.]+]?$/.exec(navigator.userAgent),h;if(p){var g;parseInt(p[1],10)>=36&&(w="woff2")}else{for(var v in s)if(a.indexOf(v)>-1){c=a.indexOf(s[v]),f=v,l=a.substring(c+s[v].length+1,c+s[v].length+3);break}for(var b=0;b<d.length;b++)if(a.indexOf(d[b])>-1){u=d[b];break}switch("default"===f&&a.indexOf("instagram")>-1&&a.indexOf("iphone")>-1&&(c=a.indexOf("iphone os"),f="safari",u="iphone",l=a.substring(c+10,c+12)),f){case"firefox":l>=39&&(w="woff2");break;case"safari":"iphone"===u?l>=10&&(w="woff2"):l>=12&&(w="woff2");break;case"opera":l>=23&&(w="woff2")}}r("https://fonts.tildacdn.com/get/","?fonts="+TildaFonts+"&format="+w+m,!0,e)}function r(e,t,n,o){var a=document.createElement("link");if(a.addEventListener("load",(function(){i()})),n){a.addEventListener("error",(function(){r("https://fonts2.tildacdn.com/get/",t,!1,o)}));var s=window.performance.timing;if(!s)return;var d=s.responseEnd-s.connectStart,f=2e3;switch(!0){case d<=300:f=2e3;break;case d<=1e3:f=7e3;break;case d<=2e3:f=2e4;break;case d<=3e3:f=3e4;break;case d>3e3:f=45e3}setTimeout((function(){!1===window.tildafonts_loaded&&r("https://fonts2.tildacdn.com/get/",t,!1,o)}),f)}a.setAttribute("href",e+t),a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("media","all"),o.insertBefore(a,o.firstChild)}n()}();