Skip to content

Instantly share code, notes, and snippets.

@avanwart
Last active November 8, 2018 02:02
Show Gist options
  • Save avanwart/bbf6c7a145f6874cfa162feb7535fdf8 to your computer and use it in GitHub Desktop.
Save avanwart/bbf6c7a145f6874cfa162feb7535fdf8 to your computer and use it in GitHub Desktop.
<script>
(function(d) {
loadFonts = 1;
if(window.sessionStorage){
if(sessionStorage.getItem('useTypekit')==='false'){
loadFonts = 0;
}
}
if (loadFonts == 1) {
var config = {
kitId: 'qwc7gjr',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";if(window.sessionStorage){sessionStorage.setItem("useTypekit","false")}},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+="wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s);
}
}
)(document);
</script>
<style>
.wf-loading {
visibility: hidden;
}
.wf-active {
visibility: visible;
}
.wf-inactive {
visibility: visible;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment