JAVASCRIPT
!function(e){var t=e.noise={};function r(e,t,r){this.x=e,this.y=t,this.z=r}r.prototype.dot2=function(e,t){return this.x*e+this.y*t},r.prototype.dot3=function(e,t,r){return this.x*e+this.y*t+this.z*r};var n=[new r(1,1,0),new r(-1,1,0),new r(1,-1,0),new r(-1,-1,0),new r(1,0,1),new r(-1,0,1),new r(1,0,-1),new r(-1,0,-1),new r(0,1,1),new r(0,-1,1),new r(0,1,-1),new r(0,-1,-1)],o=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],i=new Array(512),a=new Array(512);t.seed=function(e){e>0&&e<1&&(e*=65536),(e=Math.floor(e))<256&&(e|=e<<8);for(var t=0;t<256;t++){var r;r=1&t?o[t]^255&e:o[t]^e>>8&255,i[t]=i[t+256]=r,a[t]=a[t+256]=n[r%12]}},t.seed(0);var s=.5*(Math.sqrt(3)-1),h=(3-Math.sqrt(3))/6,d=1/6;function c(e){return e*e*e*(e*(6*e-15)+10)}function v(e,t,r){return(1-r)*e+r*t}t.simplex2=function(e,t){var r,n,o=(e+t)*s,d=Math.floor(e+o),c=Math.floor(t+o),v=(d+c)*h,l=e-d+v,u=t-c+v;l>u?(r=1,n=0):(r=0,n=1);var m=l-r+h,w=u-n+h,f=l-1+2*h,g=u-1+2*h,y=a[(d&=255)+i[c&=255]],p=a[d+r+i[c+n]],M=a[d+1+i[c+1]],E=.5-l*l-u*u,T=.5-m*m-w*w,R=.5-f*f-g*g;return 70*((E<0?0:(E*=E)*E*y.dot2(l,u))+(T<0?0:(T*=T)*T*p.dot2(m,w))+(R<0?0:(R*=R)*R*M.dot2(f,g)))},t.simplex3=function(e,t,r){var n,o,s,h,c,v,l=(e+t+r)*(1/3),u=Math.floor(e+l),m=Math.floor(t+l),w=Math.floor(r+l),f=(u+m+w)*d,g=e-u+f,y=t-m+f,p=r-w+f;g>=y?y>=p?(n=1,o=0,s=0,h=1,c=1,v=0):g>=p?(n=1,o=0,s=0,h=1,c=0,v=1):(n=0,o=0,s=1,h=1,c=0,v=1):y<p?(n=0,o=0,s=1,h=0,c=1,v=1):g<p?(n=0,o=1,s=0,h=0,c=1,v=1):(n=0,o=1,s=0,h=1,c=1,v=0);var M=g-n+d,E=y-o+d,T=p-s+d,R=g-h+2*d,x=y-c+2*d,z=p-v+2*d,H=g-1+.5,P=y-1+.5,q=p-1+.5,L=a[(u&=255)+i[(m&=255)+i[w&=255]]],S=a[u+n+i[m+o+i[w+s]]],A=a[u+h+i[m+c+i[w+v]]],C=a[u+1+i[m+1+i[w+1]]],V=.6-g*g-y*y-p*p,W=.6-M*M-E*E-T*T,F=.6-R*R-x*x-z*z,G=.6-H*H-P*P-q*q;return 32*((V<0?0:(V*=V)*V*L.dot3(g,y,p))+(W<0?0:(W*=W)*W*S.dot3(M,E,T))+(F<0?0:(F*=F)*F*A.dot3(R,x,z))+(G<0?0:(G*=G)*G*C.dot3(H,P,q)))},t.perlin2=function(e,t){var r=Math.floor(e),n=Math.floor(t);e-=r,t-=n;var o=a[(r&=255)+i[n&=255]].dot2(e,t),s=a[r+i[n+1]].dot2(e,t-1),h=a[r+1+i[n]].dot2(e-1,t),d=a[r+1+i[n+1]].dot2(e-1,t-1),l=c(e);return v(v(o,h,l),v(s,d,l),c(t))},t.perlin3=function(e,t,r){var n=Math.floor(e),o=Math.floor(t),s=Math.floor(r);e-=n,t-=o,r-=s;var h=a[(n&=255)+i[(o&=255)+i[s&=255]]].dot3(e,t,r),d=a[n+i[o+i[s+1]]].dot3(e,t,r-1),l=a[n+i[o+1+i[s]]].dot3(e,t-1,r),u=a[n+i[o+1+i[s+1]]].dot3(e,t-1,r-1),m=a[n+1+i[o+i[s]]].dot3(e-1,t,r),w=a[n+1+i[o+i[s+1]]].dot3(e-1,t,r-1),f=a[n+1+i[o+1+i[s]]].dot3(e-1,t-1,r),g=a[n+1+i[o+1+i[s+1]]].dot3(e-1,t-1,r-1),y=c(e),p=c(t),M=c(r);return v(v(v(h,m,y),v(d,w,y),M),v(v(l,f,y),v(u,g,y),M),p)}}(this);var canvas=document.querySelector("#scene"),width=canvas.offsetWidth,height=canvas.offsetHeight,renderer=new THREE.WebGLRenderer({canvas:canvas,antialias:!0});renderer.setPixelRatio(window.devicePixelRatio>1?2:1),renderer.setSize(width,height),renderer.setClearColor(0);var scene=new THREE.Scene,camera=new THREE.PerspectiveCamera(100,width/height,.1,1e4);camera.position.set(0,0,200);var light=new THREE.HemisphereLight(0,0,.6);scene.add(light),(light=new THREE.DirectionalLight(15856113,.5)).position.set(200,300,400),scene.add(light);var light2=light.clone();light2.position.set(-200,300,400),scene.add(light2);for(var geometry=new THREE.IcosahedronGeometry(120,4),i=0;i<geometry.vertices.length;i++){var vector=geometry.vertices[i];vector._o=vector.clone()}var material=new THREE.MeshPhongMaterial({emissive:0,emissiveIntensity:.4,shininess:0}),shape=new THREE.Mesh(geometry,material);function updateVertices(e){for(var t=0;t<geometry.vertices.length;t++){var r=geometry.vertices[t];r.copy(r._o);var n=.4*noise.simplex3(.006*r.x+2e-4*e,.006*r.y+3e-4*e,.006*r.z)*(mouse.y+.1)+.8;r.multiplyScalar(n)}geometry.verticesNeedUpdate=!0}function render(e){requestAnimationFrame(render),updateVertices(e),renderer.render(scene,camera)}function onResize(){canvas.style.width="",canvas.style.height="",width=canvas.offsetWidth,height=canvas.offsetHeight,camera.aspect=width/height,camera.updateProjectionMatrix(),renderer.setSize(width,height)}scene.add(shape);var resizeTm,mouse=new THREE.Vector2(.8,.5);function onMouseMove(e){TweenMax.to(mouse,.8,{y:e.clientY/height,x:e.clientX/width,ease:Power1.easeOut})}requestAnimationFrame(render),window.addEventListener("mousemove",onMouseMove),window.addEventListener("resize",function(){resizeTm=clearTimeout(resizeTm),resizeTm=setTimeout(onResize,200)});