Skip to content

Commit 48c42b5

Browse files
committed
Modify movement ranges to be ranges with nicer output and percentage vals
1 parent 4ad7ab8 commit 48c42b5

3 files changed

Lines changed: 62 additions & 22 deletions

File tree

index.html

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -129,37 +129,29 @@ <h2>Settings</h2>
129129

130130
<fieldset>
131131
<legend>General</legend>
132+
<fieldset class="speed">
133+
<legend>Carriage Movement Speed:</legend>
134+
<div>
135+
<label for="movespeed">...while Brush is Up:</label>
136+
<input type="range" id="movespeed" min="200" max="2000" title="Move left for slower, right for faster."/>
137+
</div>
138+
<div>
139+
<label for="paintspeed">...while Brush is Down:</label>
140+
<input type="range" id="paintspeed" min="200" max="2000" title="Move left for slower, right for faster."/>
141+
</div>
142+
</fieldset>
143+
132144
<div>
133145
<label for="showcolortext">Show color name:</label>
134146
<input type="checkbox" id="showcolortext"/>
135-
<aside>When checked, color names will display for print colors, otherwise they will only be visible on hover.</aside>
147+
<aside>When checked, color names will display on the paint palette for print colors, otherwise they will only be visible on hover.</aside>
136148
</div>
137149

138150
<div>
139151
<label for="colorset">Installed Paint Set:</label>
140152
<select id="colorset"></select>
141153
</div>
142154

143-
<div>
144-
<label for="movespeed">Moving speed (brush up):</label>
145-
<select id="movespeed">
146-
<option value="700">Slow</option>
147-
<option value="1500">Medium (default)</option>
148-
<option value="2500">Fast</option>
149-
<option value="3000">Ludicrous!</option>
150-
</select>
151-
</div>
152-
153-
<div>
154-
<label for="paintspeed">Painting speed (brush down):</label>
155-
<select id="paintspeed">
156-
<option value="500">Slow</option>
157-
<option value="1000">Medium (default)</option>
158-
<option value="1500">Fast</option>
159-
<option value="2500">Ludicrous!</option>
160-
</select>
161-
</div>
162-
163155
<hr>
164156

165157
<div>

resources/main.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ function addSettingsRangeValues() {
396396
$r.change(function(){
397397
var num = parseInt($r.val());
398398
var post = "";
399+
var wrap = ['(', ')'];
399400
var dosep = true;
400401

401402
if (['servotime', 'latencyoffset'].indexOf(this.id) != -1) {
@@ -420,11 +421,32 @@ function addSettingsRangeValues() {
420421
num = Math.round((x * 100) / b);
421422
post = '%';
422423
break;
424+
case 'movespeed':
425+
case 'paintspeed':
426+
num = Math.round((num / this.max) * 100);
427+
var msg = "";
428+
429+
if (num < 25) {
430+
msg = "Paintbrush on a Snail";
431+
} else if (num < 50) {
432+
msg = "Painfully Slow";
433+
} else if (num < 75) {
434+
msg = "Medium";
435+
} else if (num < 80) {
436+
msg = "Fast (default)";
437+
} else {
438+
msg = "Stupid Fast!";
439+
}
440+
441+
dosep = false;
442+
wrap = ['', ''];
443+
post = "% - " + msg;
444+
break;
423445
}
424446

425447
if (dosep) num = num.toString(10).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
426448

427-
$l.text('(' + num + post + ')');
449+
$l.text(wrap[0] + num + post + wrap[1]);
428450
}).change();
429451

430452
$r.addClass('processed').after($l);

resources/styles.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,32 @@ body.home #settings {
674674
margin-bottom: 1em;
675675
}
676676

677+
#settings fieldset > fieldset {
678+
margin-top: 0.75em;
679+
}
680+
681+
/* Custom styling for speed fieldset */
682+
#settings fieldset.speed {
683+
margin-bottom: 1em;
684+
padding-top: 0.75em;
685+
padding-bottom: 0;
686+
}
687+
688+
#settings fieldset.speed label {
689+
display: block;
690+
text-align: center;
691+
}
692+
693+
#settings fieldset.speed input {
694+
display: block;
695+
width: 90%;
696+
}
697+
698+
#settings fieldset.speed div {
699+
float: left;
700+
width: 48%;
701+
}
702+
677703
#settings > div {
678704
padding:10px;
679705
height: 75%;

0 commit comments

Comments
 (0)