Skip to content

Commit eb8893d

Browse files
Animations
1 parent 09ba0eb commit eb8893d

File tree

5 files changed

+12
-38
lines changed

5 files changed

+12
-38
lines changed

build/debugger.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ ScriptDebugger.prototype.initialize = function() {
3232
$( "#next-opcode-container").css({"background-color": "#dddddd", "color":"black"});
3333
$( "#current-execution-pass").animate({ 'opacity': '0.0' });
3434
$( "#current-execution-fail").animate({ 'opacity': '0.0' });
35+
36+
$(" .next-opcode ").animate({ 'opacity': '1.0' }, 300);
3537
};
3638

3739

@@ -77,6 +79,7 @@ ScriptDebugger.prototype.nextStep = function(){
7779
if (this.visibleStack.peek() == 0) {
7880
this.index = -1;
7981
} else {
82+
$(" .next-opcode ").animate({ 'opacity': '0.0' });
8083
$( "#next-opcode-container").text("Execution successful");
8184
$( "#next-opcode-container").css({"background-color": "green", "color":"white"});
8285
$( "#current-execution-pass").animate({ 'opacity': '1.0' });
@@ -85,6 +88,7 @@ ScriptDebugger.prototype.nextStep = function(){
8588
}
8689

8790
if (this.index == -1) { // Execution Failure
91+
$(" .next-opcode ").animate({ 'opacity': '0.0' });
8892
$( "#next-opcode-container").text("Execution unsuccessful");
8993
$( "#next-opcode-container").css({"background-color": "red", "color":"white"});
9094
$( "#current-execution-fail").animate({ 'opacity': '1.0' });

build/editor.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ body {
177177
.completion-icon {
178178
font-size: 3.0em;
179179
position: absolute;
180-
margin-top: 2.5%;
180+
display:block;
181+
margin-top: 46px;
182+
margin-left:87%;
181183
width: 50px;
182184
}
183185

@@ -221,7 +223,6 @@ body {
221223
letter-spacing: 1px;
222224

223225
background-color: #dddddd;
224-
225226
text-shadow: 1px 1px #BFBFBF;
226227
}
227228

@@ -271,7 +272,6 @@ body {
271272
float:right;
272273
}
273274

274-
275275
#editor {
276276
height: 100%;
277277
margin: 0;

build/editor.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ <h2 id="ide-subtitle">Bitcoin Script for dummies.</h2>
151151
</button>
152152
</div>
153153
<div id="next-opcode-container" class=""></div>
154-
<span id="next-opcode-arrow" class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
154+
<span id="next-opcode-arrow" class="glyphicon glyphicon-arrow-down next-opcode" aria-hidden="true"></span>
155155

156-
<h3 id="next-opcode-text" class="">Next Argument</h3>
156+
<h3 id="next-opcode-text" class="next-opcode">Next Argument</h3>
157157
<span id="current-execution-pass" class="glyphicon glyphicon-ok completion-icon" aria-hidden="true" style="opacity:0.0; color:green;"></span>
158158
<span id="current-execution-fail" class="glyphicon glyphicon-remove completion-icon" aria-hidden="true" style="opacity:0.0; color:red;"></span>
159159
</div>

build/editor.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ var resizeDebuggerElements = function() {
139139
var debuggerCenteredWidth = buttonsWidth + $("#next-opcode-container").outerWidth(true);
140140
var widthRemainingLeftSide = (totalWidth - debuggerCenteredWidth)/2;
141141
var leftMarginForCenter = widthRemainingLeftSide + buttonsWidth + ($("#next-opcode-container").outerWidth(true)/2);
142-
console.log(totalWidth);
143-
console.log(debuggerCenteredWidth);
144-
console.log(widthRemainingLeftSide);
145-
console.log(leftMarginForCenter);
142+
146143
$("#next-opcode-arrow").css({
147144
"margin-left" : leftMarginForCenter - 19
148145
});

build/stack-visualizer.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,47 +27,20 @@ StackVisualizer.msToWaitBeforeQueueing = 0; //setTimeout timer
2727
StackVisualizer.msToWaitPerCall = 0; //delay between calls
2828

2929

30-
/*
31-
//Have an element with id myQueue
32-
var qname = 'stackAnimQueue';
33-
34-
//Add animation to the queue
35-
$('#myQueue').queue(qname, function(next) {
36-
$('#t1').animate({
37-
left: 100
38-
}, {
39-
duration: stackAnimationTime,
40-
queue: false, //so other anim queues are independent
41-
complete: next //THIS IS IMPORTANT FOR ANIMATION
42-
});
43-
});
44-
45-
//Add variable actions to the queue
46-
$('#myQueue').queue(qname, function(next) {
47-
console.log("Remove");
48-
$('#t1').append(stackElement);
49-
$('#t1').remove();
50-
$('#myQueue').dequeue(qname); //THIS IS IMPORTANT TO CONTINUE THE QUEUE SEQUENCE
51-
});
52-
53-
$('#myQueue').dequeue(qname); //Needed at some point to start the queue sequence
54-
55-
*/
56-
5730
function StackVisualizer (elemID, isHiddenStack) {
5831
this.name = "Bitcoin Stack Visualizer";
5932
this.stack = new Array();
6033
this.hasFailed = false;
6134

62-
if(isHiddenStack == undefined || !isHiddenStack) {
35+
if(elemID != undefined && (isHiddenStack == undefined || !isHiddenStack)) {
6336
this.parentID = elemID;
6437
this.stackID = StackVisualizer.stackID;
6538
this.parentElement = $("#"+elemID);
6639
this.createStackDiagram();
6740
this.isHiddenStack = false;
6841
this.callerCount = 0;
6942
} else {
70-
this.isHiddenStack = true;
43+
this.isHiddenStack = true; //Do not visualize this stack
7144
}
7245
}
7346

0 commit comments

Comments
 (0)