html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!--
This code uses parts from my modified code visulize javascript code using js2flowchart.js library
Changelog: removed dead code. made the flowChart function reusable, visualize any code from input box
previous: minor changes + some speed improvements
added minor animation & flowchart based on input box code + some change
added button to run the javascript code.
-->
<!DOCTYPE html>
<html>
<head>
<title>best quizz ever...</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- js2flowchart library -->
<script src="https://bogdan-lyashenko.github.io/js-code-to-svg-flowchart/dist/js2flowchart.js"></script>
</head>
<body>
<h2>can you solve this?</h2>
<!-- edit box for quiz code -->
<pre id="editable"contenteditable><span class="comment">//What is the output of this code?
</span>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
*{
transition: 0.3s ease;
}
body {
font-size: 108%;
text-align: center;
background-color: ;
color: ;
}
h2 {
text-transform: capitalize;
color: crimson;
}
/*edit box style */
#editable{
color: white;
background-color: black;
border-radius: 1rem ;
border-color: green;
padding: 0.5rem;
}
/* color for 1st line of code */
.comment{
color: green;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';
//const c = console.log;
//info about possible issues old device
alert('note: may not work correctly in old devices like android kitkat and below. \n for them run in latest version of firefox or chrome. ')
//var startTime = performance.now();//debug
// starts page render when DOM is parsed
window.addEventListener('DOMContentLoaded',
//window.onload =// will remove onload as it's a bit slow a few miliseconds for cached load just left for testing
function delay(){
let edit = document.querySelector("#editable");
//c(eval(edit.innerText))//debug
//let btn = document.querySelector("button")
// not necessary declared a id for it in html
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run