-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
436 lines (340 loc) · 23.6 KB
/
index.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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Super Orange App</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="manifest" href="manifest.json">
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js');
}
</script>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Monoton&display=swap" rel="stylesheet">
<script src="localforage.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.5.2/vue.min.js"></script>
<!-- CDNJS :: Sortable (https://cdnjs.com/) -->
<script src="//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
<!-- CDNJS :: Vue.Draggable (https://cdnjs.com/) -->
<script src="//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js"></script>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<script defer src="//unpkg.com/brain.js" defer></script>
<!-- <script type="text/javascript" src="browserbrain.js"></script> -->
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/8.2.0/firebase-analytics.js"></script>
<!-- Add Firebase products that you want to use -->
<script defer src="https://www.gstatic.com/firebasejs/8.1.2/firebase-auth.js"></script>
<script defer src="https://www.gstatic.com/firebasejs/8.1.2/firebase-firestore.js"></script>
<script defer src="./init-firebase.js"></script>
<!-- <script defer src="httpVueLoader.js"></script> -->
<script src="https://unpkg.com/http-vue-loader"></script>
<script type="module" src="script.js" defer></script>
</head>
<body>
<div id="app">
<overlay-input-edit :show="overlayInputEditShow" :inputdata="selectedWorkplace.inputData" @showm="overlayInputEditShow=false" @done="inputedit"></overlay-input-edit>
<orange-face v-show="showOrangeFace" @closeface="showOrangeFace=false"></orange-face>
<div class="container-fluid">
<div class="row header">
<div class="col-12 col-md-4" style="width:400px;font-family: 'Monoton', cursive;">
<h2>Super Orange App</h2>
</div>
<div class="col-8 col-md-2" v-show="isMobile">
<button class="btn btn-primary" @click="navigateTo('viewTabs')" v-if="!showLogin">Home</button>
<button class="btn btn-primary" @click="installapp" v-else>Install App</button>
<button class="btn btn-primary" @click="logout()" v-if="!showLogin">Logout</button>
</div>
<div class="col-3 col-md-2" class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" v-model="darkmode" />
<div class="slider round"></div>
</label>
<em v-show="!isMobile">Enable Dark Mode!</em>
</div>
</div>
<div class="row main login-container" v-if="showLogin">
<div class="login-form">
<form>
<!-- <h2 class="text-center" style="color:#F44725;">You already have an account! , only an email
address is required</h2> -->
<h2 class="text-center" style="color:#F44725;">Login</h2>
<div class="form-group">
<input type="text" class="form-control" v-model="fireEmail" id="fireEmail" Placeholder="Email" required="required">
<input type="password" class="form-control" v-model="firePassword" id="firePassword" Placeholder="Password" required="required">
<input type="password" class="form-control" v-model="fireConfirmPassword" id="fireConfirmPassword" Placeholder="Confirm Password" required="required" v-show="showRegister">
</div>
<div class="form-group" v-if="!showRegister">
<button @click="fireSigninWithPassword();" type="submit" class="btn btn-primary btn-block">Login</button>
</div>
<div class="form-group" v-else>
<button @click="fireRegisterWithPassword();" type="submit" class="btn btn-primary btn-block">Register</button>
</div>
<hr>
<div v-show="!showRegister" style="color: var(--font-color-invert);">
Don't have an account,
<a @click="showRegister = true" style="color:blue;text-decoration: underline;">Signup</a>
</div>
<div v-show="showRegister" style="color: var(--font-color-invert);">
Already have an account
<a @click="showRegister = false" style="color:blue;text-decoration: underline;">Login</a>
</div>
<hr>
<div class="form-group">
<button @click="fireSignin();" type="submit" class="btn btn-primary btn-block">Login via
email only</button>
</div>
<hr>
<div class="form-group">
<input type="text" class="form-control" v-model="firePhone" id="firePhone" Placeholder="Phone" required="required">
</div>
<div class="form-group">
<button @click="fireSigninPhone();" type="submit" class="btn btn-primary btn-block">Log via
phone</button>
</div>
<div id="recaptcha-container"></div>
</form>
<p class="text-center"><a @click="showLogin = false" style="cursor: pointer;">Use Locally</a></p>
</div>
<!-- <input size="20" type="text" v-model="fireEmail" id="groupsConfig" Placeholder="Email" style="width: 200px;"/>
<button class="btn btn-primary" @click="fireSignin();" style="width: 200px;">Signin</button>
<button class="btn btn-primary" @click="showLogin = false" style="width: 200px;">Try Demo</button> -->
</div>
<div :class="isMobile ? 'row main-mobile' : 'row main'" v-if="!showLogin">
<!-- half size column in bootstrap -->
<div class="col-12 col-md-5" v-show="viewTabs || viewDataInsert">
<div :class="isMobile ? 'row main-mobile' : 'row main'">
<div class="col-12 col-md-4 workspaces" v-show="viewTabs">
<div class="options-panel">
<button class="btn btn-primary" @click="addWorkPlace();">+ Add Tab</button>
</div>
<draggable class="overflow-container" v-model="workplaces" :options="{disabled : isMobile}" @start="drag=true" @end="drag=false" @change="saveWorkPlace()">
<div :class="selectedWorkplace.name === item.name ? 'workplace-button-selected noselect':'workplace-button noselect'" v-for="item in workplaces" @click="changeWorkPlace(item);output='';diagram=''">
<span>{{item.name}}</span>
</div>
</draggable>
<div class="footer-style footer-margin" v-if="isMobile">
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="showOrangeFace = true;">Orange Face</button>
<button class="btn btn-primary" @click="installapp" v-show="installButton">Install App</button>
</footer>
</div>
<div class="footer-style footer-margin" v-else>
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="showOrangeFace = true;">Orange Face</button>
</footer>
</div>
<!-- <div class="workplace-button" @click="addWorkPlace();">
<span>+ Add Tab</span>
</div> -->
</div>
<div class="col-12 col-md-8 data-insert-container" v-show="viewDataInsert">
<div class="options-panel scrollmenu" v-if="selectedWorkplace.name">
<button class="btn btn-primary scrollmenuitem" @click="saveWorkPlace()">Save</button>
<button class="btn btn-primary scrollmenuitem" @click="renameWorkPlace()">Rename</button>
<button class="btn btn-primary scrollmenuitem" @click="removeWorkPlace()">Delete Tab</button>
<button class="btn btn-primary scrollmenuitem" @click="duplicateWorkPlace()">Duplicate</button>
<button class="btn btn-primary scrollmenuitem" @click="overlayInputEditShow=true;">Select Columns</button>
<button class="btn btn-primary scrollmenuitem" @click="inputUndo()">Undo Last Change</button>
</div>
<div class="overflow-container" v-if="selectedWorkplace.name" style="padding: 20px;">
<div>
Enter your previous draw data below (oldest to newest, newest on the bottom):<br>
<div class="form-group">
<textarea class="form-control text-area" v-model="selectedWorkplace.inputData" placeholder="Insert winnings" id="floatingTextarea2" style="height: 400px"></textarea>
<label for="floatingTextarea2">Winnings</label>
</div>
</div>
<br>
<button class="btn btn-primary" @click="selectedWorkplace.inputData='';">Clear
Input</button>
<button class="btn btn-primary" @click="reverseInputLines();">Reverse Input
Lines</button>
<div class="form-group row">
<div class="col-8">
<label for="refDate">Reference date (in last column of row) : </label>
</div>
<div class="col">
<input type="checkbox" id="refDate" v-model="selectedWorkplace.refDate">
</div>
</div>
<div class="form-group row">
<div class="col-8">
<label for="lengthrow">Number of columns in a row : </label>
</div>
<div class="col">
<input size="4" type="text" v-model="selectedWorkplace.lengthrow" id="lengthrow" />
</div>
</div>
<div class="form-group row">
<div class="col-8">
<label for="numberballs">Number on balls go to : </label>
</div>
<div class="col">
<input size="4" type="text" v-model="selectedWorkplace.numberballs" id="numberballs" />
</div>
</div>
<div class="form-group row">
<div class="col-8">
<label for="groupsConfig">Configure your groups (10,20,30,40,50) : </label>
</div>
<div class="col">
<input size="4" type="text" v-model="selectedWorkplace.groupsConfig" id="groupsConfig" />
</div>
</div>
<div class="form-group row">
<div class="col-8">
<label for="layers">Hidden Layers first learning Shape : </label>
</div>
<div class="col">
<input size="4" type="text" v-model="selectedWorkplace.layers" id="layers" />
</div>
</div>
<div class="form-group row">
<div class="col-8">
<label for="predictnextgroup">Predict next group : </label>
</div>
<div class="col">
<input type="checkbox" id="predictnextgroup" v-model="selectedWorkplace.predictnextgroup">
</div>
</div>
<p>
<button class="btn btn-primary" @click="createGroups();">Create Groups</button>
</p>
</div>
<div class="footer-style footer-margin" v-show="isMobile">
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="navigateTo('viewTabs')">Back</button>
<button class="btn btn-primary" @click="navigateTo('viewGroups')">View
groups</button>
</footer>
</div>
</div>
</div>
</div>
<!-- half size column in bootstrap -->
<div class="col-12 col-md-3" v-show="viewGroups">
<div :class="isMobile ? 'row main-mobile': 'row main'">
<div class="col-6 col-md-6 groups-container" v-show="viewGroups">
<div v-if="selectedWorkplace.name" class="options-panel">
<div class="placeholder-button" style="height:50px;">
{{(selectedWorkplace.nextGroupResult ? selectedWorkplace.nextGroupResult.join('-') : '')}}
</div>
</div>
<div v-if="selectedWorkplace.name" class="overflow-container">
<div v-if="loadinggroups">
<div class="spinner"></div>
<div>You can go get a coffee, i'll send you a message when i'm done.</div>
</div>
<div v-if="!loadinggroups" :class="selectedGroup === name ? 'sub-button-selected noselect':'sub-button noselect'" v-for="(value, name) in subgroups" @click="changeResultGroup(name,value);output='';diagram=''">
<span class="sub-button-length" :style="value.name === (selectedWorkplace.nextGroupResult ? selectedWorkplace.nextGroupResult.join('-') : '') ? 'background-color:#f44725;':''">{{value.winning.length}}</span>
<span>{{value.name}}</span>
</div>
</div>
<div class="footer-style footer-margin" v-show="isMobile">
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="navigateTo('viewDataInsert')">Back</button>
</footer>
</div>
</div>
<div class="col-6 col-md-6 results-container" v-show="viewGroups">
<div v-if="selectedWorkplace.name" class="options-panel">
<div style="height:50px;"></div>
</div>
<div v-if="selectedWorkplace.name && selectedGroup" class="overflow-container" style="padding: 10px;">
<div v-for="(item, index) in result_group" :key="index">
<!-- <div class="diamond-container">
<span class="diamond-shape">
<span class="item-count">{{index===0?0: (result_group_refs[index] - result_group_refs[index-1]) - 1}}</span>
</span>
</div> -->
<div class="reference-number-container">
<span class="reference-number-difference">{{index===0?0: (result_group_refs[index] - result_group_refs[index-1]) - 1}}</span>
</div>
<div class="reference-number-container">
<span class="reference-number-line"></span>
</div>
<div class="badges-black">
<span v-for="(item, index) in item" @click="selectnumber(item)" :class="result_group_selected_number.includes(item+'') ? 'selectable_number selected_number' : 'selectable_number'">
{{item}}
</span>
<span class="ref-number-badge">{{result_group_refs[index]}}</span>
</div>
<div class="reference-number-container">
<span class="reference-number-line"></span>
</div>
</div>
<div class="diamond-container">
<span class="diamond-shape">
<span
class="item-count">{{ subgroups.All.refs[subgroups.All.refs.length-1] - result_group_refs[result_group_refs.length-1]}}</span>
<!-- .item-count -->
</span>
<!-- .container .diamond-shape-->
</div>
</div>
<div class="footer-style footer-margin" v-show="isMobile" v-if="selectedWorkplace.name && selectedGroup">
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="navigateTo('viewResult')">Results</button>
</footer>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-4 results-container" style="border-left: 0px solid #F44725;" v-show="viewResult">
<div class="options-panel scrollmenu" v-if="selectedWorkplace.name && selectedGroup && result_group.length > 1">
<button class="btn btn-primary scrollmenuitem" @click="createnetwork();">Create Network</button>
<button class="btn btn-primary scrollmenuitem" @click="readtrainingdata();">Train</button>
<button class="btn btn-primary scrollmenuitem" @click="runapp();">Run</button>
<button class="btn btn-primary scrollmenuitem" @click="runViaServiceWorker();">Run in background</button>
</div>
<div class="options-panel" v-if="selectedWorkplace.name && selectedGroup && result_group.length < 2">
<div style="height:50px;"></div>
</div>
<div class="overflow-container" style="padding-left: 20px;" v-if="selectedWorkplace.name && selectedGroup">
<div v-if="loading">
<div class="spinner"></div>
<div>You can go get a coffee, i'll send you a message when i'm done.</div>
</div>
<b>Output will show below:</b><br>
<div v-html="output">
</div>
<div v-html="diagram" style="background-color: white;"></div>
<table class="table" style="background-color:white;margin-top:20px" :key="selectedGroup">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col" v-for="colHead in +selectedWorkplace.lengthrow" :key="colHead">
{{colHead}}</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in matrix" :class="(result_group_numbers.includes(index+'') ? 'table-highlight' : '' )">
<th scope="row" v-if="item"><span :class="result_group_numbersToPlay.includes(index) ? 'table-number-to-play' : 'table-number-regular'">{{index}}</span>
</th>
<td v-for="colcount in +selectedWorkplace.lengthrow" :key="colcount+'colrow'" v-if="item" v-html="getMatrixValueWithTableFormate(index,colcount-1)"></td>
</tr>
</tbody>
</table>
</div>
<helpInformation v-else></helpInformation>
<div class="footer-style footer-margin" v-show="isMobile">
<footer class="card-footer footer-position">
<button class="btn btn-primary" @click="navigateTo('viewGroups')">Back</button>
</footer>
</div>
</div>
</div>
</div>
</div>
</body>
<!-- main CSS -->
<link href="style.css" rel="stylesheet">
</html>