var isMac = false function $$(query, el) { return [].slice.call((el || document).querySelectorAll(query)) } function $(query, el) { return (el || document).querySelector(query) } // fetchjson(url string, cb (err Error, d Object)->nil) // var fetchjson = ( typeof window.fetch == 'function' ? ( function _fetchjson(url, cb) { return window.fetch(url) .then(function(r) { return r.json() }) .then(function(data) { cb(null, data) }) .catch(cb) } ) : function _fetchjson(url, cb) { var r = new XMLHttpRequest() r.addEventListener("load", function(){ try { cb(null, JSON.parse(r.responseText)) } catch (err) { cb(err) } }) r.open("GET", url) r.send() } ) ;(function(){ "use strict"; // anim.min.js var anim=function(h){h=function(a,e,f,b){var g,d,c=[],j=function(a){ if(a=c.shift())a[1]?h.apply(this,a).anim(j):0g){ for(d in a)d=a[d],d.p=1,d.fn(d,d.n,d.to,d.fr,d.a,d.e);f&&f()}else{g/=e;for(d in a){d=a[d]; if(d.n[d.mx]!=d.mxv)return;h=d.e;c=g;"lin"==h?c=1-c:"ease"==h?(c=2*(0.5-c),c=1-(c*c*c-3*c+2)/4): "ease-in"==h?(c= 1-c,c*=c*c):c=1-c*c*c;d.p=c;d.fn(d,d.n,d.to,d.fr,d.a,d.e)}s?s(b):setTimeout(b,20)}}; b()};h.fx={_:function(a,e,f,b,g){b=parseFloat(b)||0;f=parseFloat(f)||0;a.s[g]=(1<=a.p?f:a.p*(f-b)+b)+a.u}, width:function(a,e,f,b,g,d){0<=a._fr||(a._fr=!isNaN(b=parseFloat(b))?b:"width"==g?e.clientWidth:e.clientHeight); h.fx._(a,e,f,a._fr,g,d)},opacity:function(a,e,f,b,g){if(isNaN(b=b||a._fr))b=e.style,b.zoom=1, b=a._fr=(/alpha\(opacity=(\d+)\b/i.exec(b.filter)||{})[1]/100||1;b*=1;f=a.p*(f-b)+b;e=e.style;g in e?e[g]= f: e.filter=1<=f?"":"alpha("+g+"="+Math.round(100*f)+")"},color:function(a,e,f,b,g,d,c,j){ a.ok||(f=a.to=h.toRGBA(f),b=a.fr=h.toRGBA(b),0==f[3]&&(f=[].concat(b),f[3]=0),0==b[3]&& (b=[].concat(f),b[3]=0),a.ok=1);j=[0,0,0,a.p*(f[3]-b[3])+1*b[3]];for(c=2;0<=c;c--)j[c]=Math.round( a.p*(f[c]-b[c])+1*b[c]);(1<=j[3]||h.rgbaIE)&&j.pop();try{a.s[g]=(3a;a++)k[a]=parseInt(k[a],16),b[a]=Math.round(2.55*b[a]); e=[k[0]||b[0]||q||0,k[1]||b[1]||r||0,k[2]||b[2]||s||0,p||t||1]});return e};return h}(); if (!window.MSStream && /mac|ipad|iphone|ipod/i.test(navigator.userAgent)) { isMac = true document.body.classList.add('mac_or_ios') if (navigator.userAgent.indexOf('Safari') != -1) { document.body.classList.add('safari') } } // timeNow() :float var timeNow = ( window.performance !== undefined && window.performance.now ? function() { return window.performance.now() } : Date.now ? function() { return Date.now() } : function() { return (new Date()).getTime() } ) // download-link fetchjson('/inter/info.json', function(err, data) { if (err) { throw err } var ids = Object.keys(data) var regularId = ids[0] ids.forEach(function(id){ if (id.indexOf('Inter UI Regular:') == 0) { regularId = id } }) if (ids.length == 0) { console.error('failed to find Inter UI Regular in info.json', data) return } var regular = data[regularId] // console.log('info.json:', regular) if (regular.names && regular.names.version) { var v = regular.names.version var p = v.indexOf(';') if (p != -1) { v = v.substr(0, p) } var directDownloadURL = 'https://github.com/rsms/inter/releases/download/v' + v + '/Inter-UI-' + v + '.zip' var av = document.querySelectorAll('a.download-link'), i, e for (i = 0; i < av.length; ++i) { e = av[i] e.href = directDownloadURL } } }) // Google Analytics ;(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-105091131-2', 'auto'); ga('send', 'pageview'); })();