-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex-2015.html
874 lines (852 loc) · 36.9 KB
/
index-2015.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
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://gun.eco/index.html" />
<title>GUN - Graph Database</title>
<meta name="description" content="Gun is an offline-first, real-time, decentralized, graph database built in JavaScript" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="gun_dev.css">
<link href='https://fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
<link href='https://fonts.googleapis.com/css?family=Alegreya+Sans+SC:800italic' rel='stylesheet' type='text/css'>
<!-- <script type="text/javascript" src="modernizr.js"></script> -->
<script src="dep/rsc/analytics.js"></script>
</head>
<body>
<div class="cd-index cd-main-content">
<a href="https://github.com/amark/gun" target="blank"><img class="forkMe" src="img/forkMe.png"></a>
<!-- NEW HERO IMAGE -->
<div class="hero">
<div class="heroImg"><img src="images/gun_logo-01.svg"></div>
<h1>Easiest Database Ever</h1>
<div class="devices">
<div id="phone" class="device">
<svg data-name="Layer 1" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 53.25 109.76">
<defs><style>.phone_body{fill:#212121;}.camera{fill:#fff;}.button{fill:#6d6d6d;}</style></defs>
<path class="phone_body" d="M44.19,0c6.28,0,8,3.59,8,7.05l-0.32,95.72c0,3.39-.74,7-7.85,7l-35.18,0c-8,0-7.95-5.1-7.94-7.18L1,7.08A7.28,7.28,0,0,1,8.39,0Z"/>
<path class="camera" d="M19.64,6.65a0.76,0.76,0,1,1-.75-0.76,0.76,0.76,0,0,1,.75.76"/>
<path class="camera" d="M27,2.9a0.55,0.55,0,1,1-.55-0.55A0.55,0.55,0,0,1,27,2.9"/>
<path class="camera" d="M30.47,6.69a0.36,0.36,0,0,0-.28-0.41h-7a0.36,0.36,0,0,0-.29.41,0.36,0.36,0,0,0,.28.41h7A0.36,0.36,0,0,0,30.47,6.69Z"/>
<circle class="button" cx="26.5" cy="103.28" r="3.88" transform="matrix(0, -1, 1, 0, -76.82, 129.64)"/>
<path class="screen" d="M52.68,28a0.32,0.32,0,0,1-.3.28H52.33A0.22,0.22,0,0,1,52.15,28V20.88a0.19,0.19,0,0,1,.18-0.24h0.05a0.3,0.3,0,0,1,.3.24V28Z"/>
<path class="screen" d="M0.83,17.84A0.12,0.12,0,0,1,.71,18h0c-0.08,0-.09,0-0.09-0.13V12.68c0-.08,0-0.23.09-0.23h0a0.23,0.23,0,0,1,.13.23v5.16Z"/>
<path class="screen" d="M0.81,38a0.14,0.14,0,0,1-.13.18h0c-0.08,0-.09-0.06-0.09-0.18V31c0-.12,0-0.23.09-0.23h0A0.21,0.21,0,0,1,.82,31V38Z"/>
<path class="screen" d="M0.82,27.92a0.22,0.22,0,0,1-.13.25h0C0.59,28.16.58,28,.58,27.92V20.86c0-.12,0-0.29.09-0.29h0a0.29,0.29,0,0,1,.13.29v7.06Z"/>
<rect class="screen" x="-15.6" y="30.87" width="84.15" height="47.38" transform="translate(-28.12 80.96) rotate(-89.92)"/>
</svg>
<div class="screen" style="position: absolute; left: 5%; top: 11%; right: 5%; height: 75%;"></div>
</div>
<div id="tablet" class="device">
<svg data-name="Layer 1" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 110.75 163.93">
<defs><style>.tablet_body{fill:#212121;}.button{fill:#6d6d6d;}.camera{fill:#fff;}</style></defs>
<path class="tablet_body" d="M102.47,0c6.49,0,8.28,3.7,8.28,7.28l-0.2,149.41c0,3.51-.75,7.24-8.1,7.24H8.29c-8.29,0-8.22-5.26-8.22-7.41L0,7.38A7.52,7.52,0,0,1,7.68.07Z"/>
<rect class="screen" x="5.65" y="16.26" width="99.45" height="131.57"/>
<circle class="button" cx="55.38" cy="156" r="4.1"/>
<path class="camera" d="M56.56,8.47a1.19,1.19,0,1,1-1.19-1.19,1.19,1.19,0,0,1,1.19,1.19"/>
</svg>
<div class="screen" style="position: absolute; left: 5%; top: 10%; right: 5%; height: 79%;"></div>
</div>
<div id="desktop" class="device">
<svg data-name="Layer 1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" viewBox="0 0 364.2 295.37">
<defs><style>.behindScreen{fill:#212121;}.dev_body{fill:#848484;}.camera{fill:#fff;}.dev_base{fill:url(#linear-gradient);}</style><linearGradient id="linear-gradient" x1="181.71" y1="291.95" x2="181.71" y2="250.67" gradientUnits="userSpaceOnUse"><stop offset="0.77" stop-color="#848484"/><stop offset="0.8" stop-color="#232323"/></linearGradient></defs>
<path class="behindScreen" d="M363.2,216.5V8.74A8.74,8.74,0,0,0,354.45,0H8.74A8.74,8.74,0,0,0,0,8.74V216.5H363.2Z"/>
<path class="dev_body" d="M0,216.5v25.42a8.74,8.74,0,0,0,8.74,8.74H354.45a8.74,8.74,0,0,0,8.74-8.74V216.5H0Z"/>
<path class="camera" d="M182.91,5.61a1.26,1.26,0,1,1-1.26-1.26,1.26,1.26,0,0,1,1.26,1.26"/>
<rect class="screen" x="12.93" y="14.39" width="337.34" height="189.78"/>
<path class="dev_base" d="M239.6,288.83s-9.06-7.18-11.41-9.16c-4.42-3.31-5.08-14.48-5.08-14.48l-1.59-14.53H141.89L140.3,265.2s-0.66,11.16-5.08,14.48c-2.35,2-11.41,9.16-11.41,9.16s-1.37,1.05-1.17,1.71c0,0,1.67,1.24,6,1.41h106c4.37-.17,6-1.41,6-1.41C241,289.89,239.6,288.83,239.6,288.83Z"/>
</svg>
<div class="screen" style="position: absolute; left: 3%; top: 4%; right: 3%; height: 64%;">
<img class="mouse" src="img/mouse.png">
</div>
</div>
<div id="laptop" class="device">
<svg data-name="Layer 1" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 340.6 202.98">
<defs><style>.behindScreen{fill:#212121;}.dev_body{fill:#848484;}.details{fill:#6d6d6d;}</style></defs>
<path class="behindScreen" d="M314.53,11.45A11.64,11.64,0,0,0,302.89-.19L37.71,0.19A11.64,11.64,0,0,0,26.07,11.84v0.05h0V193.7H314.53V11.89h0V11.45Z"/>
<path class="dev_body" d="M332.06,193.7H8.54a37,37,0,0,0-8.54.75V200l0.37,0,9.41,0.44h321l9.41-.44,0.37,0v-5.57A37.06,37.06,0,0,0,332.06,193.7Z"/>
<path class="details" d="M332.7,200.41l-3.28.08H11.18l-3.28-.08-7.58-.31s1.45,1.88,9.46,2.23h321c8-.35,9.46-2.23,9.46-2.23Z"/>
<rect class="screen" x="39.27" y="14.94" width="262.06" height="163.66"/>
<path class="details" d="M143.86,193.69c0,0.08,0,.15,0,0.23v0.86a4.23,4.23,0,0,0,4.23,4.23h44.44a4.23,4.23,0,0,0,4.23-4.23v-0.86c0-.08,0-0.16,0-0.23H143.86Z"/>
</svg>
<div class="screen" style="position: absolute; left: 12%; top: 6%; right: 12%; height: 80%;"></div>
</div>
</div>
</div>
<!-- END OF NEW HERO -->
<!-- TRY NOW SECTION -->
<div class="try">
<!-- BEGIN TUTORIAL -->
<div class="tutorial">
<script src="https://gunjs.herokuapp.com/gun.js"></script>
<link id="style" rel="stylesheet" href="https://yandex.st/highlightjs/8.0/styles/ir_black.min.css">
<script src="https://yandex.st/highlightjs/8.0/highlight.min.js"></script>
<style>
.tutorial {
margin: 0;
padding: 0;
color: #eee;
overflow: auto;
}
.tutorial a { color: skyblue; }
.center {
text-align: center;
}
.lean {
font-family: 'Poiret One', Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
.clean {
font-family: 'Dosis', Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
.crisp {
font-family: 'Oxygen', Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
pre {
background-color: black;
border: 1px dashed white;
color: white;
line-height: 1.5em;
padding: .5em;
margin: 0em;
overflow: auto;
}
button {
border: none;
color: white;
background: skyblue;
padding: 1em;
cursor: pointer;
}
.hide {
display: none;
}
.show {
display: block;
}
.grid {
text-align: center;
}
.unit {
display: inline-block;
}
.tutorial .main {
min-width: 250px;
max-width: 1024px;
width: 90%;
margin: 0% auto;
padding: 2% 5%;
}
div {
position: relative;
}
.left { float: left;}
.teft { text-align: left; font-family: 'Oxygen' }
.middle {
vertical-align: middle;
}
.full {
width: 100%;
}
</style>
<div class="wrapper">
<div class="main">
<h1 style="color: white;" class="oxygen dark_header">Try it now</h1>
<div class="step show step1">
<div class="full grid">
<div class="middle unit teft">
<pre style="max-width: 30.1em; margin: 0 1em 1em 0;">var gun = Gun('https://gunjs.herokuapp.com/gun');
gun.get('<span class="your-key">example/tutorial</span>').put({hello: "world"});</pre>
</div>
<div class="middle unit teft" style="min-width: 20em; max-width: 28em; margin-bottom: 1em;">
<a href="#step2"><button class="left" style="margin-right: 1em;"><big>Run!</big></button></a>
In this <b>1 minute</b> tutorial, we will connect to a gun peer, create an object, and sync data in realtime.
</div>
</div>
</div>
<div class="step hide step2">
<div class="full grid">
<div class="middle unit teft">
<pre style="max-width: 30.1em; margin: 0 1em 1em 0;">var ref = gun.get('<span class="your-key">example/tutorial</span>');
ref.on(function(data){
$('body').text(JSON.stringify(data));
});</pre>
</div>
<div class="middle unit teft" style="min-width: 34em; max-width: 28em; margin-bottom: 1em;">
<a href="#step3"><button class="left" style="margin-right: 1em; background: MediumSpringGreen;"><big>Next</big></button></a>
Congratulations! You just referenced an object and saved data to it.
In two tabs, we'll load that reference and sync data between them.
</div>
</div>
</div>
<div class="step hide step3">
<style>.step3 a { color: skyblue; }</style>
<div class="full grid">
<style>
.browser {
background: white;
border-radius: .25em;
width: 375px;
//height: 300px;
color: #222;
margin: .5em;
overflow: hidden;
}
.b-bar {
background: #EEE;
border-radius: .25em .25em 0 0;
}
.b-but {
float: left;
width: 1em;
height: 1em;
}
.browser a {
text-decoration: none;
background: white;
border-radius: .4em;
padding: 0 1em;
color: #555;
}
.browser iframe { border: none; padding: 0; }
</style>
<div class="browser unit teft">
<div class="b-bar">
<div class="b-but">←</div>
<div class="b-but">→</div>
<div class="b-but"><small>↻</small></div>
<small><small><span>
<a href="https://gunjs.herokuapp.com/" target="_blank">https://gunjs.herokuapp.com/</a>
</span></small></small>
<small class="center" style="position: relative; top: -.14em;">x</small>
<span class="center">≡<span>
</div>
<iframe></iframe>
</div>
<div class="browser unit teft">
<div class="b-bar">
<div class="b-but">←</div>
<div class="b-but">→</div>
<div class="b-but"><small>↻</small></div>
<small><small><span>
<a href="https://gunjs.herokuapp.com/" target="_blank">https://gunjs.herokuapp.com/</a>
</span></small></small>
<small class="center" style="position: relative; top: -.14em;">x</small>
<span class="center">≡<span>
</div>
<iframe></iframe>
</div>
</div>
<form action="#step3" onsubmit="return false;">
<style>
.step3 input {
width: 6em;
}
</style>
<div class="grid">
<div class="middle unit teft">
<pre style="max-width: 40em; margin: 0 1em 1em 0;">ref.get('<input id="try-path" value="hello">').put("<input id="try-sync" value="sync">");</pre>
</div>
<div class="middle unit teft" style="min-width: 20em; max-width: 30em; margin-bottom: 1em;">
<button type="submit" class="left" style="margin-right: 1em;"><big>Update!</big></button>
<span class="instruct">Let's update the "hello" field with a different value.
We can get any field on the object, and update it directly.</span>
</div>
</div>
</form>
</div>
<script>
$(function(){
var gun, key = "random/" + Gun.text.random(9),
hili = function(){
$("pre").each(function(){
hljs.highlightBlock(this);
})
}, tut = {};
$(".your-key").text(key);
hili();
location.hash = 'step1';
$(window).on('hashchange', function(){
$('.step').removeClass('show').addClass('hide')
$(location.hash.replace('#','.')).addClass('show');
});
$(".step1").find('button').on('click', function(e){
if(gun){ return }
gun = Gun('https://gunjs.herokuapp.com/gun');
gun.get(key).put({hello: "world"});
});
$(".step2").find('button').on('click', function(e){
//$(".browser").find("iframe").attr("src", "./tabs.html?key=" + key);
$(".browser").find("iframe").attr("src", "https://gun.eco/tabs.html?key=" + key);
});
$(".step3").find('form').on('submit', function(e){
var val = $("#try-sync").val() || null;
var path = $("#try-path").val();
gun.get(key).get(path).put(val);
if(!tut.sync){
//$(this).find('.instruct').html("Great job! That is it, <a href='./think.html'>click here</a> if you want a more advanced tutorial. Thanks for trying GUN!");
$(this).find('.instruct').html("Great job! That is it, <a href='https://gun.eco/think.html'>click here</a> if you want a more advanced tutorial. Thanks for trying GUN!");
}
tut.sync = (tut.sync || 0) + 1;
});
})
</script>
</div>
</div>
</div>
<!-- END TUTORIAL -->
</div>
<!-- SWIPER CUBE EFFECT STARTS HERE -->
<div class="slider">
<img class="prev" src="img/icons/arrow.svg">
<img class="next" src="img/icons/arrow.svg">
<div class="panels">
<div class="panel red">
<div class="content">
<h1>Realtime</h1>
<p>It may be trivial to get realtime updates with socket.io or something, but what you do not get is state synchronization. GUN does this for you out of the box, assuring that two users' simultaneous updates won't concurrently break each other.</p>
</div>
<img class="edgePhotos" src="images/edgePhotos/realTime.png">
<!-- REAL TIME ANIMATION STARTS -->
<div class="aniHolder">
<div id="RealTime" class="realtime">
<div id="RealTime_iMac2" class="edgeLoad-realtime">
<div id="RealTime_iMac2_RoundRect"></div>
<div id="RealTime_iMac2_Rectangle4"></div>
<div id="RealTime_iMac2_Ellipse"></div>
<div id="RealTime_iMac2_Rectangle3"></div>
<div id="RealTime_iMac2_Rectangle2"></div>
<div id="RealTime_iMac2_Rectangle"></div>
<div id="RealTime_iMac2_Pasted2"></div>
</div>
<div id="RealTime_iMac3" class="edgeLoad-realtime">
<div id="RealTime_iMac3_RoundRect"></div>
<div id="RealTime_iMac3_Rectangle4"></div>
<div id="RealTime_iMac3_Ellipse"></div>
<div id="RealTime_iMac3_Rectangle3"></div>
<div id="RealTime_iMac3_Rectangle2"></div>
<div id="RealTime_iMac3_Rectangle"></div>
<div id="RealTime_iMac3_Pasted2"></div>
</div>
</div>
</div>
<!-- REAL TIME ANIMATION ENDS -->
</div>
<div class="panel blue">
<div class="content">
<h1>Distributed</h1>
<p>GUN is peer-to-peer by design, meaning you have no centralized database server to maintain or that could crash. This lets you sleep through the night without worrying about database DevOps - we call this "NoDB". From that, you can build decentralized, federated, or centralized apps.</p>
</div>
<!-- DISTRIBUTED ANIMATION BEGINS -->
<img class="edgePhotos" src="images/edgePhotos/distributed.png">
<div class="aniHolder">
<div id="Dist" class="distributed">
<div id="Dist_Rectangle10" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle11" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle9" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle8" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle7" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle6" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle5" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle4Copy2" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle4Copy" class="edgeLoad-distributed"></div>
<div id="Dist_Rectangle4" class="edgeLoad-distributed"></div>
<div id="Dist_imac" class="edgeLoad-distributed"></div>
<div id="Dist_screen" class="edgeLoad-distributed">
<div id="Dist_screen_Ellipse2"></div>
<div id="Dist_screen_Ellipse"></div>
<div id="Dist_screen_Rectangle3"></div>
<div id="Dist_screen_Rectangle2Copy"></div>
<div id="Dist_screen_Rectangle2"></div>
<div id="Dist_screen_Rectangle"></div>
</div>
<div id="Dist_Pasted32" class="edgeLoad-distributed"></div>
<div id="Dist_Pasted42" class="edgeLoad-distributed"></div>
<div id="Dist_screen2" class="edgeLoad-distributed">
<div id="Dist_screen2_Ellipse2"></div>
<div id="Dist_screen2_Ellipse"></div>
<div id="Dist_screen2_Rectangle3"></div>
<div id="Dist_screen2_Rectangle2Copy"></div>
<div id="Dist_screen2_Rectangle2"></div>
<div id="Dist_screen2_Rectangle"></div>
</div>
<div id="Dist_Pasted63" class="edgeLoad-distributed"></div>
<div id="Dist_Pasted43" class="edgeLoad-distributed"></div>
<div id="Dist_screen5" class="edgeLoad-distributed">
<div id="Dist_screen5_Ellipse2"></div>
<div id="Dist_screen5_Ellipse"></div>
<div id="Dist_screen5_Rectangle3"></div>
<div id="Dist_screen5_Rectangle2Copy"></div>
<div id="Dist_screen5_Rectangle2"></div>
<div id="Dist_screen5_Rectangle"></div>
</div>
<div id="Dist_screen6" class="edgeLoad-distributed">
<div id="Dist_screen6_Ellipse2"></div>
<div id="Dist_screen6_Ellipse"></div>
<div id="Dist_screen6_Rectangle3"></div>
<div id="Dist_screen6_Rectangle2Copy"></div>
<div id="Dist_screen6_Rectangle2"></div>
<div id="Dist_screen6_Rectangle"></div>
</div>
<div id="Dist_Pasted7" class="edgeLoad-distributed"></div>
<div id="Dist_Pasted3" class="edgeLoad-distributed"></div>
</div>
</div>
<!-- DISTRIBUTED ANIMATION ENDS -->
</div>
<div class="panel green">
<div class="content">
<h1>Offline-first</h1>
<p>GUN works even if your internet or cell reception doesn't. Users can still plug away and save data as normal, and then when the network comes back online GUN will automatically synchronize all the changes and handle any conflicts for you.</p>
</div>
<img class="edgePhotos" src="images/edgePhotos/offline.png">
<!-- OFFLINE ANIMATION STARTS -->
<div class="aniHolder">
<div id="Offline" class="offline">
<div id="Offline_tablet" class="edgeLoad-offline"></div>
<div id="Offline_laptop" class="edgeLoad-offline"></div>
<div id="Offline_Rectangle" class="edgeLoad-offline"></div>
<div id="Offline_Rectangle2" class="edgeLoad-offline"></div>
<div id="Offline_circle_cont" class="edgeLoad-offline">
<div id="Offline_circle" class="edgeLoad-offline"></div>
</div>
<div id="Offline_bigger_screen" class="edgeLoad-offline"></div>
<div id="Offline_Rectangle2Copy" class="edgeLoad-offline"></div>
<div id="Offline_circle_contCopy" class="edgeLoad-offline">
<div id="Offline_circleCopy2" class="edgeLoad-offline"></div>
</div>
<div id="Offline_hand" class="edgeLoad-offline"></div>
<div id="Offline_circleCopy2" class="edgeLoad-offline"></div>
<div id="Offline_Pasted9" class="edgeLoad-offline"></div>
<div id="Offline_Pasted9Copy" class="edgeLoad-offline"></div>
<div id="Offline_cross2" class="edgeLoad-offline">
<div id="Offline_cross2_cross"></div>
</div>
</div>
</div>
<!-- OFFLINE ANIMATION ENDS -->
</div>
<div class="panel yellow">
<div class="content">
<h1>Graph</h1>
<p>Most databases force you to bend over backwards to match their storage constraints. But graphs are different, they let you have any data structure you want. Whether that be traditional tables with relations, document oriented trees, or tons of circular references. You choose.</p>
</div>
<img class="edgePhotos" src="images/edgePhotos/graph.png">
<!-- GRAPH ANIMATION STARTS -->
<div class="aniHolder">
<div id="Graph" class="graph">
<div id="Graph_arrow9" class="edgeLoad-graph">
<div id="Graph_arrow9_Pasted3"></div>
</div>
<div id="Graph_arrow5Copy" class="edgeLoad-graph">
<div id="Graph_arrow5Copy_Pasted3"></div>
</div>
<div id="Graph_arrow5Copy2" class="edgeLoad-graph">
<div id="Graph_arrow5Copy2_Pasted3"></div>
</div>
<div id="Graph_arrow5" class="edgeLoad-graph">
<div id="Graph_arrow5_Pasted3"></div>
</div>
<div id="Graph_arrow6" class="edgeLoad-graph">
<div id="Graph_arrow6_Pasted3"></div>
</div>
<div id="Graph_arrow7" class="edgeLoad-graph">
<div id="Graph_arrow7_Pasted3"></div>
</div>
<div id="Graph_arrow13" class="edgeLoad-graph">
<div id="Graph_arrow13_Pasted3"></div>
</div>
<div id="Graph_arrow14" class="edgeLoad-graph">
<div id="Graph_arrow14_Pasted3"></div>
</div>
<div id="Graph_Rectangle" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy6" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy2" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy3" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy4" class="edgeLoad-graph"></div>
<div id="Graph_RectangleCopy5" class="edgeLoad-graph"></div>
<div id="Graph_Rectangle2Copy4" class="edgeLoad-graph"></div>
<div id="Graph_Rectangle2Copy5" class="edgeLoad-graph"></div>
<div id="Graph_Rectangle2Copy2" class="edgeLoad-graph"></div>
<div id="Graph_Rectangle2Copy3" class="edgeLoad-graph"></div>
<div id="Graph_Rectangle3" class="edgeLoad-graph"></div>
<div id="Graph_key3" class="edgeLoad-graph">
<div id="Graph_key3_Pasted5"></div>
</div>
<div id="Graph_Ellipse" class="edgeLoad-graph"></div>
</div>
</div>
<!-- GRAPH ANIMATION ENDS -->
</div>
</div>
</div>
<!-- END OF SWIPER -->
<!-- START OF GITTER SECTION -->
<div class="in_touch">
<div class="wrapper">
<h1>Community</h1>
<p>Are you currently working on a project using GUN or perhaps you would like more information before you make up your mind.</p>
<p>We always love to be in touch with our community and listen about what you're working on and maybe we can give you a hand. Click the button below and talk to us on Gitter!</p>
<button class="js-gitter-toggle-chat-button open blue" data-gitter-toggle-chat-state="true">Open Chat</button>
</div>
<div class="gitter">
<!-- THE ANIMATION STARTS HERE -->
<div id="Gitter" class="gitter_animation">
<div id="Gitter_laptop4" class="edgeLoad-gitter_animation">
<div id="Gitter_laptop4_check"></div>
<div id="Gitter_laptop4_Pasted32"></div>
<div id="Gitter_laptop4_Pasted22"></div>
<div id="Gitter_laptop4_Rectangle3Copy5"></div>
<div id="Gitter_laptop4_Rectangle3Copy3"></div>
<div id="Gitter_laptop4_Rectangle3Copy2"></div>
<div id="Gitter_laptop4_Rectangle3Copy"></div>
<div id="Gitter_laptop4_Rectangle3Copy7"></div>
<div id="Gitter_laptop4_Rectangle3"></div>
<div id="Gitter_laptop4_screen"></div>
<div id="Gitter_laptop4_mcAir"></div>
</div>
<div id="Gitter_gun_laptop" class="edgeLoad-gitter_animation">
<div id="Gitter_gun_laptop_bubble3">
<div id="Gitter_gun_laptop_bubble3_Pasted"></div>
</div>
<div id="Gitter_gun_laptop_logo">
<div id="Gitter_gun_laptop_logo_gun_logo_white"></div>
</div>
<div id="Gitter_gun_laptop_Rectangle4"></div>
<div id="Gitter_gun_laptop_mcAir"></div>
</div>
</div>
<!-- ANIMATION ENDS HERE -->
</div>
</div>
<!-- END OF GITTER -->
<div class="api_reference">
<div class="wrapper">
<h1 class="dark_header">API</h1>
<div class="grid">
<div class="grid-item">
<div class="red tile">
<h2>Gun constructor</h2>
<p>Used to creates a new gun database instance.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="blue tile">
<h2>gun.put</h2>
<p>Save data into gun, syncing it with your connected peers.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="blue tile">
<h2>gun.get</h2>
<p>Load all data under a key into the context.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="blue tile">
<h2>gun.back</h2>
<p>Move up to the parent context on the chain.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="blue tile">
<h2>gun.opt</h2>
<p>Change the database options.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="green tile">
<h2>gun.path</h2>
<p>Navigate through a node's properties</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="green tile">
<h2>gun.on</h2>
<p>Subscribe to realtime updated changes on a node or property.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="yellow tile">
<h2>gun.val</h2>
<p>Read a full object without subscribing updates.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="yellow tile">
<h2>gun.set</h2>
<p>Add a unique item to an unordered list.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="yellow tile">
<h2>gun.map</h2>
<p>Loop over each property in a node, and subscribe to future changes. It's essentially performing a .path on each field.</p>
<a href="docs">Read more</a>
</div>
</div>
<div class="grid-item">
<div class="yellow tile">
<h2>gun.not</h2>
<p>Handle cases where data can't be found.</p>
<a href="docs">Read more</a>
</div>
</div>
</div>
</div>
</div>
<div class="explanation">
<div class="wrapper">
<h1>Interactive explainers</h1>
<p>Databases can be scary, which is why we are making a series of explainers to educate everyone. Young or old, our goal is to show you that these ideas are actually simple.</p>
<div class="grid">
<div class="grid-item">
<a href="explainers/basketball/basketball.html">
<img src="images/data.png">
<h4>Data structures</h4>
</a>
</div>
<div class="grid-item">
<a href="explainers/conflict/lexical.html">
<img src="images/lexical.jpg">
<h4>Conflict resolution</h4>
</a>
</div>
<div class="grid-item">
<a href="explainers/data/security.html">
<img src="images/security.jpg">
<h4>Data security</h4>
</a>
</div>
</div>
</div>
</div>
<div class="developed yellow">
<div class="wrapper">
<h1>Projects</h1>
<p>Our GUN community is working on great projects here are the promising ones.</p>
</div>
<div class="grid">
<div class="grid-item">
<div class="hover pic_holder">
<div class="front">
<img src="img/map.png">
</div>
<a class="back" href="http://gps.gundb.io" target="blank"><div>
<h3>Geolocation app</h3>
<p>Using GUN's location awareness, is able to track other devices and tell the user where this device in relation to their position, the updates happen in real time.</p>
</div></a>
</div>
</div>
<div class="grid-item">
<div class="hover pic_holder">
<div class="front">
<img src="img/trace.png">
</div>
<a class="back" href="http://trace.gundb.io" target="blank"><div>
<h3>Trace game</h3>
<p>Fun game where up to 4 users try to eliminate each other by blocking the other players path.</p>
</div></a>
</div>
</div>
<div class="grid-item">
<div class="hover pic_holder">
<div class="front">
<img src="img/c4game.png">
</div>
<a class="back" href="http://C4.gunDB.io" target="blank"><div>
<h3>Connect 4 - C4</h3>
<p>High speed games aren't the only games that benefit from real time data. Consider turn-based games: some parts of the game are slow moving, and some parts are fast (pondering a move for a while, or seeing a perfect opening and launching for it).</p>
</div></a>
</div>
</div>
</div>
</div>
<div class="narrative">
<div class="wrapper"><h1>Resources</h1></div>
<div class="swiper-container">
<div class="swiper-wrapper">
<iframe class="iframeVid" src="https://www.youtube.com/embed/F1GB8P6_gVo?rel=0" frameborder="0" allowfullscreen></iframe>
<div class="swiper_nav grid-item">
<audio data-theme="night" data-src="https://changelog.com/podcast/236/embed" src="https://cdn.changelog.com/uploads/podcast/236/the-changelog-236.mp3" preload="none" class="changelog-episode" controls></audio><p><a href="https://changelog.com/podcast/236">The Changelog 236: GunDB, Venture Backed and Decentralized with Mark Nadal</a> – Listen on <a href="https://changelog.com/">Changelog.com</a></p><script async src="https://cdn.changelog.com/embed.js"></script>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/-i-11T5ZI9o?list=PL9EMvPaQlrL8VQuSsZ-_DqX0AevgmVokx" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/qJNDplwJ8aQ?list=PL9EMvPaQlrL9mgmihQNcKdqmZTcmxFG__" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/cOO6wz1rZVY?list=PL9EMvPaQlrL9ocZQaKBvEPXpx_Msdo7Vv" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<a href="explainers/conflict/lexical.html"><img class="iframe" src="https://img.youtube.com/vi/c80vSf45H4k/0.jpg"></a>
</div>
<div class="swiper_nav grid-item">
<a href="explainers/conflict/chronological.html"><img class="iframe" src="https://img.youtube.com/vi/UBnkhpcLQuM/0.jpg"></a>
</div>
<div class="swiper_nav grid-item">
<a href="explainers/conflict/deferred.html"><img class="iframe" src="https://img.youtube.com/vi/gRoJqzko_mE/0.jpg"></a>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/ccKThyaDR30?list=PL9EMvPaQlrL9ocZQaKBvEPXpx_Msdo7Vv" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/Zl0nk_ZZV6Q?list=PL9EMvPaQlrL9ocZQaKBvEPXpx_Msdo7Vv" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/jXni0KDQNsc?list=PL9EMvPaQlrL9ocZQaKBvEPXpx_Msdo7Vv" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/kzrmAdBAnn4?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/70dn1oZQFCk?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/nG3yz1FsAxc?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/_RDC37hrTo8?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/-SiLnaSDkh4?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/tg06mdcGs5k?rel=0" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<a href="https://www.codenewbie.org/podcast/intro-to-databases" target="_blank"><img class="iframe" src="img/codenewbie.jpg"></a>
</div>
<div class="swiper_nav grid-item">
<a href="https://devchat.tv/js-jabber/mjs-002-my-js-story-mark-nadal" target="_blank"><img class="iframe" src="img/js_jabber.jpg"></a>
</div>
<div class="swiper_nav grid-item">
<a href="https://video.webcamp.si/wc2016_nadal_the_frontend_backend_without_devops/" target="_blank"><img class="iframe" src="img/frontEndBackEnd.png"></a>
</div>
<div class="swiper_nav grid-item">
<a href="https://skillsmatter.com/skillscasts/6489-the-javascript-database-for-javascript-developers" target="_blank"><img class="iframe" src="img/skillMaster.png"></a>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/i7jEntJXgKw?list=PL9EMvPaQlrL8VQuSsZ-_DqX0AevgmVokx" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<iframe src="https://www.youtube.com/embed/gBp_vA6D9PI?list=PL9EMvPaQlrL8VQuSsZ-_DqX0AevgmVokx" allowfullscreen></iframe>
</div>
<div class="swiper_nav grid-item">
<a href="https://thewebplatformpodcast.com/102-offline-with-gundb" target="_blank"><img class="iframe" src="img/webPlatform.png"></a>
</div>
<div class="swiper_nav grid-item">
<a href="https://devchat.tv/js-jabber/232-jsj-gundb-and-databases-with-mark-nadal" target="_blank"><img class="iframe" src="img/js_jabber.jpg"></a>
</div>
</div>
<div class="meetup grid blue">
<a href="https://www.meetup.com/GUN-User-Group/" target="blank"><div class="grid-item">
<img src="img/meetUplogo.gif">
<h3>We invite you to come to our meetups to collaborate and eat!</h3>
</div></a>
</div>
</div>
</div>
<!-- FOOTER -->
<div id="footer">
<div class="container" class="page">
<div class="footer_social">
<div class="grid">
<a href="https://www.github.com/amark/gun" target="_blank"><img src="img/icons/github.svg"></a>
<a href="https://gitter.im/amark/gun" target="_blank"><img src="img/icons/gitter.svg"></a>
<a href="https://twitter.com/databasegun" target="_blank"><img src="img/icons/twitter.svg"></a>
<a href="https://www.linkedin.com/company/gun-inc" target="_blank"><img src="img/icons/linkedin.svg"></a>
</div>
</div>
</div>
<nav>
<a href="https://gun.eco/" target="_blank">Get Started</a>
<a href="docs">Documentation</a>
<a href="https://gun.eco/think.html">Tutorials</a>
<a href="https://github.com/amark/gun">Download</a>
<a href="http://gun.js.org/enterprise/team.html" target="_blank">Our Team</a>
</nav>
</div>
<footer>
<div class="container">
<p>Designed with ♥ by Mark Nadal, the gun team, and many very awesome contributors. Liberally licensed under <a href="https://github.com/amark/gun/wiki/package.json"> Zlib or MIT or Apache 2.0.</a></p>
</div>
</footer>
</div>
<script type="text/javascript">
var stopAdobe = false;
if(-1 < navigator.userAgent.toLowerCase().indexOf('iphone') || -1 < navigator.userAgent.indexOf('iOS')){
stopAdobe = true;
$('.aniHolder').empty();
$('.edgePhotos').css({'display':'block'});
}
</script>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="https://animate.adobe.com/runtime/6.0.0/edge.6.0.0.min.js"></script>
<!--Adobe Edge Runtime End-->
<script>
((window.gitter = {}).chat = {}).options = {
room: 'amark/gun',
activationElement: false,
useStyles: true
};
</script>
<script>
if(!stopAdobe){
AdobeEdge.loadComposition('dev_ani', 'gitter_animation', {
scaleToFit: "width",
centerGitter: "none",
minW: "320px",
maxW: "2560px",
width: "1280px",
height: "400px"
}, {"dom":{}}, {"dom":{}});
AdobeEdge.loadComposition('realtime', 'realtime', {
scaleToFit: "width",
centerRealTime: "none",
minW: "320px",
maxW: "2560px",
width: "1280px",
height: "800px"
}, {"dom":{}}, {"dom":{}});
AdobeEdge.loadComposition('distributed', 'distributed', {
scaleToFit: "width",
centerStage: "none",
minW: "320px",
maxW: "2560px",
width: "1280px",
height: "800px"
}, {"dom":{}}, {"dom":{}});
AdobeEdge.loadComposition('offline', 'offline', {
scaleToFit: "width",
centerOffline: "none",
minW: "320px",
maxW: "2560px",
width: "1280px",
height: "800px"
}, {"dom":{}}, {"dom":{}});
AdobeEdge.loadComposition('graph', 'graph', {
scaleToFit: "width",
centerGraph: "none",
minW: "320px",
maxW: "2560px",
width: "1280px",
height: "800px"
}, {"dom":{}}, {"dom":{}});
}
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script type="text/javascript" src="gun_dev.js"></script>
</body>
</html>