WIP fixes, adding button to randomize point cycles

This commit is contained in:
Tyler Hallada 2017-08-12 21:33:53 -04:00
parent e97a4ee3ec
commit 1b5c8261cf
2 changed files with 4 additions and 2 deletions

View File

@ -111,6 +111,7 @@
<input type="range" name="timeRange" min="1" max="360" value="0" oninput="this.form.timeInput.value=this.value" /> <input type="range" name="timeRange" min="1" max="360" value="0" oninput="this.form.timeInput.value=this.value" />
<input type="number" name="timeInput" min="1" max="360" value="0" oninput="this.form.timeRange.value=this.value" /> <input type="number" name="timeInput" min="1" max="360" value="0" oninput="this.form.timeRange.value=this.value" />
</label><br /> </label><br />
<button name="randomizeCyclesButton">Randomize Point Cycles</button><br />
<label>Point tweening: <label>Point tweening:
<label><input type="radio" name="tweening" value="linear" /> Linear</label> <label><input type="radio" name="tweening" value="linear" /> Linear</label>
<label><input type="radio" name="tweening" value="meandering" checked /> Meandering</label> <label><input type="radio" name="tweening" value="meandering" checked /> Meandering</label>

View File

@ -817,7 +817,7 @@ window.onload = function () {
window.addEventListener('keydown', function (e) { window.addEventListener('keydown', function (e) {
var i; var i;
if (e.target.tagName !== 'CANVAS' || e.target.tagName !== 'BODY') return; if (e.target.tagName === 'INPUT') return;
if (e.keyCode === 37) { // left if (e.keyCode === 37) { // left
pointShiftBiasX = -1; pointShiftBiasX = -1;
} else if (e.keyCode === 38) { // up } else if (e.keyCode === 38) { // up
@ -889,7 +889,7 @@ window.onload = function () {
} }
}); });
/* BUTTON EVENTS */ /* BUTTON & INPUT EVENTS */
document.getElementById('toggle-help').addEventListener('click', function () { document.getElementById('toggle-help').addEventListener('click', function () {
toggleHelp(); toggleHelp();
@ -912,6 +912,7 @@ window.onload = function () {
timeInput.value = cycleDuration; timeInput.value = cycleDuration;
timeInput.addEventListener('input', function (e) { timeInput.addEventListener('input', function (e) {
var oldCycleDuration = cycleDuration; var oldCycleDuration = cycleDuration;
if (this.value === '' || this.value === '0') return;
cycleDuration = parseInt(this.value, 10); cycleDuration = parseInt(this.value, 10);
polygonPoints = redistributeCycles(polygonPoints, oldCycleDuration, cycleDuration); polygonPoints = redistributeCycles(polygonPoints, oldCycleDuration, cycleDuration);
}); });