2016-11-20 19:41:57 -05:00
/ * !
2017-01-26 18:42:07 -05:00
* matter - tools 0.9 . 1 by Liam Brummitt 2017 - 01 - 26
2016-11-20 19:41:57 -05:00
* https : //github.com/liabru/matter-tools
* License MIT
* /
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
2017-01-26 18:42:07 -05:00
module . exports = factory ( require ( "Matter" ) , require ( "MatterTools" ) ) ;
2016-11-20 19:41:57 -05:00
else if ( typeof define === 'function' && define . amd )
2017-01-26 18:42:07 -05:00
define ( [ "Matter" , "MatterTools" ] , factory ) ;
2016-11-20 19:41:57 -05:00
else if ( typeof exports === 'object' )
2017-01-26 18:42:07 -05:00
exports [ "Gui" ] = factory ( require ( "Matter" ) , require ( "MatterTools" ) ) ;
2016-11-20 19:41:57 -05:00
else
2017-01-26 18:42:07 -05:00
root [ "MatterTools" ] = root [ "MatterTools" ] || { } , root [ "MatterTools" ] [ "Gui" ] = factory ( root [ "Matter" ] , root [ "MatterTools" ] ) ;
} ) ( this , function ( _ _WEBPACK _EXTERNAL _MODULE _1 _ _ , _ _WEBPACK _EXTERNAL _MODULE _2 _ _ ) {
2016-11-20 19:41:57 -05:00
return /******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] )
/******/ return installedModules [ moduleId ] . exports ;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ exports : { } ,
/******/ id : moduleId ,
/******/ loaded : false
/******/ } ;
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/ // Flag the module as loaded
/******/ module . loaded = true ;
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "/demo/lib" ;
/******/ // Load entry module and return exports
/******/ return _ _webpack _require _ _ ( 0 ) ;
/******/ } )
/************************************************************************/
/******/ ( [
/* 0 */
/***/ function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
/ * *
* A tool for modifying the properties of an engine and renderer .
* @ module Gui
* /
var Gui = module . exports = { } ;
2017-01-26 18:42:07 -05:00
var dat = _ _webpack _require _ _ ( 5 ) ;
var ToolsCommon = _ _webpack _require _ _ ( 3 ) ;
var Serializer = _ _webpack _require _ _ ( 2 ) . Serializer ;
var Matter = _ _webpack _require _ _ ( 1 ) ;
2016-11-20 19:41:57 -05:00
var Engine = Matter . Engine ;
var Detector = Matter . Detector ;
var Grid = Matter . Grid ;
var World = Matter . World ;
var Bodies = Matter . Bodies ;
var Events = Matter . Events ;
2017-01-26 18:42:07 -05:00
var Composite = Matter . Composite ;
2016-11-20 19:41:57 -05:00
/ * *
* Creates a Gui
* @ function Gui . create
* @ param { engine } [ engine ]
* @ param { runner } [ runner ]
* @ param { render } [ render ]
* @ return { gui } The created gui instance
* /
Gui . create = function ( engine , runner , render ) {
dat . GUI . TEXT _CLOSED = '▲' ;
dat . GUI . TEXT _OPEN = '▼' ;
var datGui = new dat . GUI ( ) ;
var gui = {
engine : engine ,
runner : runner ,
render : render ,
datGui : datGui ,
broadphase : 'grid' ,
broadphaseCache : {
grid : engine . broadphase . controller === Grid ? engine . broadphase : Grid . create ( ) ,
bruteForce : {
detector : Detector . bruteForce
}
} ,
amount : 1 ,
size : 40 ,
sides : 4 ,
density : 0.001 ,
restitution : 0 ,
friction : 0.1 ,
frictionStatic : 0.5 ,
frictionAir : 0.01 ,
offset : { x : 0 , y : 0 } ,
renderer : 'canvas' ,
chamfer : 0 ,
isRecording : false
} ;
if ( Serializer ) {
gui . serializer = Serializer . create ( ) ;
}
var styles = _ _webpack _require _ _ ( 6 ) ;
ToolsCommon . injectStyles ( styles , 'matter-gui-style' ) ;
_initDatGui ( gui ) ;
return gui ;
} ;
/ * *
* Updates the Gui
* @ function Gui . update
* @ param { gui } gui
* /
Gui . update = function ( gui ) {
var i ;
var datGui = gui . datGui ;
for ( i in datGui . _ _folders ) {
Gui . update ( gui , datGui . _ _folders [ i ] ) ;
}
for ( i in datGui . _ _controllers ) {
var controller = datGui . _ _controllers [ i ] ;
if ( controller . updateDisplay ) controller . updateDisplay ( ) ;
}
} ;
/ * *
* Closes all sections of the Gui
* @ function Gui . closeAll
* @ param { gui } gui
* /
Gui . closeAll = function ( gui ) {
var datGui = gui . datGui ;
for ( var i in datGui . _ _folders ) {
datGui . _ _folders [ i ] . close ( ) ;
}
} ;
/ * *
* Destroys the GUI
* @ function Gui . destroy
* @ param { gui } gui
* /
Gui . destroy = function ( gui ) {
gui . datGui . destroy ( ) ;
} ;
var _initDatGui = function _initDatGui ( gui ) {
var engine = gui . engine ,
runner = gui . runner ,
datGui = gui . datGui ;
var funcs = {
addBody : function addBody ( ) {
_addBody ( gui ) ;
} ,
clear : function clear ( ) {
_clear ( gui ) ;
} ,
save : function save ( ) {
Serializer . saveState ( gui . serializer , engine , 'guiState' ) ; Events . trigger ( gui , 'save' ) ;
} ,
load : function load ( ) {
Serializer . loadState ( gui . serializer , engine , 'guiState' ) ; Events . trigger ( gui , 'load' ) ;
}
} ;
var metrics = datGui . addFolder ( 'Metrics' ) ;
if ( runner ) {
metrics . add ( runner , 'fps' ) . listen ( ) ;
}
if ( engine . metrics . extended ) {
if ( runner ) {
metrics . add ( runner , 'delta' ) . listen ( ) ;
metrics . add ( runner , 'correction' ) . listen ( ) ;
}
if ( engine ) {
metrics . add ( engine . metrics , 'bodies' ) . listen ( ) ;
metrics . add ( engine . metrics , 'collisions' ) . listen ( ) ;
metrics . add ( engine . metrics , 'pairs' ) . listen ( ) ;
metrics . add ( engine . metrics , 'broadEff' ) . listen ( ) ;
metrics . add ( engine . metrics , 'midEff' ) . listen ( ) ;
metrics . add ( engine . metrics , 'narrowEff' ) . listen ( ) ;
metrics . add ( engine . metrics , 'narrowReuse' ) . listen ( ) ;
}
metrics . close ( ) ;
} else {
metrics . open ( ) ;
}
if ( engine ) {
var controls = datGui . addFolder ( 'Add Body' ) ;
controls . add ( gui , 'amount' , 1 , 5 ) . step ( 1 ) ;
controls . add ( gui , 'size' , 5 , 150 ) . step ( 1 ) ;
controls . add ( gui , 'sides' , 1 , 8 ) . step ( 1 ) ;
controls . add ( gui , 'density' , 0.0001 , 0.01 ) . step ( 0.001 ) ;
controls . add ( gui , 'friction' , 0 , 1 ) . step ( 0.05 ) ;
controls . add ( gui , 'frictionStatic' , 0 , 10 ) . step ( 0.1 ) ;
controls . add ( gui , 'frictionAir' , 0 , gui . frictionAir * 10 ) . step ( gui . frictionAir / 10 ) ;
controls . add ( gui , 'restitution' , 0 , 1 ) . step ( 0.1 ) ;
controls . add ( gui , 'chamfer' , 0 , 30 ) . step ( 2 ) ;
controls . add ( funcs , 'addBody' ) ;
controls . open ( ) ;
var worldGui = datGui . addFolder ( 'World' ) ;
if ( gui . serializer ) {
worldGui . add ( funcs , 'load' ) ;
worldGui . add ( funcs , 'save' ) ;
}
worldGui . add ( funcs , 'clear' ) ;
worldGui . open ( ) ;
var gravity = worldGui . addFolder ( 'Gravity' ) ;
2017-01-26 18:42:07 -05:00
gravity . add ( engine . world . gravity , 'scale' , 0 , 0.001 ) . step ( 0.0001 ) ;
2016-11-20 19:41:57 -05:00
gravity . add ( engine . world . gravity , 'x' , - 1 , 1 ) . step ( 0.01 ) ;
gravity . add ( engine . world . gravity , 'y' , - 1 , 1 ) . step ( 0.01 ) ;
gravity . open ( ) ;
var physics = datGui . addFolder ( 'Engine' ) ;
physics . add ( engine , 'enableSleeping' ) ;
physics . add ( engine . timing , 'timeScale' , 0 , 1.2 ) . step ( 0.05 ) . listen ( ) ;
physics . add ( engine , 'velocityIterations' , 1 , 10 ) . step ( 1 ) ;
physics . add ( engine , 'positionIterations' , 1 , 10 ) . step ( 1 ) ;
2017-01-26 18:42:07 -05:00
physics . add ( engine , 'constraintIterations' , 1 , 10 ) . step ( 1 ) ;
2016-11-20 19:41:57 -05:00
if ( runner ) {
physics . add ( runner , 'enabled' ) ;
}
physics . open ( ) ;
}
if ( gui . render ) {
var render = datGui . addFolder ( 'Render' ) ;
2017-01-26 18:42:07 -05:00
render . add ( gui . render . options , 'wireframes' ) . onFinishChange ( function ( value ) {
if ( ! value ) {
angleIndicatorWidget . setValue ( false ) ;
axesWidget . setValue ( false ) ;
}
} ) ;
2016-11-20 19:41:57 -05:00
render . add ( gui . render . options , 'showDebug' ) ;
render . add ( gui . render . options , 'showPositions' ) ;
render . add ( gui . render . options , 'showBroadphase' ) ;
render . add ( gui . render . options , 'showBounds' ) ;
render . add ( gui . render . options , 'showVelocity' ) ;
render . add ( gui . render . options , 'showCollisions' ) ;
render . add ( gui . render . options , 'showSeparations' ) ;
2017-01-26 18:42:07 -05:00
var axesWidget = render . add ( gui . render . options , 'showAxes' ) ;
var angleIndicatorWidget = render . add ( gui . render . options , 'showAngleIndicator' ) ;
2016-11-20 19:41:57 -05:00
render . add ( gui . render . options , 'showSleeping' ) ;
render . add ( gui . render . options , 'showIds' ) ;
render . add ( gui . render . options , 'showVertexNumbers' ) ;
render . add ( gui . render . options , 'showConvexHulls' ) ;
render . add ( gui . render . options , 'showInternalEdges' ) ;
render . add ( gui . render . options , 'enabled' ) ;
render . open ( ) ;
}
} ;
var _addBody = function _addBody ( gui ) {
var engine = gui . engine ;
var options = {
density : gui . density ,
friction : gui . friction ,
frictionStatic : gui . frictionStatic ,
frictionAir : gui . frictionAir ,
restitution : gui . restitution
} ;
if ( gui . chamfer && gui . sides > 2 ) {
options . chamfer = {
radius : gui . chamfer
} ;
}
for ( var i = 0 ; i < gui . amount ; i ++ ) {
World . add ( engine . world , Bodies . polygon ( gui . offset . x + 120 + i * gui . size + i * 50 , gui . offset . y + 200 , gui . sides , gui . size , options ) ) ;
}
} ;
var _clear = function _clear ( gui ) {
2017-01-26 18:42:07 -05:00
var engine = gui . engine ,
constraints = Composite . allConstraints ( engine . world ) ,
mouseConstraint = null ;
// find mouse constraints
for ( var i = 0 ; i < constraints . length ; i += 1 ) {
var constraint = constraints [ i ] ;
// TODO: need a better way than this
if ( constraint . label === 'Mouse Constraint' ) {
mouseConstraint = constraint ;
break ;
}
}
2016-11-20 19:41:57 -05:00
World . clear ( engine . world , true ) ;
Engine . clear ( engine ) ;
2017-01-26 18:42:07 -05:00
// add mouse constraint back in
if ( mouseConstraint ) {
Composite . add ( engine . world , mouseConstraint ) ;
}
2016-11-20 19:41:57 -05:00
// clear scene graph (if defined in controller)
if ( gui . render ) {
var renderController = gui . render . controller ;
if ( renderController . clear ) renderController . clear ( gui . render ) ;
}
Events . trigger ( gui , 'clear' ) ;
} ;
/ *
*
* Events Documentation
*
* /
/ * *
* Fired after the gui ' s clear button pressed
*
* @ event clear
* @ param { } event An event object
* @ param { } event . source The source object of the event
* @ param { } event . name The name of the event
* /
/ * *
* Fired after the gui ' s save button pressed
*
* @ event save
* @ param { } event An event object
* @ param { } event . source The source object of the event
* @ param { } event . name The name of the event
* /
/ * *
* Fired after the gui ' s load button pressed
*
* @ event load
* @ param { } event An event object
* @ param { } event . source The source object of the event
* @ param { } event . name The name of the event
* /
/*** EXPORTS FROM exports-loader ***/
/***/ } ,
/* 1 */
/***/ function ( module , exports ) {
module . exports = _ _WEBPACK _EXTERNAL _MODULE _1 _ _ ;
/***/ } ,
/* 2 */
2017-01-26 18:42:07 -05:00
/***/ function ( module , exports ) {
module . exports = _ _WEBPACK _EXTERNAL _MODULE _2 _ _ ;
/***/ } ,
/* 3 */
2016-11-20 19:41:57 -05:00
/***/ function ( module , exports ) {
"use strict" ;
/ * *
* @ class Common
* /
var Common = module . exports = { } ;
Common . injectStyles = function ( styles , id ) {
if ( document . getElementById ( id ) ) {
return ;
}
var root = document . createElement ( 'div' ) ;
root . innerHTML = '<style id="' + id + '" type="text/css">' + styles + '</style>' ;
2017-01-26 18:42:07 -05:00
var lastStyle = document . head . querySelector ( 'style:last-of-type' ) ;
2016-11-20 19:41:57 -05:00
Common . domInsertBefore ( root . firstElementChild , lastStyle ) ;
} ;
Common . injectScript = function ( url , id , callback ) {
if ( document . getElementById ( id ) ) {
return ;
}
var script = document . createElement ( 'script' ) ;
script . id = id ;
script . src = url ;
script . onload = callback ;
document . body . appendChild ( script ) ;
} ;
Common . domRemove = function ( element ) {
return element . parentElement . removeChild ( element ) ;
} ;
Common . domInsertBefore = function ( element , before ) {
return before . parentNode . insertBefore ( element , before . previousElementSibling ) ;
} ;
/*** EXPORTS FROM exports-loader ***/
/***/ } ,
2017-01-26 18:42:07 -05:00
/* 4 */ ,
/* 5 */
2016-11-20 19:41:57 -05:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
! function ( e , t ) { true ? 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 ( o ) { if ( n [ o ] ) return n [ o ] . exports ; var i = n [ o ] = { exports : { } , id : o , loaded : ! 1 } ; return e [ o ] . call ( i . exports , i , i . exports , t ) , i . loaded = ! 0 , i . exports } var n = { } ; return t . m = e , t . c = n , t . p = "" , t ( 0 ) } ( [ function ( e , t , n ) { "use strict" ; e . exports = n ( 1 ) } , function ( e , t , n ) { "use strict" ; e . exports = { color : { Color : n ( 2 ) , math : n ( 6 ) , interpret : n ( 3 ) } , controllers : { Controller : n ( 7 ) , BooleanController : n ( 8 ) , OptionController : n ( 10 ) , StringController : n ( 11 ) , NumberController : n ( 12 ) , NumberControllerBox : n ( 13 ) , NumberControllerSlider : n ( 14 ) , FunctionController : n ( 20 ) , ColorController : n ( 21 ) } , dom : { dom : n ( 9 ) } , gui : { GUI : n ( 22 ) } , GUI : n ( 22 ) } } , function ( e , t , n ) { "use strict" ; function o ( e ) { return e && e . _ _esModule ? e : { "default" : e } } function i ( e , t ) { if ( ! ( e instanceof t ) ) throw new TypeError ( "Cannot call a class as a function" ) } function r ( e , t , n ) { Object . defineProperty ( e , t , { get : function ( ) { return "RGB" === this . _ _state . space ? this . _ _state [ t ] : ( _ . recalculateRGB ( this , t , n ) , this . _ _state [ t ] ) } , set : function ( e ) { "RGB" !== this . _ _state . space && ( _ . recalculateRGB ( this , t , n ) , 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 ] : ( _ . recalculateHSV ( this ) , this . _ _state [ t ] ) } , set : function ( e ) { "HSV" !== this . _ _state . space && ( _ . recalculateHSV ( this ) , this . _ _state . space = "HSV" ) , this . _ _state [ t ] = e } } ) } t . _ _esModule = ! 0 ; var s = n ( 3 ) , l = o ( s ) , u = n ( 6 ) , d = o ( u ) , c = n ( 4 ) , f = o ( c ) , h = n ( 5 ) , p = o ( h ) , _ = function ( ) { function e ( ) { if ( i ( this , e ) , this . _ _state = l [ "default" ] . apply ( this , arguments ) , this . _ _state === ! 1 ) throw "Failed to interpret color arguments" ; this . _ _state . a = this . _ _state . a || 1 } return e . prototype . toString = function ( ) { return f [ "default" ] ( this ) } , e . prototype . toOriginal = function ( ) { return this . _ _state . conversion . write ( this ) } , e } ( ) ; _ . recalculateRGB = function ( e , t , n ) { if ( "HEX" === e . _ _state . space ) e . _ _state [ t ] = d [ "default" ] . component _from _hex ( e . _ _state . hex , n ) ; else { if ( "HSV" !== e . _ _state . space ) throw "Corrupted color state" ; p [ "default" ] . extend ( e . _ _state , d [ "default" ] . hsv _to _rgb ( e . _ _state . h , e . _ _state . s , e . _ _state . v ) ) } } , _ . recalculateHSV = function ( e ) { var t = d [ "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 } , _ . COMPONENTS = [ "r" , "g" , "b" , "h" , "s" , "v" , "hex" , "a" ] , r ( _ . prototype , "r" , 2 ) , r ( _ . prototype , "g" , 1 ) , r ( _ . prototype , "b" , 0 ) , a ( _ . prototype , "h" ) , a ( _ . prototype , "s" ) , a ( _ . prototype , "v" ) , Object . defineProperty ( _ . prototype , "a" , { get : function ( ) { return this . _ _state . a } , set : function ( e ) { this . _ _state . a = e } } ) , Object . defineProperty ( _ . prototype , "hex" , { get : function ( ) { return "HEX" !== ! this . _ _state . space && ( this . _ _state . hex = d [ "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" ] = _ , e . exports = t [ "default" ] } , function ( e , t , n ) { "use strict" ; function o ( e ) { return e && e . _ _esModule ? e : { "default" : e } } t . _ _esModule = ! 0 ; var i = n ( 4 ) , r = o ( i ) , a = n ( 5 ) , s = o ( a ) , l = [ { litmus : s [ "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 ? ! 1 : { 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 : r [ "default" ] } , SIX _CHAR _HEX : { read : function ( e ) { var t = e . match ( /^#([A-F0-9]{6})$/i ) ; return null === t ? ! 1 : { space : "HEX" , hex : parseInt ( "0x" + t [ 1 ] . toString ( ) , 0 ) } } , write : r [ "default" ] } , CSS _RGB : { read : function ( e ) { var t = e . match ( /^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/ ) ; return null === t ? ! 1 : { space : "RGB" , r : parseFloat ( t [ 1 ] ) , g : parseFloat ( t [ 2 ] ) , b : parseFloat ( t [ 3 ] ) } } , write : r [ "default" ] } , CSS _RGBA : { read : function ( e ) { var t = e . match ( /^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/ ) ; return null === t ? ! 1 : { space : "RGB" , r : parseFloat ( t [ 1 ] ) , g : parseFloat ( t [ 2 ] ) , b : parseFloat ( t [ 3 ] ) , a : parseFloat ( t [ 4 ] ) } } , write : r [ "default" ] } } } , { litmus : s [ "default" ] . isNumber , conversions : { HEX : { read : function ( e ) { return { space : "HEX" , hex : e , conversionName : "HEX" } } , write : function ( e ) { return e . hex } } } } , { litmu
this . domElement . appendChild ( this . _ _input ) , this . domElement . appendChild ( this . _ _selector ) , this . updateDisplay ( ) } return r ( t , e ) , t . prototype . updateDisplay = function ( ) { var e = _ [ "default" ] ( this . getValue ( ) ) ; if ( e !== ! 1 ) { var t = ! 1 ; g [ "default" ] . each ( h [ "default" ] . COMPONENTS , function ( n ) { return g [ "default" ] . isUndefined ( e [ n ] ) || g [ "default" ] . isUndefined ( this . _ _color . _ _state [ n ] ) || e [ n ] === this . _ _color . _ _state [ n ] ? void 0 : ( t = ! 0 , { } ) } , this ) , t && g [ "default" ] . extend ( this . _ _color . _ _state , e ) } g [ "default" ] . extend ( this . _ _temp . _ _state , this . _ _color . _ _state ) , this . _ _temp . a = 1 ; var n = this . _ _color . v < . 5 || this . _ _color . s > . 5 ? 255 : 0 , o = 255 - n ; g [ "default" ] . 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(" + n + "," + n + "," + n + ")" } ) , this . _ _hue _knob . style . marginTop = 100 * ( 1 - this . _ _color . h / 360 ) + "px" , this . _ _temp . s = 1 , this . _ _temp . v = 1 , a ( this . _ _saturation _field , "left" , "#fff" , this . _ _temp . toString ( ) ) , g [ "default" ] . extend ( this . _ _input . style , { backgroundColor : this . _ _input . value = this . _ _color . toString ( ) , color : "rgb(" + n + "," + n + "," + n + ")" , textShadow : this . _ _input _textShadow + "rgba(" + o + "," + o + "," + o + ",.7)" } ) } , t } ( u [ "default" ] ) , v = [ "-moz-" , "-o-" , "-webkit-" , "-ms-" , "" ] ; t [ "default" ] = b , e . exports = t [ "default" ] } , function ( e , t , n ) { "use strict" ; function o ( e ) { return e && e . _ _esModule ? e : { "default" : e } } function i ( 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 r ( e , t ) { var n = e . _ _preset _select [ e . _ _preset _select . selectedIndex ] ; t ? n . innerHTML = n . value + "*" : n . innerHTML = n . value } function a ( e , t , n ) { if ( n . _ _li = t , n . _ _gui = e , K [ "default" ] . extend ( n , { options : function ( t ) { return arguments . length > 1 ? ( n . remove ( ) , l ( e , n . object , n . property , { before : n . _ _li . nextElementSibling , factoryArgs : [ K [ "default" ] . toArray ( arguments ) ] } ) ) : K [ "default" ] . isArray ( t ) || K [ "default" ] . isObject ( t ) ? ( n . remove ( ) , l ( 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 j [ "default" ] ) ! function ( ) { var e = new M [ "default" ] ( n . object , n . property , { min : n . _ _min , max : n . _ _max , step : n . _ _step } ) ; K [ "default" ] . each ( [ "updateDisplay" , "onChange" , "onFinishChange" ] , function ( t ) { var o = n [ t ] , i = e [ t ] ; n [ t ] = e [ t ] = function ( ) { var t = Array . prototype . slice . call ( arguments ) ; return o . apply ( n , t ) , i . apply ( e , t ) } } ) , G [ "default" ] . addClass ( t , "has-slider" ) , n . domElement . insertBefore ( e . domElement , n . domElement . firstElementChild ) } ( ) ; else if ( n instanceof M [ "default" ] ) { var o = function ( t ) { return K [ "default" ] . isNumber ( n . _ _min ) && K [ "default" ] . isNumber ( n . _ _max ) ? ( n . remove ( ) , l ( e , n . object , n . property , { before : n . _ _li . nextElementSibling , factoryArgs : [ n . _ _min , n . _ _max , n . _ _step ] } ) ) : t } ; n . min = K [ "default" ] . compose ( o , n . min ) , n . max = K [ "default" ] . compose ( o , n . max ) } else n instanceof T [ "default" ] ? ( G [ "default" ] . bind ( t , "click" , function ( ) { G [ "default" ] . fakeEvent ( n . _ _checkbox , "click" ) } ) , G [ "default" ] . bind ( n . _ _checkbox , "click" , function ( e ) { e . stopPropagation ( ) } ) ) : n instanceof R [ "default" ] ? ( G [ "default" ] . bind ( t , "click" , function ( ) { G [ "default" ] . fakeEvent ( n . _ _button , "click" ) } ) , G [ "default" ] . bind ( t , "mouseover" , function ( ) { G [ "default" ] . addClass ( n . _ _button , "hover" ) } ) , G [ "default" ] . bind ( t , "mouseout" , function ( ) { G [ "default" ] . removeClass ( n . _ _button , "hover" ) } ) ) : n instanceof D [ "default" ] && ( G [ "default" ] . addClass ( t , "color" ) , n . updateDisplay = K [ "default" ] . compose ( function ( e ) { return t . style . borderLeftColor = n . _ _color . toString ( ) , e } , n . updateDisplay ) , n . updateDisplay ( ) ) ; n . setValue = K [ "default" ] . compose ( function ( t ) { return e . getRoot ( ) . _ _preset _select && n . isModified ( ) && r ( e . getRoot ( ) , ! 0 ) , t } , n . setValue ) } function s ( 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 = n . load . remembered , a = void 0 ; if ( r [ e . preset ] ) a = r [ e . preset ] ; else { if ( ! r [ Z ] ) return ; a = r [ Z ] } if ( a [ o ] && void 0 !== a [ o ] [ t . proper
/***/ } ,
/* 6 */
/***/ function ( module , exports ) {
2017-01-26 18:42:07 -05:00
module . exports = " /*\n*\tMatterTools.Gui\n*/ \ n \ nbody . dg . c , \ nbody . dg . cr . function , \ nbody . dg . c select , \ nbody . dg . property - name , \ nbody . dg . title { \ n - webkit - touch - callout : none ; \ n - webkit - user - select : none ; \ n - khtml - user - select : none ; \ n - moz - user - select : none ; \ n - ms - user - select : none ; \ n user - select : none ; \ n } \ n \ nbody . dg . main { \ n z - index : 10 ; \ n box - shadow : 0 0 30 px rgba ( 0 , 0 , 0 , 0.2 ) ; \ n height : 100 % ; \ n background : rgb ( 28 , 29 , 47 ) ; \ n position : fixed ; \ n top : 0 ; \ n right : 0 ; \ n } \ n \ nbody . dg . ac { \ n position : static ; \ n top : inherit ; \ n left : inherit ; \ n bottom : inherit ; \ n right : inherit ; \ n } \ n \ n @ media only screen and ( max - width : 1500 px ) { \ n body . dg . main { \ n transform : translate ( 230 px , 0 ) ; \ n } \ n \ n body . dg . main : hover { \ n transform : translate ( 0 , 0 ) ; \ n } \ n \ n body . dg . main { \ n - webkit - transition : transform 500 ms cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n - moz - transition : transform 500 ms cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n - o - transition : transform 500 ms cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n transition : transform 500 ms cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n \ n - webkit - transition - timing - function : cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n - moz - transition - timing - function : cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n - o - transition - timing - function : cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n transition - timing - function : cubic - bezier ( 0.965 , 0.025 , 0.735 , 0.415 ) ; \ n \ n transition - delay : 2 s ; \ n - webkit - transition - delay : 2 s ; \ n } \ n \ n body . dg . main : hover { \ n - webkit - transition : transform 500 ms cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n - moz - transition : transform 500 ms cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n - o - transition : transform 500 ms cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n transition : transform 500 ms cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n \ n - webkit - transition - timing - function : cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n - moz - transition - timing - function : cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n - o - transition - timing - function : cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n transition - timing - function : cubic - bezier ( 0.095 , 0.665 , 0.400 , 0.835 ) ; \ n \ n transition - delay : 0 ; \ n - webkit - transition - delay : 0 ; \ n } \ n } \ n \ nbody . dg . main . close - button { \ n display : none ; \ n } \ n \ nbody . dg . main : : - webkit - scrollbar { \ n background : # 1 c1c25 ; \ n width : 12 px ; \ n } \ n \ nbody . dg . main : : - webkit - scrollbar - thumb { \ n background : transparent ; \ n width : 5 px ; \ n border - left : 5 px solid transparent ; \ n border - right : 6 px solid # 2 a2a31 ; \ n border - radius : 0 ; \ n } \ n \ nbody . dg { \ n color : # 9196 ad ; \ n text - shadow : none ! important ; \ n } \ n \ nbody . dg li : not ( . folder ) { \ n height : 28 px ; \ n background : # 1 c1c25 ; \ n border - bottom : 0 px ; \ n padding : 0 0 0 12 px ; \ n } \ n \ nbody . dg li . save - row . button { \ n text - shadow : none ! important ; \ n } \ n \ nbody . dg li . title { \ n padding - left : 22 px ; \ n color : # 6 f7388 ; \ n border - bottom : 1 px solid # 29292 d ; \ n background : # 0 d0f1b url ( data : image / gif ; base64 , R0lGODlhBQAFAJEAAP ////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 10px 10px no-repeat;\n}\n\nbody .dg .cr.boolean:hover {\n background: #232431;\n}\n\nbody .dg .cr.function {\n background: #262731;\n color: #6d7082;\n border-bottom: 1px solid #222535;\n border-top: 1px solid #3c3e48;\n}\n\nbody .dg .cr.function:hover {\n background: #30313e;\n}\n\nbody .dg .cr.function:active {\n transform: translateY(1px);\n}\n\nbody .dg .c,\nbody .dg .property-name {\n width: 50%;\n}\n\nbody .dg .c select {\n margin-top: 2px;\n margin-left: -5px;\n padding: 3px 5px;\n}\n\nbody .dg .c select,\nbody .dg .c input[type=text],\nbody .dg .cr.number input[type=text] {\n text-align: right;\n background: #191a23;\n color: #686c7b;\n border: 0;\n font-size: 10px;\n}\n\nbody .dg .cr.number,\nbody .dg .cr.boolean,\nbody .dg .cr.function {\n border-left: 0;\n}\n\nbody .dg .c select,\nbody .dg .c select:focus {\n width: 88px;\n outline: 0;\n}\n \nbody .dg .c input[type=text]:hover {\n background: #1c1d2f;\n}\n \nbody .dg .c input[type=text]
2016-11-20 19:41:57 -05:00
/***/ }
/******/ ] )
} ) ;
;