-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.min.js
4 lines (4 loc) · 52.9 KB
/
main.min.js
1
2
3
4
var icon='<svg class="sg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 185.31 251.89"><path d="M66.8,144.17c0-66.24,22.46-113.09,80.72-112.32,81.48,1.07,80.72,46.08,80.72,112.32,0,5.15,8.38,3.81,7.62,19-2.28,19.42-9.44,14.63-10.39,19.85-9.26,51.08-40.65,88.67-77.95,88.67-37.76,0-69.47-38.53-78.28-90.58-.82-4.85-5.86-.8-6.42-18.68C61.47,146.07,66.8,149.07,66.8,144.17Z" transform="translate(-56.6 -25.84)" style="fill:#ffdfbf;fill-rule:evenodd"/><path d="M147.52,31.85C99.49,31.22,75.79,63,69,111.24c8.78-23.84,27.86-26,64.33-26.54,70.62-1.13,88.39,8.27,79.64,96.55-1.84,18.6-6.1,24.62-28.36,39.74-12.07,8.2,18.54-26.37-49.78-27-49.5-.43-30.06,36.41-40.06,29.44a81.88,81.88,0,0,1-20.28-20.73c12.89,40.76,40.76,69,73.08,69,37.3,0,68.69-37.59,77.95-88.67l2.77-38.89C228.24,77.93,229,32.91,147.52,31.85Z" transform="translate(-56.6 -25.84)" style="fill:#d0b57b;fill-rule:evenodd"/><path d="M146.13,31.84h1.39c81.48,1.07,80.72,46.08,80.72,112.33,0,5.15,8.38,3.81,7.62,19-2.28,19.42-9.44,14.63-10.39,19.85-9.26,51.08-40.65,88.67-77.95,88.67-37.76,0-69.47-38.53-78.28-90.58-.82-4.85-5.86-.8-6.42-18.68-1.34-16.39,4-13.39,4-18.29,0-65.71,22.11-112.33,79.33-112.33m0-6h0c-29.39,0-51.65,11.54-66.18,34.3C67.3,80,60.86,108.06,60.8,143.68h0c-2.54,3.05-4.94,7-4,19.12.4,12.11,2.72,16.46,6.59,19.86,9.65,56,44.19,95.07,84.11,95.07,19.91,0,38.59-9.42,54-27.25,14.35-16.57,24.87-39.79,29.66-65.45l0,0c4.22-2.57,8.87-6.53,10.58-21.1l0-.2v-.2c.58-11.55-3.35-16.18-7.07-19.61l-.53-.5v-1c0-33,0-61.46-10.76-82.11-12-23-36.09-33.89-75.88-34.41Z" transform="translate(-56.6 -25.84)" style="fill:#303030"/><path d="M118.31,183.29s4.28,4.28,12.84,4S143.67,182,143.67,182s-3.62,8.23-11.53,8.89S118.31,183.29,118.31,183.29Z" transform="translate(-56.6 -25.84)" style="fill:#bfa78f;fill-rule:evenodd"/><ellipse cx="44.24" cy="115.64" rx="28.15" ry="35.97" style="fill:#fff"/><ellipse cx="104.54" cy="115.64" rx="28.15" ry="35.97" style="fill:#fff"/><circle class="eye" id="eye-left" cx="35.9" cy="121.66" r="10.5" style="fill:#303030"/><circle class="eye" cx="94.57" cy="121.66" r="10.5" style="fill:#303030"/><path d="M140.74,236.63h0c-16.92,0-29.43-4.38-29.43-18.42h0c0-4.22,4.12-7.64,9.21-7.64H160c3.6,0,6.53,2.42,6.53,5.42v7.23C166.55,234.48,154.32,236.63,140.74,236.63Z" transform="translate(-56.6 -25.84)" style="fill:#2d251d;fill-rule:evenodd"/><path d="M160,210.57h-39.5c-5.09,0-9.21,3.42-9.21,7.64,0,.07,0,.15,0,.22,7.57,2.29,17.6,3.2,29,3.2h0c9.87,0,19.24-.52,26.25-2.36V216C166.55,213,163.62,210.57,160,210.57Z" transform="translate(-56.6 -25.84)" style="fill:#fff"/></svg>';document.head.insertAdjacentHTML("beforeend","<style>.sg { width: 35px; height: 35px; position: fixed; bottom: 10px; right: 10px; } .sg .eye { -webkit-transform: translateX(0px); transform: translateX(0px); } .sg:hover .eye { -webkit-transition: -webkit-transform 0.3s ease; transition: -webkit-transform 0.3s ease; transition: transform 0.3s ease; transition: transform 0.3s ease, -webkit-transform 0.3s ease; -webkit-transform: translateX(12px); transform: translateX(12px); }</style>");var a=document.createElement("a");a.setAttribute("href","https://twitter.com/steeevg"),a.setAttribute("target","_blank"),a.innerHTML=icon;var increment="vw",oriented="horizontal",orientation_last="",slider_orientation="horizontal",dimension="wide",maxed=!1,maxed_last=!1,maxed_changed=!1,slider_menu="wheel-menu",_w=jQuery(window).width(),_h=jQuery(window).height(),aspect=_w/_h,current_slide_id="",curent_slide_title="",curent_slide_content="",curent_slide_image="",current_notch=0,wheel_nav_params={};function initSite(){null!=menus&&null!=media&&null!=posts||window.setTimeout(initSite(),100);var e="webxr";if("#undefined"==location.hash||""==location.hash?(e="webxr",location.hash="#webxr"):e=location.hash.replace("#",""),setSocial(),!0===useWheelNav){var t=menus["wheel-menu"].slug_nav[e];setSlider(),setSlides("wheel-menu"),setSlides("tag-cloud"),setSlideShow("wheel-menu"),makeWheelNav("outer-nav",menus["wheel-menu"].menu_levels),setSliderNotch(t)}}function setWheelNavParams(){wheel_nav_params={maxPercent:1,min:.8,max:1,sel_min:.8,sel_max:1},1==maxed&&(wheel_nav_params={maxPercent:1,min:.8,max:1,sel_min:.8,sel_max:1})}function positionElements(){var t=["#main","header","footer","#related","#screen"];for(dimension="wide",_w<_h?slider_orientation="horizontal":oriented="horizontal",orientation_last!=oriented&&(orientation_last=oriented,setSlider()),aspect<=.5?dimension="super-narrow":aspect>.5&&aspect<=.75?dimension="narrow":aspect>.75&&aspect<=.9?dimension="semi-narrow":aspect>.9&&aspect<=1.1?dimension="square":aspect>1.1&&aspect<=1.25?dimension="semi-wide":aspect>1.25&&aspect<=1.5?dimension="wide":aspect>1.5&&aspect<=2?dimension="super-wide":aspect>2&&(dimension="extra-super-wide"),e=0;e<t.length;e++)jQuery(t[e]).removeClass(),jQuery(t[e]).addClass(dimension),jQuery(t[e]).addClass(oriented),1==maxed&&jQuery(t[e]).addClass("maxed");jQuery("#slider-wrap").removeClass(),jQuery("#slider-wrap").addClass(slider_orientation),jQuery("#slider-wrap").addClass(dimension)}function positionProjector(){aspect>1.15&&aspect<1.5?(100*(aspect-1)+"%","10vw"):aspect>.5&&aspect<=1.15?("20%","15vw"):aspect>=1.5&&("50%","20vw")}function reposition_screen(){var e="100vw",t="100vh",n="0",i=0,s="0",a="0",r="vh";aspect<=.5?(e=_w+"px",t=2*_w+"px",n=50,i=0,s=-1*_w,a=0,_w,r="px"):aspect>=2&&(e=2*_h+"px",t=_h+"px",n=0,i=50,s=0,0,a=-1*_h,r="px"),jQuery("#main").css("width",e),jQuery("#main").css("height",t),jQuery("#main").css("top",n+"%"),jQuery("#main").css("left",i+"%"),jQuery("#main").css("marginTop",s+r),jQuery("#main").css("marginLeft",a+r),positionProjector(),positionElements(),jQuery("#slider").css("visibility","visible");jQuery("#stars").css("height","100vh"),jQuery("#stars").css("width","100vw"),jQuery("#stars").css("top",0),jQuery("#stars").css("left",0)}function isMaxed(){maxed_changed=!1,aspect<.75&&_w<768||aspect>1.5&&_h<640?(maxed=!0,0==maxed_last&&(maxed_last=!0,maxed_changed=!0)):(maxed=!1,1==maxed_last&&(maxed_last=!1,maxed_changed=!0)),1==maxed_changed&&null!=wheels["outer-nav"]&&(wheels["outer-nav"].raphael.remove(),popAWheelie("outer-nav"),makeWheelNav("outer-nav",menus["wheel-menu"].menu_levels))}function resetWheel(){setWheelNavParams(),wheels["outer-nav"].removeWheel(),null!=wheels["inner-nav"]&&wheels["inner-nav"].removeWheel(),null!=wheels["inner-subnav"]&&wheels["inner-subnav"].removeWheel()}function calibrateCircle(e,t,n){}jQuery(document).ready((function(){jQuery(".wheelnav-outer-nav-title").css("display:none;"),console.log("ready"),reposition_screen()})),jQuery(window).resize((function(){_w=jQuery(window).width(),_h=jQuery(window).height(),_w>_h?(increment="vh",oriented="horizontal"):(increment="vw",oriented="vertical"),aspect=_w/_h,reposition_screen()}));var photoCount=0,pieceCount=0,onPhoto=0,pieceCompleteCount=0,transitions=["center","random"],transitionType=1,viewerDest=null;function circleViewer(e){photoCount=state.screen_images.length,pieceCount=state.screen_images.length,viewerDest=e;for(var t=0;t<state.screen_images.length;t++)jQuery("#preload").append('<img src="'+state.screen_images[t].src+'">');jQuery(window).load((function(){})),loadCircleViewer(e)}function loadCircleViewer(e,t){jQuery(e+"-container").html("");for(var n=0;n<state.screen_images.length;n++){var i=(100-100/pieceCount*n)/100*100,s=100+(100-i)/i*100,a=100/pieceCount*n/2;jQuery(e+"-container").append('<div class="section" id="piece'+n+'" style="top: '+a+"%; left: "+a+"%; width: "+i+"%; height: "+i+"%; background-size:"+s+"%; background-image: url("+state.screen_images[n].src+')"></div>')}nextSlide()}function nextSlide(){clearInterval(state.circle_delay),pieceCompleteCount=0,++onPhoto>=photoCount&&(onPhoto=0);for(var e=0;e<state.screen_images.length;e++){var t=0,n=360,i=jQuery("#piece"+e),s=state.screen_images[onPhoto];switch(transitions[transitionType]){case"random":t=Math.random()/2,n=360*Math.random();break;case"center":t=(pieceCount-e)/10,n=181}TweenMax.to(i,1,{delay:t,directionalRotation:n+"_long",onComplete:completeRotation,onCompleteParams:[i,s],ease:Power4.easeIn})}}function completeRotation(e,t){e.css("background-image","url("+t.src+")"),TweenMax.to(e,2,{directionalRotation:"0_short",onComplete:finishPieceanimation,ease:Elastic.easeOut})}function finishPieceanimation(){++pieceCompleteCount==pieceCount&&(state.circle_delay=setInterval(nextSlide,5e3))}function setSlideContent(e,t,n){if(console.log("setSlideContents",e,t,n),"category"==n)console.log("cat",e,t,n),null!=categories[t]&&(console.log("category",e,t,n,categories[t]),jQuery("#slide-"+n+"-"+t+" h2").html(categories[t].name),jQuery("#slide-"+n+"-"+t+" section div.content").html(categories[t].description));else if(null!=posts[t]){console.log("post",t,posts[t]);posts[t].title.length,posts[t].content.length;current_slide_id="#slide-"+n+"-"+t,current_slide_title=posts[t].title,current_slide_content=posts[t].content,jQuery("#slide-"+n+"-"+t+" h2").html(current_slide_title),jQuery("#slide-"+n+"-"+t+" section div.content").html(current_slide_content),0!=posts[t].featured_media&&""!=(curent_slide_image=media_assets[posts[t].featured_media].full_path)&&jQuery("#screen-image-container").html('<img src="'+curent_slide_image+'">')}$carousel.slick("slickGoTo",e)}function setText(){"undefined"!=typeof languages?state.language==languages.default?page_title=posts[state.post_id].title+" | "+site_title:page_title=retreiveML("posts","title",state.post_id,state.language):page_title=posts[state.post_id].title+" | "+site_title,document.title=page_title}function setContent(e,t,n){if(state.slide=posts_nav[t],state.object=posts_nav[n],state.object_id=posts_nav[t],jQuery("#projects-content").fadeOut(),jQuery("#project-info").fadeOut(),jQuery("#wheel-menu-content").fadeIn(),null!=posts[t]){state.post_id=t,setText(),setImage(t,"featured","featured_media","flip");if(null!=posts[t].featured_video){uploads_path,posts[t].featured_video.video_path;setVideo(posts[t].featured_video.video_id,"#bg-video")}setRelated(posts[t]),posts[t].screen_images.length>0?setScreenImages(posts[t].screen_images,"#screen-image","circleViewer"):jQuery("#screen-image-container").html("")}setSlideContent(e,t,n)}
/*! flip - v1.1.2 - 2016-10-20
* https://github.com/nnattawat/flip
* Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */!function(e){var t=function(t,n,i){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=e.extend(this.setting,n),"string"!=typeof n.axis||"x"!==n.axis.toLowerCase()&&"y"!==n.axis.toLowerCase()||(this.setting.axis=n.axis.toLowerCase()),"boolean"==typeof n.reverse&&(this.setting.reverse=n.reverse),"string"==typeof n.trigger&&(this.setting.trigger=n.trigger.toLowerCase());var s=parseInt(n.speed);isNaN(s)||(this.setting.speed=s),"boolean"==typeof n.forceHeight&&(this.setting.forceHeight=n.forceHeight),"boolean"==typeof n.forceWidth&&(this.setting.forceWidth=n.forceWidth),"boolean"==typeof n.autoSize&&(this.setting.autoSize=n.autoSize),("string"==typeof n.front||n.front instanceof e)&&(this.setting.front=n.front),("string"==typeof n.back||n.back instanceof e)&&(this.setting.back=n.back),this.element=t,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(i)};e.extend(t.prototype,{flipDone:function(e){var t=this;t.element.one(function(){var e,t=document.createElement("fakeelement"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(void 0!==t.style[e])return n[e]}(),(function(){t.element.trigger("flip:done"),"function"==typeof e&&e.call(t.element)}))},flip:function(e){if(!this.isFlipped){this.isFlipped=!0;var t="rotate"+this.setting.axis;this.frontElement.css({transform:t+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:t+"(0deg)","z-index":"1"}),this.flipDone(e)}},unflip:function(e){if(this.isFlipped){this.isFlipped=!1;var t="rotate"+this.setting.axis;this.frontElement.css({transform:t+"(0deg)","z-index":"1"}),this.backElement.css({transform:t+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.flipDone(e)}},getFrontElement:function(){return this.setting.front instanceof e?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof e?this.setting.back:this.element.find(this.setting.back)},init:function(e){var t=this,n=t.frontElement.add(t.backElement),i="rotate"+t.setting.axis,s={perspective:2*t.element["outer"+("rotatex"===i?"Height":"Width")](),position:"relative"},a={transform:i+"("+(t.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},r={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};t.setting.forceHeight?n.outerHeight(t.element.height()):t.setting.autoSize&&(r.height="100%"),t.setting.forceWidth?n.outerWidth(t.element.width()):t.setting.autoSize&&(r.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(s["-webkit-transform-style"]="preserve-3d"),n.css(r).find("*").css({"backface-visibility":"hidden"}),t.element.css(s),t.backElement.css(a),setTimeout((function(){var i=t.setting.speed/1e3||.5;n.css({transition:"all "+i+"s ease-out"}),"function"==typeof e&&e.call(t.element)}),20),t.attachEvents()},clickHandler:function(t){t||(t=window.event),this.element.find(e(t.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var t=this;t.element.off("mouseleave.flip"),t.flip(),setTimeout((function(){t.element.on("mouseleave.flip",e.proxy(t.unflip,t)),t.element.is(":hover")||t.unflip()}),t.setting.speed+150)},attachEvents:function(){"click"===this.setting.trigger?this.element.on(e.fn.tap?"tap.flip":"click.flip",e.proxy(this.clickHandler,this)):"hover"===this.setting.trigger&&(this.element.on("mouseenter.flip",e.proxy(this.hoverHandler,this)),this.element.on("mouseleave.flip",e.proxy(this.unflip,this)))},flipChanged:function(e){this.element.trigger("flip:change"),"function"==typeof e&&e.call(this.element)},changeSettings:function(e,t){var n=this,i=!1;if(void 0!==e.axis&&n.setting.axis!==e.axis.toLowerCase()&&(n.setting.axis=e.axis.toLowerCase(),i=!0),void 0!==e.reverse&&n.setting.reverse!==e.reverse&&(n.setting.reverse=e.reverse,i=!0),i){var s=n.frontElement.add(n.backElement),a=s.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);s.css({transition:"none"});var r="rotate"+n.setting.axis;n.isFlipped?n.frontElement.css({transform:r+(n.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):n.backElement.css({transform:r+(n.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout((function(){s.css(a),n.flipChanged(t)}),0)}else n.flipChanged(t)}}),e.fn.flip=function(n,i){return"function"==typeof n&&(i=n),"string"==typeof n||"boolean"==typeof n?this.each((function(){var t=e(this).data("flip-model");"toggle"===n&&(n=!t.isFlipped),n?t.flip(i):t.unflip(i)})):this.each((function(){if(e(this).data("flip-model")){var s=e(this).data("flip-model");!n||void 0===n.axis&&void 0===n.reverse||s.changeSettings(n,i)}else e(this).data("flip-model",new t(e(this),n||{},i))})),this}}(jQuery),jQuery(".stargate").click((function(){$(".iris").toggleClass("irison"),$("#egypts").toggleClass("egyptsanim"),$("audio")[0].play(),$(".iris").hasClass("irison")?($("audio")[1].loop=!0,$("audio")[1].play()):($("audio")[1].loop=!1,$("audio")[1].pause(),$("audio")[1].currentTime=0)}));var start=Date.now(),fov=30,clock=new THREE.Clock;function render(){timeUniform.iGlobalTime.value+=clock.getDelta(),renderer.render(scene,camera),requestAnimationFrame(render)}(timeUniform={iGlobalTime:{type:"f",value:.1},iResolution:{type:"v2",value:new THREE.Vector2}}).iResolution.value.x=window.innerWidth/4,timeUniform.iResolution.value.y=window.innerHeight/4,window.addEventListener("load",(function(){container=document.getElementById("render"),scene=new THREE.Scene,(camera=new THREE.PerspectiveCamera(fov,window.innerWidth/window.innerHeight,1,1e4)).position.x=20,camera.position.y=10,camera.position.z=20,camera.lookAt(scene.position),scene.add(camera);var e=new THREE.AxisHelper(10);scene.add(e),i=new THREE.ShaderMaterial({uniforms:timeUniform,vertexShader:document.getElementById("vertex-shader").textContent,fragmentShader:document.getElementById("fragment-shader").textContent});var t=new THREE.Mesh(new THREE.PlaneBufferGeometry(window.innerWidth,window.innerHeight,40),i);scene.add(t);var n=new THREE.SphereGeometry(10,32,32),i=new THREE.MeshBasicMaterial({color:16776960}),s=new THREE.Mesh(n,i);scene.add(s),(renderer=new THREE.WebGLRenderer).setSize(window.innerWidth,window.innerHeight),container.appendChild(renderer.domElement),render()})),window.addEventListener("resize",(function(){camera.aspect=window.innerWidth/window.innerHeight,camera.updateProjectionMatrix(),renderer.setSize(window.innerWidth,window.innerHeight)}));var posts={},pages={},profiles={},profiles_array=[],hardware={},taxonomies={},categories={},category_ids={},tags={},menus={},media={},posts_nav={},posts_slug_ids={},last_dest="outer-nav",menu_levels=[],menu_slides=[],related={},data_score=7,data_loaded=[],state={},social={},profile_posts=(data_loaded=!1,{}),hardware_posts={},resource_posts={},media_assets={};function getStaticJSON(e,t,n){var i=data_path+e+".json";jQuery.ajax({url:i,data:"",success:function(e,i,s){return t(e,n)},error:function(e,t,n){},cache:!1})}function setData(e){for(p in console.log("setData",e),posts=setPosts(e.posts),pages=setPosts(e.pages),profiles=setPosts(e.profile),resources=setPosts(e.resource),posts)"profile"==profiles[p].type?(profiles[p].name=profiles[p].title.rendered,profile_posts[profiles[p].id]=profiles[p],profiles_array.push(profiles[p])):"hardware"==profiles[p].type?hardware_posts[profiles[p].id]=profiles[p]:"resource"==profiles[p].type&&(resource_posts[profiles[p].id]=profiles[p]);for(h in profiles_array=sort_array("title",profiles_array),hardware=e.hardware)hardware[h].name=hardware[h].title.rendered,hardware_posts[hardware[h].id]=hardware[h];setCategories(e.categories);for(var t="industry,feature,collaboration_type,platform".split(","),n=0;n<t.length;n++)setTaxonomy(e,t[n]);setTags(e.tags),setMenus(e.menus);for(var i=0;i<e.media.length;i++)media_assets[e.media[i].id]=e.media[i].data;console.log(media_assets),initSite(),data_loaded=!0}function sort_array(e,t){var n=(e=e.split(".")).length;return t.sort((function(t,i){for(var s=0;s<n;)t=t[e[s]],i=i[e[s]],s++;return t<i?-1:t>i?1:0})),t}function setPosts(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)void 0!==e[t].title&&void 0!==e[t].title.rendered&&(e[t].title=e[t].title.rendered),void 0!==e[t].content&&void 0!==e[t].content.rendered&&(e[t].content=e[t].content.rendered),void 0!==e[t].type&&(e[t].type,posts[e[t].id]=e[t]);else null!=e&&(console.log("data about to error",e),e.type,posts[e.id]=e);return posts}function setMedia(e){for(var t=0;t<e.length;t++)media[e[t].id]=e[t].data}function getMediaID(e,t){if(null!=posts[e][t]){var n=posts[e][t];return n>0&&null!=media[n]?n:0}return 0}function getImageSRC(e,t,n){if(null!=media[e]){var i=uploads_path+media[e].path,s=media[e].file;return"image/svg+xml"==media[e].mime?i+s:i+(s="square"==n||1==n||"thumbnail"==n?getSquareVersion(media[e].meta.sizes,t):media[e].meta.sizes[n])}return""}function toggleFace(e,t){return"front"==state[e].transition.face?"back":"front"}function loadTemplate(e,t){var n=jQuery("#"+e+"-template").html();if("flip"==t){var i='<div class="card front">'+n+"</div>",s='<div class="card back">'+n+"</div>";jQuery("#"+e).html(i+s)}else jQuery("#"+e).html(n)}function clearImageText(){}function getAspect(e,t){return e==t?"square":Math.round(e/t)}function setImageContent(e,t,n,i,s,a){setTimeout((function(){jQuery(e+" .title").html(t),jQuery(e+" .caption").html(n),jQuery(e+" .description").html(i),jQuery(e+" .image").attr("alt",s),jQuery(e+" .image").attr("src",a)}),250)}function transitionImage(e,t,n){""!=jQuery("#"+e).html()&&state[e].transition==t||(state[e].transition.type=t,loadTemplate(e,t));var i=getImageSRC(n,e+" .image",getAspect(parseInt(jQuery("#"+e).width()),parseInt(jQuery("#"+e).height())));if("flip"==t){var s=toggleFace(e,t);console.log("FLIP",s,e,t,n,i),null!=media[n]?(setImageContent("#"+e+" ."+s,media[n].title,media[n].caption,media[n].desc,media[n].alt,i),state[e].transition.face=s):setImageContent("#"+e+" ."+s,"","","","",""),jQuery("#"+e).toggleClass("is-flipped")}}function setImage(e,t,n,i,s){if(null!=posts[e]){var a=getMediaID(e,n);a>0?(jQuery("#"+t).fadeIn(),transitionImage(t,"flip",a)):jQuery("#"+t).fadeOut()}}function wrapTag(e,t){return"<"+e+">"+t+"</"+e+">"}function setMediaText(e,t){null!=media[e]?(jQuery("#"+t+"-title").html(media[e].title),jQuery("#"+t+"-caption").html(media[e].caption),jQuery("#"+t+"-description").html(media[e].desc),jQuery("#"+t).attr("alt",media[e].alt)):(jQuery("#"+t+"-title").html(""),jQuery("#"+t+"-caption").html(""),jQuery("#"+t+"-description").html(""),jQuery("#"+t).attr("alt",""))}function getSquareVersion(e,t){return box={w:jQuery(t+"-container").width(),h:jQuery(t+"-container").height()},box.w>1280||box.h>1280?e["sq-lg"]:(box.w>250||box.h>250)&&(box.w<=1280||box.h<=1280)?e["sq-med"]:e["sq-sm"]}function setVideo(e,t){if(null!=media[e]){var n=uploads_path+media[e].path,i=media[e].file;jQuery(t+" video source").attr("src",n+i);jQuery(t+" video")[0].load(),jQuery(t+" video source").attr("src",n+i),jQuery(t).fadeIn()}else jQuery(t).fadeOut()}function setScreenImages(e,t,n){for(var i=[],s=0;s<e.length;s++)i.push({src:getImageSRC(e[s],"#screen-image","square"),data:media[e[s]]});state.screen_images=i,i.length>0&&"circleViewer"==n&&circleViewer(t,state.screen_images)}state.featured={transition:{type:"flip",face:"front"}},0==data_loaded&&getStaticJSON("content",setData);var menu_config={megamenu:{menu_type:"megamenu",location:"#main-menu"},"wheel-menu":{menu_type:"wheel",location:"#outer-nav"},mindmap:{menu_type:"mindmap",location:"#mindmap"},"tag-cloud":{menu_type:"profile",location:"#tag-cloud"},"social-links":{menu_type:"social",location:"#social"}};function setMenus(e){for(var t=0;t<e.length;t++)menus[e[t].slug]={},menus[e[t].slug].menu_array=[],menus[e[t].slug].name=e[t].name,menus[e[t].slug].slug=e[t].slug,menus[e[t].slug].items=setMenu(e[t].slug,e[t].items);buildMenuData()}function setMenu(e,t){menu={};for(var n=0;n<t.length;n++)menu[t[n].ID]=setMenuItem(e,t[n]),0!=t[n].menu_item_parent&&menu[t[n].menu_item_parent].children.push(t[n].ID),menus[e].menu_array.push(menu[t[n].ID]);return menu}function setMenuItem(e,t){return this_item={},this_item.menu_id=t.ID,this_item.title=t.title,this_item.menu_order=t.menu_order,this_item.object=t.object,this_item.object_id=t.object_id,this_item.parent=t.menu_item_parent,this_item.classes=t.classes,this_item.url=t.url,this_item.description=t.description,this_item.slug=t.slug,this_item.xfn=t.xfn,this_item.children=[],this_item}function menu_order(e,t){return e.menu_order<t.menu_order?-1:e.menu_order>t.menu_order?1:0}function setLinearNav(e){menus[e].linear_nav=[];for(var t in menus[e].items)menus[e].items[t].slug=menus[e].items[t].slug,menus[e].items[t].object_id,menus[e].linear_nav.push(menus[e].items[t]);menus[e].linear_nav.sort(menu_order)}function setLinearDataNav(e,t){menus[e].data_nav=[],menus[e].slug_nav=[];for(var n=0,i=0,s=0,a=0,r="outer-nav",o=0;o<t.length;o++){r="outer-nav",t[o].dest=r,t[o].slice=i,t[o].notch=n,s=n,menus[e].data_nav.push(t[o]),menus[e].slug_nav[t[o].slug]=n,n++;for(var l=0;l<t[o].children.length;l++){t[o].children[l].dest="inner-nav",t[o].children[l].slice=l,t[o].children[l].notch=n,t[o].children[l].parent=s,a=n,menus[e].data_nav.push(t[o].children[l]),menus[e].slug_nav[t[o].children[l].slug]=n,n++;for(var c=0;c<t[o].children[l].children.length;c++)t[o].children[l].children[c].dest="inner-subnav",t[o].children[l].children[c].slice=c,t[o].children[l].children[c].notch=n,t[o].children[l].children[c].grandparent=s,t[o].children[l].children[c].parent=a,menus[e].data_nav.push(t[o].children[l].children[c]),menus[e].slug_nav[t[o].children[l].children[c].slug]=n,n++}i++}}function getSlug(e,t,n,i){var s="";return null!=e&&(s=e.slug,null!=posts[e.object_id]&&(s=posts[e.object_id].slug)),s}function buildMenuData(){if(null==posts)window.setTimeout(buildMenuData(),10);else for(var e in menus){var t=[];if(null!=menu_config[e]){for(var n in menus[e].menu_array=[],menus[e].items)0==menus[e].items[n].parent&&menus[e].menu_array.push(menus[e].items[n]);menus[e].menu_array.sort(menu_order);for(var i=[],s=menus[e].menu_array,a=0;a<s.length;a++){i=[];for(var r=0;r<s[a].children.length;r++){for(var o=[],l=menus[e].items[s[a].children[r]].children,c=0;c<l.length;c++)o.push({title:menus[e].items[l[c]].title,url:menus[e].items[l[c]].url,slug:menus[e].items[l[c]].slug,object:menus[e].items[l[c]].object,object_id:menus[e].items[l[c]].object_id,classes:menus[e].items[l[c]].classes,description:menus[e].items[l[c]].description,description:menus[e].items[l[c]].xfn});i.push({title:menus[e].items[s[a].children[r]].title,slug:menus[e].items[s[a].children[r]].slug,url:menus[e].items[s[a].children[r]].url,object:menus[e].items[s[a].children[r]].object,object_id:menus[e].items[s[a].children[r]].object_id,classes:menus[e].items[s[a].children[r]].classes,description:menus[e].items[s[a].children[r]].description,xfn:menus[e].items[s[a].children[r]].xfn,children:o})}t.push({title:s[a].title,slug:s[a].slug,url:s[a].url,object:s[a].object,object_id:s[a].object_id,children:i,classes:s[a].classes,description:s[a].description,xfn:s[a].xfn})}menus[e].menu_levels=t,menu_levels=t,setLinearDataNav(e,t),setLinearNav(e)}}}var initMindMap=!1,mindmapCanvas=null;!function(e){"use strict";var t,n,i=e("#mindmap").width(),s=e("#mindmap").height(),a=e("#mindmap").position();(t=function(t,i,s,a){this.obj=t,this.options=t.options,this.name=i,this.href=a.href,a.url&&(this.url=a.url),a.color&&(this.color=a.color),a.size&&(this.size="size/"),a.external&&(this.size=a.external),a.className&&(this.className=a.className),a.backgroundImage&&(this.backgroundImage=a.backgroundImage),a.type&&(this.type=a.type),a.external&&(this.external=a.external),a.id&&(this.id=a.id),this.el=e('<a rel="" href="'+this.href+'"><div class="back" style="background-image:url('+theme_image_path+'icons/back-01.svg)"></div><div class="ext" style="background-image:url('+theme_image_path+'icons/ExternalLink-01.svg)"></div><div><span>'+this.name+"</span></div></a>").addClass("node").addClass(this.color).addClass(this.size),1==this.external&&this.el.addClass("external"),null!=a.backgroundImage&&this.el.css("background-image","url("+a.backgroundImage+")"),e("#mindmap").prepend(this.el),s?t.lines[t.lines.length]=new n(t,this,s):(t.activeNode=this,this.el.addClass("active root")),this.parent=s,this.children=[],this.parent&&this.parent.children.push(this),this.moving=!1,this.moveTimer=0,this.obj.movementStopped=!1,this.visible=!0,this.x=1,this.y=1,this.dx=0,this.dy=0,this.hasPosition=!1,this.content=[],this.el.css("position","absolute"),null!=this.backgroundImage&&this.el.css("background-image","url("+this.backgroundImage+")");var r=this;this.el.draggable({drag:function(){t.root.animateToStatic()}}),this.el.click((function(){return t.activeNode&&(t.activeNode.el.removeClass("active"),t.activeNode.parent&&t.activeNode.parent.el.removeClass("activeparent")),"function"==typeof a.onclick&&a.onclick(r),t.activeNode=r,t.activeNode.el.addClass("active"),t.activeNode.parent&&t.activeNode.parent.el.addClass("activeparent"),t.root.animateToStatic(),!1})),this.el.mouseover((function(){return"function"==typeof a.onmouseover&&a.onmouseover(r),!1})),this.el.mouseout((function(){return"function"==typeof a.onmouseover&&a.onmouseout(r),!1}))}).prototype.animateToStatic=function(){clearTimeout(this.moveTimer);var e=this;this.moveTimer=setTimeout((function(){e.obj.movementStopped=!0}),4e3),this.moving||(this.moving=!0,this.obj.movementStopped=!1,this.animateLoop())},t.prototype.animateLoop=function(){var e,t,n=this;for(this.obj.canvas.clear(),e=0,t=this.obj.lines.length;e<t;e++)this.obj.lines[e].updatePosition();this.findEquilibrium()||this.obj.movementStopped?this.moving=!1:setTimeout((function(){n.animateLoop()}),10)},t.prototype.findEquilibrium=function(){var e,t,n=!0;for(n=this.display()&&n,e=0,t=this.children.length;e<t;e++)n=this.children[e].findEquilibrium()&&n;return n},t.prototype.display=function(t){var n,i,s=this;return t=t||0,this.visible?this.obj.activeNode!==this&&this.obj.activeNode!==this.parent&&this.obj.activeNode.parent!==this&&(this.el.hide(),this.visible=!1):this.obj.activeNode!==this&&this.obj.activeNode!==this.parent&&this.obj.activeNode.parent!==this||(this.el.show(),this.visible=!0),this.drawn=!0,this.hasPosition||(this.x=this.options.mapArea.x/2,this.y=this.options.mapArea.y/2,this.el.css({left:this.x+"px",top:this.y+"px"}),this.hasPosition=!0),n=2*Math.PI/this.children.length,e.each(this.children,(function(e){this.hasPosition||(!this.options.showProgressive||t<=1)&&(i=e*n,this.x=50*Math.cos(i)+s.x,this.y=50*Math.sin(i)+s.y,this.hasPosition=!0,this.el.css({left:this.x+"px",top:this.y+"px"}))})),this.updatePosition()},t.prototype.updatePosition=function(){var e,t,n;return this.el.hasClass("ui-draggable-dragging")?(this.x=parseInt(this.el.css("left"),10)+this.el.width()/2,this.y=parseInt(this.el.css("top"),10)+this.el.height()/2,this.dx=0,this.dy=0,!1):(e=this.getForceVector(),this.dx+=e.x*this.options.timeperiod,this.dy+=e.y*this.options.timeperiod,this.dx=this.dx*this.options.damping,this.dy=this.dy*this.options.damping,Math.abs(this.dx)<this.options.minSpeed&&(this.dx=0),Math.abs(this.dy)<this.options.minSpeed&&(this.dy=0),Math.abs(this.dx)+Math.abs(this.dy)===0||(this.x+=this.dx*this.options.timeperiod,this.y+=this.dy*this.options.timeperiod,this.x=Math.min(this.options.mapArea.x,Math.max(1,this.x)),this.y=Math.min(this.options.mapArea.y,Math.max(1,this.y)),t=this.x-this.el.width()/2,n=this.y-this.el.height()/2-10,this.el.css({left:t+"px",top:n+"px"}),!1))},t.prototype.getForceVector=function(){var e,t,n,i,s,a,r,o,l,c,d,u=0,h=0,m=this.obj.nodes,p=this.obj.lines;for(e=0;e<m.length;e++)m[e]!==this&&m[e].visible&&(t=m[e].x-this.x,n=m[e].y-this.y,s=Math.sqrt(t*t+n*n),Math.abs(s)<500&&(0===t?(a=Math.PI/2,i=0):(a=Math.atan(n/t),i=t/Math.abs(t)),u+=-(r=500*this.options.repulse/(s*s))*Math.cos(a)*i,h+=-r*Math.sin(a)*i));for(o=this.x+this.el.width(),r=500*this.options.wallrepulse/(o*o),u+=Math.min(2,r),l=this.options.mapArea.x-o,r=-500*this.options.wallrepulse/(l*l),u+=Math.max(-2,r),r=500*this.options.wallrepulse/(this.y*this.y),h+=Math.min(2,r),c=this.options.mapArea.y-this.y,r=-500*this.options.wallrepulse/(c*c),h+=Math.max(-2,r),e=0;e<p.length;e++){if(d=null,p[e].start===this)d=p[e].end;else{if(p[e].end!==this)continue;d=p[e].start}d.visible&&(t=d.x-this.x,n=d.y-this.y,s=Math.sqrt(t*t+n*n),Math.abs(s)>0&&(0===t?(a=Math.PI/2,i=0):(a=Math.atan(n/t),i=t/Math.abs(t)),u+=(r=this.options.attract*s/1e4)*Math.cos(a)*i,h+=r*Math.sin(a)*i))}return this.obj.activeNode===this&&(t=(d=this.options.mapArea).x/2-this.options.centreOffset-this.x,n=d.y/2-this.y,s=Math.sqrt(t*t+n*n),Math.abs(s)>0&&(0===t?(a=Math.PI/2,i=0):(i=t/Math.abs(t),a=Math.atan(n/t)),u+=(r=.1*this.options.attract*s*3/1e3)*Math.cos(a)*i,h+=r*Math.sin(a)*i)),Math.abs(u)>this.options.maxForce&&(u=this.options.maxForce*(u/Math.abs(u))),Math.abs(h)>this.options.maxForce&&(h=this.options.maxForce*(h/Math.abs(h))),{x:u,y:h}},t.prototype.removeNode=function(){var e,t=this.obj.nodes,n=this.obj.lines;for(e=0;e<this.children.length;e++)this.children[e].removeNode();for(this.obj.nodes=[],e=0;e<t.length;e++)t[e]!==this&&this.obj.nodes.push(t[e]);for(this.obj.lines=[],e=0;e<n.length;e++)n[e].start!==this&&n[e].end!==this&&(console.log("OLD LINES",n[e]),this.obj.lines.push(n[e]));this.el.remove()},(n=function(e,t,n){this.obj=e,this.options=e.options,this.start=t,this.colour="blue",this.size="thin",this.end=n}).prototype.updatePosition=function(){(this.options.showSublines||this.start.visible&&this.end.visible)&&(this.size=this.start.visible&&this.end.visible?"thick":"thin",this.color=this.obj.activeNode.parent===this.start||this.obj.activeNode.parent===this.end?"red":"blue",this.strokeStyle="#ff0",this.obj.canvas.path("M"+this.start.x+" "+this.start.y+"L"+this.end.x+" "+this.end.y).attr({stroke:this.strokeStyle,opacity:1,"stroke-width":"2px"}))},e.fn.addNode=function(e,n,i){var s=this[0],a=s.nodes[s.nodes.length]=new t(s,n,e,i);return s.root.animateToStatic(),a},e.fn.addRootNode=function(e,n){var i=this[0].nodes[0]=new t(this[0],e,null,n);return this[0].root=i,i},e.fn.removeNode=function(e){return this.each((function(){}))},e.fn.mindmap=function(t){t=e.extend({attract:6,repulse:6,damping:.55,timeperiod:10,wallrepulse:.4,mapArea:{x:-1,y:-1},canvasError:"alert",minSpeed:.05,maxForce:.1,showSublines:!1,updateIterationCount:20,showProgressive:!0,centreOffset:100,timer:0},t);var n=e("#mindmap");return this.each((function(){var r=this;this.mindmapInit=!0,this.nodes=[],this.lines=[],this.activeNode=null,this.options=t,this.animateToStatic=function(){this.root.animateToStatic()},n.resize((function(){r.animateToStatic()})),-1===t.mapArea.x&&(t.mapArea.x=i),-1===t.mapArea.y&&(t.mapArea.y=s),console.log("mindmap width",i,"mindmap height",s);var o=a.left,l=a.top;console.log("canvas",this.canvas,o,l,t.mapArea),console.log("this before",this),null!=mindmapCanvas&&mindmapCanvas.clear(),this.canvas=Raphael(o,l,t.mapArea.x,t.mapArea.y),mindmapCanvas=this.canvas,console.log("this ater",this),mindmapNodes=this,e(this).addClass("js-mindmap-active"),e(this).keyup((function(e){var t,n,i=r.activeNode.parent;switch(e.which){case 33:case 38:i&&i.el.click();break;case 13:case 34:case 40:r.activeNode.children.length&&r.activeNode.children[0].el.click();break;case 37:if(i){if(t=null,i.children[0]===r.activeNode)t=i.children[i.children.length-1];else for(n=1;n<i.children.length;n++)i.children[n]===r.activeNode&&(t=i.children[n-1]);t&&t.el.click()}break;case 39:if(i){if(t=null,i.children[i.children.length-1]===r.activeNode)t=i.children[0];else for(n=i.children.length-2;n>=0;n--)i.children[n]===r.activeNode&&(t=i.children[n+1]);t&&t.el.click()}}return!1}))}))}}(jQuery);var mindmapNodes={};function setPostNodes(e){for(var t in e);return[]}function getNodeBackgroundImage(e){if(console.log(e),"category"==e.object&&null!=categories[e.object_id].image)return bg_path=categories[e.object_id].image}function setMindMapNotch(e){var t={},n=e.object_id,i=e.object,s=getNodeBackgroundImage(e);if(t.root={type:i,id:n,title:e.title,href:e.url,className:"root-node",backgroundImage:s,nodes:[]},console.log("notch",e),console.log("posts",posts),"category"==i&&null!=categories[n].posts)for(c=0;c<categories[n].posts.length;c++)t.root.nodes.push(posts[categories[n].posts[c]]);loadMindmap("#mindmap",t)}function getNodeImage(e){if(null!=e){if("category"==e.type)return e.backgroundImage;if(null!=e.post_media&&null!=e.post_media._thumbnail_id&&null!=e.post_media._thumbnail_id[0])return e.post_media._thumbnail_id[0].full_path}}function setGrandChildren(e){var t=[];if(null!=e.related)for(var n in e.related)t.push(posts[e.related[n]]);return t}function loadMindmap(e,t){jQuery("body svg").last().html(""),console.log("CANVAS after",mindmapCanvas),0==initMindMap?initMindMap=!0:(console.log("new nodes"),mindmapNodes.canvas.clear()),mindmap_width=jQuery(e).css("width"),mindmap_height=jQuery(e).css("height");function i(e){var t={};return t.title=e.title,t.info_count=r(e.info),t.backgroundImage=getNodeImage(e),t.grandchildren=setGrandChildren(e),t.className="child-node",t.external=!1,1==t.info_count&&0==t.grandchildren.length?(t.href=e.info.url,t.external=!0):t.href="/",t}count=[];var s=function(t,n){var s=i(t),l=s.href;title=s.title,this.mynode=jQuery(e).addNode(n,title,{href:l,size:external,external:s.external,id:t.id,className:s.className,backgroundImage:s.backgroundImage,type:t.type,onclick:function(e){if("/"!=l)return window.open(l,"_blank"),!1;jQuery(e.obj.activeNode.content).each((function(){this.hide()})),jQuery(e.content).each((function(){this.show()}))},onmouseover:function(e){a(e)},onmouseout:function(e){}}),t.info;var c=this.mynode;if(s.grandchildren.length>0){for(0,g=0;g<s.grandchildren.length;g++)s.grandchildren[g].id!=t.id&&(grandprops=i(s.grandchildren[g]),title=grandprops.title,this.grandnode=jQuery(e).addNode(c,title,{href:grandprops.href,size:"/",className:"grandchild-node",type:grandprops.object,backgroundImage:grandprops.backgroundImage,onclick:function(e){if("/"!=l)return window.open(grandprops.href,"_blank"),!1;jQuery(e.obj.activeNode.content).each((function(){this.hide()})),jQuery(e.content).each((function(){this.show()}))},onmouseover:function(e){a(e)},onmouseout:function(e){}}),null!=grandprops.info&&r(grandprops.info)>1&&o(grandprops,this.grandnode));jQuery(this).hide()}};function a(e){""!=e.backgroundImage&&jQuery("#screen-image-container").html('<img src="'+e.backgroundImage+'">'),"category"==e.type?(jQuery(current_slide_id+" h2").html(e.name),jQuery(current_slide_id+" section div.content").html(categories[e.id].description)):(console.log("post",e.id,e.name),jQuery(current_slide_id+" h2").html(e.name),jQuery(current_slide_id+" section div.content").html(posts[e.id].content))}function r(e){var t=0;for(var n in e)t++;return t}function o(t,n){for(var i in t.info)console.log("adinfonode",i,t.info[i]),backgroundImage="",this.infonode=jQuery(e).addNode(n,i,{href:"/",className:"info-node",backgroundImage:backgroundImage,onclick:function(e){console.log("external link",i,t.info),l(t.info[i])}})}function l(e){return window.open(e,"blank"),!1}if(t.root.nodes.length>0){jQuery(e).html("");var c=function(){console.log("root",t.root);var n=getNodeImage(t.root);return jQuery(e).addRootNode(t.root.title,{href:"/",url:"/",id:t.root.id,type:t.root.type,backgroundImage:n,onclick:function(e){jQuery(e.obj.activeNode.content).each((function(){this.hide()}))},onmouseover:function(e){a(e)},onmouseout:function(e){}})}();for(n=0;n<t.root.nodes.length;n++)s(t.root.nodes[n],c)}}function psConsole(){}function setProject(e){if(state.object_id!=e){var t=posts[e].slug,n=menus.projects.slug_nav[t];jQuery("#wheel-menu-content").fadeOut(),jQuery("#projects-content").fadeIn(),setSlideContent(n,e),setImage(e,"featured","featured_media","flip");uploads_path,posts[e].featured_video.video_path;setVideo(posts[e].featured_video.video_id,"#bg-video"),projectInfo(e),state.object_id=e}}function projectInfo(e){var t=jQuery("#project-info-template").html(),n=posts[e].project_info,i="#project-info";jQuery(i).html(t);var s='<a href="'+n.url+'" target="_blank">Go to </a>';jQuery(i+" .client").html(n.client),jQuery(i+" .agency").html(n.agency),jQuery(i+" .project-url").html(s),jQuery(i+" .era").html(n.era),jQuery("project-info").html(t).fadeIn();for(var a=n.client,r=[],o=0;o<a.length;o++)r.push(a[o])}function setRelated(e){var t=null;(related={}).cats={},related.tags={};var n={cats:categories,tags:tags};for(var i in related)for(var s=0;s<e[i].length;s++)for(var a=0;a<n[i][e[i][s]].posts.length;a++)if(t=n[i][e[i][s]].posts[a],e.id!=t&&null!=posts[t]){var r=posts[t].type;null==related[i][r]&&(related[i][r]=[]),related[i][r].push(t)}delete n,displayRelated()}function displayRelated(){jQuery("#related").html(""),rel_list="";getAspect(jQuery("#related ul li").width(),jQuery("#related ul li").height());for(var e in related){for(var t in rel_list+='<ul class="'+e+'">',related[e])for(var n=0;n<related[e][t].length;n++){post_id=related[e][t][n];var i="",s="",a=getMediaID(post_id,"featured_media");a>0&&(s=getImageSRC(a,"#related ul li","thumbnail")),""!=s&&(i=' style="background-image:url('+s+')"'),rel_list+="<li "+i+' class="ui-widget '+t+'" data-rel="'+post_id+'">',rel_list+=post_id,rel_list+="</li>"}rel_list+="</ul>"}jQuery("#related").html(rel_list)}function tipHoverContent(e){var t="";return"project"==posts[e].type&&(t+='<span class="hover-title">'+posts[e].project_info.client+"</span>",""!=posts[e].project_info.agency&&(t+='<span class="hover-sub">'+posts[e].project_info.agency+"</span>")),t}function selectRelatedPost(e){"project"==posts[e].type&&setProject(e)}!function(e){e(document).tooltip({items:"[data-rel]",content:function(){var t=e(this).data("rel"),n="",i="",s="",a=getMediaID(t,"featured_media");0!=a&&(s=getImageSRC(a,".rel-tooltip","thumbnail")),""!=s&&(i=' style="background-image:url('+s+')"'),e(this).on("click",(function(e){e.preventDefault(),selectRelatedPost(t)})).on("mouseover",(function(e){console.log("related1"+t,"mouseover"),e.preventDefault(),console.log("related"+t,"mouseover")})).on("mouseout",(function(e){e.preventDefault()})).on("mousedown",(function(e){e.preventDefault()})).on("mouseup",(function(e){e.preventDefault()})),n+='<div class="rel-tooltip"'+i+">",n+="</div>",console.log(n)}})}(jQuery);var gotoslide=function(e){setSlideContent(notch,menus["wheel-menu"].linear_nav[e].object_id),$(".slideshow").slickGoTo(parseInt(e))};function setSlideShow(e){jQuery(".slideshow").slick({dots:!1,arrows:!0,infinite:!0,speed:1e3,fade:!0,cssEase:"linear",focusoOnSelect:!0})}function setSlide(e,t,n){return e='\n<div><div id="slide-'+t+"-"+n+'" data-id="'+t+"-"+n+'" class="slide-wrap">',e+="\n\t<h2></h2>",e+='\n\t<div class="img-wrap"></div>',e+='\n\t<section><div class="content"></div></section>',e+="\n</div></div>\n"}function setSlides(e){var t="0",n="page",s="";if(null==posts)window.setTimeout(setSlides(e),100);else{for(i=0;menus[e].linear_nav[i];i++)n=menus[e].linear_nav[i].object,t=menus[e].linear_nav[i].object_id.toString(),s+=setSlide(i,n,t);jQuery("#"+e+"-content").html(s)}}jQuery(".slick-dots li button").on("click",(function(e){e.stopPropagation()}));var $carousel=jQuery(".slideshow");function setSlider(){null!=menus["wheel-menu"]&&(jQuery("#slider").slider({orientation:slider_orientation,range:"max",min:0,max:menus["wheel-menu"].linear_nav.length,value:0,slide:function(e,t){setSliderNotch(t.value)}}),jQuery(".slick-dots li button").on("click",(function(e){e.stopPropagation()})))}function setSliderNotch(e){var t="wheel-menu";null!=state.circle_delay&&clearInterval(state.circle_delay),location.hash=getSlug(menus[t].data_nav[e]),jQuery("#slider").slider("value",e),setMindMapNotch(menus[t].data_nav[e]),null!=menus["wheel-menu"].linear_nav[e]&&(setContent(e,menus[t].data_nav[e].object_id,menus[t].data_nav[e].object),console.log("trigger notch=",e,location.hash),triggerWheelNav(e)),current_notch=e}function setSocial(){var e=menus["social-links"].items,t="";for(s in e){var n=posts[e[s].object_id],i=getImageSRC(n.featured_media);t+='<li><a href="'+n.social_url+'" target="_blank"><img src="'+i+'" alt="'+n.title+'"></a></li>'}jQuery("#social-links ul").html(t)}jQuery(document).on("keydown",(function(e){37==e.keyCode&&$carousel.slick("slickPrev"),39==e.keyCode&&$carousel.slick("slickNext")})),jQuery("a[data-slide]").click((function(e){e.preventDefault();var t=jQuery(this).data("slide");setSlideContent(notch,menus["wheel-menu"].linear_nav[t].object_id)})),jQuery("#slider").on("mousewheel DOMMouseScroll",(function(e){e.preventDefault(),value=jQuery("#slider").slider("value"),null!=value&&NaN!=value||(value=0);var t=e.originalEvent;console.log(jQuery("#slider").slider),-150==t.deltaY?(value<menus["wheel-menu"].linear_nav.length?value+=1:value=0,setSliderNotch(value)):150==t.deltaY&&(0==value?value=menus["wheel-menu"].linear_nav.length:value-=1,setSliderNotch(value))})),function(e){e("div.arrow").on("click",(function(t){t.stopPropagation();var n=e(this).attr("id"),i=current_notch;"down-arrow"==n?0==i?i=menus["wheel-menu"].linear_nav.length-1:i--:"up-arrow"==n&&(i==menus["wheel-menu"].linear_nav.length-1?i=0:i++),setSliderNotch(i)}))}(jQuery),jQuery("#stargate").click((function(){jQuery(".iris").toggleClass("irison"),jQuery("#egypts").toggleClass("egyptsanim"),jQuery("audio")[0].play(),jQuery(".iris").hasClass("irison")?(jQuery("audio")[1].loop=!0,jQuery("audio")[1].play()):(jQuery("audio")[1].loop=!1,jQuery("audio")[1].pause(),jQuery("audio")[1].currentTime=0)}));var container,mesh,timeUniform;start=Date.now(),fov=30,clock=new THREE.Clock;function render(){timeUniform.iGlobalTime.value+=clock.getDelta(),renderer.render(scene,camera),requestAnimationFrame(render)}(timeUniform={iGlobalTime:{type:"f",value:.1},iResolution:{type:"v2",value:new THREE.Vector2}}).iResolution.value.x=window.innerWidth/4,timeUniform.iResolution.value.y=window.innerHeight/4,window.addEventListener("load",(function(){container=document.getElementById("render"),scene=new THREE.Scene,(camera=new THREE.PerspectiveCamera(fov,window.innerWidth/window.innerHeight,1,1e4)).position.x=20,camera.position.y=10,camera.position.z=20,camera.lookAt(scene.position),scene.add(camera);var e=new THREE.AxisHelper(10);scene.add(e),i=new THREE.ShaderMaterial({uniforms:timeUniform,vertexShader:document.getElementById("vertex-shader").textContent,fragmentShader:document.getElementById("fragment-shader").textContent});var t=new THREE.Mesh(new THREE.PlaneBufferGeometry(window.innerWidth,window.innerHeight,40),i);scene.add(t);var n=new THREE.SphereGeometry(10,32,32),i=new THREE.MeshBasicMaterial({color:16776960}),s=new THREE.Mesh(n,i);scene.add(s),(renderer=new THREE.WebGLRenderer).setSize(window.innerWidth,window.innerHeight),container.appendChild(renderer.domElement),render()})),window.addEventListener("resize",(function(){camera.aspect=window.innerWidth/window.innerHeight,camera.updateProjectionMatrix(),renderer.setSize(window.innerWidth,window.innerHeight)}));var camera,scene,renderer,stars=[];function initStars(){(camera=new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,1e3)).position.z=5,scene=new THREE.Scene,(renderer=new THREE.WebGLRenderer).setSize(window.innerWidth,window.innerHeight),jQuery("#stars").append(renderer.domElement)}function addSphere(){for(var e=-1e3;e<1e3;e+=20){var t=new THREE.SphereGeometry(.5,32,32),n=new THREE.MeshBasicMaterial({color:16777215}),i=new THREE.Mesh(t,n);i.position.x=1e3*Math.random()-500,i.position.y=1e3*Math.random()-500,i.position.z=e,i.scale.x=i.scale.y=2,scene.add(i),stars.push(i)}}function animateStars(){for(var e=0;e<stars.length;e++)star=stars[e],star.position.z+=e/10,star.position.z>1e3&&(star.position.z-=2e3)}function render(){requestAnimationFrame(render),renderer.render(scene,camera),animateStars()}function tagCloud(){for(var e=menus["tag-cloud"].menu_array,t=[],n=0;n<e.length;n++)t.push({label:e[n].title,url:"/#"+e[n].slug+"/",target:"_top"});var i=.5*_w,s={entries:t,width:i,height:i,radius:"65%",radiusMin:75,bgDraw:!0,bgColor:"#111",opacityOver:1,opacityOut:.05,opacitySpeed:6,fov:800,speed:2,bgColor:"transparent",fontFamily:"Krona One, Arial, sans-serif",fontSize:"1em",fontWeight:"normal",fontStyle:"normal",fontStretch:"normal",fontToUpperCase:!1};jQuery("#tag-cloud").svg3DTagCloud(s)}function setChildCategories(e){for(var t=0;t<e.length;t++)category[e[t].id]=e[t];return e}function setCategories(e){if(null!=e)for(var t=0;t<e.length;t++)categories[e[t].id]=e[t];return console.log("categories",categories),e}function setTaxonomy(e,t){if(taxonomies[t]={},null!=e[t])for(var n=0;n<e[t].length;n++)taxonomies[t][e[t][n].id]=e[t][n];return e}function setTags(e){for(var t=0;t<e.length;t++)tags[e[t].id]=e[t];return e}initStars(),addSphere(),render(),jQuery(window).on("resize",(function(){})),jQuery("#tag-cloud-button").on("click",(function(){jQuery("#tag-cloud").fadeToggle("slow","linear")})),last_outer_notch=0,last_inner_notch=0;var menu_raphael={},wheels={};function makeWheelNav(e,t,n){setWheelNavParams(),n=wheel_nav_params,"outer-nav"==e?(child_dest="inner-nav",child_params=wheel_nav_params):"inner-nav"==e&&(child_dest="inner-subnav",child_params=wheel_nav_params);var i=[],s=[];for(wheels[e]=new wheelnav(e),wheels[e].spreaderEnable=!1,wheels[e].cssMode=!0,wheels[e].navAngle=270,wheels[e].selectedNavItem=2,wheels[e].selectedNavItemIndex=null,wheels[e].maxPercent=n.maxPercent,wheels[e].slicePathFunction=slicePath().DonutSlice,wheels[e].slicePathCustom=slicePath().PieSliceCustomization(),wheels[e].slicePathCustom.minRadiusPercent=n.min,wheels[e].slicePathCustom.maxRadiusPercent=n.max,wheels[e].sliceSelectedPathCustom=slicePath().PieSliceCustomization(),wheels[e].sliceSelectedPathCustom.minRadiusPercent=n.sel_min,wheels[e].sliceSelectedPathCustom.maxRadiusPercent=n.sel_max,wheels[e].titleSelectedAttr={},o=0;o<t.length;o++)i.push(t[o].title),s.push(t[o].id);wheels[e].initWheel(i);var a=360/wheels[e].navItemCount,r=90;for(o=0;o<wheels[e].navItemCount;o++)wheels[e].navItems[o].titleRotateAngle=r,r=a+(90-a);"outer-nav"==e&&t[0].children.length>0&&makeWheelNav("inner-nav",t[0].children,wheel_nav_params),wheels[e].createWheel(),counter=0;for(var o=0;o<wheels[e].navItemCount;o++)wheels[e].navItems[o].data=t[o],wheels[e].navItems[o].navigateFunction=function(){jQuery("#slider").slider("option","value",this.data.notch),setSliderNotch(menus["wheel-menu"].slug_nav[this.data.slug])};menu_raphael[e]=wheels[e].raphael,reposition_screen()}function triggerWheelNav(e){var t=menus["wheel-menu"].data_nav,n=t[e],i=n.dest;"outer-nav"==i?(null!=wheels["inner-nav"]&&wheels[i].navigateWheel(n.slice),popAWheelie("inner-nav"),n.children.length>0&&makeWheelNav("inner-nav",n.children,wheel_nav_params),last_outer_notch=e):"inner-nav"==i?(last_outer_notch!=n.parent?(wheels["outer-nav"].navigateWheel(t[n.parent].slice),makeWheelNav("inner-nav",t[n.parent].children,wheel_nav_params),wheels[i].navigateWheel(n.slice),last_outer_notch=n.parent):(wheels["outer-nav"].navigateWheel(t[n.parent].slice),null!=wheels["inner-nav"]?(wheels[i].navigateWheel(n.slice),null!=wheels["inner-subnav"]&&wheels["inner-subnav"].raphael.remove()):(makeWheelNav("inner-nav",t[n.parent].children,wheel_nav_params),wheels[i].navigateWheel(n.slice)),n.children.length>0?makeWheelNav("inner-subnav",n.children,wheel_nav_params):popAWheelie("inner-subnav")),last_inner_notch=e):"inner-subnav"==i&&(last_outer_notch!=n.grandparent&&(wheels["outer-nav"].navigateWheel(t[n.grandparent].slice),last_outer_notch=n.grandparent,popAWheelie("inner-nav"),makeWheelNav("inner-nav",t[n.grandparent].children,wheel_nav_params),wheels["inner-nav"].navigateWheel(t[n.parent].slice),t[n.parent].children.length>0&&(makeWheelNav("inner-subnav",t[n.parent].children,wheel_nav_params),wheels["inner-nav"].navigateWheel(t[n.parent].slice))),last_inner_notch!=n.parent?(wheels["inner-nav"].navigateWheel(t[n.parent].slice),makeWheelNav("inner-subnav",t[n.parent].children,wheel_nav_params),wheels["inner-subnav"].navigateWheel(n.slice),last_inner_notch=n.parent):(console.log(wheels["inner-subnav"]),null==wheels["inner-subnav"].raphael?makeWheelNav("inner-subnav",t[n.parent].children,wheel_nav_params):wheels[i].navigateWheel(n.slice))),last_dest=i}function popAWheelie(e){"outer-nav"==e?null!=wheels["inner-nav"]&&(wheels["inner-nav"].raphael.remove(),null!=wheels["inner-subnav"]&&wheels["inner-subnav"].raphael.remove()):"inner-nav"==e&&null!=wheels["inner-subnav"]&&wheels["inner-subnav"].raphael.remove()}function setWorld(e,t){var n=-20,i=40,s=0;var a,r,o,l,c,d,u,h,m,p,g,f,v,w=d3.select("#current"),y=d3.select(t),_=y.node().getContext("2d"),b={type:"Sphere"},j=d3.geoOrthographic().precision(.1),x=d3.geoGraticule10(),k=d3.geoPath(j).context(_),Q=d3.now();function C(){l="300",c="300",y.attr("width",l).attr("height",c),j.scale(.9*Math.min(l,c)/2).translate([l/2,c/2]),S()}function S(){var e,t;_.clearRect(0,0,l,c),E(b,"#fff"),e=x,t="#ccc",_.beginPath(),k(e),_.strokeStyle=t,_.stroke(),E(d,"#111"),f&&E(f,"#a00")}function E(e,t){_.beginPath(),k(e),_.fillStyle=t,_.fill()}function M(e){p=d3.now(),(g=p-Q)<e&&(rotation=j.rotate(),rotation[0]+=.006*g,j.rotate(rotation),S()),Q=p}function N(e,t){for(var n,i,s=e.length,a=e[s-1],r=t[0],o=t[1],l=a[0],c=a[1],d=!1,u=0;u<s;++u)n=(a=e[u])[0],(i=a[1])>o!=c>o&&r<(l-n)*(o-i)/(c-i)+n&&(d=!d),l=n,c=i;return d}!function(){var e=j.rotate();e[0]=i,e[1]=n,e[2]=s,j.rotate(e)}(),y.call(d3.drag().on("start",(function(){a=versor.cartesian(j.invert(d3.mouse(this))),r=j.rotate(),o=versor(r),m.stop()})).on("drag",(function(){var e=versor.cartesian(j.rotate(r).invert(d3.mouse(this))),t=versor.multiply(o,versor.delta(a,e)),n=versor.rotation(t);j.rotate(n),S()})).on("end",(function(){var e;e=3e3,m.restart(M,e||0)}))).on("mousemove",(function(){var e,t,n,i=(e=this,t=j.invert(d3.mouse(e)),u.features.find((function(e){return e.geometry.coordinates.find((function(e){return N(e,t)||e.find((function(e){return N(e,t)}))}))})));i?i!==f&&(f=i,S(),n=i,n=h.find((function(e){return e.id===n.id})),w.text(n&&n.name||"")):f&&(w.text(""),f=void 0,S())})),v=function(e,t){d=topojson.feature(e,e.objects.land),u=topojson.feature(e,e.objects.countries),h=t,window.addEventListener("resize",C),C(),m=d3.timer(M)},d3.json("https://unpkg.com/world-atlas@1/world/110m.json",(function(e,t){if(e)throw e;d3.tsv("https://gist.githubusercontent.com/mbostock/4090846/raw/07e73f3c2d21558489604a0bc434b3a5cf41a867/world-country-names.tsv",(function(e,n){if(e)throw e;v(t,n)}))}))}function initLanguageMenu(e){state.language=languages.default;var t="<ul>";for(var n in languages)if("default"!=n){var i="";n==state.language&&(i=' class="active-language"'),t+='<li id="'+n+'"'+i+">"+languages[n].native+"</li>"}jQuery(e).on("click","li",(function(e){for(var t in state.language=jQuery(this).attr("id"),languages)t==state.language?(t!=languages.default&&null==languages[t].data&&getStaticJSON(t,setLanguage,t),state.language=t,changeLanguage(t),jQuery("#"+t).addClass("active-language")):jQuery("#"+t).removeClass("active-language")})),jQuery(e).html(t)}function retreiveML(e,t,n,i){if("posts"==e){if(null!=posts[n].languages&&null!=posts[n].languages[i]){var s=posts[n].languages[i].id;return posts[s][t]}return posts[n][t]}}function setLanguage(e,t){for(var n in languages[t].data=e,e)"page"!=e[n].type&&"post"!=e[n].type&&"project"!=e[n].type||(posts[n]=e[n]);changeLanguage(t)}function changeLanguage(e){}"undefined"!=typeof languages&&initLanguageMenu("#language-menu");