Skip to content

Commit fec3dbd

Browse files
committed
improve run/pause buttons
1 parent 8399e39 commit fec3dbd

9 files changed

+41
-17
lines changed

css/stylesheet.css

+13-4
Original file line numberDiff line numberDiff line change
@@ -493,16 +493,25 @@ input[type=number]::-webkit-outer-spin-button {
493493
}
494494

495495
.complexity {
496-
margin: 10px 0px;
496+
margin: 10px 0px;
497497
}
498+
498499
.complexity-type {
499-
font-weight: bold;
500+
font-weight: bold;
500501
}
501502

502503
.buttons button.active {
503-
font-weight: bold;
504+
font-weight: bold;
504505
}
505506

506507
.buttons button.active .fa {
507-
color: #00e676;
508+
color: #00e676;
509+
}
510+
511+
#btn_pause > .btn-text:before {
512+
content: 'Pause'
508513
}
514+
515+
#btn_pause.active > .btn-text:before {
516+
content: 'Resume'
517+
}

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h3>
4747
</button>
4848
<button id="btn_pause">
4949
<i class="fa fa-pause" aria-hidden="true"></i>
50-
<span class="btn-text">Pause</span>
50+
<span class="btn-text"></span>
5151
</button>
5252
<button id="btn_next">
5353
<span class="btn-text">Next</span>

js/tracer_manager/manager.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ TracerManager.prototype = {
164164
step(i, options = {}) {
165165
const tracer = this;
166166

167-
if (isNaN(i) || i >= this.traces.length || i < 0) return;
167+
if (isNaN(i) || i >= this.traces.length || i < 0) {
168+
$('#btn_run').removeClass('active');
169+
return;
170+
}
168171

169172
this.traceIndex = i;
170173
const trace = this.traces[i];

public/algorithm_visualizer.css

+13-4
Original file line numberDiff line numberDiff line change
@@ -622,16 +622,25 @@ input[type=number]::-webkit-outer-spin-button {
622622
}
623623

624624
.complexity {
625-
margin: 10px 0px;
625+
margin: 10px 0px;
626626
}
627+
627628
.complexity-type {
628-
font-weight: bold;
629+
font-weight: bold;
629630
}
630631

631632
.buttons button.active {
632-
font-weight: bold;
633+
font-weight: bold;
633634
}
634635

635636
.buttons button.active .fa {
636-
color: #00e676;
637+
color: #00e676;
638+
}
639+
640+
#btn_pause > .btn-text:before {
641+
content: 'Pause'
637642
}
643+
644+
#btn_pause.active > .btn-text:before {
645+
content: 'Resume'
646+
}

public/algorithm_visualizer.js

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)