-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-workers.html
114 lines (108 loc) · 4.63 KB
/
web-workers.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<title>Víctor Pérez - Experiments - Web Workers</title>
<meta charset="utf-8">
<link rel="shortcut icon" href="data:,">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css">
<link rel="stylesheet" href="css/spectre.min.css">
<link rel="stylesheet" href="css/spectre-exp.min.css">
<link rel="stylesheet" href="css/custom.css">
</head>
<body>
<div class="page-container off-canvas off-canvas-sidebar-show">
<div class="page-navbar">
<a class="off-canvas-toggle btn btn-link btn-action" href="#sidebar">
<i class="icon ion-md-menu"></i>
</a>
</div>
<div class="page-sidebar off-canvas-sidebar" id="sidebar">
<div class="page-brand">
<a class="page-logo" href="./"><h2>Víctor Pérez</h2></a>
</div>
<div class="page-nav">
<div class="accordion-container">
<div class="accordion">
<input id="accordion-start" type="checkbox" name="page-accordion-checkbox" hidden="" checked="checked"/>
<label class="accordion-header c-hand" for="accordion-start">Start</label>
<div class="accordion-body">
<ul class="menu menu-nav">
<li class="menu-item">
<a href="/index.html#about-me"><i class="icon ion-md-person"></i> About me</a>
</li>
<li class="menu-item">
<a href="/index.html#education"><i class="icon ion-md-school"></i> Education</a>
</li>
<li class="menu-item">
<a href="/index.html#work-experience"><i class="icon ion-md-cafe"></i> Work experience</a>
</li>
<li class="menu-item">
<a href="/index.html#skills"><i class="icon ion-md-briefcase"></i> Skills</a>
</li>
</ul>
</div>
</div>
<div class="accordion">
<input id="accordion-experiments" type="checkbox" name="page-accordion-checkbox" hidden="" checked="checked"/>
<label class="accordion-header c-hand" for="accordion-experiments">Experiments</label>
<div class="accordion-body">
<ul class="menu menu-nav">
<li class="menu-item"><a href="/web-workers.html">Web Workers</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div><a class="off-canvas-overlay" href="#close"></a>
<div class="off-canvas-content">
<div class="page-content" id="content">
<!-- Web Workers -->
<div class="container" id="web-workers">
<h3 class="s-title">Web Workers <a class="anchor" href="#web-workers" aria-hidden="true">#</a></h3>
<div class="row">
<p>
<div class="form-group">
<label class="form-label" for="input-nworkers">Number of workers to spawn</label>
<input class="form-input" type="number" max="10" min="2" value="2" id="input-nworkers" placeholder="Workers to spawn">
</div>
<div class="form-group">
<button class="btn" type="button" onclick="spawn()"><i class="icon ion-md-add"></i> Spawn workers</button>
<button class="btn" type="button" onclick="resetEverything()"><i class="icon ion-md-trash"></i> Kill workers and reset</button>
</div>
</p>
</div>
<div class="row">
<p>
<h5>Send message to workers</h5>
<div class="form-group">
<input class="form-input" type="text" maxlength="50" value="test" id="input-message" placeholder="Message to send">
</div>
<div id="button-container"></div>
</p>
</div>
<div class="row">
<p>
<h5>Message tracking</h5>
<table class="table" id="message-container">
<thead>
<tr>
<th width="25%">Time</th>
<th>Message</th>
</tr>
</thead>
<tbody></tbody>
</table>
</p>
</div>
</div>
<!-- spacer -->
<div style="height:200px"></div>
</div>
</div>
</div>
<!-- Web workers main script -->
<script defer src="./js/main.js"></script>
</body>
</html>