").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/public/themes/the great wave/js/parallax.min.js b/public/themes/the great wave/js/parallax.min.js
new file mode 100644
index 0000000..48b368c
--- /dev/null
+++ b/public/themes/the great wave/js/parallax.min.js
@@ -0,0 +1,2 @@
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Parallax=t()}}(function(){return function t(e,i,n){function o(r,a){if(!i[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);var h=new Error("Cannot find module '"+r+"'");throw h.code="MODULE_NOT_FOUND",h}var u=i[r]={exports:{}};e[r][0].call(u.exports,function(t){var i=e[r][1][t];return o(i||t)},u,u.exports,t,e,i,n)}return i[r].exports}for(var s="function"==typeof require&&require,r=0;r
1)for(var i=1;ii?i:t:te?e:t},data:function(t,e){return a.deserialize(t.getAttribute("data-"+e))},deserialize:function(t){return"true"===t||"false"!==t&&("null"===t?null:!isNaN(parseFloat(t))&&isFinite(t)?parseFloat(t):t)},camelCase:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},accelerate:function(t){a.css(t,"transform","translate3d(0,0,0) rotate(0.0001deg)"),a.css(t,"transform-style","preserve-3d"),a.css(t,"backface-visibility","hidden")},transformSupport:function(t){for(var e=document.createElement("div"),i=!1,n=null,o=!1,s=null,r=null,l=0,h=a.vendors.length;l0&&"none"!==n,c.style.overflow=d,u.removeChild(e),m&&(u.removeAttribute("style"),u.parentNode.removeChild(u))}}return o},css:function(t,e,i){var n=a.propertyCache[e];if(!n)for(var o=0,s=a.vendors.length;othis.calibrationThreshold||Math.abs(e)>this.calibrationThreshold)&&this.queueCalibration(0),this.portrait?(this.motionX=this.calibrateX?e:this.inputY,this.motionY=this.calibrateY?t:this.inputX):(this.motionX=this.calibrateX?t:this.inputX,this.motionY=this.calibrateY?e:this.inputY),this.motionX*=this.elementWidth*(this.scalarX/100),this.motionY*=this.elementHeight*(this.scalarY/100),isNaN(parseFloat(this.limitX))||(this.motionX=a.clamp(this.motionX,-this.limitX,this.limitX)),isNaN(parseFloat(this.limitY))||(this.motionY=a.clamp(this.motionY,-this.limitY,this.limitY)),this.velocityX+=(this.motionX-this.velocityX)*this.frictionX,this.velocityY+=(this.motionY-this.velocityY)*this.frictionY;for(var i=0;ithis.windowWidth;this.portrait!==o&&(this.portrait=o,this.calibrationFlag=!0),this.calibrationFlag&&(this.calibrationFlag=!1,this.calibrationX=i,this.calibrationY=n),this.inputX=i,this.inputY=n}},{key:"onDeviceOrientation",value:function(t){var e=t.beta,i=t.gamma;null!==e&&null!==i&&(this.orientationStatus=1,this.rotate(e,i))}},{key:"onDeviceMotion",value:function(t){var e=t.rotationRate.beta,i=t.rotationRate.gamma;null!==e&&null!==i&&(this.motionStatus=1,this.rotate(e,i))}},{key:"onMouseMove",value:function(t){var e=t.clientX,i=t.clientY;if(this.hoverOnly&&(ethis.elementPositionX+this.elementWidth||ithis.elementPositionY+this.elementHeight))return this.inputX=0,void(this.inputY=0);this.relativeInput?(this.clipRelativeInput&&(e=Math.max(e,this.elementPositionX),e=Math.min(e,this.elementPositionX+this.elementWidth),i=Math.max(i,this.elementPositionY),i=Math.min(i,this.elementPositionY+this.elementHeight)),this.elementRangeX&&this.elementRangeY&&(this.inputX=(e-this.elementPositionX-this.elementCenterX)/this.elementRangeX,this.inputY=(i-this.elementPositionY-this.elementCenterY)/this.elementRangeY)):this.windowRadiusX&&this.windowRadiusY&&(this.inputX=(e-this.windowCenterX)/this.windowRadiusX,this.inputY=(i-this.windowCenterY)/this.windowRadiusY)}},{key:"destroy",value:function(){this.disable(),clearTimeout(this.calibrationTimer),clearTimeout(this.detectionTimer),this.element.removeAttribute("style");for(var t=0;t{
+ if(response.status!=200){
+ document.getElementById('summary').innerHTML= 'Error '+ response.status;
+ }
+ else{
+ response.json().then(data=>showCurrentWeather(data));
+ }
+ })
+
+}
+
+function showCurrentWeather(data){
+ document.getElementById('currentTemp').innerHTML= leadingZero(Math.round(data.main.temp)) + "°";
+ document.getElementById('summary').innerHTML= data.weather[0].description;
+}
+
+
+function leadingZero(val){
+ if(val<10 && val>=0)
+ {
+ return '0'+val;
+ }
+ else if(val>-10 && val<=0){
+ return '-0'+Math.abs(val);
+ }
+ else{
+ return val;
+ }
+}
+
+function getFormatedTime(){
+ let d = new Date();
+ if(_12hour)
+ return new Intl.DateTimeFormat('en-US',{'hour':'2-digit','minute':'2-digit','second':'2-digit','hour12':true}).format(d);
+
+ return new Intl.DateTimeFormat('en-US',{'hour':'2-digit','minute':'2-digit','second':'2-digit','hour12':false}).format(d);
+}
+
+//updates the weather each hour
+setInterval(getWeather, 1*60*60*1000);
+
+//Lively ipc: https://github.com/rocksdanister/lively/wiki/Web-Guide-IV-:-Interaction
+function livelyPropertyListener(name, val)
+{
+ switch(name) {
+ case "uiCheck":
+ if(val)
+ {
+ document.getElementById('card').style.visibility = "visible";
+ }
+ else
+ {
+ document.getElementById('card').style.visibility = "hidden";
+ }
+ break;
+ case "cityInput":
+ cityName = val;
+ break;
+ case "apiInput":
+ weatherApi = val;
+ break;
+ case "unit":
+ if(val == 0)
+ units = "metric";
+ else
+ units = "imperial";
+ //last item on property, check weather now.
+ getWeather();
+ break;
+ case "btnRefresh":
+ //update weather.
+ getWeather();
+ break;
+ }
+}
\ No newline at end of file
diff --git a/public/themes/the great wave/license.txt b/public/themes/the great wave/license.txt
new file mode 100644
index 0000000..30c34df
--- /dev/null
+++ b/public/themes/the great wave/license.txt
@@ -0,0 +1,7 @@
+Image Credit: "The Great Wave off Kanagawa"
+https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa
+(public domain)
+
+Parallax.js
+https://github.com/wagerfield/parallax
+(MIT License)
\ No newline at end of file
diff --git a/public/themes/the great wave/lively_p.gif b/public/themes/the great wave/lively_p.gif
new file mode 100644
index 0000000..965fe03
Binary files /dev/null and b/public/themes/the great wave/lively_p.gif differ
diff --git a/public/themes/the great wave/lively_t.jpg b/public/themes/the great wave/lively_t.jpg
new file mode 100644
index 0000000..4a2c806
Binary files /dev/null and b/public/themes/the great wave/lively_t.jpg differ
diff --git a/public/themes/the spirit/LivelyInfo.json b/public/themes/the spirit/LivelyInfo.json
new file mode 100644
index 0000000..65d5bdc
--- /dev/null
+++ b/public/themes/the spirit/LivelyInfo.json
@@ -0,0 +1,14 @@
+{
+ "AppVersion": "0.9.5.1",
+ "Title": "The Spirit",
+ "Thumbnail": "lively_t.jpg",
+ "Preview": "lively_p.gif",
+ "Desc": "WebGL smoke like particle simulation.",
+ "Author": "Edan Kwan",
+ "License": "see license.txt",
+ "Contact": "https://github.com/edankwan/The-Spirit",
+ "Type": 1,
+ "FileName": "index.html",
+ "Arguments": null,
+ "IsAbsolutePath": false
+}
\ No newline at end of file
diff --git a/public/themes/the spirit/LivelyProperties.json b/public/themes/the spirit/LivelyProperties.json
new file mode 100644
index 0000000..23a15a1
--- /dev/null
+++ b/public/themes/the spirit/LivelyProperties.json
@@ -0,0 +1,118 @@
+{
+ "particleAmt": {
+ "type": "dropdown",
+ "value": 3,
+ "text": "Particle Amount",
+ "items": [
+ "4k",
+ "8k",
+ "16k",
+ "32k",
+ "65k",
+ "131k",
+ "252k",
+ "524k",
+ "1m",
+ "2m",
+ "3m",
+ "4m"
+ ]
+ },
+ "baseColor": {
+ "text": "Base",
+ "type": "color",
+ "value": "#ffffff"
+ },
+ "fadeColor": {
+ "text": "Fade",
+ "type": "color",
+ "value": "#ffffff"
+ },
+ "bgColor": {
+ "text": "Background",
+ "type": "color",
+ "value": "#202020"
+ },
+ "speed": {
+ "max": 30,
+ "min": 0,
+ "tick": 51,
+ "text": "Speed",
+ "type": "slider",
+ "value": 10
+ },
+ "dieSpeed": {
+ "max": 50,
+ "min": 1,
+ "tick": 51,
+ "text": "dieSpeed",
+ "type": "slider",
+ "value": 15
+ },
+ "radius": {
+ "max": 300,
+ "min": 20,
+ "tick": 281,
+ "text": "Radius",
+ "type": "slider",
+ "value": 60
+ },
+ "curlSize": {
+ "max": 50,
+ "min": 1,
+ "tick": 50,
+ "text": "Curl",
+ "type": "slider",
+ "value": 20
+ },
+ "attraction": {
+ "max": 200,
+ "min": -200,
+ "tick": 401,
+ "text": "Attraction",
+ "type": "slider",
+ "value": 100
+ },
+ "shadow": {
+ "max": 100,
+ "min": 0,
+ "tick": 101,
+ "text": "Shadow",
+ "type": "slider",
+ "value": 45
+ },
+ "newParticle": {
+ "type": "checkbox",
+ "value": true,
+ "text": "New Particle"
+ },
+ "followMouse": {
+ "type": "checkbox",
+ "value": true,
+ "text": "Mouse"
+ },
+ "orbit": {
+ "type": "checkbox",
+ "value": false,
+ "text": "Click to Orbit"
+ },
+ "label1": {
+ "type": "label",
+ "value": "Post-Processing"
+ },
+ "fxaa": {
+ "type": "checkbox",
+ "value": true,
+ "text": "Anti-Aliasing"
+ },
+ "motionBlur": {
+ "type": "checkbox",
+ "value": false,
+ "text": "Motion Blur"
+ },
+ "bloom": {
+ "type": "checkbox",
+ "value": false,
+ "text": "Bloom"
+ },
+}
\ No newline at end of file
diff --git a/public/themes/the spirit/css/font/Oxygen-Bold.otf b/public/themes/the spirit/css/font/Oxygen-Bold.otf
new file mode 100644
index 0000000..e12fef9
Binary files /dev/null and b/public/themes/the spirit/css/font/Oxygen-Bold.otf differ
diff --git a/public/themes/the spirit/css/font/Oxygen-BoldItalic.otf b/public/themes/the spirit/css/font/Oxygen-BoldItalic.otf
new file mode 100644
index 0000000..15b3842
Binary files /dev/null and b/public/themes/the spirit/css/font/Oxygen-BoldItalic.otf differ
diff --git a/public/themes/the spirit/css/font/Oxygen-Italic.otf b/public/themes/the spirit/css/font/Oxygen-Italic.otf
new file mode 100644
index 0000000..b203169
Binary files /dev/null and b/public/themes/the spirit/css/font/Oxygen-Italic.otf differ
diff --git a/public/themes/the spirit/css/font/Oxygen.otf b/public/themes/the spirit/css/font/Oxygen.otf
new file mode 100644
index 0000000..8f500cc
Binary files /dev/null and b/public/themes/the spirit/css/font/Oxygen.otf differ
diff --git a/public/themes/the spirit/css/font/SIL Open Font License.txt b/public/themes/the spirit/css/font/SIL Open Font License.txt
new file mode 100644
index 0000000..a8aa319
--- /dev/null
+++ b/public/themes/the spirit/css/font/SIL Open Font License.txt
@@ -0,0 +1,43 @@
+Copyright (c) 2012, Vernon Adams (vern@newtypography.co.uk)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
+
+"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
+
+5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
diff --git a/public/themes/the spirit/css/index.css b/public/themes/the spirit/css/index.css
new file mode 100644
index 0000000..3d7a1ac
--- /dev/null
+++ b/public/themes/the spirit/css/index.css
@@ -0,0 +1,129 @@
+@font-face
+{
+ font-family: 'Oxygen';
+ font-weight: normal;
+ font-style: normal;
+ src: url('font/Oxygen.otf');
+}
+
+html {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ font-family: 'Oxygen', sans-serif;
+ background-color: #343434;
+}
+
+body {
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+
+html, body,
+.mobile, .mobile *,
+.loader, .logo,
+.footer, .footer * {
+ box-sizing: border-box;
+}
+.dg .c .selector {
+ transform: translate(0, -1px);
+}
+
+.mobile {
+ display: none;
+ position: absolute;
+ width: 100%;
+ top: 50%;
+ padding: 0 30px;
+
+ font-size: 14px;
+ color: #fff;
+
+ transform: translate3d(0, -50%, 0);
+}
+
+.mobile span {
+ color: #ccc;
+ text-decoration: underline;
+}
+
+.mobile a {
+ color: #ccc;
+}
+
+.logo {
+ display: none;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 338px;
+ height: 102px;
+ margin-left: -169px;
+ margin-top: -51px;
+ background-size: 338px 102px;
+ background-image: url(../images/logo.png);
+ pointer-events: none;
+ opacity: 0;
+}
+@media (min-width: 960px) {
+ .logo {
+ left: 75%;
+ }
+}
+
+.instruction, .footer {
+ display: none;
+ position: absolute;
+ left: 0;
+ width: 100%;
+ bottom: 20px;
+ padding-right: 20px;
+ padding-left: 20px;
+
+ font-size: 14px;
+}
+
+html.is-mobile .instruction, html.is-mobile .footer {
+ font-size: 11px;
+}
+
+.instruction {
+ pointer-events: none;
+ color: #ccc;
+}
+
+.footer {
+ display: none;
+ position: absolute;
+ text-align: right;
+ left: 0;
+ width: 100%;
+ bottom: 20px;
+ padding-right: 20px;
+ padding-left: 20px;
+
+ font-size: 16px;
+ color: #999;
+}
+
+.credit {
+ float: left;
+}
+
+.footer span {
+ display: inline-block;
+ transform: translate3d(0, 50px, 0);
+}
+
+.footer a {
+ color: #bbb;
+}
+
+html.is-white .footer {
+ color: #000;
+}
+html.is-white .footer a {
+ color: #121212;
+}
diff --git a/public/themes/the spirit/css/normalize.css b/public/themes/the spirit/css/normalize.css
new file mode 100644
index 0000000..5e5e3c8
--- /dev/null
+++ b/public/themes/the spirit/css/normalize.css
@@ -0,0 +1,424 @@
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS and IE text size adjust after device orientation change,
+ * without disabling user zoom.
+ */
+
+html {
+ font-family: sans-serif; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+ margin: 0;
+}
+
+/* HTML5 display definitions
+ ========================================================================== */
+
+/**
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11
+ * and Firefox.
+ * Correct `block` display not defined for `main` in IE 11.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/**
+ * 1. Correct `inline-block` display not defined in IE 8/9.
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
+ */
+
+audio,
+canvas,
+progress,
+video {
+ display: inline-block; /* 1 */
+ vertical-align: baseline; /* 2 */
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9/10.
+ * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+ display: none;
+}
+
+/* Links
+ ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+ background-color: transparent;
+}
+
+/**
+ * Improve readability of focused elements when they are also in an
+ * active/hover state.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari, and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9/10.
+ */
+
+img {
+ border: 0;
+}
+
+/**
+ * Correct overflow not hidden in IE 9/10/11.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari.
+ */
+
+figure {
+ margin: 1em 40px;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+ box-sizing: content-box;
+ height: 0;
+}
+
+/**
+ * Contain overflow in all browsers.
+ */
+
+pre {
+ overflow: auto;
+}
+
+/**
+ * Address odd `em`-unit font size rendering in all browsers.
+ */
+
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
+ * styling of `select`, unless a `border` property is set.
+ */
+
+/**
+ * 1. Correct color not being inherited.
+ * Known issue: affects color of disabled elements.
+ * 2. Correct font properties not being inherited.
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit; /* 1 */
+ font: inherit; /* 2 */
+ margin: 0; /* 3 */
+}
+
+/**
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
+ */
+
+button {
+ overflow: visible;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
+ * Correct `select` style inheritance in Firefox.
+ */
+
+button,
+select {
+ text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ * `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+input {
+ line-height: normal;
+}
+
+/**
+ * It's recommended that you don't attempt to style these elements.
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
+ *
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
+ * `font-size` values of the `input`, it causes the cursor style of the
+ * decrement button to change from `default` to `text`.
+ */
+
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ box-sizing: content-box; /* 2 */
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
+ * Safari (but not Chrome) clips the cancel button when the search input has
+ * padding (and `textfield` appearance).
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Remove default vertical scrollbar in IE 8/9/10/11.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * Don't inherit the `font-weight` (applied by a rule above).
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
+ */
+
+optgroup {
+ font-weight: bold;
+}
+
+/* Tables
+ ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+td,
+th {
+ padding: 0;
+}
diff --git a/public/themes/the spirit/favicon.ico b/public/themes/the spirit/favicon.ico
new file mode 100644
index 0000000..e6d43b3
Binary files /dev/null and b/public/themes/the spirit/favicon.ico differ
diff --git a/public/themes/the spirit/images/logo.png b/public/themes/the spirit/images/logo.png
new file mode 100644
index 0000000..b064c3d
Binary files /dev/null and b/public/themes/the spirit/images/logo.png differ
diff --git a/public/themes/the spirit/images/screenshot.jpg b/public/themes/the spirit/images/screenshot.jpg
new file mode 100644
index 0000000..99a06a0
Binary files /dev/null and b/public/themes/the spirit/images/screenshot.jpg differ
diff --git a/public/themes/the spirit/images/share.jpg b/public/themes/the spirit/images/share.jpg
new file mode 100644
index 0000000..e9839fc
Binary files /dev/null and b/public/themes/the spirit/images/share.jpg differ
diff --git a/public/themes/the spirit/index.html b/public/themes/the spirit/index.html
new file mode 100644
index 0000000..a080299
--- /dev/null
+++ b/public/themes/the spirit/index.html
@@ -0,0 +1,185 @@
+
+
+
+
+ The Spirit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sorry, this experiment is not designed for mobile devices. But if you think your device can handle it, you can keep forward to access the experiment here.
+
Or you check out the video capture of this experiment instead. The source code is also accessible at Github.
+
Sorry for any inconvenience caused.
+
Cheers,
+
Edan Kwan
+
+
+ Press space key to toggle movement
+
+
+
+
+
+
+
+
+
diff --git a/public/themes/the spirit/js/index.js b/public/themes/the spirit/js/index.js
new file mode 100644
index 0000000..46c44ff
--- /dev/null
+++ b/public/themes/the spirit/js/index.js
@@ -0,0 +1,5 @@
+!function(){function e(t,n,o){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a=0;o--)n=[e[o].apply(this,n)];return n[0]}},each:function(t,n,o){if(e&&t.forEach===e)t.forEach(n,o);else if(t.length===t.length+0){for(var i=0,r=t.length;i1?t.toArray(arguments):arguments[0];return t.each(r,function(i){if(i.litmus(e))return t.each(i.conversions,function(i,r){if(n=i.read(e),!1===o&&!1!==n)return o=n,n.conversionName=r,n.conversion=i,t.BREAK}),t.BREAK}),o},r=[{litmus:t.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString())}},write:e},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:e},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:e}}},{litmus:t.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:t.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3==e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4==e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:t.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)&&t.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)&&t.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}];return i}(o.color.toString,o.utils.common),o.color.math=function(){var e;return{hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),u=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][o];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,n){var o,i,r=Math.min(e,t,n),a=Math.max(e,t,n),s=a-r;return 0==a?{h:NaN,s:0,v:0}:(i=s/a,o=e==a?(t-n)/s:t==a?2+(n-e)/s:4+(e-t)/s,o/=6,o<0&&(o+=1),{h:360*o,s:i,v:a/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(t,n,o){return o<<(e=8*n)|t&~(255<=0;o--)n=[e[o].apply(this,n)];return n[0]}},each:function(t,n,o){if(e&&t.forEach===e)t.forEach(n,o);else if(t.length===t.length+0){for(var i=0,r=t.length;i-1?e.length-e.indexOf(".")-1:0}var o=function(e,i,r){o.superclass.call(this,e,i),r=r||{},this.__min=r.min,this.__max=r.max,this.__step=r.step,t.isUndefined(this.__step)?0==this.initialValue?this.__impliedStep=1:this.__impliedStep=Math.pow(10,Math.floor(Math.log(this.initialValue)/Math.LN10))/10:this.__impliedStep=this.__step,this.__precision=n(this.__impliedStep)};return o.superclass=e,t.extend(o.prototype,e.prototype,{setValue:function(e){return void 0!==this.__min&ðis.__max&&(e=this.__max),void 0!==this.__step&&e%this.__step!=0&&(e=Math.round(e/this.__step)*this.__step),o.superclass.prototype.setValue.call(this,e)},min:function(e){return this.__min=e,this},max:function(e){return this.__max=e,this},step:function(e){return this.__step=e,this}}),o}(o.controllers.Controller,o.utils.common),o.controllers.NumberControllerBox=function(e,t,n){function o(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var i=function(e,o,r){function a(){var e=parseFloat(f.__input.value);n.isNaN(e)||f.setValue(e)}function s(){a(),f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())}function u(e){t.bind(window,"mousemove",l),t.bind(window,"mouseup",c),d=e.clientY}function l(e){var t=d-e.clientY;f.setValue(f.getValue()+t*f.__impliedStep),d=e.clientY}function c(){t.unbind(window,"mousemove",l),t.unbind(window,"mouseup",c)}this.__truncationSuspended=!1,i.superclass.call(this,e,o,r);var d,f=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),t.bind(this.__input,"change",a),t.bind(this.__input,"blur",s),t.bind(this.__input,"mousedown",u),t.bind(this.__input,"keydown",function(e){13===e.keyCode&&(f.__truncationSuspended=!0,this.blur(),f.__truncationSuspended=!1)}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return i.superclass=e,n.extend(i.prototype,e.prototype,{updateDisplay:function(){return this.__input.value=this.__truncationSuspended?this.getValue():o(this.getValue(),this.__precision),i.superclass.prototype.updateDisplay.call(this)}}),i}(o.controllers.NumberController,o.dom.dom,o.utils.common),o.controllers.NumberControllerSlider=function(e,t,n,o,i){function r(e,t,n,o,i){return o+(e-t)/(n-t)*(i-o)}var a=function(e,n,o,i,s){function u(e){t.bind(window,"mousemove",l),t.bind(window,"mouseup",c),l(e)}function l(e){e.preventDefault();var n=t.getOffset(d.__background),o=t.getWidth(d.__background);return d.setValue(r(e.clientX,n.left,n.left+o,d.__min,d.__max)),!1}function c(){t.unbind(window,"mousemove",l),t.unbind(window,"mouseup",c),d.__onFinishChange&&d.__onFinishChange.call(d,d.getValue())}a.superclass.call(this,e,n,{min:o,max:i,step:s});var d=this;this.__background=document.createElement("div"),this.__foreground=document.createElement("div"),t.bind(this.__background,"mousedown",u),t.addClass(this.__background,"slider"),t.addClass(this.__foreground,"slider-fg"),this.updateDisplay(),this.__background.appendChild(this.__foreground),this.domElement.appendChild(this.__background)};return a.superclass=e,a.useDefaultStyles=function(){n.inject(".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")},o.extend(a.prototype,e.prototype,{updateDisplay:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",a.superclass.prototype.updateDisplay.call(this)}}),a}(o.controllers.NumberController,o.dom.dom,o.utils.css,o.utils.common),o.controllers.FunctionController=function(e,t,n){var o=function(e,n,i){o.superclass.call(this,e,n);var r=this;this.__button=document.createElement("div"),this.__button.innerHTML=void 0===i?"Fire":i,t.bind(this.__button,"click",function(e){return e.preventDefault(),r.fire(),!1}),t.addClass(this.__button,"button"),this.domElement.appendChild(this.__button)};return o.superclass=e,n.extend(o.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.getValue().call(this.object)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.controllers.BooleanController=function(e,t,n){var o=function(e,n){function i(){r.setValue(!r.__prev)}o.superclass.call(this,e,n);var r=this;this.__prev=this.getValue(),this.__checkbox=document.createElement("input"),this.__checkbox.setAttribute("type","checkbox"),t.bind(this.__checkbox,"change",i,!1),this.domElement.appendChild(this.__checkbox),this.updateDisplay()};return o.superclass=e,n.extend(o.prototype,e.prototype,{setValue:function(e){var t=o.superclass.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),t},updateDisplay:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,o.superclass.prototype.updateDisplay.call(this)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.color.toString=function(e){return function(t){if(1==t.a||e.isUndefined(t.a)){for(var n=t.hex.toString(16);n.length<6;)n="0"+n;return"#"+n}return"rgba("+Math.round(t.r)+","+Math.round(t.g)+","+Math.round(t.b)+","+t.a+")"}}(o.utils.common),o.color.interpret=function(e,t){var n,o,i=function(){o=!1;var e=arguments.length>1?t.toArray(arguments):arguments[0];return t.each(r,function(i){if(i.litmus(e))return t.each(i.conversions,function(i,r){if(n=i.read(e),!1===o&&!1!==n)return o=n,n.conversionName=r,n.conversion=i,t.BREAK}),t.BREAK}),o},r=[{litmus:t.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString())}},write:e},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:e},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:e}}},{litmus:t.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:t.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3==e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4==e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:t.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)&&t.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)&&t.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}];return i}(o.color.toString,o.utils.common),o.GUI=o.gui.GUI=function(e,t,n,o,i,r,a,s,u,l,c,d,f,p,m){function h(e,t,n,r){if(void 0===t[n])throw new Error("Object "+t+' has no property "'+n+'"');var a;if(r.color)a=new c(t,n);else{var s=[t,n].concat(r.factoryArgs);a=o.apply(e,s)}r.before instanceof i&&(r.before=r.before.__li),g(e,a),p.addClass(a.domElement,"c");var u=document.createElement("span");p.addClass(u,"property-name"),u.innerHTML=a.property;var l=document.createElement("div");l.appendChild(u),l.appendChild(a.domElement);var d=v(e,l,r.before);return p.addClass(d,L.CLASS_CONTROLLER_ROW),p.addClass(d,typeof a.getValue()),_(e,d,a),e.__controllers.push(a),a}function v(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,params.before):e.__ul.appendChild(o),e.onResize(),o}function _(e,t,n){if(n.__li=t,n.__gui=e,m.extend(n,{options:function(t){return arguments.length>1?(n.remove(),h(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[m.toArray(arguments)]})):m.isArray(t)||m.isObject(t)?(n.remove(),h(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[t]})):void 0},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof u){var o=new s(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});m.each(["updateDisplay","onChange","onFinishChange"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return t.apply(n,e),i.apply(o,e)}}),p.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof s){var i=function(t){return m.isNumber(n.__min)&&m.isNumber(n.__max)?(n.remove(),h(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]})):t};n.min=m.compose(i,n.min),n.max=m.compose(i,n.max)}else n instanceof r?(p.bind(t,"click",function(){p.fakeEvent(n.__checkbox,"click")}),p.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof a?(p.bind(t,"click",function(){p.fakeEvent(n.__button,"click")}),p.bind(t,"mouseover",function(){p.addClass(n.__button,"hover")}),p.bind(t,"mouseout",function(){p.removeClass(n.__button,"hover")})):n instanceof c&&(p.addClass(t,"color"),n.updateDisplay=m.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=m.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&C(e.getRoot(),!0),t},n.setValue)}function g(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(-1!=o){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r,a=n.load.remembered;if(a[e.preset])r=a[e.preset];else{if(!a[N])return;r=a[N]}if(r[o]&&void 0!==r[o][t.property]){var s=r[o][t.property];t.initialValue=s,t.setValue(s)}}}}function b(e,t){return document.location.href+"."+t}function x(e){function t(){l.style.display=e.useLocalStorage?"block":"none"}var n=e.__save_row=document.createElement("li");p.addClass(e.domElement,"has-save"),e.__ul.insertBefore(n,e.__ul.firstChild),p.addClass(n,"save-row");var o=document.createElement("span");o.innerHTML=" ",p.addClass(o,"button gears");var i=document.createElement("span");i.innerHTML="Save",p.addClass(i,"button"),p.addClass(i,"save");var r=document.createElement("span");r.innerHTML="New",p.addClass(r,"button"),p.addClass(r,"save-as");var a=document.createElement("span");a.innerHTML="Revert",p.addClass(a,"button"),p.addClass(a,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?m.each(e.load.remembered,function(t,n){S(e,n,n==e.preset)}):S(e,N,!1),p.bind(s,"change",function(){for(var t=0;t *{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}\n");var T,R,N="Default",P=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}(),O=!0,I=!1,D=[],L=function(e){function t(){localStorage.setItem(b(n,"gui"),JSON.stringify(n.getSaveObject()))}var n=this;this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),p.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],e=e||{},e=m.defaults(e,{autoPlace:!0,width:L.DEFAULT_WIDTH}),e=m.defaults(e,{resizable:e.autoPlace,hideable:e.autoPlace}),m.isUndefined(e.load)?e.load={preset:N}:e.preset&&(e.load.preset=e.preset),m.isUndefined(e.parent)&&e.hideable&&D.push(this),e.resizable=m.isUndefined(e.parent)&&e.resizable,e.autoPlace&&m.isUndefined(e.scrollable)&&(e.scrollable=!0);var o=P&&"true"===localStorage.getItem(b(this,"isLocal"));if(Object.defineProperties(this,{parent:{get:function(){return e.parent}},scrollable:{get:function(){return e.scrollable}},autoPlace:{get:function(){return e.autoPlace}},preset:{get:function(){return n.parent?n.getRoot().preset:e.load.preset},set:function(t){n.parent?n.getRoot().preset=t:e.load.preset=t,A(this),n.revert()}},width:{get:function(){return e.width},set:function(t){e.width=t,w(n,t)}},name:{get:function(){return e.name},set:function(t){e.name=t,r&&(r.innerHTML=e.name)}},closed:{get:function(){return e.closed},set:function(t){e.closed=t,e.closed?p.addClass(n.__ul,L.CLASS_CLOSED):p.removeClass(n.__ul,L.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?L.TEXT_OPEN:L.TEXT_CLOSED)}},load:{get:function(){return e.load}},useLocalStorage:{get:function(){return o},set:function(e){P&&(o=e,e?p.bind(window,"unload",t):p.unbind(window,"unload",t),localStorage.setItem(b(n,"isLocal"),e))}}}),m.isUndefined(e.parent)){if(e.closed=!1,p.addClass(this.domElement,L.CLASS_MAIN),p.makeSelectable(this.domElement,!1),P&&o){n.useLocalStorage=!0;var i=localStorage.getItem(b(this,"gui"));i&&(e.load=JSON.parse(i))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=L.TEXT_CLOSED,p.addClass(this.__closeButton,L.CLASS_CLOSE_BUTTON),this.domElement.appendChild(this.__closeButton),p.bind(this.__closeButton,"click",function(){n.closed=!n.closed})}else{void 0===e.closed&&(e.closed=!0);var r=document.createTextNode(e.name);p.addClass(r,"controller-name");var a=v(n,r),s=function(e){return e.preventDefault(),n.closed=!n.closed,!1};p.addClass(this.__ul,L.CLASS_CLOSED),p.addClass(a,"title"),p.bind(a,"click",s),e.closed||(this.closed=!1)}e.autoPlace&&(m.isUndefined(e.parent)&&(O&&(R=document.createElement("div"),p.addClass(R,"dg"),p.addClass(R,L.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(R),O=!1),R.appendChild(this.domElement),p.addClass(this.domElement,L.CLASS_AUTO_PLACE)),this.parent||w(n,e.width)),p.bind(window,"resize",function(){n.onResize()}),p.bind(this.__ul,"webkitTransitionEnd",function(){n.onResize()}),p.bind(this.__ul,"transitionend",function(){n.onResize()}),p.bind(this.__ul,"oTransitionEnd",function(){n.onResize()}),this.onResize(),e.resizable&&y(this);n.getRoot();e.parent||function(){var e=n.getRoot();e.width+=1,m.defer(function(){e.width-=1})}()};return L.toggleHide=function(){I=!I,m.each(D,function(e){e.domElement.style.zIndex=I?-999:999,e.domElement.style.opacity=I?0:1})},L.CLASS_AUTO_PLACE="a",L.CLASS_AUTO_PLACE_CONTAINER="ac",L.CLASS_MAIN="main",L.CLASS_CONTROLLER_ROW="cr",L.CLASS_TOO_TALL="taller-than-window",L.CLASS_CLOSED="closed",L.CLASS_CLOSE_BUTTON="close-button",L.CLASS_DRAG="drag",L.DEFAULT_WIDTH=245,L.TEXT_CLOSED="Close Controls",L.TEXT_OPEN="Open Controls",p.bind(window,"keydown",function(e){"text"===document.activeElement.type||72!==e.which&&72!=e.keyCode||L.toggleHide()},!1),m.extend(L.prototype,{add:function(e,t){return h(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return h(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.slice(this.__controllers.indexOf(e),1);var t=this;m.defer(function(){t.onResize()})},destroy:function(){this.autoPlace&&R.removeChild(this.domElement)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new L(t);this.__folders[e]=n;var o=v(this,n.domElement);return p.addClass(o,"folder"),n},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=p.getOffset(e.__ul).top,n=0;m.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=p.getHeight(t))}),window.innerHeight-t-20\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n \n\n
Automatically save\n values to
localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n '),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;m.each(Array.prototype.slice.call(arguments),function(t){0==e.__rememberedObjects.length&&x(e),-1==e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&w(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=E(this)),e.folders={},m.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=E(this),C(this,!1)},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[N]=E(this,!0)),this.load.remembered[e]=E(this),this.preset=e,S(this,e,!0)},revert:function(e){m.each(this.__controllers,function(t){this.getRoot().load.remembered?g(e||this.getRoot(),t):t.setValue(t.initialValue)},this),m.each(this.__folders,function(e){e.revert(e)}),e||C(this.getRoot(),!1)},listen:function(e){var t=0==this.__listening.length;this.__listening.push(e),t&&M(this.__listening)}}),L}(o.utils.css,0,0,o.controllers.factory=function(e,t,n,o,i,r,a){return function(s,u){var l=s[u];return a.isArray(arguments[2])||a.isObject(arguments[2])?new e(s,u,arguments[2]):a.isNumber(l)?a.isNumber(arguments[2])&&a.isNumber(arguments[3])?new n(s,u,arguments[2],arguments[3]):new t(s,u,{min:arguments[2],max:arguments[3]}):a.isString(l)?new o(s,u):a.isFunction(l)?new i(s,u,""):a.isBoolean(l)?new r(s,u):void 0}}(o.controllers.OptionController,o.controllers.NumberControllerBox,o.controllers.NumberControllerSlider,o.controllers.StringController=function(e,t,n){var o=function(e,n){function i(){a.setValue(a.__input.value)}function r(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}o.superclass.call(this,e,n);var a=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),t.bind(this.__input,"keyup",i),t.bind(this.__input,"change",i),t.bind(this.__input,"blur",r),t.bind(this.__input,"keydown",function(e){13===e.keyCode&&this.blur()}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return o.superclass=e,n.extend(o.prototype,e.prototype,{updateDisplay:function(){return t.isActive(this.__input)||(this.__input.value=this.getValue()),o.superclass.prototype.updateDisplay.call(this)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.controllers.FunctionController,o.controllers.BooleanController,o.utils.common),o.controllers.Controller,o.controllers.BooleanController,o.controllers.FunctionController,o.controllers.NumberControllerBox,o.controllers.NumberControllerSlider,o.controllers.OptionController,o.controllers.ColorController=function(e,t,n,o,i){function r(e,t,n,o){e.style.background="",i.each(u,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function a(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var s=function(e,u){function l(e){p(e),t.bind(window,"mousemove",p),t.bind(window,"mouseup",c)}function c(){t.unbind(window,"mousemove",p),t.unbind(window,"mouseup",c)}function d(){var e=o(this.value);!1!==e?(h.__color.__state=e,h.setValue(h.__color.toOriginal())):this.value=h.__color.toString()}function f(){t.unbind(window,"mousemove",m),t.unbind(window,"mouseup",f)}function p(e){e.preventDefault();var n=t.getWidth(h.__saturation_field),o=t.getOffset(h.__saturation_field),i=(e.clientX-o.left+document.body.scrollLeft)/n,r=1-(e.clientY-o.top+document.body.scrollTop)/n;return r>1?r=1:r<0&&(r=0),i>1?i=1:i<0&&(i=0),h.__color.v=r,h.__color.s=i,h.setValue(h.__color.toOriginal()),!1}function m(e){e.preventDefault();var n=t.getHeight(h.__hue_field),o=t.getOffset(h.__hue_field),i=1-(e.clientY-o.top+document.body.scrollTop)/n;return i>1?i=1:i<0&&(i=0),h.__color.h=360*i,h.setValue(h.__color.toOriginal()),!1}s.superclass.call(this,e,u),this.__color=new n(this.getValue()),this.__temp=new n(0);var h=this;this.domElement=document.createElement("div"),t.makeSelectable(this.domElement,!1),this.__selector=document.createElement("div"),this.__selector.className="selector",this.__saturation_field=document.createElement("div"),this.__saturation_field.className="saturation-field",this.__field_knob=document.createElement("div"),this.__field_knob.className="field-knob",this.__field_knob_border="2px solid ",this.__hue_knob=document.createElement("div"),this.__hue_knob.className="hue-knob",this.__hue_field=document.createElement("div"),this.__hue_field.className="hue-field",this.__input=document.createElement("input"),this.__input.type="text",this.__input_textShadow="0 1px 1px ",t.bind(this.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),t.bind(this.__input,"blur",d),t.bind(this.__selector,"mousedown",function(e){t.addClass(this,"drag").bind(window,"mouseup",function(e){t.removeClass(h.__selector,"drag")})});var v=document.createElement("div");i.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),i.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),i.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),i.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),i.extend(v.style,{width:"100%",height:"100%",background:"none"}),r(v,"top","rgba(0,0,0,0)","#000"),i.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"}),a(this.__hue_field),i.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"}),t.bind(this.__saturation_field,"mousedown",l),t.bind(this.__field_knob,"mousedown",l),t.bind(this.__hue_field,"mousedown",function(e){m(e),t.bind(window,"mousemove",m),t.bind(window,"mouseup",f)}),this.__saturation_field.appendChild(v),this.__selector.appendChild(this.__field_knob),this.__selector.appendChild(this.__saturation_field),this.__selector.appendChild(this.__hue_field),this.__hue_field.appendChild(this.__hue_knob),this.domElement.appendChild(this.__input),this.domElement.appendChild(this.__selector),this.updateDisplay()};s.superclass=e,i.extend(s.prototype,e.prototype,{updateDisplay:function(){var e=o(this.getValue());if(!1!==e){var t=!1;i.each(n.COMPONENTS,function(n){if(!i.isUndefined(e[n])&&!i.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&i.extend(this.__color.__state,e)}i.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var a=this.__color.v<.5||this.__color.s>.5?255:0,s=255-a;i.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+"rgb("+a+","+a+","+a+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,r(this.__saturation_field,"left","#fff",this.__temp.toString()),i.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+a+","+a+","+a+")",textShadow:this.__input_textShadow+"rgba("+s+","+s+","+s+",.7)"})}});var u=["-moz-","-o-","-webkit-","-ms-",""];return s}(o.controllers.Controller,o.dom.dom,o.color.Color=function(e,t,n,o){function i(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(a(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(a(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function r(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(s(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(s(this),this.__state.space="HSV"),this.__state[t]=e}})}function a(e,n,i){if("HEX"===e.__state.space)e.__state[n]=t.component_from_hex(e.__state.hex,i);else{if("HSV"!==e.__state.space)throw"Corrupted color state";o.extend(e.__state,t.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}}function s(e){var n=t.rgb_to_hsv(e.r,e.g,e.b);o.extend(e.__state,{s:n.s,v:n.v}),o.isNaN(n.h)?o.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=n.h}var u=function(){if(this.__state=e.apply(this,arguments),!1===this.__state)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1};return u.COMPONENTS=["r","g","b","h","s","v","hex","a"],o.extend(u.prototype,{toString:function(){return n(this)},toOriginal:function(){return this.__state.conversion.write(this)}}),i(u.prototype,"r",2),i(u.prototype,"g",1),i(u.prototype,"b",0),r(u.prototype,"h"),r(u.prototype,"s"),r(u.prototype,"v"),Object.defineProperty(u.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(u.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=t.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),u}(o.color.interpret,o.color.math=function(){var e;return{hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),u=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][o];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,n){var o,i,r=Math.min(e,t,n),a=Math.max(e,t,n),s=a-r;return 0==a?{h:NaN,s:0,v:0}:(i=s/a,o=e==a?(t-n)/s:t==a?2+(n-e)/s:4+(e-t)/s,o/=6,o<0&&(o+=1),{h:360*o,s:i,v:a/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(t,n,o){return o<<(e=8*n)|t&~(255<