-
Notifications
You must be signed in to change notification settings - Fork 0
/
diffusion.html
270 lines (260 loc) · 11.5 KB
/
diffusion.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="Vendors/css/normalize.css" type="text/css" rel="stylesheet" />
<link href="Resources/css/base.css" type="text/css" rel="stylesheet" />
<link href="Resources/css/style-general.css" type="text/css" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Lato:100,300,400,300italic" rel="stylesheet" type="text/css" />
<style>
</style>
<script defer type="module" src="Resources/js/graphD3.js"></script>
<script defer type="module" src="Resources/js/treePloter.js"></script>
<script defer type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script defer nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
</head>
<body>
<header>
<div class="topbar">
<div class="row">
<a id="btnHome" href="./index.html">
<ion-icon name="home-outline"></ion-icon> Home
</a>
<div class="topList">
<li>
<a href="#creation">Creation</a>
</li>
<li>
<a href="#canva">Canva</a>
</li>
<li>
<a href="#logic">Logic</a>
</li>
<li>
<img src="Resources/img/logo-white.png" alt="logo" class="logo" />
</li>
</div>
</div>
</div>
</header>
<main>
<section id="creation">
<div class="row">
<h3>Network Creation</h3>
</div>
<div class="row">
<div class="tab">
<button class="tablinks active" onclick="openTab(event, 'Nodes')">Nodes</button>
<button class="tablinks" onclick="openTab(event, 'Behaviors')">Behaviors</button>
<button class="tablinks" onclick="openTab(event, 'Settings')">Settings</button>
</div>
<div id="Nodes" class="tabcontent" style="display: block;">
<div class="row">
<h6>Selected Node:</h6>
<span class="note">(Selected node in <span class="blue-span">■blue</span>)</span>
<span class="note">(Auto-select last added with <span class="purple-span">■purple</span>
color)</span>
</div>
<div class="row flex-box" id="divNodes">
<span id="spanNodeDiv" class="note">click below at "Add Random Node" to start</span>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<h6>Linked Nodes:</h6>
<span class="note">(Nodes linked to selected node in <span
class="green-span">■green</span>)</span>
<span class="note">(Non-linkable nodes in <span class="black-span">■black</span>
color)</span>
</div>
<div class="row flex-box" id="divNodeLinks">
<span id="spanNodeLinkDiv" class="note">click below at "Add Random Node" to start</span>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<h6>Behaviors of the Selected Node:</h6>
</div>
<div class="row flex-box" id="divNodeBehaviors">
<span id="spanNodeBehaviorDiv" class="note">Behaviors are created in the adjacent tab</span>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<h6>ID:</h6><input type="text" class="input-text-style" id="tbxNodeId" disabled />
<h6>Symbol:</h6>
<div class="styled-select">
<select id="selNodeSymbol">
</select>
</div>
<h6>Name:</h6><input type="text" class="input-text-style" id="tbxNodeName" />
<button id="btnUpdateNode" class="btn-style-small wauto">Update
Node</button>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<button id="btnAddNode" class="btn-style-small wauto">Add Random Node</button>
<button id="btnDeleteNode" class="btn-style-small wauto">Delete Selected Node</button>
<div id="modalDeleteNode" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<p>Confirm Node Deletion?</p>
<button id="btnConfirmDetion" class="btn-style-small wauto">Yes</button>
<button id="btnCancelDeletion" class="btn-style-small wauto">No</button>
</div>
</div>
</div>
</div>
<div id="Behaviors" class="tabcontent">
<div class="row">
<h6>Behaviors:</h6>
<span class="note">(Selected Behavior in <span class="blue-span">■blue</span>)</span>
<span class="note">(Auto-select last added with <span class="purple-span">■purple</span>
color)</span>
</div>
<div class="row flex-box" id="divBehaviors">
<span id="spanDivBehaviors" class="note">click below at "Add Random Behavior" to start</span>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<h6>ID:</h6><input type="text" class="input-text-style" id="tbxBehaviorId" disabled />
<h6>short-description:</h6>
<input type="text" class="input-text-style" id="tbxBehaviorShort" />
<h6>description:</h6><input type="text" class="input-text-style" id="tbxBehaviorDesc" />
<button id="btnUpdateBehavior" class="btn-style-small wauto">Update
Behavior</button>
</div>
<div class="row">
<hr>
</div>
<div class="row">
<h6>Selected Behavior Commands:</h6>
</div>
<div class="row">
<button id="btnAddBehavior" class="btn-style-small wauto">Add Random Behavior</button>
<button id="btnDeleteBehavior" class="btn-style-small wauto">Delete
Behavior</button>
<div id="modalDeleteBehavior" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<p>Confirm Behavior Deletion?</p>
<button id="btnConfirmBehaviorDeletion" class="btn-style-small wauto">Yes</button>
<button id="btnCancelBehaviorDeletion" class="btn-style-small wauto">No</button>
</div>
</div>
</div>
</div>
<div id="Settings" class="tabcontent">
<div class="row">
<h6>Threshold:</h6>
</div>
<div class="row">
<input type="range" min="1" max="100" value="50" class="slider" id="rangeThreshold">
</div>
<div class="row">
<p>Value: <span id="lblThreshold">teste</span></p>
</div>
<div class="row">
<h6>Graph Settings:</h6>
</div>
<div class="row flex-box">
<input class="check-input" type="checkbox" id="btnShowHideAxis" checked />
<label class="check-label" for="btnShowHideAxis">Axis Bar</label>
</div>
</div>
</div>
<div class="row" id="database">
<div class="right">
<button id="btnDatabase" class="btn-style-small wauto">
<ion-icon id="iconDatabase" name="add-circle-outline"></ion-icon>Show/Hide Database
</button>
<button id="btnRefreshDatabase" class="btn-style-small wauto">Refresh Database</button>
<button id="btnSaveDatabase" class="btn-style-small wauto">Save Database</button>
</div>
<textarea id="myTextArea" class="textarea15" rows=15 readonly style="display: none;"></textarea>
</div>
</section>
<section id="canvas">
<div class="row">
<div class="canva"></div>
</div>
</section>
<section id="logic">
<div class="row">
<h3>Logic area:</h3>
</div>
<div id="logicDiv" class="logic-content">
<div class="row">
<div class="command-bar-container">
<input id="txtCommand" type="text" class="input-text-underlined"
placeholder="Insert your desired Logical Commands here...">
<button id="btnSubmitCommand" class="btn-style-small">Submit</button>
</div>
</div>
</div>
<div class="row">
<div id="message">
<ion-icon name="information-circle-outline"></ion-icon>
<span>tanannana</span>
</div>
</div>
<div class="row" id="ast">
<div class="canvaAST"></div>
<textarea id="myTextAreaAST" onfocus="this.select();" class="textarea15" rows=32 readonly></textarea>
</div>
</section>
<script>
function openTab(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
/* ----- Modal Deletion Area ----- */
// Get the modal
var modal = document.getElementById("modalDeleteNode");
// Get the button that opens the modal
var btn = document.getElementById("btnDeleteNode");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// Get the "No" button that cancel deletion
var btnNo = document.getElementById("btnCancelDeletion");
// When the user clicks on the button, open the modal
btn.onclick = function () {
modal.style.display = "block";
}
// When the user clicks on <span> (x) or "No" button, close the modal
span.onclick = function () {
modal.style.display = "none";
}
btnNo.onclick = function () {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
</main>
</body>
</html>