Difference between revisions of "Template:Humboldt Berlin"

Line 28: Line 28:
  
 
</head>
 
</head>
 
<script>
 
var ScrollReveal=function(){"use strict";var e={delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:!0,container:document.documentElement,desktop:!0,mobile:!0,reset:!1,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:function(){},afterReveal:function(){},beforeReset:function(){},beforeReveal:function(){}},t={clean:function(){},destroy:function(){},reveal:function(){},sync:function(){},get noop(){return!0}};function n(e){return"object"==typeof window.Node?e instanceof window.Node:null!==e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function i(e,t){if(void 0===t&&(t=document),e instanceof Array)return e.filter(n);if(n(e))return[e];if(i=e,r=Object.prototype.toString.call(i),"object"==typeof window.NodeList?i instanceof window.NodeList:null!==i&&"object"==typeof i&&"number"==typeof i.length&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(r)&&(0===i.length||n(i[0])))return Array.prototype.slice.call(e);var i,r;if("string"==typeof e)try{var o=t.querySelectorAll(e);return Array.prototype.slice.call(o)}catch(e){return[]}return[]}function r(e){return null!==e&&e instanceof Object&&(e.constructor===Object||"[object Object]"===Object.prototype.toString.call(e))}function o(e,t){if(r(e))return Object.keys(e).forEach(function(n){return t(e[n],n,e)});if(e instanceof Array)return e.forEach(function(n,i){return t(n,i,e)});throw new TypeError("Expected either an array or object literal.")}function a(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];if(this.constructor.debug&&console){var i="%cScrollReveal: "+e;t.forEach(function(e){return i+="\n — "+e}),console.log(i,"color: #ea654b;")}}function s(){var e=this,t={active:[],stale:[]},n={active:[],stale:[]},r={active:[],stale:[]};try{o(i("[data-sr-id]"),function(e){var n=parseInt(e.getAttribute("data-sr-id"));t.active.push(n)})}catch(e){throw e}o(this.store.elements,function(e){-1===t.active.indexOf(e.id)&&t.stale.push(e.id)}),o(t.stale,function(t){return delete e.store.elements[t]}),o(this.store.elements,function(e){-1===r.active.indexOf(e.containerId)&&r.active.push(e.containerId),e.hasOwnProperty("sequence")&&-1===n.active.indexOf(e.sequence.id)&&n.active.push(e.sequence.id)}),o(this.store.containers,function(e){-1===r.active.indexOf(e.id)&&r.stale.push(e.id)}),o(r.stale,function(t){var n=e.store.containers[t].node;n.removeEventListener("scroll",e.delegate),n.removeEventListener("resize",e.delegate),delete e.store.containers[t]}),o(this.store.sequences,function(e){-1===n.active.indexOf(e.id)&&n.stale.push(e.id)}),o(n.stale,function(t){return delete e.store.sequences[t]})}function l(e){var t,n=this;try{o(i(e),function(e){var i=e.getAttribute("data-sr-id");if(null!==i){t=!0;var r=n.store.elements[i];r.callbackTimer&&window.clearTimeout(r.callbackTimer.clock),e.setAttribute("style",r.styles.inline.generated),e.removeAttribute("data-sr-id"),delete n.store.elements[i]}})}catch(e){return a.call(this,"Clean failed.",e.message)}if(t)try{s.call(this)}catch(e){return a.call(this,"Clean failed.",e.message)}}function c(e){if(e.constructor!==Array)throw new TypeError("Expected array.");if(16===e.length)return e;if(6===e.length){var t=d();return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function d(){for(var e=[],t=0;t<16;t++)t%5==0?e.push(1):e.push(0);return e}function u(e,t){for(var n=c(e),i=c(t),r=[],o=0;o<4;o++)for(var a=[n[o],n[o+4],n[o+8],n[o+12]],s=0;s<4;s++){var l=4*s,d=[i[l],i[l+1],i[l+2],i[l+3]],u=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3];r[o+l]=u}return r}function f(e,t){var n=d();return n[0]=e,n[5]="number"==typeof t?t:e,n}var m=function(){var e={},t=document.documentElement.style;function n(n,i){if(void 0===i&&(i=t),n&&"string"==typeof n){if(e[n])return e[n];if("string"==typeof i[n])return e[n]=n;if("string"==typeof i["-webkit-"+n])return e[n]="-webkit-"+n;throw new RangeError('Unable to find "'+n+'" style property.')}throw new TypeError("Expected a string.")}return n.clearCache=function(){return e={}},n}();function h(e,t){void 0===t&&(t={});var n=t.pristine||this.pristine,i="always"===e.config.useDelay||"onload"===e.config.useDelay&&n||"once"===e.config.useDelay&&!e.seen,r=e.visible&&!e.revealed,o=!e.visible&&e.revealed&&e.config.reset;return t.reveal||r?function(e,t){var n=[e.styles.inline.generated,e.styles.opacity.computed,e.styles.transform.generated.final];t?n.push(e.styles.transition.generated.delayed):n.push(e.styles.transition.generated.instant),e.revealed=e.seen=!0,e.node.setAttribute("style",n.filter(function(e){return""!==e}).join(" ")),p.call(this,e,t)}.call(this,e,i):t.reset||o?function(e){var t=[e.styles.inline.generated,e.styles.opacity.generated,e.styles.transform.generated.initial,e.styles.transition.generated.instant];e.revealed=!1,e.node.setAttribute("style",t.filter(function(e){return""!==e}).join(" ")),p.call(this,e)}.call(this,e):void 0}function p(e,t){var n=this,i=t?e.config.duration+e.config.delay:e.config.duration,r=e.revealed?e.config.beforeReveal:e.config.beforeReset,o=e.revealed?e.config.afterReveal:e.config.afterReset,a=0;e.callbackTimer&&(a=Date.now()-e.callbackTimer.start,window.clearTimeout(e.callbackTimer.clock)),r(e.node),e.callbackTimer={start:Date.now(),clock:window.setTimeout(function(){o(e.node),e.callbackTimer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&l.call(n,e.node)},i-a)}}var g,y=(g=0,function(){return g++});function v(e,t){if(void 0===t&&(t=this.pristine),!e.visible&&e.revealed&&e.config.reset)return h.call(this,e,{reset:!0});var n=this.store.sequences[e.sequence.id],i=e.sequence.index;if(n){var r=new b(n,"visible",this.store),o=new b(n,"revealed",this.store);if(n.models={visible:r,revealed:o},!o.body.length){var a=n.members[r.body[0]],s=this.store.elements[a];if(s)return w.call(this,n,r.body[0],-1,t),w.call(this,n,r.body[0],1,t),h.call(this,s,{reveal:!0,pristine:t})}if(!n.blocked.head&&i===[].concat(o.head).pop()&&i>=[].concat(r.body).shift())return w.call(this,n,i,-1,t),h.call(this,e,{reveal:!0,pristine:t});if(!n.blocked.foot&&i===[].concat(o.foot).shift()&&i<=[].concat(r.body).pop())return w.call(this,n,i,1,t),h.call(this,e,{reveal:!0,pristine:t})}}function b(e,t,n){var i=this;this.head=[],this.body=[],this.foot=[],o(e.members,function(e,r){var o=n.elements[e];o&&o[t]&&i.body.push(r)}),this.body.length&&o(e.members,function(e,r){var o=n.elements[e];o&&!o[t]&&(r<i.body[0]?i.head.push(r):i.foot.push(r))})}function w(e,t,n,i){var r=this,o=["head",null,"foot"][1+n],a=e.members[t+n],s=this.store.elements[a];e.blocked[o]=!0,setTimeout(function(){e.blocked[o]=!1,s&&v.call(r,s,i)},e.interval)}function E(){var e=this;s.call(this),o(this.store.elements,function(e){var t=[e.styles.inline.generated];e.visible?(t.push(e.styles.opacity.computed),t.push(e.styles.transform.generated.final)):(t.push(e.styles.opacity.generated),t.push(e.styles.transform.generated.initial)),e.node.setAttribute("style",t.filter(function(e){return""!==e}).join(" "))}),o(this.store.containers,function(t){var n=t.node===document.documentElement?window:t.node;n.addEventListener("scroll",e.delegate),n.addEventListener("resize",e.delegate)}),this.delegate(),this.initTimeout=null}function T(e){return void 0===e&&(e=navigator.userAgent),/Android|iPhone|iPad|iPod/i.test(e)}function j(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];if(r(e))return o(t,function(t){o(t,function(t,n){r(t)?(e[n]&&r(e[n])||(e[n]={}),j(e[n],t)):e[n]=t})}),e;throw new TypeError("Target must be an object literal.")}function k(t,n,r){var s=this;void 0===n&&(n={}),void 0===r&&(r=!1);var h,p=[],g=n.interval||e.interval;try{g&&(h=new function(e){var t=Math.abs(e);if(isNaN(t))throw new RangeError("Invalid sequence interval.");this.id=y(),this.interval=Math.max(t,16),this.members=[],this.models={},this.blocked={head:!1,foot:!1}}(g));var v=i(t);if(!v.length)throw new Error("Invalid reveal target.");o(v.reduce(function(e,t){var r={},a=t.getAttribute("data-sr-id");a?(j(r,s.store.elements[a]),r.node.setAttribute("style",r.styles.inline.computed)):(r.id=y(),r.node=t,r.seen=!1,r.revealed=!1,r.visible=!1);var g=j({},r.config||s.defaults,n);if(!g.mobile&&T()||!g.desktop&&!T())return a&&l.call(s,r),e;var v,b=i(g.container)[0];if(!b)throw new Error("Invalid container.");return b.contains(t)&&(null===(v=function(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];var i=null;return o(t,function(t){o(t,function(t){null===i&&t.node===e&&(i=t.id)})}),i}(b,p,s.store.containers))&&(v=y(),p.push({id:v,node:b})),r.config=g,r.containerId=v,r.styles=function(e){var t=window.getComputedStyle(e.node),n=t.position,i=e.config,r={},o=(e.node.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[];r.computed=o?o.map(function(e){return e.trim()}).join("; ")+";":"",r.generated=o.some(function(e){return e.match(/visibility\s?:\s?visible/i)})?r.computed:o.concat(["visibility: visible"]).map(function(e){return e.trim()}).join("; ")+";";var a,s,l,h,p,g,y,v,b,w,E,T,j,k=parseFloat(t.opacity),I=isNaN(parseFloat(i.opacity))?parseFloat(t.opacity):parseFloat(i.opacity),L={computed:k!==I?"opacity: "+k+";":"",generated:k!==I?"opacity: "+I+";":""},A=[];if(parseFloat(i.distance)){var O="top"===i.origin||"bottom"===i.origin?"Y":"X",x=i.distance;"top"!==i.origin&&"left"!==i.origin||(x=/^-/.test(x)?x.substr(1):"-"+x);var P=x.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g),q=P[0];switch(P[1]){case"em":x=parseInt(t.fontSize)*q;break;case"px":x=q;break;case"%":x="Y"===O?e.node.getBoundingClientRect().height*q/100:e.node.getBoundingClientRect().width*q/100;break;default:throw new RangeError("Unrecognized or missing distance unit.")}"Y"===O?A.push((l=x,(h=d())[13]=l,h)):A.push((a=x,(s=d())[12]=a,s))}i.rotate.x&&A.push((p=i.rotate.x,g=Math.PI/180*p,(y=d())[5]=y[10]=Math.cos(g),y[6]=y[9]=Math.sin(g),y[9]*=-1,y)),i.rotate.y&&A.push((v=i.rotate.y,b=Math.PI/180*v,(w=d())[0]=w[10]=Math.cos(b),w[2]=w[8]=Math.sin(b),w[2]*=-1,w)),i.rotate.z&&A.push((E=i.rotate.z,T=Math.PI/180*E,(j=d())[0]=j[5]=Math.cos(T),j[1]=j[4]=Math.sin(T),j[4]*=-1,j)),1!==i.scale&&(0===i.scale?A.push(f(2e-4)):A.push(f(i.scale)));var M={};if(A.length){M.property=m("transform"),M.computed={raw:t[M.property],matrix:function(e){if("string"==typeof e){var t=e.match(/matrix(3d)?\(([^)]+)\)/);if(t)return c(t[2].split(", ").map(parseFloat))}return d()}(t[M.property])},A.unshift(M.computed.matrix);var R=A.reduce(u);M.generated={initial:M.property+": matrix3d("+R.join(", ")+");",final:M.property+": matrix3d("+M.computed.matrix.join(", ")+");"}}else M.generated={initial:"",final:""};var S={};if(L.generated||M.generated.initial){S.property=m("transition"),S.computed=t[S.property],S.fragments=[];var N=i.delay,C=i.duration,D=i.easing;L.generated&&S.fragments.push({delayed:"opacity "+C/1e3+"s "+D+" "+N/1e3+"s",instant:"opacity "+C/1e3+"s "+D+" 0s"}),M.generated.initial&&S.fragments.push({delayed:M.property+" "+C/1e3+"s "+D+" "+N/1e3+"s",instant:M.property+" "+C/1e3+"s "+D+" 0s"}),S.computed&&!S.computed.match(/all 0s/)&&S.fragments.unshift({delayed:S.computed,instant:S.computed});var F=S.fragments.reduce(function(e,t,n){return e.delayed+=0===n?t.delayed:", "+t.delayed,e.instant+=0===n?t.instant:", "+t.instant,e},{delayed:"",instant:""});S.generated={delayed:S.property+": "+F.delayed+";",instant:S.property+": "+F.instant+";"}}else S.generated={delayed:"",instant:""};return{inline:r,opacity:L,position:n,transform:M,transition:S}}(r),h&&(r.sequence={id:h.id,index:h.members.length},h.members.push(r.id)),e.push(r)),e},[]),function(e){(s.store.elements[e.id]=e).node.setAttribute("data-sr-id",e.id)})}catch(t){return a.call(this,"Reveal failed.",t.message)}o(p,function(e){s.store.containers[e.id]={id:e.id,node:e.node}}),h&&(this.store.sequences[h.id]=h),!0!==r&&(this.store.history.push({target:t,options:n}),this.initTimeout&&window.clearTimeout(this.initTimeout),this.initTimeout=window.setTimeout(E.bind(this),0))}var I,L=Math.sign||function(e){return(0<e)-(e<0)||+e},A=(I=Date.now(),function(e){var t=Date.now();16<t-I?e(I=t):setTimeout(function(){return A(e)},0)}),O=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||A;function x(e,t){for(var n=t?e.node.clientHeight:e.node.offsetHeight,i=t?e.node.clientWidth:e.node.offsetWidth,r=0,o=0,a=e.node;isNaN(a.offsetTop)||(r+=a.offsetTop),isNaN(a.offsetLeft)||(o+=a.offsetLeft),a=a.offsetParent;);return{bounds:{top:r,right:o+i,bottom:r+n,left:o},height:n,width:i}}var P,q,M,R,S,N,C,D,F="4.0.0";function z(n){var r;if(void 0===n&&(n={}),void 0===this||Object.getPrototypeOf(this)!==z.prototype)return new z(n);if(!z.isSupported())return a.call(this,"Instantiation failed.","This browser is not supported."),t;try{r=j({},N||e,n)}catch(n){return a.call(this,"Instantiation failed.","Invalid configuration.",n.message),t}try{if(!i(r.container)[0])throw new Error("Invalid container.");if(!r.mobile&&T()||!r.desktop&&!T())throw new Error("This device is disabled.")}catch(n){return a.call(this,"Instantiation failed.",n.message),t}return N=r,document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",function(){document.body.style.height="100%"}),this.store={containers:{},elements:{},history:[],sequences:{}},this.pristine=!0,P=P||function(e,t){var n=this;void 0===e&&(e={type:"init"}),void 0===t&&(t=this.store.elements),O(function(){var i="init"===e.type||"resize"===e.type;o(n.store.containers,function(e){i&&(e.geometry=x.call(n,e,!0));var t=function(e){var t,n;return e.node===document.documentElement?(t=window.pageYOffset,n=window.pageXOffset):(t=e.node.scrollTop,n=e.node.scrollLeft),{top:t,left:n}}.call(n,e);e.scroll&&(e.direction={x:L(t.left-e.scroll.left),y:L(t.top-e.scroll.top)}),e.scroll=t}),o(t,function(e){i&&(e.geometry=x.call(n,e)),e.visible=function(e){void 0===e&&(e={});var t=this.store.containers[e.containerId];if(t){var n=Math.max(0,Math.min(1,e.config.viewFactor)),i=e.config.viewOffset,r=e.geometry.bounds.top+e.geometry.height*n,o=e.geometry.bounds.right-e.geometry.width*n,a=e.geometry.bounds.bottom-e.geometry.height*n,s=e.geometry.bounds.left+e.geometry.width*n,l=t.geometry.bounds.top+t.scroll.top+i.top,c=t.geometry.bounds.right+t.scroll.left-i.right,d=t.geometry.bounds.bottom+t.scroll.top-i.bottom,u=t.geometry.bounds.left+t.scroll.left+i.left;return r<d&&u<o&&l<a&&s<c||"fixed"===e.styles.position}}.call(n,e)}),o(t,function(e){e.sequence?v.call(n,e):h.call(n,e)}),n.pristine=!1})}.bind(this),q=q||function(){var e=this;o(this.store.elements,function(e){e.node.setAttribute("style",e.styles.inline.generated),e.node.removeAttribute("data-sr-id")}),o(this.store.containers,function(t){var n=t.node===document.documentElement?window:t.node;n.removeEventListener("scroll",e.delegate),n.removeEventListener("resize",e.delegate)}),this.store={containers:{},elements:{},history:[],sequences:{}}}.bind(this),M=M||k.bind(this),R=R||l.bind(this),S=S||function(){var e=this;o(this.store.history,function(t){k.call(e,t.target,t.options,!0)}),E.call(this)}.bind(this),Object.defineProperty(this,"delegate",{get:function(){return P}}),Object.defineProperty(this,"destroy",{get:function(){return q}}),Object.defineProperty(this,"reveal",{get:function(){return M}}),Object.defineProperty(this,"clean",{get:function(){return R}}),Object.defineProperty(this,"sync",{get:function(){return S}}),Object.defineProperty(this,"defaults",{get:function(){return N}}),Object.defineProperty(this,"version",{get:function(){return F}}),Object.defineProperty(this,"noop",{get:function(){return!1}}),D||(D=this)}return z.isSupported=function(){return("transform"in(t=document.documentElement.style)||"WebkitTransform"in t)&&("transition"in(e=document.documentElement.style)||"WebkitTransition"in e);var e,t},Object.defineProperty(z,"debug",{get:function(){return C||!1},set:function(e){return C="boolean"==typeof e?e:C}}),z(),z}();function addScrollListener(e){for(var t=0;t<e.length;t++)e[t].addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("data-link"),n=document.getElementById(t);animate(document.scrollingElement||document.documentElement,"scrollTop","",0,n.offsetTop,300,!0)},!1)}function animate(e,t,n,i,r,o,a){if(e){var s=(new Date).getTime(),l=setInterval(function(){var c=Math.min(1,((new Date).getTime()-s)/o);a?e[t]=i+c*(r-i)+n:e.style[t]=i+c*(r-i)+n,1===c&&clearInterval(l)},25);a?e[t]=i+n:e.style[t]=i+n}}!function(){const e=document.documentElement;if(e.classList.remove("no-js"),e.classList.add("js"),document.body.classList.contains("has-animations")){(window.sr=ScrollReveal()).reveal(".is-revealing",{duration:1e3,distance:"40px",easing:"cubic-bezier(0.5, -0.01, 0, 1.005)",origin:"bottom",interval:150})}addScrollListener(document.querySelectorAll(".scroll-link",0))}(),window.onscroll=function(){if(null!==document.getElementById("mouse")){var e=document.getElementById("mouse"),t=window.innerHeight,n=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;t/=2,e.style.opacity=(t-n)/t}};const imageContainer=document.querySelector(".image-bg"),showAllButton=document.querySelector(".show-all-members"),allTeamMembers=document.querySelectorAll(".team-member");function addPosition(e,t){e.style.left=t[0]+"%",e.style.top=t[1]+"%",e.style.width=t[2]-t[0]+"%",e.style.height=t[3]-t[1]+"%"}function getPosition(e){var t=e.target.getBoundingClientRect(),n=e.target.width,i=e.target.height,r=(e.clientX-t.left)/n*100,o=(e.clientY-t.top)/i*100;console.log(r,o)}function addTag(e,t,n){const i=document.createElement("div");document.createElement("div");i.addEventListener("click",n),i.classList.add("image-tag"),addPosition(i,e),imageContainer.appendChild(i)}function filterImages(e){allTeamMembers.forEach(t=>{t.id===e?(t.classList.remove("hidden"),t.scrollIntoView({left:0,block:"start",behavior:"smooth"})):t.classList.add("hidden")}),showAllButton.classList.remove("hidden")}function resetFilter(e){e.preventDefault(),allTeamMembers.forEach(e=>{e.classList.remove("hidden")}),showAllButton.classList.add("hidden")}imageContainer.addEventListener("click",getPosition),null!==document.getElementById("team")&&(showAllButton.addEventListener("click",resetFilter),addTag([45,49,52,66],"Paul",()=>{filterImages("paul")}),addTag([15,27,21,40],"Vincent",()=>{filterImages("vincent")}),addTag([70,25,77,38],"Johannes",()=>{filterImages("johannes")}),addTag([3,39,10,52],"Juli",()=>{filterImages("juli")}),addTag([54,21,61,35],"Luise",()=>{filterImages("luise")}),addTag([32,22,38,32],"Marc",()=>{filterImages("marc")}),addTag([25,27,31,39],"Sandra",()=>{filterImages("sandra")}));
 
</script>
 
  
  

Revision as of 10:58, 8 June 2019