forked from GustavoRSSilva/lightning.family
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
336 lines (308 loc) · 10.8 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
<!DOCTYPE html>
<head>
<title>Lightning Family - Search intuitively</title>
<meta name="og:description" content="Lightning Network digital resources map">
<meta name="keywords" content="Lightning family, Lightning Network, Bitcoin">
<meta name="og:image" content="/icons/metaimage.png">
<meta name="og:url" content="https://lightning.family/">
<meta name="og:title" content="Lightning Family - Search intuitively">
<meta name="twitter:site" content="@lightningfamily">
<meta property="og:site_name" content="Lightning Family">
<meta name="twitter:image:alt" content="Lightning Family - Search intuitively">
<meta charset="utf-8">
<link rel="icon" href="/icons/icon.png">
<link rel="stylesheet" href="/css/main.css">
<link href="/css/jquery-ui.min.css" rel="stylesheet">
<link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt"
rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<a href="https://github.com/Lightning-Family/lightning.family">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"
alt="Fork me on GitHub" title="Fork me on GitHub">
</a>
<a href="https://github.com/Lightning-Family/lightning.family/tree/master/Upload%20Your%20Lapp">
<img style="position: absolute; top: 0; left: 0; border: 0; height: 150px; width: 150px; padding: 10px;" src="/icons/addproject.png"
alt="Add your Lightning Element" title="Add your Lightning Element">
</a>
<!--div class="foo">
<span class="letter" data-letter="L">LIGHTNING</span>
<span class="letter" data-letter="F">FAMILY</span>
</div-->
<div class="search-form">
<form style="margin-right: 200px;">
<input type="text" id="autocomplete" placeholder="Type to Search...">
<button></button>
</form>
<!--div class="share-button">
<input class="toggle-input" id="toggle-input" type="checkbox" />
<label for="toggle-input" class="toggle"></label>
<ul class="network-list">
<li class="twitter">
<a href="#">Share on Twitter</a>
</li>
<li class="facebook">
<a href="#">Share on Facebook</a>
</li>
<li class="googleplus">
<a href="#">Share on Google+</a>
</li>
</ul>
</div-->
</div>
<center>
<svg width="750" height="750" style="margin-top: 65px;"></svg>
</center>
</body>
<script>
var input = document.querySelector('.search-form');
var search = document.querySelector('input')
var button = document.querySelector('button');
button.addEventListener('click', function (e) {
e.preventDefault();
input.classList.toggle('active');
})
search.addEventListener('focus', function () {
input.classList.add('focus');
})
search.addEventListener('blur', function () {
search.value.length != 0 ? input.classList.add('focus') : input.classList.remove('focus');
})
var svg = d3.select("svg"),
margin = 20,
diameter = +svg.attr("width"),
g = svg.append("g").attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")");
var color = d3.scaleLinear()
.domain([-1, 5])
.range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"])
.interpolate(d3.interpolateHcl);
var pack = d3.pack()
.size([diameter - margin, diameter - margin])
.padding(2);
var element;
// Search function to enable a searching
function search(text) {
return element.children.filter(function (e) { return e.name === text });
}
// Read from JSON file called Cateogries.json
d3.json("categories.json", function (error, root) {
if (error) throw error;
element = root;
// Creates a hierarchy of data
root = d3.hierarchy(root)
.sum(function (d) { return d.size; })
.sort(function (a, b) { return b.value - a.value; });
var focus = root,
nodes = pack(root).descendants(),
view;
// Creates circle properties + event handler
var circle = g.selectAll("circle")
.data(nodes)
.enter().append("circle")
.attr("class", function (d) { return d.parent ? d.children ? "node" : "node node--leaf" : "node node--root"; })
.style("fill", function (d) { return d.children ? color(d.depth) : null; })
.on("click", function (d) { if (focus !== d) zoom(d), d3.event.stopPropagation(); });
// Creates tittle properties + return categories.json name label
var text = g.selectAll("text")
.data(nodes)
.enter().append("text")
.attr("class", "label")
.style("fill-opacity", function (d) { return d.parent === root ? 1 : 0; })
.style("display", function (d) { return d.parent === root ? "inline" : "none"; })
.text(function (d) { return d.data.name; });
// Creates group of circles with tittle
var node = g.selectAll("circle,text");
// Creates different background colour in layers + Event handler to zoom in/out
svg
.style("background", color(-1))
.on("click", function () { zoom(root); });
zoomTo([root.x, root.y, root.r * 2 + margin]);
// Zoom function with time duration properties
function zoom(d) {
var focus0 = focus; focus = d;
var transition = d3.transition()
.duration(d3.event.altKey ? 7500 : 750)
.tween("zoom", function (d) {
var i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);
return function (t) { zoomTo(i(t)); };
});
// Transition effect for Category tittles
transition.selectAll("text")
.filter(function (d) { return d.parent === focus || this.style.display === "inline"; })
.style("fill-opacity", function (d) { return d.parent === focus ? 1 : 0; })
.on("start", function (d) { if (d.parent === focus) this.style.display = "inline"; })
.on("end", function (d) { if (d.parent !== focus) this.style.display = "none"; });
}
// Zoom in fucntion to map JSON values as coordinates
function zoomTo(v) {
var k = diameter / v[2]; view = v;
node.attr("transform", function (d) { return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")"; });
circle.attr("r", function (d) { return d.r * k; });
}
});
var availableTags = [
"Startups",
"Fulmo",
"Bitlum",
"DiscoveryBlock",
"Wallets",
"Hardware",
"LNHW",
"Web Wallets",
"HTLC",
"Discovery Wallet",
"Desktop Wallets",
"Zap Wallets",
"Mobile Wallets",
"Shango",
"Eclair",
"Bitcoin Lightning",
"Atom Lightning",
"LigthningPeach",
"CoinOS",
"Fulmo",
"Zap iOS",
"Swift Lightning",
"Bit Box",
"Documents",
"LN Developers",
"Learning",
"Medium Articles",
"Understanding LN using an Abacus",
"LN is the Future of Bitcoin",
"Introducing Breez",
"LN for non-technical learners",
"Tutorial on LN node setup",
"Don’t Buy Into the FUD",
"Wikis",
"Fulmo wiki",
"Wikiversity",
"Bitcoin Wiki",
"Wikipedia",
"Videos",
"WikiMedia Commons",
"Lightning Network Explained",
"Buying Coffee at Lightning Speed",
"Lightning Makers",
"Videocall",
"Funding",
"VC",
"a16z",
"Steve Lee",
"Crowdfunding",
"Consultants",
"Hardware",
"software",
"Front-end",
"Back-end",
"Business",
"Events",
"Meet-ups",
"Switzerland",
"Scaling Bitcoin with Lightning",
"Amsterdam",
"Tech Tuesday: Lightning Network",
"Hackathons",
"#LightningHackDay",
"Madrid Lightning Network",
"Cripto Chapa",
"Conferences",
"#LightningHackDay",
"Madrid Lightning Network",
"Regulation",
"Guides",
"Projects",
"Stores",
"Apparel",
"Moonstuff",
"C+C Remeras",
"Bitcoin Art",
"Cryptoid Shop",
"YYBazaar",
"Hipp Tee",
"Bitcoin Shirt",
"Wears My Liberty",
"BTC Echo",
"Gully Flip",
"Quinsolo",
"Electronics",
"Crypto Cloaks",
"Coin Cards",
"Never Fiat",
"Ligthning Farm",
"Services",
"Joltfun",
"Bitgild",
"Eichenhain",
"Coin Cards",
"Bit Launch",
"Coin Mall",
"Domorder",
"The Kashbash",
"Peer Name",
"Tor Guard",
"Coingate",
"LN SMS",
"The Vault",
"Bitrefill",
"Games",
"Satoshi's Games",
"Moneni",
"The Lightning Spin",
"Unblurrer",
"Microbet",
"In Dice",
"Lightning Gem",
"In Plays",
"Lightning Roulette",
"Lightning Roulette",
"Arcade Money",
"Hardware Nodes",
"RaspiBolt",
"RaspiBlitz",
"Trueno",
"Faucets",
"Appspot",
"Backend Hmaburg",
"Coinfaucet",
"Kuttler",
"Exchanges",
"Submarine Swaps",
"Zig Zag",
"Bitbargain",
"Bitgild",
"Lightning Conductor",
"Mercuriex",
"Bitcoin Venezuela",
"eCommerce",
"BTCPay Server",
"lIGHTNING cHARGE",
"WooCommerce WP plugin",
"Kriptode",
"Living Room of Satoshi",
"Nanopos",
"Advertising",
"Satoshi's Place",
"Art of Lightning",
"Blogs",
"Yalls",
"Thunder Message",
"WordPress Lightning Publisher",
"Utils",
"Nanotip",
"IFTT",
"Lightning Jukebox",
"Pay Per Call",
"Lightning Buddy",
"Matreon",
"Quote From Me",
"In Tip Slack",
];
$("#autocomplete").autocomplete({
source: availableTags
});
</script>