Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <p class="f">Made with love by <a class="gradient" target="_blank"  href="https://twitter.com/JeremBoo">@jeremboo</a>
</p>
              
            
!

CSS

              
                body {
  margin : 0;
  padding : 0;
  overflow: hidden;
  background-color: white;
}

.f {
  color: #332626;
  font-family: 'Arial';
  font-size: 0.8em;
  position: fixed;
  top: 5px;
  right: 10px;
}

.f a {
  color: #FB6AAB;
}
              
            
!

JS

              
                !function(){"use strict";var e="undefined"==typeof window?global:window;if("function"!=typeof e.require){var t={},n={},o={},i={}.hasOwnProperty,r="components/",s=function(e,t){var n=0;t&&(0===t.indexOf(r)&&(n=r.length),t.indexOf("/",n)>0&&(t=t.substring(n,t.indexOf("/",n))));var i=o[e+"/index.js"]||o[t+"/deps/"+e+"/index.js"];return i?r+i.substring(0,i.length-".js".length):e},a=/^\.\.?(\/|$)/,l=function(e,t){for(var n,o=[],i=(a.test(t)?e+"/"+t:t).split("/"),r=0,s=i.length;s>r;r++)n=i[r],".."===n?o.pop():"."!==n&&""!==n&&o.push(n);return o.join("/")},c=function(e){return e.split("/").slice(0,-1).join("/")},u=function(t){return function(n){var o=l(c(t),n);return e.require(o,t)}},h=function(e,t){var o={id:e,exports:{}};return n[e]=o,t(o.exports,u(e),o),o.exports},d=function(e,o){var r=l(e,".");if(null==o&&(o="/"),r=s(e,o),i.call(n,r))return n[r].exports;if(i.call(t,r))return h(r,t[r]);var a=l(r,"./index");if(i.call(n,a))return n[a].exports;if(i.call(t,a))return h(a,t[a]);throw new Error('Cannot find module "'+e+'" from "'+o+'"')};d.alias=function(e,t){o[t]=e},d.register=d.define=function(e,n){if("object"==typeof e)for(var o in e)i.call(e,o)&&(t[o]=e[o]);else t[e]=n},d.list=function(){var e=[];for(var n in t)i.call(t,n)&&e.push(n);return e},d.brunch=!0,d._cache=n,e.require=d}}(),THREE.OrbitControls=function(e,t,n){function o(){return 2*Math.PI/60/60*f.autoRotateSpeed}function i(){return Math.pow(.95,f.zoomSpeed)}function r(e){if(f.enabled!==!1){if(e.preventDefault(),0===e.button){if(f.noRotate===!0)return;x=M.ROTATE,m.set(e.clientX,e.clientY)}else if(1===e.button){if(f.noZoom===!0)return;x=M.DOLLY,w.set(e.clientX,e.clientY)}else if(2===e.button){if(f.noPan===!0)return;x=M.PAN,b.set(e.clientX,e.clientY)}f.domElement.addEventListener("mousemove",s,!1),f.domElement.addEventListener("mouseup",a,!1)}}function s(e){if(f.enabled!==!1){e.preventDefault();var t=f.domElement===document?f.domElement.body:f.domElement;if(x===M.ROTATE){if(f.noRotate===!0)return;v.set(e.clientX,e.clientY),E.subVectors(v,m),f.rotateLeft(2*Math.PI*E.x/t.clientWidth*f.rotateSpeed),f.rotateUp(2*Math.PI*E.y/t.clientHeight*f.rotateSpeed),m.copy(v)}else if(x===M.DOLLY){if(f.noZoom===!0)return;O.set(e.clientX,e.clientY),T.subVectors(O,w),T.y>0?f.dollyIn():f.dollyOut(),w.copy(O)}else if(x===M.PAN){if(f.noPan===!0)return;y.set(e.clientX,e.clientY),g.subVectors(y,b),f.pan(g),b.copy(y)}f.update()}}function a(){f.enabled!==!1&&(f.domElement.removeEventListener("mousemove",s,!1),f.domElement.removeEventListener("mouseup",a,!1),x=M.NONE)}function l(e){if(f.enabled!==!1&&f.noZoom!==!0){var t=0;e.wheelDelta?t=e.wheelDelta:e.detail&&(t=-e.detail),t>0?f.dollyOut():f.dollyIn()}}function c(e){if(f.enabled!==!1&&f.noKeys!==!0&&f.noPan!==!0){var t=!1;switch(e.keyCode){case f.keys.UP:f.pan(new THREE.Vector2(0,f.keyPanSpeed)),t=!0;break;case f.keys.BOTTOM:f.pan(new THREE.Vector2(0,-f.keyPanSpeed)),t=!0;break;case f.keys.LEFT:f.pan(new THREE.Vector2(f.keyPanSpeed,0)),t=!0;break;case f.keys.RIGHT:f.pan(new THREE.Vector2(-f.keyPanSpeed,0)),t=!0}t&&f.update()}}function u(e){if(f.enabled!==!1)switch(e.touches.length){case 1:if(f.noRotate===!0)return;x=M.TOUCH_ROTATE,m.set(e.touches[0].pageX,e.touches[0].pageY);break;case 2:if(f.noZoom===!0)return;x=M.TOUCH_DOLLY;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,o=Math.sqrt(t*t+n*n);w.set(0,o);break;case 3:if(f.noPan===!0)return;x=M.TOUCH_PAN,b.set(e.touches[0].pageX,e.touches[0].pageY);break;default:x=M.NONE}}function h(e){if(f.enabled!==!1){e.preventDefault(),e.stopPropagation();var t=f.domElement===document?f.domElement.body:f.domElement;switch(e.touches.length){case 1:if(f.noRotate===!0)return;if(x!==M.TOUCH_ROTATE)return;v.set(e.touches[0].pageX,e.touches[0].pageY),E.subVectors(v,m),f.rotateLeft(2*Math.PI*E.x/t.clientWidth*f.rotateSpeed),f.rotateUp(2*Math.PI*E.y/t.clientHeight*f.rotateSpeed),m.copy(v);break;case 2:if(f.noZoom===!0)return;if(x!==M.TOUCH_DOLLY)return;var n=e.touches[0].pageX-e.touches[1].pageX,o=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(n*n+o*o);O.set(0,i),T.subVectors(O,w),T.y>0?f.dollyOut():f.dollyIn(),w.copy(O);break;case 3:if(f.noPan===!0)return;if(x!==M.TOUCH_PAN)return;y.set(e.touches[0].pageX,e.touches[0].pageY),g.subVectors(y,b),f.pan(g),b.copy(y);break;default:x=M.NONE}}}function d(){f.enabled!==!1&&(x=M.NONE)}this.object=e,this.domElement=void 0!==t?t:document,this.localElement=void 0!==n?n:document,this.enabled=!0,this.target=new THREE.Vector3,this.center=this.target,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.noRotate=!1,this.rotateSpeed=1,this.noPan=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.noKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};var f=this,p=1e-6,m=new THREE.Vector2,v=new THREE.Vector2,E=new THREE.Vector2,b=new THREE.Vector2,y=new THREE.Vector2,g=new THREE.Vector2,w=new THREE.Vector2,O=new THREE.Vector2,T=new THREE.Vector2,R=0,_=0,H=1,P=new THREE.Vector3,j=new THREE.Vector3,M={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},x=M.NONE,L={type:"change"};this.rotateLeft=function(e){void 0===e&&(e=o()),_-=e},this.rotateUp=function(e){void 0===e&&(e=o()),R-=e},this.panLeft=function(e){var t=new THREE.Vector3,n=this.object.matrix.elements;t.set(n[0],n[1],n[2]),t.multiplyScalar(-e),P.add(t)},this.panUp=function(e){var t=new THREE.Vector3,n=this.object.matrix.elements;t.set(n[4],n[5],n[6]),t.multiplyScalar(e),P.add(t)},this.pan=function(e){var t=f.domElement===document?f.domElement.body:f.domElement;if(void 0!==f.object.fov){var n=f.object.position,o=n.clone().sub(f.target),i=o.length();i*=Math.tan(f.object.fov/2*Math.PI/180),f.panLeft(2*e.x*i/t.clientHeight),f.panUp(2*e.y*i/t.clientHeight)}else void 0!==f.object.top?(f.panLeft(e.x*(f.object.right-f.object.left)/t.clientWidth),f.panUp(e.y*(f.object.top-f.object.bottom)/t.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.dollyIn=function(e){void 0===e&&(e=i()),H/=e},this.dollyOut=function(e){void 0===e&&(e=i()),H*=e},this.update=function(){var e=this.object.position,t=e.clone().sub(this.target),n=Math.atan2(t.x,t.z),i=Math.atan2(Math.sqrt(t.x*t.x+t.z*t.z),t.y);this.autoRotate&&this.rotateLeft(o()),n+=_,i+=R,i=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,i)),i=Math.max(p,Math.min(Math.PI-p,i));var r=t.length()*H;r=Math.max(this.minDistance,Math.min(this.maxDistance,r)),this.target.add(P),t.x=r*Math.sin(i)*Math.sin(n),t.y=r*Math.cos(i),t.z=r*Math.sin(i)*Math.cos(n),e.copy(this.target).add(t),this.object.lookAt(this.target),_=0,R=0,H=1,P.set(0,0,0),j.distanceTo(this.object.position)>0&&(this.dispatchEvent(L),j.copy(this.object.position))},this.domElement.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.localElement.addEventListener("mousedown",r,!1),this.domElement.addEventListener("mousewheel",l,!1),this.domElement.addEventListener("DOMMouseScroll",l,!1),this.domElement.addEventListener("keydown",c,!1),this.localElement.addEventListener("touchstart",u,!1),this.domElement.addEventListener("touchend",d,!1),this.domElement.addEventListener("touchmove",h,!1)},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,n,o){var i=this,r=new THREE.XHRLoader(i.manager);r.setCrossOrigin(this.crossOrigin),r.load(e,function(e){t(i.parse(e))},n,o)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){function t(e){var t=parseInt(e);return 3*(t>=0?t-1:t+d.length/3)}function n(e){var t=parseInt(e);return 3*(t>=0?t-1:t+f.length/3)}function o(e){var t=parseInt(e);return 2*(t>=0?t-1:t+p.length/2)}function i(e,t,n){c.vertices.push(d[e],d[e+1],d[e+2],d[t],d[t+1],d[t+2],d[n],d[n+1],d[n+2])}function r(e,t,n){c.normals.push(f[e],f[e+1],f[e+2],f[t],f[t+1],f[t+2],f[n],f[n+1],f[n+2])}function s(e,t,n){c.uvs.push(p[e],p[e+1],p[t],p[t+1],p[n],p[n+1])}function a(e,a,l,c,u,h,d,f,p,m,v,E){var b,y=t(e),g=t(a),w=t(l);void 0===c?i(y,g,w):(b=t(c),i(y,g,b),i(g,w,b)),void 0!==u&&(y=o(u),g=o(h),w=o(d),void 0===c?s(y,g,w):(b=o(f),s(y,g,b),s(g,w,b))),void 0!==p&&(y=n(p),g=n(m),w=n(v),void 0===c?r(y,g,w):(b=n(E),r(y,g,b),r(g,w,b)))}console.time("OBJLoader");var l,c,u,h=[];/^o /gm.test(e)===!1&&(c={vertices:[],normals:[],uvs:[]},u={name:""},l={name:"",geometry:c,material:u},h.push(l));for(var d=[],f=[],p=[],m=/v( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,v=/vn( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,E=/vt( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,b=/f( +-?\d+)( +-?\d+)( +-?\d+)( +-?\d+)?/,y=/f( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))?/,g=/f( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))?/,w=/f( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))?/,O=e.split("\n"),T=0;T<O.length;T++){var R=O[T];R=R.trim();var _;0!==R.length&&"#"!==R.charAt(0)&&(null!==(_=m.exec(R))?d.push(parseFloat(_[1]),parseFloat(_[2]),parseFloat(_[3])):null!==(_=v.exec(R))?f.push(parseFloat(_[1]),parseFloat(_[2]),parseFloat(_[3])):null!==(_=E.exec(R))?p.push(parseFloat(_[1]),parseFloat(_[2])):null!==(_=b.exec(R))?a(_[1],_[2],_[3],_[4]):null!==(_=y.exec(R))?a(_[2],_[5],_[8],_[11],_[3],_[6],_[9],_[12]):null!==(_=g.exec(R))?a(_[2],_[6],_[10],_[14],_[3],_[7],_[11],_[15],_[4],_[8],_[12],_[16]):null!==(_=w.exec(R))?a(_[2],_[5],_[8],_[11],void 0,void 0,void 0,void 0,_[3],_[6],_[9],_[12]):/^o /.test(R)?(c={vertices:[],normals:[],uvs:[]},u={name:""},l={name:R.substring(2).trim(),geometry:c,material:u},h.push(l)):/^g /.test(R)||(/^usemtl /.test(R)?u.name=R.substring(7).trim():/^mtllib /.test(R)||/^s /.test(R)))}for(var H=new THREE.Object3D,T=0,P=h.length;P>T;T++){l=h[T],c=l.geometry;var j=new THREE.BufferGeometry;j.addAttribute("position",new THREE.BufferAttribute(new Float32Array(c.vertices),3)),c.normals.length>0&&j.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c.normals),3)),c.uvs.length>0&&j.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(c.uvs),2)),u=new THREE.MeshLambertMaterial,u.name=l.material.name;var M=new THREE.Mesh(j,u);M.name=l.name,H.add(M)}return console.timeEnd("OBJLoader"),H}},require.register("js/components/Flower",function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t,n){for(var o=!0;o;){var i=e,r=t,s=n;o=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;return void 0===l?void 0:l.call(s)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=r,n=s,o=!0,a=c=void 0}},l=t("js/core/props"),c=(o(l),t("js/core/LoadingManager")),u=o(c),h=t("js/components/Pollen"),d=o(h),f=function(e){function t(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.numberOfPollen=3,this.material=new THREE.MeshLambertMaterial({color:16476843,shading:THREE.FlatShading}),this.flowerObject=!1,this.pollens=[],this._binds={},this._binds.onUpdate=this._onUpdate.bind(this)}return r(t,e),s(t,[{key:"init",value:function(e){var t=this;u["default"]._binds.load("http://jeremieboulay.fr/3d/flower.obj",function(n){t.flowerObject=n.children[0],t.flowerObject.scale.set(0,0,0),t.flowerObject.rotation.x=-1,t._traverseChilds(function(e){e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e.material=t.material}),t._createPollen(t.numberOfPollen),e()})}},{key:"_onUpdate",value:function(){var e=.03*(10-this.flowerObject.scale.x);.9>e&&(this.flowerObject.scale.x+=e,this.flowerObject.scale.y+=e,this.flowerObject.scale.z+=e);var t=.03*-this.flowerObject.rotation.x;.9>t&&(this.flowerObject.rotation.x+=t);for(var n=0;n<this.pollens.length;n++)this.pollens[n]._binds.onUpdate()}},{key:"_createPollen",value:function(e){var t=this;e-=1;var n=new d["default"];n.orientation(e),this.flowerObject.add(n.pollenMesh),this.pollens.push(n),e>0&&setTimeout(function(){t._createPollen(e)},200)}},{key:"_traverseChilds",value:function(e){this.flowerObject.traverse(function(t){t instanceof THREE.Mesh&&e(t)})}}]),t}(THREE.Object3D);n.exports=f}),require.register("js/components/Pollen",function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t,n){for(var o=!0;o;){var i=e,r=t,s=n;o=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;return void 0===l?void 0:l.call(s)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=r,n=s,o=!0,a=c=void 0}},l=t("js/core/props"),c=(o(l),function(e){function t(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.SCALE={x:.03,y:.03,z:.03},this.POZ={x:-.09,y:-.15,z:.275},this.segments=32,this.radiusSegment=32,this.size=.1,this.length=this.getRandomFloat(5,12),this.curve=this.getRandomFloat(1,3),this.curve=this.createCustomCurve(),this.pollenHeadPosition=this.curve.getPoints()[this.curve.getPoints().length-1],this.materialStem=new THREE.MeshPhongMaterial({color:7517794,specular:39168,shininess:30,shading:THREE.FlatShading}),this.pollenStemGeometry=new THREE.TubeGeometry(this.curve,this.segments,this.size,this.radiusSegment/2),this.pollenStemMesh=new THREE.Mesh(this.pollenStemGeometry,this.materialStem),this.materialHead=new THREE.MeshPhongMaterial({color:4274737,specular:10053698,shininess:30,shading:THREE.FlatShading}),this.pollenHeadGeometry=new THREE.SphereGeometry(5*this.size,this.radiusSegment,this.segment),this.pollenHeadMesh=new THREE.Mesh(this.pollenHeadGeometry,this.materialHead),this.pollenHeadMesh.position.set(this.pollenHeadPosition.x,this.pollenHeadPosition.y,this.pollenHeadPosition.z),this.pollenMesh=new THREE.Object3D,this.pollenMesh.add(this.pollenHeadMesh),this.pollenMesh.add(this.pollenStemMesh),this.pollenMesh.scale.set(0,0,0),this.pollenMesh.position.set(this.POZ.x,this.POZ.y,this.POZ.z),this.pollenMesh.rotation.x=-this.getRandomFloat(.5,1),this._binds={},this._binds.onUpdate=this._onUpdate.bind(this)}return r(t,e),s(t,[{key:"orientation",value:function(e){this.pollenMesh.rotation.y=.5-e/2}},{key:"_onUpdate",value:function(){var e=this.SCALE.x-this.pollenMesh.scale.x;if(e>.001){var t=this.pollenMesh.scale.x+.02*e;this.pollenMesh.scale.set(t,t,t)}}},{key:"createCustomCurve",value:function(){var e=THREE.Curve.create(function(e,t){this.curve=void 0===t?1:t,this.length=void 0===e?1:e},function(e){var t=0,n=Math.sin(e*this.curve),o=e*this.length;return new THREE.Vector3(t,n,o)});return new e(this.length,this.curve)}},{key:"getRandomFloat",value:function(e,t){return Math.random()*(t-e)+e}}]),t}(THREE.Object3D));n.exports=c}),require.register("js/components/Stem",function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=function(e,t,n){for(var o=!0;o;){var i=e,r=t,s=n;o=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;return void 0===l?void 0:l.call(s)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=r,n=s,o=!0,a=c=void 0}},l=t("js/core/props"),c=(o(l),function(e){function t(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.heightSegment=6,this.radiusSegment=10,this.currentFloor=1,this._a=0,this.material=new THREE.MeshLambertMaterial({color:1769741,wireframe:!0}),this.stemGeometry=new THREE.CylinderGeometry(.03,.08,5,this.radiusSegmen,this.heightSegment,!0),this.stemGeometry.vertices.map(function(e){e.y=0}),this.stemMesh=new THREE.Mesh(this.stemGeometry,this.material),this._binds={},this._binds.onUpdate=this._onUpdate.bind(this)}return r(t,e),s(t,[{key:"_onUpdate",value:function(){var e=.05;this.stemGeometry.verticesNeedUpdate=!0;for(var t=this.radiusSegment-1,n=0,o=0;o<this.stemGeometry.vertices.length-t*this.currentFloor;o++)this.stemGeometry.vertices[o].y+=e,n++;this.currentFloor>=0&&(this._a++,10==this._a&&this.currentFloor<=this.heightSegment&&(this._a=0,this.currentFloor++))}}]),t}(THREE.Object3D));n.exports=c}),require.register("js/core/LoadingManager",function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(){o(this,e),this._binds={},this._binds.load=this._load.bind(this),this._binds.loadWithMtl=this._loadWithMtl.bind(this)}return i(e,[{key:"_load",value:function(e,t){var n=new THREE.OBJLoader;n.load(e,function(e){t(e)},this._onProgress.bind(this),this._onError.bind(this))}},{key:"_loadWithMtl",value:function(e,t,n){var o=new THREE.OBJMTLLoader;o.load(e,t,function(e){n(e)},this._onProgress.bind(this),this._onError.bind(this))}},{key:"_onProgress",value:function(e){if(e.lengthComputable){var t=e.loaded/e.total*100;console.log(Math.round(t,2)+"% downloaded")}}},{key:"_onError",value:function(e){console.error("LoadingERROR : ",e)}},{key:"_onLoaded",value:function(e,t,n){console.log("Loaded : ",e,t,n)}}]),e}();n.exports=new r}),require.register("js/core/Loop",function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(){o(this,e),this._idRAF=-1,this._count=0,this._listeners=[],this._binds={},this._binds.update=this._update.bind(this)}return i(e,[{key:"_update",value:function(){for(var e=null,t=this._count;--t>=0;)e=this._listeners[t],e&&e.apply(this,null);this._idRAF=requestAnimationFrame(this._binds.update)}},{key:"start",value:function(){this._update()}},{key:"stop",value:function(){cancelAnimationFrame(this._idRAF)}},{key:"add",value:function(e){var t=this._listeners.indexOf(e);t>=0||(this._listeners.push(e),this._count++)}},{key:"remove",value:function(e){var t=this._listeners.indexOf(e);0>t||(this._listeners.splice(t,1),this._count--)}}]),e}();n.exports=new r}),require.register("js/core/Webgl",function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=t("js/core/props"),a=(o(s),function(){function e(){i(this,e),this.width=window.innerWidth,this.height=window.innerHeight,this.scene=new THREE.Scene,this.camera=new THREE.PerspectiveCamera(50,0,1,1e3),this.camera.position.z=20,this.controls=new THREE.OrbitControls(this.camera),this.renderer=new THREE.WebGLRenderer({antialias:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setClearColor(13361383),this.dom=this.renderer.domElement,this.usePostprocessing=!1,this.initPostprocessing(),this._binds={},this._binds.onUpdate=this._onUpdate.bind(this),this._binds.onResize=this._onResize.bind(this)}return r(e,[{key:"init",value:function(){window.addEventListener("orientationchange",this._binds.onResize,!1),this._onResize()}},{key:"initPostprocessing",value:function(){this.usePostprocessing&&(this.vignettePass=new WAGNER.VignettePass,this.fxaaPass=new WAGNER.FXAAPass)}},{key:"add",value:function(e){this.scene.add(e)}},{key:"_onUpdate",value:function(){this.usePostprocessing?(this.composer.reset(),this.composer.renderer.clear(),this.composer.render(this.scene,this.camera),this.composer.pass(this.fxaaPass),this.composer.toScreen()):(this.renderer.autoClear=!1,this.renderer.clear(),this.renderer.render(this.scene,this.camera))}},{key:"_onResize",value:function(){var e=window.innerWidth,t=window.innerHeight;this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t)}}]),e}());n.exports=new a}),require.register("js/core/props",function(e,t,n){"use strict";var o={zoom:10};n.exports=o}),require.register("main",function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var i=t("js/core/Webgl"),r=o(i),s=t("js/core/Loop"),a=o(s),l=t("js/core/props"),c=(o(l),t("js/components/Flower")),u=o(c);r["default"].init(),document.body.appendChild(r["default"].dom),a["default"].add(r["default"]._binds.onUpdate);var h=new THREE.PointLight(16777215,1,100);h.position.set(1,10,10),r["default"].add(h);var d=new u["default"];d.init(function(){r["default"].add(d.flowerObject),a["default"].add(d._binds.onUpdate)}),a["default"].start(),window.addEventListener("resize",function(){r["default"]._binds.onResize()},!1)});
require('main');
              
            
!
999px

Console