Skip to content

Commit d99cc02

Browse files
committed
Merge branch 'gh-pages' of https://github.com/parkjs814/AlgorithmVisualizer into gh-pages
2 parents 993b983 + c2e4504 commit d99cc02

5 files changed

Lines changed: 53 additions & 9 deletions

File tree

‎css/stylesheet.css‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,19 @@ input[type=number]::-webkit-inner-spin-button,
489489
input[type=number]::-webkit-outer-spin-button {
490490
-webkit-appearance: none;
491491
margin: 0;
492-
}
492+
}
493+
494+
.complexity {
495+
margin: 10px 0px;
496+
}
497+
.complexity-type {
498+
font-weight: bold;
499+
}
500+
501+
.buttons button.active {
502+
font-weight: bold;
503+
}
504+
505+
.buttons button.active .fa {
506+
color: #00e676;
507+
}

‎index.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ <h3>
3838
</div>
3939
</div>
4040
<button id="btn_run">
41-
<i class="fa fa-play" aria-hidden="true"></i>
41+
<i class="fa fa-play" aria-hidden="true"></i>
4242
<span class="btn-text">Run</span>
4343
</button>
4444
<button id="btn_prev">
45-
<i class="fa fa-chevron-left" aria-hidden="true"></i>
45+
<i class="fa fa-chevron-left" aria-hidden="true"></i>
4646
<span class="btn-text">Prev</span>
4747
</button>
4848
<button id="btn_pause">
@@ -147,4 +147,4 @@ <h3>
147147
</script>
148148
</body>
149149

150-
</html>
150+
</html>

‎js/dom/setup/setup_top_menu.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,34 @@ module.exports = () => {
2424

2525
// control
2626

27-
$('#btn_run').click(() => {
27+
$('#btn_run').click(function() {
2828
$('#btn_trace').click();
29+
$('#btn_pause').removeClass('active');
30+
$(this).addClass('active');
2931
var err = app.getEditor().execute();
3032
if (err) {
3133
console.error(err);
3234
Toast.showErrorToast(err);
3335
}
3436
});
3537
$('#btn_pause').click(function() {
38+
$('#btn_run').removeClass('active');
39+
$(this).addClass('active');
3640
if (app.getTracerManager().isPause()) {
3741
app.getTracerManager().resumeStep();
3842
} else {
3943
app.getTracerManager().pauseStep();
4044
}
4145
});
4246
$('#btn_prev').click(() => {
47+
$('#btn_run').removeClass('active');
48+
$('#btn_pause').addClass('active');
4349
app.getTracerManager().pauseStep();
4450
app.getTracerManager().prevStep();
4551
});
4652
$('#btn_next').click(() => {
53+
$('#btn_run').removeClass('active');
54+
$('#btn_pause').addClass('active');
4755
app.getTracerManager().pauseStep();
4856
app.getTracerManager().nextStep();
4957
});
@@ -64,4 +72,4 @@ module.exports = () => {
6472
$(this).addClass('active');
6573
});
6674

67-
};
75+
};

‎js/dom/show_description.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ module.exports = (data) => {
3636
$container.append($ul);
3737

3838
each(value, (prop) => {
39-
$ul.append($('<li>').append($('<strong>').html(prop)).append(` ${value[prop]}`));
39+
const $wrapper = $('<div class="complexity">');
40+
const $type = $('<span class="complexity-type">').html(`${prop}: `);
41+
const $value = $('<span class="complexity-value">').html(`${value[prop]}`);
42+
43+
$wrapper.append($type).append($value);
44+
45+
$ul.append($('<li>').append($wrapper));
4046
});
4147
}
4248
});
43-
};
49+
};

‎public/algorithm_visualizer.css‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,4 +618,19 @@ input[type=number]::-webkit-inner-spin-button,
618618
input[type=number]::-webkit-outer-spin-button {
619619
-webkit-appearance: none;
620620
margin: 0;
621-
}
621+
}
622+
623+
.complexity {
624+
margin: 10px 0px;
625+
}
626+
.complexity-type {
627+
font-weight: bold;
628+
}
629+
630+
.buttons button.active {
631+
font-weight: bold;
632+
}
633+
634+
.buttons button.active .fa {
635+
color: #00e676;
636+
}

0 commit comments

Comments
 (0)