Skip to content

Instantly share code, notes, and snippets.

@imlinus
Created January 9, 2017 03:03
Show Gist options
  • Save imlinus/7243d2f64f4d1c2a7769d5e124a23e9c to your computer and use it in GitHub Desktop.
Save imlinus/7243d2f64f4d1c2a7769d5e124a23e9c to your computer and use it in GitHub Desktop.
<style type="text/css">.body-js { opacity: 0; height: 100%; }</style>
<script type="text/javascript">
!function(a,b){a.async=b}(this,function(){function a(a,b){function c(){g.incr(b)}function d(){"complete"===f.readyState&&c()}function e(){console.warn("[async] occurred an error while fetching",a)}var f=document.createElement("script");f.type="text/javascript",f.onload=c,f.async=!0,f.onreadystatechange=d,f.onerror=e,f.src=a,document.head.appendChild(f)}function b(a){c.apply(this,a)}function c(){var c=Array.prototype.slice.call(arguments),d=c[0];"string"==typeof d&&(d=[d]),"[object Array]"===Object.prototype.toString.call(c[1])&&(c[1]=b.bind(this,c.slice(1,c.length)));for(var f=g.push(d.length,c[1]),h=0;h<d.length;h++){var i=d[h];a(e[i]||i,f)}}var d=Object.prototype.hasOwnProperty,e={},f={"extends":function(a,b,c){for(var e in b)d.call(b,e)&&("constructor"===e&&a===global||(void 0===b[e]?delete a[e]:c&&"undefined"!=typeof a[e]||(a[e]=b[e])));return a},merge:function(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}},g={queues:[],push:function(a,b){return this.queues.push({paths:a,loaded:0,exec:b}),this.queues.length-1},incr:function(a){var b=this.queues[a];b.loaded+=1,b.paths<=b.loaded&&"function"==typeof b.exec&&b.exec()},reset:function(){this.queues=[]}};return this.config=function(a){"object"==typeof a.paths&&(e=f.merge(e,a.paths))},this.getConfig=function(){return{paths:e}},this.resetConfig=function(){e={},g.reset()},f["extends"](c.bind(this),this)}());
async.config({
paths: {
'modernizr': 'https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js',
'tweenmax': 'https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js',
'main': 'http://xn--nstalt-buam.se/assets/js/main.js',
'Router': 'http://xn--nstalt-buam.se/assets/js/Router.js',
'Player': 'http://xn--nstalt-buam.se/assets/js/Player.js'
}
});
async(['modernizr', 'jquery', 'tweenmax'], ['main', 'Router'], function() {
function minify(css) { css = css.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g,'').replace(/\s*\{\s*/g,'{').replace(/\s*\}\s*/g,'}').replace(/\s*\:\s*/g,':').replace(/\s*\;\s*/g,';').replace(/\s*\,\s*/g,',').replace(/\s*\~\s*/g,'~').replace(/\s*\>\s*/g,'>').replace(/\s*\+\s*/g,'+').replace(/\s*\!\s*/g,'!'); return css; }
$.get('http://xn--nstalt-buam.se/assets/css/reset.css', function(css) { $('head').append('<style type="text/css" data-orig="reset.css">' + minify(css) + '</style>'); });
$.get('http://xn--nstalt-buam.se/assets/css/general.css', function(css) { $('head').append('<style type="text/css" data-orig="general.css">' + minify(css) + '</style>'); });
$.get('http://xn--nstalt-buam.se/assets/css/misc.css', function(css) { $('head').append('<style type="text/css" data-orig="misc.css">' + minify(css) + '</style>'); });
$.get('http://xn--nstalt-buam.se/assets/css/main.css', function(css) { $('head').append('<style type="text/css" data-orig="main.css">' + minify(css) + '</style>'); });
TweenLite.to($('html, body'), 1, { delay: 0.5, css: { opacity: "1", filter: "blur(0)" }, ease: Sine.easeOut });
TweenLite.to($('.top-bar'), 0.75, { delay: 0.75, css: { opacity: "1", top: "0px" }, ease: Sine.easeOut });
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-89551175-1', 'auto'); ga('send', 'pageview');
});
</script>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js" async></script><![endif]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment