dat.gui/build/dat.gui.min.js

4 lines
97 KiB
JavaScript
Raw Normal View History

2017-09-26 18:49:19 +00:00
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var i=o[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(1),l=n(i);t.default=l.default,e.exports=t.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(2),l=n(i),a=o(6),r=n(a),d=o(3),s=n(d),u=o(7),f=n(u),_=o(8),c=n(_),p=o(10),h=n(p),b=o(11),m=n(b),g=o(12),x=n(g),v=o(13),y=n(v),w=o(14),C=n(w),E=o(15),k=n(E),S=o(16),A=n(S),O=o(17),T=n(O),R=o(18),L=n(R),N=o(19),M=n(N),j=o(20),H=n(j),V=o(9),B=n(V),D=o(21),F=n(D);t.default={color:{Color:l.default,math:r.default,interpret:s.default},controllers:{Controller:f.default,BooleanController:c.default,OptionController:h.default,StringController:m.default,NumberController:x.default,NumberControllerBox:y.default,NumberControllerSlider:C.default,FunctionController:k.default,ColorController:A.default,BgColorController:T.default,NgColorController:L.default,HSVColorController:H.default,GtColorController:M.default},dom:{dom:B.default},gui:{GUI:F.default},GUI:F.default},e.exports=t.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t,o){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(h.recalculateRGB(this,t,o),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(h.recalculateRGB(this,t,o),this.__state.space="RGB"),this.__state[t]=e}})}function a(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(h.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(h.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var r=o(3),d=n(r),s=o(6),u=n(s),f=o(4),_=n(f),c=o(5),p=n(c),h=function(){function e(){if(i(this,e),this.__state=d.default.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return(0,_.default)(this)},e.prototype.toHexString=function(){return(0,_.default)(this,!0)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();h.recalculateRGB=function(e,t,o){if("HEX"===e.__state.space)e.__state[t]=u.default.component_from_hex(e.__state.hex,o);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");p.default.extend(e.__state,u.default.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},h.recalculateHSV=function(e){var t=u.default.rgb_to_hsv(e.r,e.g,e.b);p.default.extend(e.__state,{s:t.s,v:t.v}),p.default.isNaN(t.h)?p.default.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},h.COMPONENTS=["r","g","b","h","s","v","hex","a"],l(h.prototype,"r",2),l(h.prototype,"g",1),l(h.prototype,"b",0),a(h.prototype,"h"),a(h.prototype,"s"),a(h.prototype,"v"),Object.defineProperty(h.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(h.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=u.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t.default=h,e.exports=t.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(4),l=n(i),a=o(5),r=n(a),d=[{litmus:r.default.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(),0)}},write:l.default},SI
}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function r(e,t,o,n){e.style.background="",g.default.each(v,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+o+" 0%, "+n+" 100%); "})}function d(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%);"}t.__esModule=!0;var s=o(7),u=n(s),f=o(9),_=n(f),c=o(2),p=n(c),h=o(3),b=n(h),m=o(5),g=n(m),x=function(e){function t(o,n){function a(e){C(e),_.default.bind(window,"mousemove",C),_.default.bind(window,"mouseup",u)}function s(e){w(e),_.default.bind(window,"mousemove",w),_.default.bind(window,"mouseup",f)}function u(){_.default.unbind(window,"mousemove",C),_.default.unbind(window,"mouseup",u),v()}function f(){_.default.unbind(window,"mousemove",w),_.default.unbind(window,"mouseup",f),y()}function c(){var e=(0,b.default)(this.value);e!==!1?(A.__color.__state=e,A.setValue(A.__color.toOriginal())):this.value=A.__color.toString()}function h(){var e=(0,b.default)(this.value);e!==!1?(A.__color2.__state=e,A.setValue2(A.__color2.toOriginal())):this.value=A.__color2.toString()}function m(){_.default.unbind(window,"mousemove",k),_.default.unbind(window,"mouseup",m),v()}function x(){_.default.unbind(window,"mousemove",E),_.default.unbind(window,"mouseup",x),y()}function v(){A.__onFinishChange&&A.__onFinishChange.call(A,A.__color2.toOriginal())}function y(){A.__onFinishChange&&A.__onFinishChange.call(A,A.__color.toOriginal())}function w(e){e.preventDefault();var t=A.__saturation_field2.getBoundingClientRect(),o=(e.clientX-t.left)/(t.right-t.left),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),o>1?o=1:o<0&&(o=0),A.__color2.v=n,A.__color2.s=o,A.setValue2(A.__color2.toOriginal()),!1}function C(e){e.preventDefault();var t=A.__saturation_field.getBoundingClientRect(),o=(e.clientX-t.left)/(t.right-t.left),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),o>1?o=1:o<0&&(o=0),A.__color.v=n,A.__color.s=o,A.setValue(A.__color.toOriginal()),!1}function E(e){e.preventDefault();var t=A.__hue_field2.getBoundingClientRect(),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),A.__color2.h=360*o,A.setValue2(A.__color2.toOriginal()),!1}function k(e){e.preventDefault();var t=A.__hue_field.getBoundingClientRect(),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),A.__color.h=360*o,A.setValue(A.__color.toOriginal()),!1}i(this,t);var S=l(this,e.call(this,o,n));S.__color=new p.default(S.getValue()),S.value2="#FFee00",S.object[S.property+"bg"]&&(S.value2=S.object[S.property+"bg"]),S.__color2=new p.default(S.value2),S.__temp=new p.default(0),S.__temp2=new p.default(0);var A=S;S.domElement=document.createElement("div"),_.default.makeSelectable(S.domElement,!1),S.__selector=document.createElement("div"),S.__saturation_field=document.createElement("div"),S.__saturation_field.className="saturation-field",S.__saturation_field2=document.createElement("div"),S.__saturation_field2.className="saturation-field",S.__field_knob=document.createElement("div"),S.__field_knob.className="field-knob",S.__field_knob_border="2px solid ",S.__field_knob2=document.createElement("div"),S.__field_knob2.className="field-knob",S.__field_knob_border2="2px solid ",S.__hue_knob=document.createElement("div"),S.__hue_knob.className="hue-knob",S.__hue_knob2=document.createElement("div"),S.__hue_knob2.className="hue-knob",S.__hue_field=document.createElement("div"),S.__h
}),_.default.bind(x.__input,"blur",u);var y=document.createElement("div");return g.default.extend(x.__selector.style,{width:"256px",height:"10px",marginTop:"22px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(x.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:x.__field_knob_border+(x.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",top:"-2",zIndex:1}),g.default.extend(x.__field_knob2.style,{position:"absolute",width:"12px",height:"12px",border:x.__field_knob_border+(x.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",top:"-2",zIndex:1}),g.default.extend(x.__field_knob3.style,{position:"absolute",width:"12px",height:"12px",border:x.__field_knob_border+(x.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",top:"-2",zIndex:1}),g.default.extend(y.style,{width:"100%",height:"100%",background:"none"}),g.default.extend(x.__hsv_field.style,{width:"256px",height:"20px",border:"1px solid #555",position:"absolute",top:"30px",left:"0px"}),g.default.extend(x.__hsv_field2.style,{width:"256px",height:"20px",border:"1px solid #555",position:"absolute",top:"55px",left:"0px"}),g.default.extend(x.__hsv_field3.style,{width:"256px",height:"20px",border:"1px solid #555",position:"absolute",top:"80px",left:"0px"}),d(x.__hsv_field),d(x.__hsv_field2),d(x.__hsv_field3),g.default.extend(x.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,left:"0px",position:"absolute",fontWeight:"bold",width:"256px",textShadow:x.__input_textShadow+"rgba(0,0,0,0.7)"}),g.default.extend(x.__hsv_fieldLabel.style,{outline:"none",textAlign:"left",color:"#fff",border:0,left:"-70px",position:"absolute",font:"bold 12px Courier",width:"50px",textShadow:x.__input_textShadow+"rgba(0,0,0,0.7)"}),g.default.extend(x.__hsv_fieldLabel2.style,{outline:"none",textAlign:"left",color:"#fff",border:0,left:"-70px",position:"absolute",font:"bold 12px Courier",width:"50px",textShadow:x.__input_textShadow+"rgba(0,0,0,0.7)"}),g.default.extend(x.__hsv_fieldLabel3.style,{outline:"none",textAlign:"left",color:"#fff",border:0,left:"-70px",position:"absolute",font:"bold 12px Courier",width:"50px",textShadow:x.__input_textShadow+"rgba(0,0,0,0.7)"}),_.default.bind(x.__hsv_field,"mousedown",function(e){m(e),_.default.bind(window,"mousemove",m),_.default.bind(window,"mouseup",a)}),_.default.bind(x.__hsv_field2,"mousedown",function(e){c(e),_.default.bind(window,"mousemove",c),_.default.bind(window,"mouseup",r)}),_.default.bind(x.__hsv_field3,"mousedown",function(e){h(e),_.default.bind(window,"mousemove",h),_.default.bind(window,"mouseup",s)}),g.default.extend(x.domElement.style,{height:"100px"}),x.__hsv_field.appendChild(x.__field_knob),x.__hsv_field2.appendChild(x.__field_knob2),x.__hsv_field3.appendChild(x.__field_knob3),x.__selector.appendChild(x.__hsv_field),x.__selector.appendChild(x.__hsv_field2),x.__selector.appendChild(x.__hsv_field3),x.__hsv_field.appendChild(x.__hsv_fieldLabel),x.__hsv_field2.appendChild(x.__hsv_fieldLabel2),x.__hsv_field3.appendChild(x.__hsv_fieldLabel3),x.domElement.appendChild(x.__input),x.domElement.appendChild(x.__selector),x.updateDisplay(),x}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,b.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(o){if(!g.default.isUndefined(e[o])&&!g.default.isUndefined(this.__color.__state[o])&&e[o]!==this.__color.__state[o])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1,this.__temp2.a=1;var o=this.__color.v<.5||this.__color.s>.5?255:0,n=255-o;g.default.extend(this.__field_knob.style,{marginLeft:parseInt(this.__color.h/360*256-7,10)+"px",marginTop:"5px",border:this.__field_knob_border+"rgb(255,255,255)"}),g.default.extend(this.__field_knob2.style,{marginLeft:256*this.__color.s-7+"px",marginTop:"5px",border:this.__field_knob_border+"rgb("+o+","+o+","+o+")"}),g.default.extend(this.__field_knob3.style,{ma
},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var o=this[t];o[2]?e.push("@media "+o[2]+"{"+o[1]+"}"):e.push(o[1])}return e.join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;i<this.length;i++){var l=this[i][0];"number"==typeof l&&(n[l]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&n[a[0]]||(o&&!a[2]?a[2]=o:o&&(a[2]="("+a[2]+") and ("+o+")"),e.push(a))}},e}}])});