-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstepper.html
More file actions
71 lines (63 loc) · 2.24 KB
/
stepper.html
File metadata and controls
71 lines (63 loc) · 2.24 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Step-Through Event Loop Demo</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a class="active" href="stepper.html">Stepper</a></li>
</ul>
</nav>
<h1>Step-Through JavaScript Event Loop</h1>
<div id="steps" class="steps">
<div id="initialExecution" class="step">
1. Initial Execution (Prepping Ingredients)
</div>
<div id="promiseExecutor" class="step">
2. Promise Executor (Boiling Water)
</div>
<div id="callStackExecution" class="step">
3. Call Stack Execution (Cooking Sauce)
</div>
<div id="microtasksExecution" class="step">
4. Microtasks Execution (Checking Water & Adding Pasta)
</div>
<div id="taskExecution" class="step">
5. Task Execution (Baking & Serving)
</div>
</div>
<div class="stackContainer">
<div class="currentContainer">
<h2>Current Task</h2>
<div id="currentTask">Waiting to start Cooking...</div>
</div>
<div class="visualizer">
<h2>🔄 Event Loop Visualization</h2>
<h4>📌 Call Stack:</h4>
<div id="callStack" class="loopSteps"></div>
<h4>⌛ Pending Promises:</h4>
<div id="pendingPromises" class="loopSteps"></div>
<h4>🔹 Microtasks Queue:</h4>
<div id="microtasksQueue" class="loopSteps"></div>
<h4>🕒 Macrotasks Queue:</h4>
<div id="macrotasksQueue" class="loopSteps"></div>
</div>
</div>
<div class="bttnContainer">
<button onclick="prevStep()">Previous Step</button>
<button onclick="nextStep()">Next Step</button>
</div>
<script src="stepper.js"></script>
</body>
</html>