formatted source

I’ve run the source files through js-beautify because my editor (Atom)
kept barfing on things like not having newlines at the ends of files.
This commit is contained in:
mike 2016-06-25 14:25:23 -04:00
parent b9410572ea
commit 581e482823
27 changed files with 1635 additions and 1613 deletions

View File

@ -1,13 +1,19 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript" src="build/dat.gui.min.js"></script>
<script type="text/javascript">
var obj = { x: 5 };
var obj = {
x: 5
};
var gui = new dat.GUI();
gui.add(obj, 'x');
</script>
</body>
</html>

View File

@ -28,7 +28,6 @@ define([
this.__state.a = this.__state.a || 1;
};
Color.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];
@ -169,12 +168,10 @@ define([
var result = math.rgb_to_hsv(color.r, color.g, color.b);
common.extend(color.__state,
{
common.extend(color.__state, {
s: result.s,
v: result.v
}
);
});
if (!common.isNaN(result.h)) {
color.__state.h = result.h;

View File

@ -331,10 +331,8 @@ define([
}
];
return interpret;
});

View File

@ -36,7 +36,6 @@ define([
this.__checkbox = document.createElement('input');
this.__checkbox.setAttribute('type', 'checkbox');
dom.bind(this.__checkbox, 'change', onChange, false);
this.domElement.appendChild(this.__checkbox);
@ -81,7 +80,6 @@ define([
}
}
);

View File

@ -205,7 +205,6 @@ define([
_this.setValue(_this.__color.toOriginal());
return false;
}
@ -318,7 +317,6 @@ define([
elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'
}
return ColorController;
});

View File

@ -140,5 +140,4 @@ define([
return Controller;
});

View File

@ -45,7 +45,6 @@ define([
this.domElement.appendChild(this.__button);
};
FunctionController.superclass = Controller;
@ -53,8 +52,7 @@ define([
common.extend(
FunctionController.prototype,
Controller.prototype,
{
Controller.prototype, {
fire: function () {
if (this.__onChange) {

View File

@ -57,7 +57,6 @@ define([
this.__precision = numDecimals(this.__impliedStep);
};
NumberController.superclass = Controller;

View File

@ -134,4 +134,3 @@ define([
return NumberControllerBox;
});

View File

@ -40,15 +40,17 @@ function(NumberController, dom, css, common, styleSheet) {
*/
var NumberControllerSlider = function (object, property, min, max, step) {
NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step });
NumberControllerSlider.superclass.call(this, object, property, {
min: min,
max: max,
step: step
});
var _this = this;
this.__background = document.createElement('div');
this.__foreground = document.createElement('div');
dom.bind(this.__background, 'mousedown', onMouseDown);
dom.addClass(this.__background, 'slider');
@ -116,8 +118,6 @@ function(NumberController, dom, css, common, styleSheet) {
}
);
function map(v, i1, i2, o1, o2) {

View File

@ -45,7 +45,6 @@ define([
}
});
function onChange() {
_this.setValue(_this.__input.value);
}

View File

@ -42,7 +42,10 @@ define([
} else {
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
return new NumberControllerBox(object, property, {
min: arguments[2],
max: arguments[3]
});
}

View File

@ -16,7 +16,6 @@ define([
'dat/utils/common'
], function (dom, common) {
var CenteredDiv = function () {
this.backgroundElement = document.createElement('div');
@ -44,7 +43,6 @@ define([
transition: 'transform 0.2s ease-out, opacity 0.2s linear'
});
document.body.appendChild(this.backgroundElement);
document.body.appendChild(this.domElement);
@ -53,7 +51,6 @@ define([
_this.hide();
});
};
CenteredDiv.prototype.show = function () {

View File

@ -63,8 +63,7 @@ define([
elem.onselectstart = selectable ? function () {
return false;
} : function() {
};
} : function () {};
elem.style.MozUserSelect = selectable ? 'auto' : 'none';
elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';
@ -261,7 +260,10 @@ define([
* @param elem
*/
getOffset: function (elem) {
var offset = {left: 0, top:0};
var offset = {
left: 0,
top: 0
};
if (elem.offsetParent) {
do {
offset.left += elem.offsetLeft;

View File

@ -39,7 +39,6 @@ a.guidat-toggle:active {
text-align: center;
display: block;
padding: 5px;
}
a.guidat-toggle:hover {

View File

@ -148,7 +148,6 @@ define([
hideable: params.autoPlace
});
if (!common.isUndefined(params.load)) {
// Explicit preset
@ -156,7 +155,9 @@ define([
} else {
params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };
params.load = {
preset: DEFAULT_DEFAULT_PRESET_NAME
};
}
@ -167,7 +168,6 @@ define([
// Only root level GUI's are resizable.
params.resizable = common.isUndefined(params.parent) && params.resizable;
if (params.autoPlace && common.isUndefined(params.scrollable)) {
params.scrollable = true;
}
@ -366,10 +366,8 @@ define([
_this.closed = !_this.closed;
});
// Oh, you're a nested GUI!
} else {
@ -419,19 +417,25 @@ define([
}
// Make it not elastic.
if (!this.parent) setWidth(_this, params.width);
}
dom.bind(window, 'resize', function() { _this.onResize() });
dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); });
dom.bind(this.__ul, 'transitionend', function() { _this.onResize() });
dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() });
dom.bind(window, 'resize', function () {
_this.onResize()
});
dom.bind(this.__ul, 'webkitTransitionEnd', function () {
_this.onResize();
});
dom.bind(this.__ul, 'transitionend', function () {
_this.onResize()
});
dom.bind(this.__ul, 'oTransitionEnd', function () {
_this.onResize()
});
this.onResize();
if (params.resizable) {
addResizeHandle(this);
}
@ -446,6 +450,7 @@ define([
this.saveToLocalStorageIfPossible = saveToLocalStorage;
var root = _this.getRoot();
function resetWidth() {
var root = _this.getRoot();
root.width += 1;
@ -509,8 +514,7 @@ define([
return add(
this,
object,
property,
{
property, {
factoryArgs: Array.prototype.slice.call(arguments, 2)
}
);
@ -528,8 +532,7 @@ define([
return add(
this,
object,
property,
{
property, {
color: true
}
);
@ -576,7 +579,10 @@ define([
' name "' + name + '"');
}
var new_gui_params = { name: name, parent: this };
var new_gui_params = {
name: name,
parent: this
};
// We need to pass down the autoPlace trait so that we can
// attach event listeners to open/close folder actions to
@ -781,7 +787,6 @@ define([
markPresetModified(this.getRoot(), false);
}
},
listen: function (controller) {
@ -887,8 +892,7 @@ define([
return add(
gui,
controller.object,
controller.property,
{
controller.property, {
before: controller.__li.nextElementSibling,
factoryArgs: [common.toArray(arguments)]
}
@ -902,8 +906,7 @@ define([
return add(
gui,
controller.object,
controller.property,
{
controller.property, {
before: controller.__li.nextElementSibling,
factoryArgs: [options]
}
@ -933,8 +936,11 @@ define([
// All sliders should be accompanied by a box.
if (controller instanceof NumberControllerSlider) {
var box = new NumberControllerBox(controller.object, controller.property,
{ min: controller.__min, max: controller.__max, step: controller.__step });
var box = new NumberControllerBox(controller.object, controller.property, {
min: controller.__min,
max: controller.__max,
step: controller.__step
});
common.each(['updateDisplay', 'onChange', 'onFinishChange'], function (method) {
var pc = controller[method];
@ -949,8 +955,7 @@ define([
dom.addClass(li, 'has-slider');
controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);
}
else if (controller instanceof NumberControllerBox) {
} else if (controller instanceof NumberControllerBox) {
var r = function (returned) {
@ -962,8 +967,7 @@ define([
return add(
gui,
controller.object,
controller.property,
{
controller.property, {
before: controller.__li.nextElementSibling,
factoryArgs: [controller.__min, controller.__max, controller.__step]
});
@ -977,8 +981,7 @@ define([
controller.min = common.compose(r, controller.min);
controller.max = common.compose(r, controller.max);
}
else if (controller instanceof BooleanController) {
} else if (controller instanceof BooleanController) {
dom.bind(li, 'click', function () {
dom.fakeEvent(controller.__checkbox, 'click');
@ -988,8 +991,7 @@ define([
e.stopPropagation(); // Prevents double-toggle
})
}
else if (controller instanceof FunctionController) {
} else if (controller instanceof FunctionController) {
dom.bind(li, 'click', function () {
dom.fakeEvent(controller.__button, 'click');
@ -1003,8 +1005,7 @@ define([
dom.removeClass(controller.__button, 'hover');
});
}
else if (controller instanceof ColorController) {
} else if (controller instanceof ColorController) {
dom.addClass(li, 'color');
controller.updateDisplay = common.compose(function (r) {
@ -1077,7 +1078,6 @@ define([
}
// Did the loaded object remember thcommon.isObject?
if (preset[matched_index] &&
@ -1149,7 +1149,6 @@ define([
dom.bind(select, 'change', function () {
for (var index = 0; index < gui.__preset_select.length; index++) {
gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;
}
@ -1287,7 +1286,8 @@ define([
// set the width manually if we want it to bleed to the edge
if (gui.__save_row && gui.autoPlace) {
gui.__save_row.style.width = w + 'px';
}if (gui.__closeButton) {
}
if (gui.__closeButton) {
gui.__closeButton.style.width = w + 'px';
}
}
@ -1349,7 +1349,6 @@ define([
function updateDisplays(controllerArray) {
if (controllerArray.length != 0) {
requestAnimationFrame(function () {

View File

@ -1,10 +1,7 @@
$nest-margin: 4px;
$row-height: 27px;
$button-height: 20px;
.dg {
/** Clear list styles */
ul {
list-style: none;
@ -13,7 +10,6 @@ $button-height: 20px;
width: 100%;
clear: both;
}
/* Auto-place container */
&.ac {
position: fixed;
@ -23,51 +19,35 @@ $button-height: 20px;
height: 0;
z-index: 0;
}
&:not(.ac) .main {
/** Exclude mains in ac so that we don't hide close button */
overflow: hidden;
}
&.main {
@include transition(opacity, 0.1s, linear);
&.taller-than-window {
overflow-y: auto;
.close-button {
opacity: 1;
/* TODO, these are style notes */
margin-top: -1px;
border-top: 1px solid $border-color;
}
}
ul.closed .close-button {
opacity: 1 !important;
}
&:hover .close-button,
.close-button.drag {
opacity: 1;
}
.close-button {
/*opacity: 0;*/
@include transition(opacity, 0.1s, linear);
border: 0;
position: absolute;
line-height: $button-height - 1;
height: $button-height;
/* TODO, these are style notes */
cursor: pointer;
text-align: center;
@ -75,39 +55,28 @@ $button-height: 20px;
&:hover {
background-color: #111;
}
}
}
/* Auto-placed GUI's */
&.a {
float: right;
margin-right: 15px;
overflow-x: hidden;
&.has-save> ul {
margin-top: $row-height;
&.closed {
margin-top: 0;
}
}
.save-row {
position: fixed;
top: 0;
z-index: 1002;
}
}
li {
@include transition(height, 0.1s, ease-out);
}
/* Line items that don't contain folders. */
li:not(.folder) {
cursor: auto;
@ -116,19 +85,15 @@ $button-height: 20px;
overflow: hidden;
padding: 0 4px 0 5px;
}
li.folder {
padding: 0;
border-left: $nest-margin solid rgba(0, 0, 0, 0);
}
/** Folder names */
li.title {
cursor: pointer;
margin-left: -$nest-margin;
}
/** Hides closed items */
.closed li:not(.title),
.closed ul li,
@ -137,14 +102,12 @@ $button-height: 20px;
overflow: hidden;
border: 0;
}
/** Controller row */
.cr {
clear: both;
padding-left: 3px;
height: $row-height;
}
/** Name-half (left) */
.property-name {
cursor: default;
@ -154,13 +117,11 @@ $button-height: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
/** Controller-half (right) */
.c {
float: left;
width: 60%;
}
/** Controller placement */
.c input[type=text] {
border: 0;
@ -169,14 +130,12 @@ $button-height: 20px;
width: 100%;
float: right;
}
/** Shorter number boxes when slider is present. */
.has-slider input[type=text] {
width: 30%;
/*display: none;*/
margin-left: 0;
}
.slider {
float: left;
width: 66%;
@ -185,29 +144,24 @@ $button-height: 20px;
height: 19px;
margin-top: 4px;
}
.slider-fg {
height: 100%;
}
.c input[type=checkbox] {
margin-top: 9px;
}
.c select {
margin-top: 5px;
}
/** Ensure the entire boolean and function row shows a hand */
.cr.function,
.cr.function .property-name, /* Don't know why I need to be this explicit */
.cr.function .property-name,
/* Don't know why I need to be this explicit */
.cr.function *,
.cr.boolean,
.cr.boolean * {
cursor: pointer;
}
.selector {
display: none;
position: absolute;
@ -215,25 +169,17 @@ $button-height: 20px;
margin-top: 23px;
z-index: 10;
}
.c:hover .selector,
.selector.drag {
display: block;
}
li.save-row {
padding: 0;
.button {
display: inline-block;
padding: 0px 6px;
}
}
&.dialogue {
background-color: #222;
width: 460px;
@ -241,11 +187,11 @@ $button-height: 20px;
font-size: 13px;
line-height: 15px;
}
}
/* TODO Separate style and structure */
#dg-new-constructor {
padding: 10px;
color: #222;

View File

@ -6,13 +6,9 @@
<div id="dg-save-locally">
<input id="dg-local-storage" type="checkbox"/> Automatically save
values to <code>localStorage</code> on exit.
<input id="dg-local-storage" type="checkbox" /> Automatically save values to <code>localStorage</code> on exit.
<div id="dg-local-explain">The values saved to <code>localStorage</code> will
override those passed to <code>dat.GUI</code>'s constructor. This makes it
easier to work incrementally, but <code>localStorage</code> is fragile,
and your friends may not see the same values you do.
<div id="dg-local-explain">The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do.
</div>

View File

@ -10,40 +10,58 @@
/** Controller-half (right) */
/** Controller placement */
/** Shorter number boxes when slider is present. */
/** Ensure the entire boolean and function row shows a hand */ }
/** Ensure the entire boolean and function row shows a hand */
}
.dg ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
clear: both; }
clear: both;
}
.dg.ac {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 0;
z-index: 0; }
z-index: 0;
}
.dg:not(.ac) .main {
/** Exclude mains in ac so that we don't hide close button */
overflow: hidden; }
overflow: hidden;
}
.dg.main {
-webkit-transition: opacity 0.1s linear;
-o-transition: opacity 0.1s linear;
-moz-transition: opacity 0.1s linear;
transition: opacity 0.1s linear; }
transition: opacity 0.1s linear;
}
.dg.main.taller-than-window {
overflow-y: auto; }
overflow-y: auto;
}
.dg.main.taller-than-window .close-button {
opacity: 1;
/* TODO, these are style notes */
margin-top: -1px;
border-top: 1px solid #2c2c2c; }
border-top: 1px solid #2c2c2c;
}
.dg.main ul.closed .close-button {
opacity: 1 !important; }
opacity: 1 !important;
}
.dg.main:hover .close-button,
.dg.main .close-button.drag {
opacity: 1; }
opacity: 1;
}
.dg.main .close-button {
/*opacity: 0;*/
-webkit-transition: opacity 0.1s linear;
@ -57,109 +75,162 @@
/* TODO, these are style notes */
cursor: pointer;
text-align: center;
background-color: #000; }
background-color: #000;
}
.dg.main .close-button:hover {
background-color: #111; }
background-color: #111;
}
.dg.a {
float: right;
margin-right: 15px;
overflow-x: hidden; }
overflow-x: hidden;
}
.dg.a.has-save> ul {
margin-top: 27px; }
margin-top: 27px;
}
.dg.a.has-save> ul.closed {
margin-top: 0; }
margin-top: 0;
}
.dg.a .save-row {
position: fixed;
top: 0;
z-index: 1002; }
z-index: 1002;
}
.dg li {
-webkit-transition: height 0.1s ease-out;
-o-transition: height 0.1s ease-out;
-moz-transition: height 0.1s ease-out;
transition: height 0.1s ease-out; }
transition: height 0.1s ease-out;
}
.dg li:not(.folder) {
cursor: auto;
height: 27px;
line-height: 27px;
overflow: hidden;
padding: 0 4px 0 5px; }
padding: 0 4px 0 5px;
}
.dg li.folder {
padding: 0;
border-left: 4px solid rgba(0, 0, 0, 0); }
border-left: 4px solid rgba(0, 0, 0, 0);
}
.dg li.title {
cursor: pointer;
margin-left: -4px; }
margin-left: -4px;
}
.dg .closed li:not(.title),
.dg .closed ul li,
.dg .closed ul li> * {
height: 0;
overflow: hidden;
border: 0; }
border: 0;
}
.dg .cr {
clear: both;
padding-left: 3px;
height: 27px; }
height: 27px;
}
.dg .property-name {
cursor: default;
float: left;
clear: left;
width: 40%;
overflow: hidden;
text-overflow: ellipsis; }
text-overflow: ellipsis;
}
.dg .c {
float: left;
width: 60%; }
width: 60%;
}
.dg .c input[type=text] {
border: 0;
margin-top: 4px;
padding: 3px;
width: 100%;
float: right; }
float: right;
}
.dg .has-slider input[type=text] {
width: 30%;
/*display: none;*/
margin-left: 0; }
margin-left: 0;
}
.dg .slider {
float: left;
width: 66%;
margin-left: -5px;
margin-right: 0;
height: 19px;
margin-top: 4px; }
margin-top: 4px;
}
.dg .slider-fg {
height: 100%; }
height: 100%;
}
.dg .c input[type=checkbox] {
margin-top: 9px; }
margin-top: 9px;
}
.dg .c select {
margin-top: 5px; }
margin-top: 5px;
}
.dg .cr.function,
.dg .cr.function .property-name,
.dg .cr.function *,
.dg .cr.boolean,
.dg .cr.boolean * {
cursor: pointer; }
cursor: pointer;
}
.dg .selector {
display: none;
position: absolute;
margin-left: -9px;
margin-top: 23px;
z-index: 10; }
z-index: 10;
}
.dg .c:hover .selector,
.dg .selector.drag {
display: block; }
display: block;
}
.dg li.save-row {
padding: 0; }
padding: 0;
}
.dg li.save-row .button {
display: inline-block;
padding: 0px 6px; }
padding: 0px 6px;
}
.dg.dialogue {
background-color: #222;
width: 460px;
padding: 15px;
font-size: 13px;
line-height: 15px; }
line-height: 15px;
}
/* TODO Separate style and structure */
#dg-new-constructor {
padding: 10px;
color: #222;
@ -174,7 +245,8 @@
width: 440px;
overflow-y: scroll;
height: 100px;
position: relative; }
position: relative;
}
#dg-local-explain {
display: none;
@ -183,42 +255,64 @@
border-radius: 3px;
background-color: #333;
padding: 8px;
margin-top: 10px; }
margin-top: 10px;
}
#dg-local-explain code {
font-size: 10px; }
font-size: 10px;
}
#dat-gui-save-locally {
display: none; }
display: none;
}
/** Main type */
.dg {
color: #eee;
font: 11px 'Lucida Grande', sans-serif;
text-shadow: 0 -1px 0 #111;
/** Auto place */
/* Controller row, <li> */
/** Controllers */ }
/** Controllers */
}
.dg.main {
/** Scrollbar */ }
/** Scrollbar */
}
.dg.main::-webkit-scrollbar {
width: 5px;
background: #1a1a1a; }
background: #1a1a1a;
}
.dg.main::-webkit-scrollbar-corner {
height: 0;
display: none; }
display: none;
}
.dg.main::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #676767; }
background: #676767;
}
.dg li:not(.folder) {
background: #1a1a1a;
border-bottom: 1px solid #2c2c2c; }
border-bottom: 1px solid #2c2c2c;
}
.dg li.save-row {
line-height: 25px;
background: #dad5cb;
border: 0; }
border: 0;
}
.dg li.save-row select {
margin-left: 5px;
width: 108px; }
width: 108px;
}
.dg li.save-row .button {
margin-left: 5px;
margin-top: 1px;
@ -230,51 +324,91 @@
color: #fff;
text-shadow: 0 1px 0 #b0a58f;
box-shadow: 0 -1px 0 #b0a58f;
cursor: pointer; }
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; }
width: 8px;
}
.dg li.save-row .button:hover {
background-color: #bab19e;
box-shadow: 0 -1px 0 #b0a58f; }
box-shadow: 0 -1px 0 #b0a58f;
}
.dg li.folder {
border-bottom: 0; }
border-bottom: 0;
}
.dg li.title {
padding-left: 16px;
background: black 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); }
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.dg .closed li.title {
background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }
background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==);
}
.dg .cr.boolean {
border-left: 3px solid #806787; }
border-left: 3px solid #806787;
}
.dg .cr.function {
border-left: 3px solid #e61d5f; }
border-left: 3px solid #e61d5f;
}
.dg .cr.number {
border-left: 3px solid #2fa1d6; }
border-left: 3px solid #2fa1d6;
}
.dg .cr.number input[type=text] {
color: #2fa1d6; }
color: #2fa1d6;
}
.dg .cr.string {
border-left: 3px solid #1ed36f; }
border-left: 3px solid #1ed36f;
}
.dg .cr.string input[type=text] {
color: #1ed36f; }
.dg .cr.function:hover, .dg .cr.boolean:hover {
background: #111; }
color: #1ed36f;
}
.dg .cr.function:hover,
.dg .cr.boolean:hover {
background: #111;
}
.dg .c input[type=text] {
background: #303030;
outline: none; }
outline: none;
}
.dg .c input[type=text]:hover {
background: #3c3c3c; }
background: #3c3c3c;
}
.dg .c input[type=text]:focus {
background: #494949;
color: #fff; }
color: #fff;
}
.dg .c .slider {
background: #303030;
cursor: ew-resize; }
cursor: ew-resize;
}
.dg .c .slider-fg {
background: #2fa1d6; }
background: #2fa1d6;
}
.dg .c .slider:hover {
background: #3c3c3c; }
background: #3c3c3c;
}
.dg .c .slider:hover .slider-fg {
background: #44abda; }
background: #44abda;
}

View File

@ -1,9 +1,7 @@
$background-color: #1a1a1a;
$hover-lighten: 5%;
$border-lighten: 7%;
$active-lighten: 10%;
$number-color: #2FA1D6;
$boolean-color: #806787;
$string-color: #1ed36f;
@ -12,7 +10,6 @@ $save-row-color: #dad5cb;
$button-color: darken($save-row-color, 10%);
$border-color: lighten($background-color, $border-lighten);
$input-color: lighten($background-color, 8.5%);
@mixin transition($prop, $time, $curve) {
-webkit-transition: $prop $time $curve;
-o-transition: $prop $time $curve;
@ -49,16 +46,13 @@ $input-color: lighten($background-color, 8.5%);
@import "structure";
/** Main type */
.dg {
color: #eee;
font: 11px 'Lucida Grande', sans-serif;
text-shadow: 0 -1px 0 #111;
/** Auto place */
&.main {
/** Scrollbar */
&::-webkit-scrollbar {
width: 5px;
@ -72,102 +66,72 @@ $input-color: lighten($background-color, 8.5%);
border-radius: 5px;
background: lighten($background-color, 30%);
}
}
li {
&:not(.folder) {
background: $background-color;
border-bottom: 1px solid $border-color;
}
&.save-row {
line-height: 25px;
background: $save-row-color;
border: 0;
select {
margin-left: 5px;
width: 108px;
}
.button {
&.gears {
@include gears;
}
@include button;
&:hover {
background-color: darken($button-color, 5%);
box-shadow: 0 -1px 0 darken($button-color, 10%);
}
}
}
&.folder {
border-bottom: 0;
}
&.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);
}
}
.closed li.title {
background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==);
}
/* Controller row, <li> */
.cr {
&.boolean {
border-left: 3px solid $boolean-color;
}
&.function {
border-left: 3px solid $function-color;
}
&.number {
border-left: 3px solid $number-color;
input[type=text] {
color: $number-color;
}
}
&.string {
border-left: 3px solid $string-color;
input[type=text] {
color: $string-color;
}
}
&.function:hover,
&.boolean:hover {
background: #111;
}
}
/** Controllers */
.c {
input[type=text] {
background: $input-color;
outline: none;
&:hover {
@ -177,26 +141,19 @@ $input-color: lighten($background-color, 8.5%);
background: lighten($input-color, $active-lighten);
color: #fff;
}
}
.slider {
background: $input-color;
cursor: ew-resize;
}
.slider-fg {
background: $number-color;
}
.slider:hover {
background: lighten($input-color, $hover-lighten);
.slider-fg {
background: lighten($number-color, $hover-lighten);
}
}
}
}

View File

@ -11,8 +11,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
define([
], function() {
define([], function () {
var ARR_EACH = Array.prototype.forEach;
var ARR_SLICE = Array.prototype.slice;

View File

@ -11,8 +11,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
define([
], function() {
define([], function () {
/**
* requirejs version of Paul Irish's RequestAnimationFrame