mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Changes to index
This commit is contained in:
parent
5a1c06798e
commit
d14512b454
@ -114,6 +114,7 @@ var NumberController = function() {
|
|||||||
} else if (max != undefined && val >= max) {
|
} else if (max != undefined && val >= max) {
|
||||||
val = max;
|
val = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
_this.setValue(val);
|
_this.setValue(val);
|
||||||
|
|
||||||
numberField.value = roundToDecimal(_this.getValue(), 4);
|
numberField.value = roundToDecimal(_this.getValue(), 4);
|
||||||
|
@ -8,11 +8,21 @@ body {
|
|||||||
padding: 0 20px 20px 20px;
|
padding: 0 20px 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#container {
|
||||||
|
max-width: 530px;
|
||||||
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
font-family: "Helvetica Neue", helvetica, arial, sans-serif;
|
font-family: "Helvetica Neue", helvetica, arial, sans-serif;
|
||||||
color: #222;
|
color: #222;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
height: 0;
|
||||||
|
border-top: 1px dotted #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 80px;
|
font-size: 80px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
@ -68,7 +78,6 @@ pre {
|
|||||||
|
|
||||||
p, ul {
|
p, ul {
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
max-width: 530px;
|
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
2
gui.js
2
gui.js
@ -147,6 +147,4 @@ var GUI = new function() {
|
|||||||
open = false;
|
open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
21
index.html
21
index.html
@ -49,6 +49,7 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="container">
|
||||||
<div id = "helvetica-demo"></div>
|
<div id = "helvetica-demo"></div>
|
||||||
<div id = "notifier"></div>
|
<div id = "notifier"></div>
|
||||||
<h1><a href = "http://twitter.com/guidat"><img src = "demo/assets/profile.png" border = "0" alt = "GUI-DAT flag" /></a></h1>
|
<h1><a href = "http://twitter.com/guidat"><img src = "demo/assets/profile.png" border = "0" alt = "GUI-DAT flag" /></a></h1>
|
||||||
@ -62,7 +63,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>Basic Usage</h2>
|
<h2>Basic Usage</h2>
|
||||||
<pre id="demo-pre" class="prettyprint"><script type="text/javascript" src="demo/demo.js"></script>
|
<pre class="prettyprint"><script type="text/javascript" src="demo/demo.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
@ -79,14 +80,14 @@ window.onload = function() {
|
|||||||
GUI.add(fizzyText, "growthSpeed", 0.01, 1);
|
GUI.add(fizzyText, "growthSpeed", 0.01, 1);
|
||||||
GUI.add(fizzyText, "speed", 0.1, 2);
|
GUI.add(fizzyText, "speed", 0.1, 2);
|
||||||
|
|
||||||
// Sliders with min, max and increment.
|
// Sliders with min, max and increment
|
||||||
GUI.add(fizzyText, "noiseStrength", 10, 100, 5);
|
GUI.add(fizzyText, "noiseStrength", 10, 100, 5);
|
||||||
|
|
||||||
// Boolean checkbox
|
// Boolean checkbox
|
||||||
GUI.add(fizzyText, "displayOutline");
|
GUI.add(fizzyText, "displayOutline");
|
||||||
|
|
||||||
// Fires a function called "explode"
|
// Fires a function called "explode"
|
||||||
GUI.add(fizzyText, "explode").setName('Explode!'); // Specify a custom name.
|
GUI.add(fizzyText, "explode").setName("Explode!"); // Specify a custom name.
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,8 +97,20 @@ window.onload = function() {
|
|||||||
<li><strong>gui-dat</strong> will infer the type of the property you're trying to add<br/>(based on its initial value) and create the corresponding control.</li>
|
<li><strong>gui-dat</strong> will infer the type of the property you're trying to add<br/>(based on its initial value) and create the corresponding control.</li>
|
||||||
<li>The properties must be public, i.e. defined by <code><strong>this</strong>.prop = value</code>.</li>
|
<li>The properties must be public, i.e. defined by <code><strong>this</strong>.prop = value</code>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<!--
|
||||||
|
<hr/>
|
||||||
|
<h2>Monitor variable changes <em>outside</em> of the GUI</h2>
|
||||||
|
<p>Let's say you have a variable that changes by itself from time to time. If you'd like the GUI to reflect those changes, use the <code>listen()</code> method.</p>
|
||||||
|
<pre class="prettyprint">GUI.add(obj, "propName").listen();</pre>
|
||||||
|
|
||||||
|
<h2>Fire a function when someone uses a control</h2>
|
||||||
|
<pre class="prettyprint">GUI.add(obj, "propName").onChange(function(n) {
|
||||||
|
alert("You changed me to " + n);
|
||||||
|
});</pre>
|
||||||
|
-->
|
||||||
<footer>
|
<footer>
|
||||||
By <a href="http://georgemichaelbrower.com/">George Michael Brower</a>, <a href="http://jonobr1.com/">Jono Brandel</a>, and <a href="http://github.com/jonobr1/GUI-DAT">you</a>.
|
Initiated by <a href="http://georgemichaelbrower.com/">George Michael Brower</a> and <a href="http://jonobr1.com/">Jono Brandel</a> of the Data Arts Team, Google Creative Lab.
|
||||||
</footer>
|
</footer>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user