forked from satellitecomponent/Neurite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1197 lines (1054 loc) · 72.1 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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<html>
<head>
<title>Neurite</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="./styles_v1.css">
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.min.js"></script>
<!-- Core -->
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.css">
<!-- Add-Ons -->
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/addon/scroll/simplescrollbars.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/addon/mode/overlay.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/addon/mode/loadmode.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/addon/runmode/runmode.js"></script>
<!-- Modes -->
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/mode/meta.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.3/mode/htmlmixed/htmlmixed.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/mode/xml/xml.js"></script> <!-- for HTML -->
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/mode/javascript/javascript.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/mode/css/css.js"></script> <!-- for CSS -->
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/mode/python/python.js"></script> <!-- for Python -->
<!--Themes-->
<!-- Custom Scrollbars -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5/addon/scroll/simplescrollbars.css">
<!--Prism.js-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>-->
<!-- Pyodide -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/pyodide/v0.23.0/full/pyodide.js"></script>
</head>
<body id="body">
<!-- filters -->
<!-- filters <div id="filter-overlay"></div>-->
<div id="invert-filter"></div>
<!-- View Matrix -->
<div ondragover="dragOverHandler(event);" ondrop="dropHandler(event);">
<svg id="svg_bg" viewBox="-128 -128 256 256" width="100%" height="100vh" top="0" left="0" position="fixed">
<g id="viewmatrix">
<g id="bg" />
<path id="mousePath" d="" fill="none" stroke="rgb(50 51 62 / 80%)" stroke-width="0.01" />
<g id="edges" />
<g id="sensorData" />
<g id="placementPreview" />
</g>
</svg>
</div>
<svg id="debug_layer" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" style="position: absolute; left:0px; top:0px; display:none; visibility:hidden; width: 100%; height: 100vh;">
<style type="text/css">
.white {
font: 12px sans-serif;
fill: white;
}
</style>
<text x="0" y="0" class="white">fps:</text>
</svg>
<!-- Modals -->
<div id="customModal" class="modal">
<div class="modal-content">
<div class="modal-header" id="modal-header">
<h2 class="modal-title"></h2>
<span class="close">×</span>
</div>
<div class="modal-body"></div>
</div>
</div>
<div id="noteModal" style="display: none;">
<!-- Content for the note modal -->
<div style="display: flex; justify-content: space-evenly; align-items: center;" title="Determine what path the Zettelkasten decides to place nodes on.">
<label for="zetPathTypeDropdown" style="margin-right: 10px;">Placement Style</label>
<div class="dropdown-container">
<select id="zetPathTypeDropdown" class="model-selector custom-select">
<option value="Radial">Radial</option>
<option value="Spiral">Spiral</option>
<option value="Branching">Branching</option>
</select>
</div>
</div>
<br />
<div class="gridLayout">
<!-- Node Count Slider : For Radial-->
<div class="settingsSlider radial-slider" title="Defines the number of steps or nodes in the path.">
<label for="radialPathLengthSlider">Number of Nodes</label>
<input type="range" id="radialPathLengthSlider" name="radial-path-length-slider" min="1" max="64" step="1">
</div>
<!-- Distance Slider: : For Radial-->
<div class="settingsSlider radial-slider" title="Sets the general spacing between nodes, affecting how spread out the path is.">
<label for="radialPathDistanceSlider">Node Spacing</label>
<input type="range" id="radialPathDistanceSlider" name="radial-path-distance-slider" min="0.1" max="8" step="0.1">
</div>
<!-- Scale Slider : For Radial-->
<div class="settingsSlider radial-slider" title="Adjusts the size of each node. Affects how large or small nodes appear.">
<label for="radialScaleSlider">Node Size</label>
<input type="range" id="radialScaleSlider" name="radial-scale-slider" min="0.1" max="2" step="0.01">
</div>
<!-- Radial Branch Depth Slider: For Radial -->
<div class="settingsSlider radial-slider" title="Sets the starting radius from the center for the first node.">
<label for="radialDepthSlider">Number of Radii</label>
<input type="range" id="radialDepthSlider" name="radial-depth-slider" min="1" max="32" step="1">
</div>
<!-- Node Count Slider : For Spiral-->
<div class="settingsSlider spiral-slider" title="Defines the number of steps or nodes in the path.">
<label for="spiralPathLengthSlider">Number of Nodes</label>
<input type="range" id="spiralPathLengthSlider" name="spiral-path-length-slider" min="1" max="100" step="1">
</div>
<!-- Distance Slider: : For Spiral-->
<div class="settingsSlider spiral-slider" title="Sets the general spacing between nodes, affecting how spread out the path is.">
<label for="spiralPathDistanceSlider">Node Spacing</label>
<input type="range" id="spiralPathDistanceSlider" name="spiral-path-distance-slider" min="0.1" max="4" step="0.1">
</div>
<!-- Scale Slider : For Spiral-->
<div class="settingsSlider spiral-slider" title="Adjusts the size of each node. Affects how large or small nodes appear.">
<label for="spiralScaleSlider">Node Size</label>
<input type="range" id="spiralScaleSlider" name="spiral-scale-slider" min="0.1" max="2" step="0.01">
</div>
<!-- Curl Slider: For Spiral -->
<div class="settingsSlider spiral-slider" title="Adjusts the curl of the spiral. Negative values create counterclockwise spirals, while positive values create clockwise spirals.">
<label for="curlSlider">Curl</label>
<input type="range" id="curlSlider" name="curl-slider" min="-1" max="1" step="0.01">
</div>
<!-- Node Count Slider : For Branching-->
<div class="settingsSlider branching-slider" title="Defines the number of steps or nodes in the path.">
<label for="branchingPathLengthSlider">Number of Nodes</label>
<input type="range" id="branchingPathLengthSlider" name="branching-path-length-slider" min="1" max="100" value="64" step="1">
</div>
<!-- Distance Slider: : For Branching-->
<div class="settingsSlider branching-slider" title="Sets the general spacing between nodes, affecting how spread out the path is.">
<label for="pathDistanceSlider">Node Spacing</label>
<input type="range" id="branchingPathDistanceSlider" name="path-distance-slider" min="0.1" max="4" value="1" step="0.1">
</div>
<!-- Scale Slider : For Branching-->
<div class="settingsSlider branching-slider" title="Adjusts the size of each node. Affects how large or small nodes appear.">
<label for="branchingScaleSlider">Node Size</label>
<input type="range" id="branchingScaleSlider" name="branching-scale-slider" min="0.1" max="2" value="0.98" step="0.01">
</div>
<!-- Branching Factor Slider: For Branching -->
<div class="settingsSlider branching-slider" title="Controls the number of branches emanating from each node.">
<label for="branchingFactorSlider">Branching Factor</label>
<input type="range" id="branchingFactorSlider" name="branching-factor-slider" min="2" max="12" value="4" step="1">
</div>
</div>
<br />
<div class="checkboxarray">
<div title="Places random nodes within your viewport instead of using the placement style.">
<input type="checkbox" id="zetPlacementOverride" name="override-zet-placement">
<label for="zetPlacementOverride">Random Placement</label>
</div>
<!-- <div title="Starts and stops nodes from making decisions based off their current state.">
<input type="checkbox" id="toggleAutomataCheckbox" name="toggleAutomataCheckbox">
<label for="toggleAutomataCheckbox">Toggle Automata</label>
</div>-->
</div>
</div>
<div id="alertModal" style="display: none;">
<!-- Content for the alert modal -->
<p>This is an alert message.</p>
<button>OK</button>
</div>
<!-- Dropdown -->
<div class="dropdown" id="dropdowndiv">
<div class="menu-button">
<div class="menu-icon" id="menu-icon"></div>
</div>
<div class="node-panel">
<div class="icon-row">
<div class="icon-content">
<div class="panel-icon edges-icon" title="Freeze and Connect Nodes (Hold Shift)">
<svg class="w-[42px] h-[42px] text-gray-800 dark:text-white" style="transform: translateX(-1px);" aria-hidden="true">
<use xlink:href="#edges-icon-symbol"></use>
</svg>
</div>
</div>
<div class="icon-content">
<div class="panel-icon note-icon" title="Create Note (Shift + Double Click)">
<svg class="w-[42px] h-[42px] text-gray-800 dark:text-white" aria-hidden="true">
<use xlink:href="#note-icon-symbol"></use>
</svg>
</div>
</div>
<div class="icon-content">
<div class="panel-icon ai-icon" title="Ai Note (ALT/Option + Double Click)">
<svg class="w-[42px] h-[42px] text-gray-800 dark:text-white" aria-hidden="true">
<use xlink:href="#ai-icon-symbol"></use>
</svg>
</div>
</div>
<div class="icon-content">
<div class="panel-icon link-icon" title="Display Link">
<svg class="w-[42px] h-[42px] text-gray-800 dark:text-white" aria-hidden="true">
<use xlink:href="#link-icon-symbol"></use>
</svg>
</div>
</div>
<div class="icon-content">
<div class="panel-icon code-icon" title="Create Code Editor (Shift + ALT/Option + Double Click)">
<svg class="w-[42px] h-[42px] text-gray-800 dark:text-white" aria-hidden="true">
<use xlink:href="#code-icon-symbol"></use>
</svg>
</div>
</div>
</div>
<!-- New container for the function call panel and its toggle button -->
<div class="function-call-container">
<!-- Sub-dropdown for function calls -->
<div class="function-call-panel hidden">
<!-- Function call list -->
<div class="function-call-list custom-scrollbar">
<!-- Function call items will be added here dynamically -->
</div>
<!-- Function prompt wrapper -->
<div class="function-prompt-wrapper">
<!-- Function prompt input -->
<div style="display: flex;">
<!-- Run function button -->
<button id="function-run-button" class="function-button">
<svg width="18" height="18">
<use xlink:href="#function-button"></use>
</svg>
</button>
<div class="input-group" style="display: flex; position: relative; width: 60%;">
<textarea id="function-prompt" class="custom-scrollbar function-prompt-textarea" rows="1" oninput="autoGrow(event);" placeholder="Set Task..." required></textarea>
<div class="status-icons-container" style="position: absolute; right: 42px; top: 50%; transform: translateY(-50%);">
<!-- Status icons here -->
<div class="loader" id="functionLoadingIcon" style="display:none;"></div>
<div class="error-icon-css" id="functionErrorIcon" style="display:none;">
<div class="error-x-mark">
<span class="error-x-mark-left"></span>
<span class="error-x-mark-right"></span>
</div>
</div>
</div>
</div>
<button id="function-send-button" class="function-button">
<svg width="18" height="18" class="function-send-svg">
<use xlink:href="#play-icon"></use>
</svg>
</button>
<!-- Regenerate button -->
<button id="function-regen-button" class="function-button">
<svg width="18" height="18">
<use xlink:href="#refresh-icon"></use>
</svg>
</button>
</div>
</div>
<!-- CodeMirror container -->
<div class="function-codemirror-container">
<textarea id="neurite-function-cm"></textarea>
</div>
</div>
<!-- Toggle button for function call panel -->
<div class="toggle-panel" onclick="toggleFunctionCallPanel()">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<!-- Wrapper for the icon only -->
<div class="toggle-icon">
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4" />
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
<div class="dropdown-content">
<div style="display: none;" id="search-results">
<div class="submenu custom-scrollbar">
</div>
</div>
<div>
<div class="tabs">
<button class="tablink" onclick="openTab('tab1', this)">Notes</button>
<button class="tablink" onclick="openTab('tab4', this)">Ai</button>
<button class="tablink" onclick="openTab('tabExtract', this)">Data</button>
<button class="tablink" onclick="openTab('tab2', this)">Edit</button>
<button class="tablink" onclick="openTab('tab6', this)">Save</button>
<button class="tablink" onclick="openTab('tab3', this)">?</button>
</div>
<div id="tab1" class="tabcontent">
<!-- First tab content here -->
<div class="submenu">
<div style="display: flex; align-items: center; margin-bottom: 10px;">
<!-- Added margin for spacing -->
<input id="Searchbar" class="Searchbar" placeholder="search notes..." onkeydown="if(event.key === 'Enter') event.preventDefault();" />
</div>
<form id="prompt-form" onsubmit="sendMessage(event);">
<div>
<!-- Second Row: Prompt Form -->
<div style="display: flex;">
<!-- Input Group with flex layout and relative positioning -->
<div class="input-group" style="display: flex; position: relative; width: 208px;">
<!-- Textarea for main prompt -->
<textarea id="prompt" class="custom-scrollbar" rows="1" oninput="autoGrow(event);" placeholder="Enter prompt..." required></textarea>
<!-- Status icons positioned similarly to function prompt -->
<div class="status-icons-container" style="position: absolute; right: 42px; top: 50%; transform: translateY(-50%);">
<!-- Status icons (Loader and Error) -->
<div class="loader" id="aiLoadingIcon" style="display:none;"></div>
<div class="error-icon-css" id="aiErrorIcon" style="display:none;">
<div class="error-x-mark">
<span class="error-x-mark-left"></span>
<span class="error-x-mark-right"></span>
</div>
</div>
</div>
</div>
<!-- Run button (Play icon) -->
<button type="submit">
<svg width="18" height="18">
<use xlink:href="#play-icon"></use>
</svg>
</button>
<!-- Regenerate button (Refresh icon) -->
<button id="regen-button" type="button">
<svg width="18" height="18">
<use xlink:href="#refresh-icon"></use>
</svg>
</button>
</div>
</div>
</form>
<br />
<div class="zet-container" title="Zettelkasten">
<div id="zetHorizDragHandle" class="zet-drag-handle-horiz"></div>
<div id="zetVertDragHandle" class="zet-drag-handle-vert"></div>
<textarea id="note-input" class="zettelkasten" rows="10" cols="50"></textarea>
</div>
<div class="checkboxarray">
<div title="Enable Web Search Results">
<input type="checkbox" id="google-search-checkbox" name="enable-search">
<label for="google-search-checkbox">Search</label>
</div>
<div title="Enable Code Instructions and Buttons">
<input type="checkbox" id="code-checkbox" name="code-checkbox">
<label for="code-checkbox">Code</label>
</div>
<div title="Self-Prompted AI">
<input type="checkbox" id="auto-mode-checkbox">
<label for="auto-mode-checkbox">Auto</label>
</div>
<div title="Retrieve Document Snippets and send to AI">
<input type="checkbox" id="embed-checkbox">
<label for="embed-checkbox">Data</label>
</div>
<div title="Query Wolfram Alpha">
<input type="checkbox" id="enable-wolfram-alpha" name="enable-wolfram-alpha">
<label for="enable-wolfram-alpha">Wolfram</label>
</div>
<div title="Query Wikipedia">
<input type="checkbox" id="wiki-checkbox">
<label for="wiki-checkbox">Wiki</label>
</div>
</div>
</div>
</div>
<div id="tab4" class="tabcontent">
<!-- Fourth tab content here -->
<div class="submenu">
<div class="label-bar-container">
<label for="modelSelectContainer" class="button-label" onclick="toggleModelSelectPanel()">Select Ai</label>
<div class="model-select-container" id="modelSelectContainer">
<div class="model-select-panel hidden">
<br />
<div style="display: flex; justify-content: space-evenly; align-items: center; ">
<label for="model-select" style="margin-right: 10px;">GLOBAL Model:</label>
<div class="dropdown-container">
<select id="model-select" class="model-selector custom-select" onchange="checkOtherModel(this)">
<option value="gpt-4">gpt-4</option>
<option value="gpt-4-0125-preview">gpt-4-0125</option>
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
<option value="GROQ-mixtral-8x7b-32768">GROQ-mixtral 7b 32k</option>
<option value="GROQ-llama2-70b-4096">GROQ-llama2 70b 4k</option>
<option value="custom-host">Ollama</option>
</select>
<input id="model-input" class="model-input" style="display: none;" placeholder="Enter model name">
</div>
</div>
<br />
<div style="display: flex; justify-content: space-evenly; align-items: center; ">
<label for="local-model-select" style="margin-right: 10px;">Ollama Model:</label>
<div class="dropdown-container">
<select id="local-model-select" class="model-selector custom-select">
<option value="llama2">Llama 2</option>
<option value="mistral:7b">Mistral 7B</option>
<option value="dolphin-phi">Dolphin Phi 2.7B</option>
<option value="phi">Phi-2 2.7B</option>
<option value="neural-chat">Neural Chat 7B</option>
<option value="starling-lm">Starling 7B</option>
<option value="codellama">Code Llama 7B</option>
<option value="llama2-uncensored">Llama 2 Uncensored 7B</option>
<option value="llama2:13b">Llama 2 13B</option>
<option value="llama2:70b">Llama 2 70B</option>
<option value="orca-mini">Orca Mini 3B</option>
<option value="vicuna">Vicuna 7B</option>
<option value="llava">LLaVA 7B</option>
<option value="gemma:2b">Gemma 2B</option>
<option value="gemma:7b">Gemma 7B</option>
</select>
</div>
</div>
</div>
<div class="toggle-panel" onclick="toggleModelSelectPanel()" style="padding-top: 15px;">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<div class="toggle-icon">
<!-- Icon SVG -->
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
<br />
<div class="label-bar-container">
<label for="contextSettingsContainer" class="button-label" onclick="toggleContextSettingsPanel()">Context Settings</label>
<div class="context-settings-container" id="contextSettingsContainer">
<div class="context-settings-panel hidden">
<div class="gridLayout" id="aiParameterGrid" style="padding-top: 15px;">
<div class="settingsSlider" title="Set the Token Limit for Calls to GPT">
<label for="max-tokens-slider">Max Tokens: <br /><span id="max-tokens-display">2000</span></label>
<input type="range" id="max-tokens-slider" name="max-tokens-slider" min="10" max="16000" value="2000" step="1">
</div>
<div class="settingsSlider" title="Set the Tempurature for Calls to GPT">
<label id="model-temperature-label" for="model-temperature">Tempurature:<br /> 0.6</label>
<input type="range" id="model-temperature" name="model-temperature" min="0" max="1" step="0.1" value="0.6" onchange="updateLabel()">
</div>
<div class="settingsSlider" title="Set the Proportion of Tokens Dedicated to AI Memory">
<span id="max-context-size-display">2000</span>
<input type="range" id="max-context-size-slider" name="max-context-size-slider" min="0" max="2000" value="555" step="1">
</div>
<div class="settingsSlider" title="Number of Notes Retrieved from Neurite and Sent to AI">
<label id="node-slider-label">Top 3 <br />nodes</label>
<input type="range" id="node-count-slider" name="node-count-slider" min="1" max="25" value="3">
</div>
</div>
</div>
<div class="toggle-panel" onclick="toggleContextSettingsPanel()" style="padding-top: 15px;">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<div class="toggle-icon">
<!-- Icon SVG -->
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
<br />
<div class="label-bar-container">
<label for="apiContainer" class="button-label" onclick="toggleAPIPanel()">API Keys</label>
<div class="api-container" id="apiContainer">
<div class="api-panel hidden">
<div class="api-inputs">
<div>
<label for="api-key-input">OpenAI:</label>
<input type="password" id="api-key-input" class="api-input">
</div>
<div class="google-key-input">
<label for="GROQ-api-key-input">GROQ:</label>
<input type="password" id="GROQ-api-key-input" class="api-input">
</div>
<div class="google-key-input" style="display: none;">
<label for="anthropic-api-key-input">Anthropic:</label>
<input type="password" id="anthropic-api-key-input" class="api-input">
</div>
<div class="google-key-input">
<label for="googleApiKey">Google:</label>
<input type="password" id="googleApiKey" class="api-input">
</div>
<div class="google-key-input">
<label for="googleSearchEngineId">Search Engine ID:</label>
<input type="password" id="googleSearchEngineId" class="api-input">
</div>
<div class="wolfram-key-input">
<label for="wolframApiKey">Wolfram:</label>
<input type="password" id="wolframApiKey" class="api-input">
</div>
</div>
<div class="api-buttons">
<button class="key-button" onclick="saveKeys()">Save Keys</button>
<button class="key-button" onclick="clearKeys()">Clear Keys</button>
<button class="key-button" id="saveToFileButton" onclick="saveKeysToFile()">Keys .txt</button>
<button class="key-button" id="loadFromFileButton" onclick="loadKeysFromFile()">Load Keys</button>
</div>
</div>
<div class="toggle-panel" onclick="toggleAPIPanel()" style="padding-top: 15px;">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<div class="toggle-icon">
<!-- Icon SVG -->
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
</div>
</div>
<div id="tabExtract" class="tabcontent">
<!-- Extract tab content here -->
<div class="submenu">
<div style="display: flex; justify-content: space-evenly; align-items: center;">
<label for="embeddingsModelSelect">Embeddings:</label><br>
<div class="dropdown-container">
<select id="embeddingsModelSelect" class="model-selector custom-select" onchange="handleEmbeddingsSelection(this)">
<option value="text-embedding-3-small">text-embedding-3-small</option>
<option value="text-embedding-3-large">text-embedding-3-large</option>
<option value="text-embedding-ada-002">text-embedding-ada-002</option>
<option value="local-embeddings">Local Embeddings</option>
</select>
</div>
</div>
<br>
<!-- Hide the original local embeddings checkbox -->
<input type="checkbox" id="local-embeddings-checkbox" style="display: none;">
<label for="local-embeddings-checkbox" style="display: none;">: Local Embeddings</label>
<label for="inputKeyExtract">Key:</label><br>
<input type="text" id="inputKeyExtract" name="inputKeyExtract" title="Set Title of Document"><br>
<label for="inputTextExtract">Text:</label><br>
<textarea id="inputTextExtract" rows="10" cols="50" class="zettelkasten" title="Plain Text of Document"></textarea><br>
<div class="button-container">
<button id="chunkAndStoreButton" class="linkbuttons" title="Send Text to Embeddings Database">Store Text</button>
<button onclick="deleteSelectedKeys()" class="linkbuttons" title="Delete Document from Embeddings Database">Delete Key(s)</button>
</div>
<div id="key-list" class="scrollable-list" title="Embedded Documents">
<!-- Stored keys will be dynamically added here -->
</div>
<!--<input type="file" id="fileInput" />
<button id="fileUploadButton" onclick="promptForFileUpload()">Upload Files</button>-->
<br />
<div class="settingsSlider centered" style="margin-bottom: 10px;" title="Number of Embedded Document Snippets to Retrieve for AI Response">
<label for="topN">Top <span id="topNValue">5</span> Webpage Excerpts</label>
<input type="range" id="topNSlider" name="topN" min="1" max="100" value="5">
</div>
<div class="gridLayout">
<div class="settingsSlider" title="Size of Document Snippets (Set Before Embedding">
<label for="maxChunkSizeSlider">Chunk Size: <br /><span id="maxChunkSizeValue"></span></label>
<input type="range" min="1" max="4096" value="1024" class="slider" id="maxChunkSizeSlider">
</div>
<div class="settingsSlider" title="Overlap Between Document Snippets (Set Before Embedding)">
<label for="overlapSizeSlider">Overlap:<br /><span id="overlapSizeDisplay">10</span></label>
<input type="range" id="overlapSizeSlider" name="overlapSize" min="1" max="100" value="10">
</div>
</div>
</div>
</div>
<div id="tab2" class="tabcontent">
<!-- Second tab content here -->
<div class="submenu">
<div class="label-bar-container">
<label for="fractalSettingsContainer" class="button-label" onclick="toggleFractalSettingsPanel()">Fractal Settings</label>
<div class="fractal-settings-container" id="fractalSettingsContainer">
<div class="fractal-settings-panel hidden">
<div class="settingsSlider centered" style="margin-bottom: 10px;">
<label style="white-space: nowrap;">
z <sup id="exponent_value" style="color: powderblue">2</sup> + c
</label>
<input id="exponent" type="range" min="1" max="8" value="2">
</div>
<div class="settingsSlider centered" style="margin-bottom: 10px;">
<div style="display:flex; justify-content: space-between;">
<div id="quality_value">Quality</div>
<div id="fps">fps:?? (is javascript enabled?)</div>
</div>
<input id="quality" type="range" min="0" max="100" value="16">
</div>
<div class="gridLayout">
<div class="settingsSlider">
<label for="length">Length: <span id="length_value"></span></label>
<input id="length" type="range" min="0" max="100" value="50">
</div>
<div class="settingsSlider">
<label for="renderWidthMultSlider">Width: <span id="renderWidthMultValue"></span></label>
<input type="range" id="renderWidthMultSlider" min="0" max="12" step="0.001">
</div>
<div class="settingsSlider">
<label for="maxLinesSlider">Max Lines: <span id="maxLinesValue"></span></label>
<input type="range"
id="maxLinesSlider"
min="0"
max="2048"
step="1"
title="Set the removal limit for number of lines displayed">
</div>
<div class="settingsSlider">
<label for="regenDebtSlider">Speed: <span id="regenDebtValue"></span></label>
<input type="range" id="regenDebtSlider" min="0" max="4" step="0.001">
</div>
<div class="settingsSlider" title="Set the strength of line generation around your mouse.">
<label for="flashlightStrength">Strength: <span id="flashlightStrength_value"></span></label>
<input id="flashlightStrength" type="range" min="0" max="1" step="0.001">
</div>
<div class="settingsSlider" title="Set the radius of line generation around your mouse">
<label for="flashlightRadius">Radius: <span id="flashlightRadius_value"></span></label>
<input type="range" id="flashlightRadius" min="0" max="1" step="0.001">
</div>
</div>
<!-- Additional fractal settings sliders here -->
</div>
<div class="toggle-panel" onclick="toggleFractalSettingsPanel()" style="padding-top: 15px;">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<div class="toggle-icon">
<!-- Icon SVG -->
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
<br />
<div class="label-bar-container">
<label for="colorSettingsContainer" class="button-label" onclick="toggleColorSettingsPanel()">Color</label>
<div class="color-settings-container" id="colorSettingsContainer">
<div class="color-settings-panel hidden">
<div id="colorselection">
<div class="color-picker-container">
<div class="color-picker-item">
<label for="rColor">R</label>
<input type="color" id="rColor" name="rColor" value="#FF0000">
</div>
<div class="color-picker-item">
<label for="gColor">G</label>
<input type="color" id="gColor" name="gColor" value="#00FF00">
</div>
<div class="color-picker-item">
<label for="bColor">B</label>
<input type="color" id="bColor" name="bColor" value="#0000FF">
</div>
<div class="color-picker-item">
<label for="colorPicker">BG</label>
<input type="color" id="colorPicker" name="colorPicker" value="#000000" style="background:#222226;">
</div>
</div>
<br />
<div id="colorsliders">
<input type="range" min="0" max="255" id="rSlider" value="0" style="display: none;">
<div class="gridLayout">
<div class="settingsSlider">
<label for="cSlider">Brightness<span id="c_value"></span></label>
<input type="range" min="0" max="255" id="cSlider" value="128">
</div>
<div class="settingsSlider">
<label for="sSlider">Saturation<span id="s_value"></span></label>
<input type="range" min="0" max="255" id="sSlider" value="127">
</div>
<div class="settingsSlider">
<label for="outer_opacity">Outer Opacity<span id="outer_opacity_value"></span></label>
<input id="outer_opacity" type="range" min="0" max="100" value="100">
</div>
<div class="settingsSlider">
<label for="inner_opacity">Inner Opacity<span id="inner_opacity_value"></span></label>
<input id="inner_opacity" type="range" min="0" max="100" value="100">
</div>
<div class="settingsSlider" id="inversion-settings">
<!-- Slider for Inversion -->
<label for="inversion-slider">Inversion</label>
<input type="range" id="inversion-slider" min="0" max="100" value="0">
</div>
<div class="settingsSlider" id="hue-rotation-settings">
<!-- Slider for Hue Rotation -->
<label for="hue-rotation-slider">Hue Rotation</label>
<input type="range" id="hue-rotation-slider" min="0" max="360" value="0">
</div>
</div>
</div>
</div>
</div>
<div class="toggle-panel" onclick="toggleColorSettingsPanel()" style="padding-top: 15px;">
<div class="bar left-bar"></div>
<div class="icon-wrapper">
<div class="toggle-icon">
<!-- Icon SVG -->
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<div class="bar right-bar"></div>
</div>
</div>
</div>
</div>
</div>
<div id="tab6" class="tabcontent">
<div class="submenu">
<div title="Autosave enabled">
<input type="checkbox" id="autosave-enabled" name="autosave-enabled">
<label for="autosave-enabled">Autosave enabled</label>
</div>
<div id="saved-networks-container" class="scrollable-list"></div>
<input id="save-or-load" type="text" placeholder="save data..." style="width: 257px;" />
<div class="top-section">
<div class="buttons-left">
<a id="save-button">Save</a>
<a id="load-button">Load</a>
<div id="load-sure" style="display:none">
<a id="load-unsure-button">no</a>
<a id="load-sure-button">yes</a>
</div>
<a id="clear-button">Clear</a>
<div id="clear-sure" style="display:none">
<a id="clear-unsure-button">no</a>
<a id="clear-sure-button">yes</a>
</div>
</div>
<div id="savedCoordinatesContainerTop" class="saved-coordinates-container"></div>
</div>
<div id="savedCoordinatesContainer" class="saved-coordinates-container"></div>
<div class="bottom-section">
<div id="savedCoordinatesContainerBottom" class="saved-coordinates-container"></div>
<div class="buttons-right">
<a id="saveCoordinatesBtn">Store Coordinates</a>
<a id="deleteCoordinatesBtn">Delete Coordinates</a>
</div>
</div>
<div id="coordinates" class="coordinates-container">
<div class="coordinate-field">
<span>pan</span>
<input id="pan" type="text" value="0+0i" style="background:none; border:none;" size="28" />
</div>
<div class="coordinate-field">
<span>zoom</span>
<input id="zoom" type="text" value="1" style="background:none; border:none;" size="25" />
</div>
</div>
</div>
</div>
<div id="tab3" class="tabcontent">
<div id="howto" class="howto custom-scrollbar">
<table>
<tr>
<td><strong>AI HOW-TO</strong></td>
<td><input type="checkbox" id="instructions-checkbox"><label for="instructions-checkbox">Prompt the Ai to explain Neurite</label></td>
</tr>
<tr>
<td><a href="https://github.com/satellitecomponent/Neurite" id="clickable-link">Github Link</a></td>
<td>Visit our Github for extended documentation.</td>
</tr>
<tr>
<td><strong>CLICK AND DRAG</strong></td>
<td>Move around the fractal.</td>
</tr>
<tr>
<td>
<strong>
SCROLL WHEEL
<br />PINCH on touchpad
</strong>
</td>
<td>Zoom in/out.</td>
</tr>
<tr>
<td><strong>SHIFT + DOUBLE CLICK</strong></td>
<td>Creates a text node</td>
</tr>
<tr>
<td><strong>DOUBLE CLICK</strong></td>
<td>'Anchor' a window in place.</td>
</tr>
<tr>
<td><strong>SHIFT (hold)</strong></td>
<td>Freeze Windows</td>
</tr>
<tr>
<td><strong>ALT/Option + SCROLL</strong></td>
<td>Rotate the view.</td>
</tr>
<tr>
<td><strong>ALT/Option + DRAG</strong></td>
<td>Allows drag events to pass through node textareas.</td>
</tr>
<tr>
<td><strong>ALT/Option + DOUBLE CLICK</strong></td>
<td>Creates an ai chat node</td>
</tr>
<tr>
<td><strong>SHIFT + SCROLL</strong></td>
<td>Resize a window.</td>
</tr>
<tr>
<td><strong>CTRL + CLICK or DRAG</strong></td>
<td>Selects multiple nodes. Allows for multiple nodes to be re-scaled</td>
</tr>
<tr>
<td>
<strong>Local LLM</strong>
</td>
<td>Download The LocalHost Servers Folder, then run your own instance of Ollama. More info at <a href="https://github.com/satellitecomponent/Neurite" target="_blank" id="clickable-link">Github</a> or <a href="https://ollama.com/" target="_blank" id="clickable-link">Ollama</a></td>
</tr>
<tr>
<td>
<strong>Local Embeddings</strong>
</td>
<td>In the Ai tab, check Local Embeddings. The embeddings model will download into your browser cache.</td>
</tr>
<tr>
<td><strong>LocalHost Servers</strong></td>
<td>Wiki, Wolfram, and Webpage Extraction currently require setting up of personal localhosts.<br /> More info on our <a href="https://github.com/satellitecomponent/Neurite" target="_blank" id="clickable-link">Github</a><br /> The Ai How-To Checkbox at the top of the instructions will allow the ai to explain basic set-up.</td>
</tr>
<tr>
<td>
<input type="checkbox" id="forget-checkbox" name="forget-checkbox">
<label for="forget-checkbox"><strong>Enable Selective Forgetting </strong></label>
</td>
<td><input type="checkbox" id="novelty-checkbox"><label for="novelty-checkbox"><strong>Novelty<br />(Shuffled Wiki Results)</strong></label></td>
</tr>
<tr>
<td>
<input type="checkbox" id="use-all-connected-ai-nodes" />
<label for="use-all-connected-ai-nodes"><strong>Send messages between all connected ai nodes.</strong> (rather than the closest connected Ai nodes)</label>
</td>
<td>
<input type="checkbox" id="ai-nodes-checkbox">
<label for="ai-nodes-checkbox"><strong>AI Generated AI Nodes <br />(or, Alt + Double Click / type LLM:)</strong></label>
</td>
</tr>
<tr>
<td>
<input type="text" id="node-tag" class="tags" value="##" style="width:80px;" />
<label for="node-tag">Node Tag</label>
</td>
<td>
<input type="text" id="ref-tag" class="tags" value="[[" style="width:80px;" />
<label for="ref-tag">Reference Tag</label>
</td>
</tr>
<tr>
<td>
<button id="clearLocalStorage" class="key-button">Clear Local Storage</button>
</td>
<td>
<button id="screenshotButton" class="key-button">Screenshot</button>
<button id="recordButton" class="key-button">Record</button>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Nodes -->
<a id="nodes">
<!-- Save-Data .txt -->
</a>
<!--iframe id="inlineFrameExample"
title="Inline Frame Example"
width="150"
height="100"
src="https://m.media-amazon.com/images/M/MV5BOTY2NDY4OGUtYWE0Ni00NWZiLWI3NDktYmE2YWM3Njc3YmRkXkEyXkFqcGdeQXVyMTIxOTU1MjQ3._V1_.jpg">
</iframe>
<iframe id="inlineFrameExample"
title="Inline Frame Example"
width="768"
height="512"
src="https://xkcd.com">
</iframe>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="red"/></svg>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="orange"/></svg>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="yellow"/></svg>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="green"/></svg>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="blue"/></svg>
<svg width="20" height="20"><circle cx="10" cy="10" r="10" fill="purple"/></svg>
</a-->
<div id="elements" class="windowbuttons" style="display:none; visibility:hidden;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 2.125" height="16pt">
<g id="button-delete" transform="scale(0.125 0.125) translate(1 1)">
<rect x="0" y="0" width="16" height="16" fill="RGB(100,100,100)" stroke="none" />
<path d="M 1,1 l 3,0 4,4 4,-4 3,0
0,3 -4,4 4,4 0,3
-3,0 -4,-4 -4,4 -3,0
0,-3 4,-4 -4,-4 0,-3 z" fill="RGB(170,170,170)" stroke="none" />
<rect x="0" y="0" width="16" height="16" fill="transparent" stroke="none" />
</g>
<g id="button-fullscreen" transform="scale(0.125 0.125) translate(21 1)">
<rect x="0" y="0" width="16" height="16" fill="RGB(100,100,100)" stroke="none" />
<path d="M 1, 1 l 3,0 1.5,1.5 -3,0 0,3 -1.5,-1.5 0,-3 z
M 15, 1 l -3,0 -1.5,1.5 3,0 0,3 1.5,-1.5 0,-3 z
M 15,15 l -3,0 -1.5,-1.5 3,0 0,-3 1.5,1.5 0,3 z
M 1,15 l 3,0 1.5,-1.5 -3,0 0,-3 -1.5,1.5 0,3 z
M 4, 4 l 2,0 1,1 -2,0 0,2 -1,-1 0,-2 z
M 12, 4 l -2,0 -1,1 2,0 0,2 1,-1 0,-2 z
M 12,12 l -2,0 -1,-1 2,0 0,-2 1,1 0,2 z
M 4,12 l 2,0 1,-1 -2,0 0,-2 -1,1 0,2 z
" fill="RGB(170,170,170)" stroke="none" />
<rect x="0" y="0" width="16" height="16" fill="transparent" stroke="none" />
</g>
<g id="button-collapse" transform="scale(0.125 0.125) translate(41 1)">
<rect x="0" y="0" width="16" height="16" fill="RGB(100,100,100)" stroke="none" />
<circle cx="8" cy="8" r="5.375" stroke="RGB(170,170,170)" stroke-width="2.75" fill="none" />
<rect x="0" y="0" width="16" height="16" fill="transparent" stroke="none" />
</g>
</svg>
</div>