Skip to content

Commit

Permalink
Made the frontend more presentable
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyasvaidya authored Apr 16, 2023
1 parent 05264fb commit f991d97
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions base/templates/base/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
resize: vertical;
font-family: monospace;
line-height: 1.5;
margin-left: 128px;
margin-left: 330px;
margin-right: -15px;
box-sizing: border-box;
}
Expand Down Expand Up @@ -180,15 +180,14 @@ <h1>Code Visualizer</h1>
</div>
</div>
<div class="button-container">
<button name="execute" type="submit">Execute</button>
<button name="debug" type="submit">Visualize</button>
<button id = "executebtn" name="execute" class="addMore" title="Execute your python code!" type="submit">Execute</button>
<button id = "debugbtn" name="debug" class="addMore" title="Visualize runtime flow of your python code!" type="submit">Visualize</button>
</div>
</div>
</div>

<textarea name="input" id="input" class="short_textarea" placeholder="Input Field">{{ input }}</textarea>
<textarea name="output" id="output" class="short_textarea" placeholder="Output Field">{{ output }}</textarea>
<textarea name="debug" id="debug" class="short_textarea" placeholder="Debug Output"></textarea>
</form>
<div style="height: 250px;"></div>
<footer>
Expand All @@ -206,6 +205,15 @@ <h1>Code Visualizer</h1>
}
lineNumberContainer.innerHTML = lineNumberHTML.join('');
}
const deb_button = document.getElementById('debugbtn');
const exec_button = document.getElementById('executebtn');




exec_button.addEventListener("click", function() {
exec_button.innerText = "Executing....";
});

editor.addEventListener('input', updateLineNumbers);

Expand All @@ -228,19 +236,27 @@ <h1>Code Visualizer</h1>
outputs = outputs.replace(/'/g, '"');
outputs = JSON.parse(outputs);
var c = 0;
let debug_textarea = document.getElementById('debug');
let debug_textarea = document.getElementById('output');
function moveArrowDown() {
if (c < line_order.length) {
deb_button.innerText = "Visualizing....";//Will keep the text as visualising until we are iterating through the output list
console.log(line_order);
console.log(outputs);
topPos = 96 + 9 * line_order[c]; // move the arrow down by 5 pixels
arrow.style.top = `${topPos}%`; // update the top position of the arrow
if (outputs[c] != "")
debug_textarea.value += outputs[c] + "\n";
debug_textarea.value +=( outputs[c] + "\n");
c += 1;
}
else{
deb_button.innerText = "Visualize";

}


}

</script>
</body>

</html>
</html>

0 comments on commit f991d97

Please sign in to comment.