Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

Auto Save

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <canvas id="canvas"></canvas>

<div id="tag" class="before">
	<h1>HAIR</h1>
	<p>Inspired by
		<a target="_blank" href="https://twitter.com/soulwire">Soulwire's</a>
		<a target="_blank" href="https://soulwire.co.uk/experiments/muscular-hydrostats/">Muscular Hydrostats</a></p>
	<ul>
		<li><a href="https://github.com/MathiasPaumgarten/hair">Github</a></li>
	</ul>
	<span>by <a href="http://mathias-paumgarten.com">Mathias Paumgarten</a></span>
</div>
              
            
!

CSS

              
                @import "compass/css3";

@import url( https://fonts.googleapis.com/css?family=Quicksand );
@import "compass";

html, body {
	padding: 0;
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

body {
	@include background( radial-gradient( #d45656, #c23131 100% ) );
}

canvas {
	width: 100%;
	height: 100%;
}

#tag.before {
	width: 0;
	left: 0;
	padding: 15px 0 0 0;

	h1, p, ul, span {
		opacity: 0;
		@include transform( translate3d( -50px, 0, 0 ) );
	}

}

#tag.in {
	width: 220px;
}

#tag {
	@include single-transition( all, 0.3s, cubic-bezier( 0.8, 0, 0.2, 1 ) );

	position: fixed;
	width: 180px;
	height: 180px;
	top: 20px;
	left: 20px;
	font-family: "Quicksand", sans-serif;
	padding: 15px 0 0 20px;
	background-color: #000;
	color: #fff;

	h1, p, ul, span {
		opacity: 1;
		@include transform( translate3d( 0, 0, 0 ) );
	}

	h1 {
		@include single-transition( all, 0.3s, ease-in-out, 0.3s );
		font-size: 30px;
		font-weight: 400;
		margin: 0;
	}

	p {
		@include single-transition( all, 0.3s, ease-in-out, 0.4s );
	}

	ul {
		@include single-transition( all, 0.3s, ease-in-out, 0.6s );
	}

	p , ul a {
		font-size: 12px;
		font-weight: 700;
	}

	a {
		color: white;
		text-decoration: none;
	}

	a:hover {
		background-color: #333;
		color: white;
		border-bottom: 1px solid #d45656;
	}

	span {
		@include single-transition( all, 0.3s, ease-in-out, 0.7s );

		display: inline-block;
		margin-top: 20px;
		font-size: 10px;
	}

	ul {
		list-style: none;
		margin: 0;
		padding: 0;
	}
}
              
            
!

JS

              
                /*
 * Sorry for the compiled code. The original uses AMD and can be
 * found on Github: https://github.com/MathiasPaumgarten/hair
 */


var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n<e.length;n+=1)if(e[n]&&t(e[n],n,e))break}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1;n-=1)if(e[n]&&t(e[n],n,e))break}}function hasProp(e,t){return hasOwn.call(e,t)}function eachProp(e,t){var n;for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){if(n||!hasProp(e,i))r&&typeof t!="string"?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeContextModuleFunc(e,t,n){return function(){var r=aps.call(arguments,0),i;return n&&isFunction(i=r[r.length-1])&&(i.__requireJsBuild=!0),r.push(t),e.apply(null,r)}}function addRequireMethods(e,t,n){each([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(r){var i=r[1]||r[0];e[r[0]]=t?makeContextModuleFunc(t[i],n):function(){var e=contexts[defContextName];return e[i].apply(e,arguments)}})}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function v(e){var t,n;for(t=0;e[t];t+=1){n=e[t];if(n===".")e.splice(t,1),t-=1;else if(n===".."){if(t===1&&(e[2]===".."||e[0]===".."))break;t>0&&(e.splice(t-1,2),t-=2)}}}function m(e,t,n){var r,i,s,u,a,f,l,c,h,p,d,m=t&&t.split("/"),g=m,y=o.map,b=y&&y["*"];e&&e.charAt(0)==="."&&(t?(o.pkgs[t]?g=m=[t]:g=m.slice(0,m.length-1),e=g.concat(e.split("/")),v(e),i=o.pkgs[r=e[0]],e=e.join("/"),i&&e===r+"/"+i.main&&(e=r)):e.indexOf("./")===0&&(e=e.substring(2)));if(n&&(m||b)&&y){u=e.split("/");for(a=u.length;a>0;a-=1){l=u.slice(0,a).join("/");if(m)for(f=m.length;f>0;f-=1){s=y[m.slice(0,f).join("/")];if(s){s=s[l];if(s){c=s,h=a;break}}}if(c)break;!p&&b&&b[l]&&(p=b[l],d=a)}!c&&p&&(c=p,h=d),c&&(u.splice(0,h,c),e=u.join("/"))}return e}function g(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===r.contextName)return t.parentNode.removeChild(t),!0})}function y(e){var t=o.paths[e];if(t&&isArray(t)&&t.length>1)return g(e),t.shift(),r.undef(e),r.require([e]),!0}function b(e,t,n,i){var s,o,u,a=e?e.indexOf("!"):-1,f=null,c=t?t.name:null,d=e,v=!0,g="";return e||(v=!1,e="_@r"+(h+=1)),a!==-1&&(f=e.substring(0,a),e=e.substring(a+1,e.length)),f&&(f=m(f,c,i),o=l[f]),e&&(f?o&&o.normalize?g=o.normalize(e,function(e){return m(e,c,i)}):g=m(e,c,i):(g=m(e,c,i),s=r.nameToUrl(g))),u=f&&!o&&!n?"_unnormalized"+(p+=1):"",{prefix:f,name:g,parentMap:t,unnormalized:!!u,url:s,originalName:d,isDefine:v,id:(f?f+"!"+g:g)+u}}function w(e){var t=e.id,n=u[t];return n||(n=u[t]=new r.Module(e)),n}function E(e,t,n){var r=e.id,i=u[r];hasProp(l,r)&&(!i||i.defineEmitComplete)?t==="defined"&&n(l[r]):w(e).on(t,n)}function S(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=u[t];n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function x(){globalDefQueue.length&&(apsp.apply(f,[f.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function T(e,t,n){var i=e&&e.map,s=makeContextModuleFunc(n||r.require,i,t);return addRequireMethods(s,r,i),s.isBrowser=isBrowser,s}function N(e){delete u[e],each(d,function(t,n){if(t.map.id===e)return d.splice(n,1),t.defined||(r.waitCount-=1),!0})}function C(e,t){var n=e.map.id,r=e.depMaps,i;if(!e.inited)return;return t[n]?e:(t[n]=!0,each(r,function(e){var r=e.id,s=u[r];if(!s)return;return!s.inited||!s.enabled?(i=null,delete t[n],!0):i=C(s,mixin({},t))}),i)}function k(e,t,n){var r=e.map.id,s=e.depMaps;if(!e.inited||!e.map.isDefine)return;return t[r]?l[r]:(t[r]=e,each(s,function(s){var o=s.id,a=u[o],f;if(i[o])return;if(a){if(!a.inited||!a.enabled){n[r]=!0;return}f=k(a,t,n),n[o]||e.defineDepById(o,f)}}),e.check(!0),l[r])}function L(e){e.check()}function A(){var e,n,i,a,f=o.waitSeconds*1e3,l=f&&r.startTime+f<(new Date).getTime(),c=[],h=!1,p=!0;if(t)return;t=!0,eachProp(u,function(t){e=t.map,n=e.id;if(!t.enabled)return;if(!t.error)if(!t.inited&&l)y(n)?(a=!0,h=!0):(c.push(n),g(n));else if(!t.inited&&t.fetched&&e.isDefine){h=!0;if(!e.prefix)return p=!1}});if(l&&c.length)return i=makeError("timeout","Load timeout for modules: "+c,null,c),i.contextName=r.contextName,S(i);p&&(each(d,function(e){if(e.defined)return;var t=C(e,{}),n={};t&&(k(t,n,{}),eachProp(n,L))}),eachProp(u,L)),(!l||a)&&h&&(isBrowser||isWebWorker)&&!s&&(s=setTimeout(function(){s=0,A()},50)),t=!1}function O(e){w(b(e[0],null,!0)).init(e[1],e[2])}function M(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function _(e){var t=e.currentTarget||e.srcElement;return M(t,r.onScriptLoad,"load","onreadystatechange"),M(t,r.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}var t,n,r,i,s,o={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},u={},a={},f=[],l={},c={},h=1,p=1,d=[];return i={require:function(e){return T(e)},exports:function(e){e.usingExports=!0;if(e.map.isDefine)return e.exports=l[e.map.id]={}},module:function(e){return e.module={id:e.map.id,uri:e.map.url,config:function(){return o.config&&o.config[e.map.id]||{}},exports:l[e.map.id]}}},n=function(e){this.events=a[e.id]||{},this.map=e,this.shim=o.shim[e.id],this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},n.prototype={init:function(e,t,n,r){r=r||{};if(this.inited)return;this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.depMaps.rjsSkipMap=e.rjsSkipMap,this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check()},defineDepById:function(e,t){var n;return each(this.depMaps,function(t,r){if(t.id===e)return n=r,!0}),this.defineDep(n,t)},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(this.fetched)return;this.fetched=!0,r.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();T(this,!0)(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))},load:function(){var e=this.map.url;c[e]||(c[e]=!0,r.load(this.map.id,e))},check:function(e){if(!this.enabled||this.enabling)return;var t,n,i=this.map.id,s=this.depExports,o=this.exports,a=this.factory;if(!this.inited)this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(isFunction(a)){if(this.events.error)try{o=r.execCb(i,a,s,o)}catch(f){t=f}else o=r.execCb(i,a,s,o);this.map.isDefine&&(n=this.module,n&&n.exports!==undefined&&n.exports!==this.exports?o=n.exports:o===undefined&&this.usingExports&&(o=this.exports));if(t)return t.requireMap=this.map,t.requireModules=[this.map.id],t.requireType="define",S(this.error=t)}else o=a;this.exports=o,this.map.isDefine&&!this.ignore&&(l[i]=o,req.onResourceLoad&&req.onResourceLoad(r,this.map,this.depMaps)),delete u[i],this.defined=!0,r.waitCount-=1,r.waitCount===0&&(d=[])}this.defining=!1,e||this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}},callPlugin:function(){var e=this.map,t=e.id,n=b(e.prefix,null,!1,!0);E(n,"defined",bind(this,function(n){var i,s,a,f=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){n.normalize&&(f=n.normalize(f,function(e){return m(e,l,!0)})||""),s=b(e.prefix+"!"+f,this.map.parentMap,!1,!0),E(s,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),a=u[s.id],a&&(this.events.error&&a.on("error",bind(this,function(e){this.emit("error",e)})),a.enable());return}i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(u,function(e){e.map.id.indexOf(t+"_unnormalized")===0&&N(e.map.id)}),S(e)}),i.fromText=function(e,t){var n=useInteractive;n&&(useInteractive=!1),w(b(e)),req.exec(t),n&&(useInteractive=!0),r.completeLoad(e)},n.load(e.name,T(e.parentMap,!0,function(e,t,n){return e.rjsSkipMap=!0,r.require(e,t,n)}),i,o)})),r.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){this.enabled=!0,this.waitPushed||(d.push(this),r.waitCount+=1,this.waitPushed=!0),this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,s,o;if(typeof e=="string"){e=b(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.depMaps.rjsSkipMap),this.depMaps[t]=e,o=i[e.id];if(o){this.depExports[t]=o(this);return}this.depCount+=1,E(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&E(e,"error",this.errback)}n=e.id,s=u[n],!i[n]&&s&&!s.enabled&&r.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=u[e.id];t&&!t.enabled&&r.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e==="error"&&delete this.events[e]}},r={config:o,contextName:e,registry:u,defined:l,urlFetched:c,waitCount:0,defQueue:f,Module:n,makeModuleMap:b,configure:function(e){e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/");var t=o.pkgs,n=o.shim,i=o.paths,s=o.map;mixin(o,e,!0),o.paths=mixin(i,e.paths,!0),e.map&&(o.map=mixin(s||{},e.map,!0,!0)),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),e.exports&&!e.exports.__buildReady&&(e.exports=r.makeShimExports(e.exports)),n[t]=e}),o.shim=n),e.packages&&(each(e.packages,function(e){var n;e=typeof e=="string"?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),o.pkgs=t),eachProp(u,function(e,t){!e.inited&&!e.map.unnormalized&&(e.map=b(t))}),(e.deps||e.callback)&&r.require(e.deps||[],e.callback)},makeShimExports:function(e){var t;return typeof e=="string"?(t=function(){return getGlobal(e)},t.exports=e,t):function(){return e.apply(global,arguments)}},requireDefined:function(e,t){return hasProp(l,b(e,t,!1,!0).id)},requireSpecified:function(e,t){return e=b(e,t,!1,!0).id,hasProp(l,e)||hasProp(u,e)},require:function(t,n,i,s){var o,u,a,c,h;if(typeof t=="string")return isFunction(n)?S(makeError("requireargs","Invalid require call"),i):req.get?req.get(r,t,n):(o=t,s=n,a=b(o,s,!1,!0),u=a.id,hasProp(l,u)?l[u]:S(makeError("notloaded",'Module name "'+u+'" has not been loaded yet for context: '+e)));i&&!isFunction(i)&&(s=i,i=undefined),n&&!isFunction(n)&&(s=n,n=undefined),x();while(f.length){h=f.shift();if(h[0]===null)return S(makeError("mismatch","Mismatched anonymous define() module: "+h[h.length-1]));O(h)}return c=w(b(null,s)),c.init(t,n,i,{enabled:!0}),A(),r.require},undef:function(e){x();var t=b(e,null,!0),n=u[e];delete l[e],delete c[t.url],delete a[e],n&&(n.events.defined&&(a[e]=n.events),N(e))},enable:function(e,t){var n=u[e.id];n&&w(e).enable()},completeLoad:function(e){var t,n,r,i=o.shim[e]||{},s=i.exports&&i.exports.exports;x();while(f.length){n=f.shift();if(n[0]===null){n[0]=e;if(t)break;t=!0}else n[0]===e&&(t=!0);O(n)}r=u[e];if(!t&&!l[e]&&r&&!r.inited){if(o.enforceDefine&&(!s||!getGlobal(s))){if(y(e))return;return S(makeError("nodefine","No define call for "+e,null,[e]))}O([e,i.deps||[],i.exports])}A()},toUrl:function(e,t){var n=e.lastIndexOf("."),i=null;return n!==-1&&(i=e.substring(n,e.length),e=e.substring(0,n)),r.nameToUrl(m(e,t&&t.id,!0),i)},nameToUrl:function(e,t){var n,r,i,s,u,a,f,l,c;if(req.jsExtRegExp.test(e))l=e+(t||"");else{n=o.paths,r=o.pkgs,u=e.split("/");for(a=u.length;a>0;a-=1){f=u.slice(0,a).join("/"),i=r[f],c=n[f];if(c){isArray(c)&&(c=c[0]),u.splice(0,a,c);break}if(i){e===i.name?s=i.location+"/"+i.main:s=i.location,u.splice(0,a,s);break}}l=u.join("/"),l+=t||(/\?/.test(l)?"":".js"),l=(l.charAt(0)==="/"||l.match(/^[\w\+\.\-]+:/)?"":o.baseUrl)+l}return o.urlArgs?l+((l.indexOf("?")===-1?"?":"&")+o.urlArgs):l},load:function(e,t){req.load(r,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=_(e);r.completeLoad(t.id)}},onScriptError:function(e){var t=_(e);if(!y(t.id))return S(makeError("scripterror","Script error",e,[t.id]))}}}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState==="interactive")return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.0.5",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,aps=ap.slice,apsp=ap.splice,isBrowser=typeof window!="undefined"&&!!navigator&&!!document,isWebWorker=!isBrowser&&typeof importScripts!="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(typeof define!="undefined")return;if(typeof requirejs!="undefined"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=undefined}typeof require!="undefined"&&!isFunction(require)&&(cfg=require,require=undefined),req=requirejs=function(e,t,n,r){var i,s,o=defContextName;return!isArray(e)&&typeof e!="string"&&(s=e,isArray(t)?(e=t,t=n,n=r):e=[]),s&&s.context&&(o=s.context),i=contexts[o],i||(i=contexts[o]=req.s.newContext(o)),s&&i.configure(s),i.require(e,t,n)},req.config=function(e){return req(e)},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),addRequireMethods(req),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=function(e){throw e},req.load=function(e,t,n){var r=e&&e.config||{},i;if(isBrowser)return i=r.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),i.type=r.scriptType||"text/javascript",i.charset="utf-8",i.async=!0,i.setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)):(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)),i.src=n,currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;isWebWorker&&(importScripts(n),e.completeLoad(t))},isBrowser&&eachReverse(scripts(),function(e){head||(head=e.parentNode),dataMain=e.getAttribute("data-main");if(dataMain)return cfg.baseUrl||(src=dataMain.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath,dataMain=mainScript),dataMain=dataMain.replace(jsSuffixRegExp,""),cfg.deps=cfg.deps?cfg.deps.concat(dataMain):[dataMain],!0}),define=function(e,t,n){var r,i;typeof e!="string"&&(n=t,t=e,e=null),isArray(t)||(n=t,t=[]),!t.length&&isFunction(n)&&n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t)),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this),define("requireJS",function(){}),define("suds/oop/Class",[],function(){var e=!1,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,n=function(){};return n.extend=function(n){function o(){!e&&this.initialize&&this.initialize.apply(this,arguments)}var r=this.prototype;e=!0;var i=new this;e=!1;for(var s in n)i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);return this._super=n,i}}(s,n[s]):n[s];return o.prototype=i,o.prototype.constructor=o,o.extend=arguments.callee,o},n}),define("suds/events/Dispatcher",["suds/oop/Class"],function(e){"use strict";var t=e.extend({listeners:null,initialize:function(){this.listeners=[]},addListener:function(e,t){this.removeListener(e,t),this.listeners.push({name:e,closure:t})},removeListener:function(e,t){var n,r=0,i=this.listeners.length;for(;r<i;r++)n=this.listeners[r],n.name===e&&n.closure===t&&(this.listeners.splice(r,1),r--,i--)},dispatch:function(e,t){var n,r=0,i=this.listeners.length;for(;r<i;r++){n=this.listeners[r];if(!n)continue;n.name===e&&n.closure.call(null,t)}},hasListenerFor:function(e){var t,n=0,r=this.listeners.length;for(;n<r;n++)if(this.listeners[n].name===e)return!0;return!1},hasListeners:function(){return this.listeners.length>0},removeAllListeners:function(){this.listeners=[]}});return t}),define("suds/patches/function.bind",[],function(){return typeof Function.prototype.bind!="function"&&(Function.prototype.bind=function(e){var t=this;return function(){t.apply(e,arguments)}}),!0}),define("suds/events/Interval",["suds/events/Dispatcher","suds/patches/function.bind"],function(e){var t="FRAME",n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),r=e.extend({FRAME:t,initialize:function(){this._super(),this.loop()},loop:function(){this.dispatch(t),n(this.loop.bind(this))}}),i=new r;return i.FRAME=t,i}),define("suds/helpers/MouseHelper",["suds/events/Dispatcher","suds/events/Interval"],function(e,t){var n={},r=new e,i=-1,s=-1;n.x=-1,n.y=-1,n.startTracking=function(){window.addEventListener("mousemove",o)},n.stopTracking=function(){window.removeEventListener("mousemove",o),n.x=-1,n.y=-1},n.addListener=function(e,i){e===n.MOUSE_MOVE&&(n.startTracking(),t.addListener(t.FRAME,u)),r.addListener(e,i)},n.removeListener=function(e,i){r.removeListener(e,i);var s=!1;for(var o=0;o<dispachter.listeners.length;o++)dispachter.listeners[o].name===n.MOUSE_MOVE&&(s=!0);s===!1&&(n.stopTracking(),t.removeListener(t.FRAME,u))};var o=function(e){n.x=e.clientX,n.y=e.clientY},u=function(e){(n.x!==i||n.y!==s)&&r.dispatch(n.MOUSE_MOVE),i=n.x,s=n.y};return n.MOUSE_MOVE="MouseHelper.MOUSE_MOVE",n}),define("suds/math/Point",["suds/oop/Class"],function(e){var t=e.extend({x:0,y:0,initialize:function(e,t){this.x=e||0,this.y=t||0},add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this},multiply:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e,this.y/=e,this},clone:function(){return new t(this.x,this.y)},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divide(this.length())},set:function(e){return this.x=e.x,this.y=e.y,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.x*t-this.y*n,i=this.y*t+this.x*n;return this.x=r,this.y=i,this},flip:function(){return this.x*=-1,this.y*=-1,this}});return t.subtract=function(e,t){return e.clone().subtract(t)},t.add=function(e,t){return e.clone().add(t)},t.distance=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},t.between=function(e,n){return new t(n.x-e.x,n.y-e.y)},t}),define("suds/math/Bezier",["suds/oop/Class","suds/math/Point"],function(e,t){var n=e.extend({anchors:null,time:0,speed:.1,pixels:null,x:null,y:null,pixelBased:!1,initialize:function(e,t,n){this.anchors=[],this.pixelBased=typeof t=="undefined"?!1:!!t,this.accuracy=typeof n=="undefined"?10:n,this.time=0,this.speed=e||.1,this.pixels=this.speed},addAnchor:function(e){this.anchors.push(e);if(this.pixelBased){var n=this.time,r=0,i=this.accuracy,s=0,o,u;for(;r<i;r++){this.time=r/i,this.calculate();if(r===0){o=new t(this.x,this.y);continue}u=o,u=new t(this.x,this.y),s+=t.distance(o,u)}this.time=n,this.speed=Math.min(1,this.pixels/s)}},update:function(){this.time+=this.speed,this.time>1&&(this.time=1),this.calculate()},calculate:function(){var e=this.time,t=this.anchors.length,n=[],r,i;for(r=0;r<t;r++)n[r]={x:this.anchors[r].x,y:this.anchors[r].y};for(i=1;i<t;++i)for(r=0;r<t-i;++r)n[r].x=(1-e)*n[r].x+e*n[~~(r+1)].x,n[r].y=(1-e)*n[r].y+e*n[~~(r+1)].y;this.x=n[0].x,this.y=n[0].y},isComplete:function(){return this.time>=1},setPercent:function(e){this.time=e,this.calculate()}});return n}),define("suds/ui/Motion",["suds/oop/Class","suds/math/Point","suds/math/Bezier"],function(e,t,n){var r=e.extend({pointA:null,pointB:null,pointC:null,pointAB:null,pointBC:null,speed:.1,radius:10,initialize:function(e,t,r){this.radius=e||this.radius,this.speed=t||this.speed,this.accuracy=r||10,this.bezier=new n(this.speed,!0,this.accuracy),this.pointA=this.getRandomPoint(),this.pointB=this.getRandomPoint(),this.pointC=this.getRandomPoint(),this.pointAB=this.getMiddle(this.pointA,this.pointB),this.pointBC=this.getMiddle(this.pointB,this.pointC),this.bezier.addAnchor(this.pointAB),this.bezier.addAnchor(this.pointB),this.bezier.addAnchor(this.pointBC)},update:function(){if(this.bezier.isComplete()){this.bezier=new n(this.speed,!0,this.accuracy),this.bezier.addAnchor(this.pointBC),this.bezier.addAnchor(this.pointC),this.pointA=this.pointB,this.pointB=this.pointC,this.pointC=this.getRandomPoint(),this.pointAB=this.pointBC,this.pointBC=this.getMiddle(this.pointB,this.pointC),this.bezier.addAnchor(this.pointBC),this.bezier.calculate();return}this.bezier.update()},getRandomPoint:function(){var e=Math.random()*Math.PI*2;return new t(Math.cos(e)*(.1+Math.random()*.9)*this.radius,Math.sin(e)*(.1+Math.random()*.9)*this.radius)},getMiddle:function(e,n){return t.add(e,n).divide(2)},getX:function(){return this.bezier.x},getY:function(){return this.bezier.y},getPosition:function(){return new t(this.bezier.x,this.bezier.y)}});return r}),define("dat/utils/css",[],function(){return{load:function(e,t){t=t||document;var n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)},inject:function(e,t){t=t||document;var n=document.createElement("style");n.type="text/css",n.innerHTML=e,t.getElementsByTagName("head")[0].appendChild(n)}}}),function(){var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],t=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,n=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,r=typeof location!="undefined"&&location.href,i=r&&location.protocol&&location.protocol.replace(/\:/,""),s=r&&location.hostname,o=r&&(location.port||undefined),u=[];define("text",[],function(){var a,f,l;return typeof window!="undefined"&&window.navigator&&window.document?f=function(e,t){var n=a.createXhr();n.open("GET",e,!0),n.onreadystatechange=function(e){n.readyState===4&&t(n.responseText)},n.send(null)}:typeof process!="undefined"&&process.versions&&!!process.versions.node?(l=require.nodeRequire("fs"),f=function(e,t){t(l.readFileSync(e,"utf8"))}):typeof Packages!="undefined"&&(f=function(e,t){var n="utf-8",r=new java.io.File(e),i=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r),n)),o,u,a="";try{o=new java.lang.StringBuffer,u=s.readLine(),u&&u.length()&&u.charAt(0)===65279&&(u=u.substring(1)),o.append(u);while((u=s.readLine())!==null)o.append(i),o.append(u);a=String(o.toString())}finally{s.close()}t(a)}),a={version:"1.0.0",strip:function(e){if(e){e=e.replace(t,"");var r=e.match(n);r&&(e=r[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var t,n,r;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;for(n=0;n<3;n++){r=e[n];try{t=new ActiveXObject(r)}catch(i){}if(t){e=[r];break}}if(!t)throw new Error("createXhr(): XMLHttpRequest not available");return t},get:f,parseName:function(e){var t=!1,n=e.indexOf("."),r=e.substring(0,n),i=e.substring(n+1,e.length);return n=i.indexOf("!"),n!==-1&&(t=i.substring(n+1,i.length),t=t==="strip",i=i.substring(0,n)),{moduleName:r,ext:i,strip:t}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,t,n,r){var i=a.xdRegExp.exec(e),s,o,u;return i?(s=i[2],o=i[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===t)&&(!o||o===n)&&(!u&&!o||u===r)):!0},finishLoad:function(e,t,n,r,i){n=t?a.strip(n):n,i.isBuild&&i.inlineText&&(u[e]=n),r(n)},load:function(e,t,n,u){var f=a.parseName(e),l=f.moduleName+"."+f.ext,c=t.toUrl(l),h=u&&u.text&&u.text.useXhr||a.useXhr;!r||h(c,i,s,o)?a.get(c,function(t){a.finishLoad(e,f.strip,t,n,u)}):t([l],function(e){a.finishLoad(f.moduleName+"."+f.ext,f.strip,e,n,u)})},write:function(e,t,n,r){if(t in u){var i=a.jsEscape(u[t]);n.asModule(e+"!"+t,"define(function () { return '"+i+"';});\n")}},writeFile:function(e,t,n,r,i){var s=a.parseName(t),o=s.moduleName+"."+s.ext,u=n.toUrl(s.moduleName+"."+s.ext)+".js";a.load(o,n,function(t){var n=function(e){return r(u,e)};n.asModule=function(e,t){return r.asModule(e,u,t)},a.write(e,o,n,i)},i)}},a})}(),define("text!dat/gui/saveDialogue.html",[],function(){return'<div id="dg-save" class="dg dialogue">\r\n\r\n  Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\r\n\r\n  <textarea id="dg-new-constructor"></textarea>\r\n\r\n  <div id="dg-save-locally">\r\n\r\n    <input id="dg-local-storage" type="checkbox"/> Automatically save\r\n    values to <code>localStorage</code> on exit.\r\n\r\n    <div id="dg-local-explain">The values saved to <code>localStorage</code> will\r\n      override those passed to <code>dat.GUI</code>\'s constructor. This makes it\r\n      easier to work incrementally, but <code>localStorage</code> is fragile,\r\n      and your friends may not see the same values you do.\r\n      \r\n    </div>\r\n    \r\n  </div>\r\n\r\n</div>'}),define("text!dat/gui/style.css",[],function(){return"/**\r\n * dat-gui JavaScript Controller Library\r\n * https://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\n.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\r\n"}),define("dat/utils/common",[],function(){var e=Array.prototype.forEach,t=Array.prototype.slice;return{BREAK:{},extend:function(e){return t
              
            
!
999px
Learning 3D transforms in CSS requires a little perspective.

Console