1/*********************************************************************************/ 2/* Settings */ 3/*********************************************************************************/ 4 5 var _settings = { 6 7 // Fullscreen 8 useFullScreen: true, 9 10 // Section Transitions 11 useSectionTransitions: true, 12 13 // Fade in speed (in ms) 14 fadeInSpeed: 1000, 15 16 // skel 17 skel: { 18 prefix: 'css/style', 19 resetCSS: true, 20 useOrientation: true, 21 boxModel: 'border', 22 breakpoints: { 23 'max': { range: '*', containers: 1440, hasStyleSheet: false }, 24 'wide': { range: '-1920', containers: 1360 }, 25 'normal': { range: '-1680', containers: 1200 }, 26 'narrow': { range: '-1280', containers: 960 }, 27 'narrower': { range: '-1000', containers: '95%', lockViewport: true }, 28 'mobile': { range: '-640', containers: '95%', grid: { gutters: 20 }, lockViewport: true }, 29 'mobile-narrow': { range: '-480', containers: '95%', grid: { collapse: true, gutters: 10 }, lockViewport: true, hasStyleSheet: false } 30 } 31 }, 32 33 // poptrox 34 poptrox: { 35 baseZIndex: 10001, 36 useBodyOverflow: false, 37 usePopupEasyClose: false, 38 overlayColor: '#1f2328', 39 overlayOpacity: 0.65, 40 usePopupDefaultStyling: false, 41 usePopupCaption: true, 42 popupLoaderText: '', 43 windowMargin: 50, 44 usePopupNav: true 45 } 46 47 }; 48 49/*********************************************************************************/ 50/* jQuery Plugins */ 51/*********************************************************************************/ 52 53 // formerize | (c) n33.co | MIT 54 jQuery.fn.formerize=function(){var _fakes=new Array(),_form = jQuery(this);_form.find('input[type=text],textarea').each(function() { var e = jQuery(this); if (e.val() == '' || e.val() == e.attr('placeholder')) { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } }).blur(function() { var e = jQuery(this); if (e.attr('name').match(/_fakeformerizefield$/)) return; if (e.val() == '') { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } }).focus(function() { var e = jQuery(this); if (e.attr('name').match(/_fakeformerizefield$/)) return; if (e.val() == e.attr('placeholder')) { e.removeClass('formerize-placeholder'); e.val(''); } }); _form.find('input[type=password]').each(function() { var e = jQuery(this); var x = jQuery(jQuery('<div>').append(e.clone()).remove().html().replace(/type="password"/i, 'type="text"').replace(/type=password/i, 'type=text')); if (e.attr('id') != '') x.attr('id', e.attr('id') + '_fakeformerizefield'); if (e.attr('name') != '') x.attr('name', e.attr('name') + '_fakeformerizefield'); x.addClass('formerize-placeholder').val(x.attr('placeholder')).insertAfter(e); if (e.val() == '') e.hide(); else x.hide(); e.blur(function(event) { event.preventDefault(); var e = jQuery(this); var x = e.parent().find('input[name=' + e.attr('name') + '_fakeformerizefield]'); if (e.val() == '') { e.hide(); x.show(); } }); x.focus(function(event) { event.preventDefault(); var x = jQuery(this); var e = x.parent().find('input[name=' + x.attr('name').replace('_fakeformerizefield', '') + ']'); x.hide(); e.show().focus(); }); x.keypress(function(event) { event.preventDefault(); x.val(''); }); }); _form.submit(function() { jQuery(this).find('input[type=text],input[type=password],textarea').each(function(event) { var e = jQuery(this); if (e.attr('name').match(/_fakeformerizefield$/)) e.attr('name', ''); if (e.val() == e.attr('placeholder')) { e.removeClass('formerize-placeholder'); e.val(''); } }); }).bind("reset", function(event) { event.preventDefault(); jQuery(this).find('select').val(jQuery('option:first').val()); jQuery(this).find('input,textarea').each(function() { var e = jQuery(this); var x; e.removeClass('formerize-placeholder'); switch (this.type) { case 'submit': case 'reset': break; case 'password': e.val(e.attr('defaultValue')); x = e.parent().find('input[name=' + e.attr('name') + '_fakeformerizefield]'); if (e.val() == '') { e.hide(); x.show(); } else { e.show(); x.hide(); } break; case 'checkbox': case 'radio': e.attr('checked', e.attr('defaultValue')); break; case 'text': case 'textarea': e.val(e.attr('defaultValue')); if (e.val() == '') { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } break; default: e.val(e.attr('defaultValue')); break; } }); window.setTimeout(function() { for (x in _fakes) _fakes[x].trigger('formerize_sync'); }, 10); }); return _form; }; 55 56 // scrolly | (c) n33.co | MIT 57 jQuery.fn.scrolly=function(d,b){d||(d=1E3);b||(b=0);jQuery(this).off("click.scrolly").on("click.scrolly",function(f){var a=jQuery(this),c=a.attr("href"),e;"#"==c.charAt(0)&&(1<c.length&&0<(e=jQuery(c)).length)&&(c=e.offset().top,a.hasClass("scrolly-centered")?a=c-($(window).height()-e.outerHeight())/2:(a=Math.max(c,0),b&&(a="function"==typeof b?a-b():a-b)),f.preventDefault(),jQuery("body,html").stop().animate({scrollTop:a},d,"swing"))})}; 58 59 // scrollgress | (c) n33.co | MIT 60 (function(){var d=$(window),h=$(document),k=1E3;jQuery.fn.scrollwatch=function(c){if(1<this.length){for(var b=0;b<this.length;b++)$(this[b]).scrollwatch(c);return this}
60var a=jQuery.extend({range:0.5,anchor:"top",init:null,on:null,off:null,delay:0},c),d=$(this),e;a.init&&a.init(d);d.data("scrollwatch-state",0).scrollgress(function(c){window.clearTimeout(e);e=window.setTimeout(function(){if(0==d.data("scrollwatch-state")){if(c>=-1*a.range&&c<=a.range&&(d.data("scrollwatch-state",1),a.on))a.on(d)}else if(c<-1*a.range||c>=a.range)d.data("scrollwatch-state",0),a.off&&a.off(d)},a.delay)},{anchor:a.anchor},"scrollwatch");return d};jQuery.fn.unscrollwatch=function(){if(1<this.length){for(var c=0;c<this.length;c++)$(this[c]).unscrollwatch();return this}c=$(this);c.removeData("scrollwatch-state",0).unscrollgress("scrollwatch");return c};jQuery.fn.scrollgress=function(c,b,a){if(1<this.length){for(var g=0;g<this.length;g++)$(this[g]).scrollgress(c,b,a);return this}a||(a="scrollgress");var e=jQuery.extend({anchor:"top",direction:"both",scope:"element",easing:0},b),f=$(this);f.data(a+"-id")||f.data(a+"-id",k++);b=f.data(a+"-id");a="scroll."+a+"-"+b;d.off(a).on(a,function(){var a=f.offset().top,b=f.outerHeight();h.height();switch(e.scope){default:case "element":switch(e.anchor){default:case "top":a=-1*((a-d.scrollTop())/b);break;case "center":a=-1*((a-d.scrollTop()-(d.height()-b)/2)/b);break;case "bottom":a=-1*((a-d.scrollTop()-(d.height()-b))/b)}break;case "window":switch(e.anchor){default:case "top":a=-1*((a-d.scrollTop())/d.height());break;case "center":a=-1*((a-d.scrollTop()-(d.height()-b)/2)/d.height());break;case "bottom":a=-1*((a-d.scrollTop()-(d.height()-b))/d.height())}}"forwards"==e.direction?a=Math.max(0,a):"backwards"==e.direction&&(a=Math.min(0,a));0<a?a=Math.max(0,a-e.easing/100):0>a&&(a=Math.min(0,a+e.easing/100));c(a,f)}).trigger("scroll");return f};jQuery.fn.unscrollgress=function(c){if(1<this.length){for(var b=0;b<this.length;b++)$(this[b]).unscrollgress(c);return this}c||(c="scrollgress");var b=$(this),a;if(!b.data(c+"-id"))return b;a=b.data(c+"-id");d.off("scroll."+c+"-"+a);b.removeData(c+"-id");return b}})(); 61 62/*********************************************************************************/ 63/* Initialize */ 64/*********************************************************************************/ 65 66 // skel 67 skel.init(_settings.skel); 68 69 // jQuery 70 jQuery(function() { 71 72 var $window = $(window), 73 $body = $('body'), 74 $header = $('#header'), 75 $all = $body.add($header), 76 sectionTransitionState = false; 77 78 // Disable animations/transitions until everything's loaded 79 $all 80 .addClass('loading') 81 .fadeTo(0, 0.0001); 82 83 $window.load(function() { 84 window.setTimeout(function() { 85 $all 86 .fadeTo(_settings.fadeInSpeed, 1, function() { 87 $body.removeClass('loading'); 88 $all.fadeTo(0, 1); 89 }); 90 }, _settings.fadeInSpeed); 91 }); 92 93 // Settings overrides 94 95 // IE <= 9? 96 if (skel.vars.IEVersion <= 9) 97 _settings.useSectionTransitions = false; 98 99 // Touch? 100 if (skel.vars.isTouch) { 101 102 // Disable section transitions 103 _settings.useSectionTransitions = false; 104 105 // Turn on touch mode 106 $body.addClass('touch'); 107 108 } 109 110 // Mobile? 111 if (skel.isActive('mobile')) { 112 113 // Reduce poptrox windowMargin 114 _settings.poptrox.windowMargin = 5; 115 116 } 117 118 // Forms 119 if (skel.vars.IEVersion < 10) 120 $('form').formerize(); 121 122 // Gallery 123 $('.gallery').poptrox(_settings.poptrox); 124 125 // Events 126 127 // State change (skel) 128 skel.onStateChange(function() { 129 130 // Force touch mode if we're in mobile 131 if (skel.isActive('mobile')) 132 $body.addClass('touch'); 133 else if (!skel.vars.isTouch) 134 $body.removeClass('touch'); 135 136 // Section transitions 137 if (_settings.useSectionTransitions) { 138 139 if (!skel.isActive('mobile')) { 140 141 if (!sectionTransitionState) { 142 143 sectionTransitionState = true; 144 145 // Generic sections 146 $('.main.style1') 147 .scrollwatch({ 148 delay: 50, 149 range: 0.25, 150 anchor: 'center', 151 init: function(t) { t.addClass('inactive'); }, 152 on: function(t) { t.removeClass('inactive'); }, 153 off: function(t) { t.addClass('inactive'); } 154 }); 155 156 $('.main.style2') 157 .scrollwatch({ 158 delay: 50, 159 range: 0.5, 160 anchor: 'center', 161 init: function(t) { t.addClass('inactive'); }, 162 on: function(t) { t.removeClass('inactive'); }, 163 off: function(t) { t.addClass('inactive'); } 164 }); 165 166 // Work 167 $('#work') 168 .scrollwatch({ 169 delay: 25, 170 range: 0.6, 171 anchor: 'center', 172 init: function(t) { t.find('.row.images').addClass('inactive'); }, 173 on: function(t) { 174 var rows = t.find('.row.images'), 175 length = rows.length, 176 n = 0; 177 178 rows.each(function() { 179 var row = $(this); 180 window.setTimeout(function() { 181 row.removeClass('inactive'); 182 }, 100 * (length - n++)); 183 }); 184 }, 185 off: function(t) { 186 var rows = t.find('.row.images'), 187 length = rows.length, 188 n = 0; 189 190 rows.each(function() { 191 var row = $(this); 192 window.setTimeout(function() { 193 row.addClass('inactive'); 194 }, 100 * (length - n++)); 195 }); 196 } 197 }); 198 199 // Contact 200 $('#contact') 201 .scrollwatch({ 202 delay: 25, 203 range: 0.5, 204 anchor: 'center', 205 init: function(t) { t.addClass('inactive'); }, 206 on: function(t) { t.removeClass('inactive'); }, 207 off: function(t) { t.addClass('inactive'); } 208 }); 209 210 // Force scroll event 211 window.setTimeout(function() { 212 $window 213 .trigger('resize') 214 .trigger('scroll'); 215 }, 0); 216 217 } 218 219 } 220 else { 221 222 sectionTransitionState = false;
223 224 // Generic sections 225 $('.main.style1') 226 .unscrollwatch() 227 .removeClass('inactive'); 228 229 $('.main.style2') 230 .unscrollwatch() 231 .removeClass('inactive'); 232 233 // Work 234 $('#work') 235 .unscrollwatch() 236 .find('.row.images').removeClass('inactive'); 237 238 // Contact 239 $('#contact') 240 .unscrollwatch() 241 .removeClass('inactive'); 242 243 } 244 245 } 246 247 }); 248 249 // Resize 250 $window.resize(function() { 251 252 // Disable animations/transitions 253 $body.addClass('loading'); 254 255 window.setTimeout(function() { 256 257 // Update scrolly links 258 $('a[href^=#]').scrolly(1500, $header.outerHeight() - 1); 259 260 // Resize fullscreen elements 261 if (_settings.useFullScreen 262 && !skel.isActive('mobile')) { 263 $('.fullscreen').each(function() { 264 265 var $t = $(this), 266 $c = $t.children('.content'), 267 x = Math.max(100, Math.round(($window.height() - $c.outerHeight() - $header.outerHeight()) / 2) + 1); 268 269 $t 270 .css('padding-top', x) 271 .css('padding-bottom', x); 272 273 }); 274 } 275 else 276 $('.fullscreen') 277 .css('padding-top', '') 278 .css('padding-bottom', ''); 279 280 281 // Re-enable animations/transitions 282 window.setTimeout(function() { 283 $body.removeClass('loading'); 284 $window.trigger('scroll'); 285 }, 1000); 286 287 }, 100); 288 289 }); 290 291 // Trigger events on load 292 $window.load(function() { 293 $window 294 .trigger('resize') 295 .trigger('scroll'); 296 }); 297 298 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.