-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelopers.html
More file actions
838 lines (756 loc) · 53.8 KB
/
developers.html
File metadata and controls
838 lines (756 loc) · 53.8 KB
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
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kadena Ecosystem | Developers</title>
<link rel="icon" type="image/svg+xml" href="img/favicon.svg">
<meta name="description"
content="Build the future with Pact on the Kadena Blockchain. Documentation, tools, APIs, and resources for builders on Chainweb.">
<meta name="keywords"
content="Kadena Developers, Pact Language, Smart Contracts, Chainweb, API, Documentation, Builders, Kadena, KDA, Kadena Blockchain, Smart Contract Language, Web3, POW Blockchain, Crypto">
<meta name="author" content="Kadena Community">
<link rel="canonical" href="https://kda-community.github.io/developers.html">
<meta property="og:type" content="website">
<meta property="og:url" content="https://kda-community.github.io/developers.html">
<meta property="og:title" content="Kadena Ecosystem | Developers">
<meta property="og:description"
content="Build the future with Pact on the Kadena Blockchain. Documentation, tools, APIs, and resources for builders on Chainweb.">
<meta property="og:image" content="https://kda-community.github.io/img/og_card/og_developers.png">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://kda-community.github.io/developers.html">
<meta property="twitter:title" content="Kadena Ecosystem | Developers">
<meta property="twitter:description"
content="Build the future with Pact on the Kadena Blockchain. Documentation, tools, APIs, and resources for builders on Chainweb.">
<meta property="twitter:image" content="https://kda-community.github.io/img/og_card/og_developers.png">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://kda-community.github.io/"
},{
"@type": "ListItem",
"position": 2,
"name": "Developers",
"item": "https://kda-community.github.io/developers.html"
}]
}
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=JetBrains+Mono:wght@400;700&display=swap"
rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'sans-serif'],
mono: ['JetBrains Mono', 'monospace'],
},
colors: {
brand: {
DEFAULT: '#63e038', /* Green */
hover: '#4ecf25',
},
dao: {
DEFAULT: '#f7931a', /* Orange */
hover: '#e0820b',
},
dev: {
DEFAULT: '#3498db', /* Blue */
hover: '#2980b9',
},
surface: {
light: '#FAFAFA',
dark: '#050505',
card: '#121212',
border: '#27272a'
},
text: {
mainLight: '#1e1f23',
mainDark: '#f5f5f5',
}
}
}
}
}
</script>
<style>
body {
transition: background-color 0.3s, color 0.3s;
}
.aspect-video {
aspect-ratio: 16 / 9;
}
</style>
</head>
<body
class="bg-surface-light dark:bg-surface-dark text-text-mainLight dark:text-text-mainDark font-sans antialiased selection:bg-dev selection:text-white overflow-x-hidden flex flex-col min-h-screen">
<nav
class="fixed w-full z-50 top-0 start-0 border-b border-gray-200 dark:border-surface-border bg-white/95 dark:bg-surface-dark/95 backdrop-blur-md">
<div class="max-w-7xl mx-auto flex flex-wrap items-center justify-between p-4">
<a href="index.html" class="flex items-center">
<img src="img/kadenace_blue_dark.svg" class="h-9 md:h-12 w-auto block dark:hidden" alt="Kadena">
<img src="img/kadenace_blue_light.svg" class="h-9 md:h-12 w-auto hidden dark:block" alt="Kadena">
</a>
<div class="flex md:order-2 space-x-2 md:space-x-4 items-center">
<button id="theme-toggle" type="button"
class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg text-sm p-2.5 transition-colors">
<svg id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
</svg>
<svg id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 100 2h1z"
fill-rule="evenodd" clip-rule="evenodd"></path>
</svg>
</button>
<button id="menu-toggle" type="button"
class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800">
<svg class="w-5 h-5" fill="none" viewBox="0 0 17 14" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M1 1h15M1 7h15M1 13h15" />
</svg>
</button>
</div>
<div class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1" id="navbar-cta">
<ul
class="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 md:mt-0 md:border-0 md:bg-white dark:bg-surface-card md:dark:bg-transparent dark:border-gray-700 shadow-xl md:shadow-none relative z-50">
<li><a href="miners.html"
class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-brand dark:text-white dark:hover:bg-gray-700 dark:hover:text-brand">Miners</a>
</li>
<li><a href="developers.html"
class="block py-2 px-3 md:p-0 text-white bg-dev rounded md:bg-transparent md:text-dev"
aria-current="page">Developers</a></li>
<li><a href="dao.html"
class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-dao dark:text-white dark:hover:bg-gray-700 dark:hover:text-dao">DAO</a>
</li>
<li><a href="ecosystem.html"
class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-brand dark:text-white dark:hover:bg-gray-700 dark:hover:text-brand">Ecosystem</a>
</li>
<li><a href="wallets.html"
class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-brand dark:text-white dark:hover:bg-gray-700 dark:hover:text-brand">Wallets</a>
</li>
<li><a href="https://explorer.chainweb-community.org/mainnet" target="_blank"
class="external-link block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-brand dark:text-white dark:hover:bg-gray-700 dark:hover:text-brand">Explorer</a>
</li>
</ul>
</div>
</div>
</nav>
<section class="pt-32 pb-24 px-4 relative z-10 w-full flex-grow">
<div class="max-w-7xl mx-auto space-y-16">
<div class="text-center">
<h1 class="text-4xl md:text-5xl font-extrabold tracking-tight mb-4">
Build the <span class="text-dev">Future</span>
</h1>
<p class="text-gray-600 dark:text-gray-400 max-w-2xl mx-auto mb-8">
Everything you need to deploy scalable, secure dApps on the world's only scalable PoW blockchain.
</p>
<div class="mb-10">
<a href="docs/" target="_blank"
class="external-link inline-flex items-center px-8 py-3 text-lg font-bold text-white bg-dev rounded-full transition-all duration-200 hover:bg-dev-hover hover:scale-105">
Official Docs
<svg class="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M14 5l7 7m0 0l-7 7m7-7H3"></path>
</svg>
</a>
</div>
<div class="flex flex-wrap justify-center gap-3">
<button onclick="scrollToSection('pact-section')"
class="px-6 py-2 rounded-full text-sm font-bold bg-white dark:bg-surface-card border border-gray-300 dark:border-gray-700 hover:border-dev hover:text-dev transition-all">Pact</button>
<button onclick="scrollToSection('chainweb-section')"
class="px-6 py-2 rounded-full text-sm font-bold bg-white dark:bg-surface-card border border-gray-300 dark:border-gray-700 hover:border-dev hover:text-dev transition-all">Chainweb</button>
<button onclick="scrollToSection('tools-section')"
class="px-6 py-2 rounded-full text-sm font-bold bg-white dark:bg-surface-card border border-gray-300 dark:border-gray-700 hover:border-dev hover:text-dev transition-all">Tools</button>
</div>
</div>
<div id="pact-section"
class="relative overflow-hidden rounded-3xl bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 scroll-mt-32">
<div class="grid grid-cols-1 lg:grid-cols-2">
<div class="p-8 md:p-12 lg:p-16 flex flex-col justify-center">
<div class="flex items-center space-x-3 mb-6">
<img src="img/pact_dark.svg" onerror="this.style.display='none'" alt="Pact"
class="h-10 w-auto block dark:hidden">
<img src="img/pact_light.svg" onerror="this.style.display='none'" alt="Pact"
class="h-10 w-auto hidden dark:block">
</div>
<p class="text-lg text-gray-600 dark:text-gray-400 mb-8 leading-relaxed">
The smartest smart contract language. Pact is human-readable, safe by design, and supports
formal verification. It allows you to write bugs-free code that can be upgraded easily.
</p>
<div class="flex flex-wrap gap-4">
<a href="docs/" target="_blank"
class="external-link inline-flex items-center px-6 py-3 text-base font-bold text-white bg-gray-900 dark:bg-white dark:text-black rounded-lg hover:opacity-90 transition-opacity">
Pact Docs
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</a>
<a href="https://www.pact-community.org/" target="_blank"
class="external-link inline-flex items-center px-6 py-3 text-base font-medium text-gray-900 dark:text-white border border-gray-300 dark:border-gray-700 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
Community Tutorials
</a>
</div>
</div>
<div
class="bg-gray-50 dark:bg-[#0a0a0a] p-8 md:p-12 flex items-center justify-center border-t lg:border-t-0 lg:border-l border-gray-200 dark:border-gray-800">
<div
class="w-full max-w-md bg-white dark:bg-[#151515] rounded-xl shadow-sm border border-gray-200 dark:border-gray-800 p-6 font-mono text-sm">
<div class="flex space-x-2 mb-4">
<div class="w-3 h-3 rounded-full bg-red-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-green-500"></div>
</div>
<div class="space-y-2 text-gray-800 dark:text-gray-400">
<p><span class="text-purple-600 dark:text-purple-400">module</span> <span
class="text-blue-600 dark:text-blue-400">coin</span> GOVERNANCE</p>
<p class="pl-4 text-gray-500 dark:text-gray-500">"The standard coin contract."</p>
<p class="pl-4"><span class="text-purple-600 dark:text-purple-400">defcap</span> <span
class="text-blue-600 dark:text-blue-400">TRANSFER</span> ()</p>
<p class="pl-8">"Managed by the coin account."</p>
<p class="pl-8">...</p>
</div>
</div>
</div>
</div>
</div>
<div id="chainweb-section"
class="relative overflow-hidden rounded-3xl bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 scroll-mt-32">
<div class="grid grid-cols-1 lg:grid-cols-2">
<div
class="order-2 lg:order-1 bg-gray-50 dark:bg-[#0a0a0a] p-8 md:p-12 flex items-center justify-center border-t lg:border-t-0 lg:border-r border-gray-200 dark:border-gray-800">
<div class="w-full max-w-md relative flex items-center justify-center">
<img src="img/chainweb_20_chains_dark.svg" onerror="this.style.display='none'"
alt="Chainweb Graph" class="w-full h-auto object-contain block dark:hidden">
<img src="img/chainweb_20_chains_light.svg" onerror="this.style.display='none'"
alt="Chainweb Graph" class="w-full h-auto object-contain hidden dark:block">
</div>
</div>
<div class="order-1 lg:order-2 p-8 md:p-12 lg:p-16 flex flex-col justify-center">
<div class="flex items-center space-x-3 mb-6">
<img src="img/chainweb_dark.svg" onerror="this.style.display='none'" alt="Chainweb"
class="h-10 w-auto block dark:hidden">
<img src="img/chainweb_light.svg" onerror="this.style.display='none'" alt="Chainweb"
class="h-10 w-auto hidden dark:block">
</div>
<p class="text-lg text-gray-600 dark:text-gray-400 mb-8 leading-relaxed">
The only sharded Layer-1 Proof-of-Work network that scales. Chainweb braids together
multiple Bitcoin-like chains to deliver massive throughput without compromising security.
</p>
<div class="flex flex-wrap gap-4">
<button
onclick="openPdfModal('https://cdn.sanity.io/files/agrhq0bu/production/1e4f5f6b99d1cb0701432df6e23e9bbbf46ea363.pdf')"
class="inline-flex items-center gap-2 px-6 py-3 text-base font-medium text-dev border border-dev rounded-lg hover:bg-dev hover:text-white dark:hover:bg-dev dark:hover:text-white transition-all shadow-sm">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z">
</path>
</svg>
Read Whitepaper
</button>
<a href="https://cdn.sanity.io/files/agrhq0bu/production/1e4f5f6b99d1cb0701432df6e23e9bbbf46ea363.pdf"
target="_blank"
class="inline-flex items-center justify-center p-3 text-gray-500 hover:text-dev dark:text-gray-400 dark:hover:text-dev border border-gray-200 dark:border-gray-800 rounded-lg hover:bg-gray-50 dark:hover:bg-surface-card transition-colors"
title="Download directly" onclick="event.stopPropagation();">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path>
</svg>
</a>
</div>
</div>
</div>
</div>
<div id="tools-section" class="scroll-mt-32">
<div class="flex items-center mb-8">
<h2 class="text-2xl md:text-3xl font-bold">Developer <span class="text-dev">Toolbox</span></h2>
<div class="h-px bg-gray-200 dark:bg-gray-800 flex-grow ml-6"></div>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
<a href="https://docs.kadena.io/" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Kadena Docs</h3>
<p class="text-xs text-gray-500 mt-1">Official Documentation</p>
</a>
<a href="https://pact-util-lib.readthedocs.io/en/beta_0.11/" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Pact Util Lib</h3>
<p class="text-xs text-gray-500 mt-1">Smart Contract Standards</p>
</a>
<a href="https://explorer.chainweb-community.org/mainnet" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Kadena Explorer</h3>
<p class="text-xs text-gray-500 mt-1">Block Explorer</p>
</a>
<a href="https://github.com/kda-community/chainweaver" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Chainweaver</h3>
<p class="text-xs text-gray-500 mt-1">IDE & Wallet</p>
</a>
<a href="https://github.com/kda-community/kda-tool" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">KDA-Tool</h3>
<p class="text-xs text-gray-500 mt-1">Utilities</p>
</a>
<a href="https://tools.chainweb-community.org/"
class="group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19.428 15.428a2 2 0 00-1.022-.547l-2.384-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z">
</path>
</svg>
</div>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Testnet Faucet</h3>
<p class="text-xs text-gray-500 mt-1">Tools</p>
</a>
<a href="https://ide.forkme.fun/" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Online REPL</h3>
<p class="text-xs text-gray-500 mt-1">Test Code</p>
</a>
<a href="https://api.chainweb-community.org/openapi/" target="_blank"
class="external-link group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10">
</path>
</svg>
</div>
<svg class="w-4 h-4 text-gray-400 group-hover:text-dev" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
</path>
</svg>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Node API</h3>
<p class="text-xs text-gray-500 mt-1">Endpoints</p>
</a>
<a href="ecosystem.html"
class="group p-4 bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 rounded-xl hover:border-dev dark:hover:border-dev transition-all hover:-translate-y-1">
<div class="flex items-center justify-between mb-3">
<div class="p-2 bg-gray-100 dark:bg-gray-800 rounded-lg">
<svg class="w-6 h-6 text-gray-700 dark:text-gray-300 group-hover:text-dev transition-colors"
fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z">
</path>
</svg>
</div>
</div>
<h3 class="font-bold text-gray-900 dark:text-white">Oracles</h3>
<p class="text-xs text-gray-500 mt-1">Data Feeds</p>
</a>
</div>
</div>
</div>
</section>
<div id="warning-modal" class="fixed inset-0 z-[60] hidden" aria-labelledby="modal-title" role="dialog"
aria-modal="true">
<div class="fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity"></div>
<div class="fixed inset-0 z-10 w-screen overflow-y-auto">
<div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0">
<div id="modal-panel"
class="relative transform overflow-hidden rounded-2xl bg-white dark:bg-surface-card border border-gray-200 dark:border-gray-800 text-left shadow-2xl transition-all sm:my-8 sm:w-full sm:max-w-md">
<div class="p-6">
<div class="flex items-center justify-center mb-5">
<div class="rounded-full bg-gray-100 dark:bg-gray-800 p-4">
<img src="img/favicon.svg" alt="Kadena" class="h-10 w-10">
</div>
</div>
<div class="text-center">
<h3 class="text-xl font-bold leading-6 text-gray-900 dark:text-white" id="modal-title">
Leaving Website</h3>
<div class="mt-3">
<p class="text-sm text-gray-500 dark:text-gray-400">
You are about to visit an external third-party website. Are you sure you want to
proceed?
</p>
</div>
</div>
</div>
<div class="bg-gray-50 dark:bg-[#0a0a0a] px-6 py-4 flex flex-row-reverse gap-3 sm:px-6">
<button type="button" id="btn-proceed"
class="inline-flex w-full justify-center rounded-lg bg-brand px-3 py-2 text-sm font-bold text-black shadow-sm hover:bg-brand-hover sm:w-auto transition-colors">Visit
Site</button>
<button type="button" id="btn-cancel"
class="inline-flex w-full justify-center rounded-lg bg-white dark:bg-gray-800 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-300 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 sm:w-auto transition-colors">Go
Back</button>
</div>
</div>
</div>
</div>
</div>
<div id="pdf-modal" class="fixed inset-0 z-[100] hidden flex-col transition-opacity"
aria-labelledby="pdf-modal-title" role="dialog" aria-modal="true">
<div class="fixed inset-0 bg-black/80 backdrop-blur-sm" id="pdf-modal-backdrop"></div>
<div class="relative z-10 flex flex-col w-full h-full max-w-6xl mx-auto p-2 sm:p-4 md:p-8 max-h-[100dvh]">
<div
class="flex justify-between items-center bg-white dark:bg-surface-card rounded-t-xl px-4 py-3 border-b border-gray-200 dark:border-gray-800 shrink-0">
<h3 class="text-lg font-bold text-gray-900 dark:text-white flex items-center gap-2"
id="pdf-modal-title">
<svg class="w-5 h-5 text-dev" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z">
</path>
</svg>
Whitepaper Preview
</h3>
<button type="button" id="btn-close-pdf"
class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 focus:outline-none transition-colors p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800">
<span class="sr-only">Close</span>
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12">
</path>
</svg>
</button>
</div>
<div
class="flex-grow bg-gray-100 dark:bg-[#0a0a0a] w-full rounded-b-xl overflow-hidden shadow-2xl relative">
<!-- Loader shown while iframe loads -->
<div id="pdf-loader"
class="absolute inset-0 flex flex-col items-center justify-center bg-white dark:bg-surface-card z-0">
<svg class="animate-spin h-8 w-8 text-dev mb-4" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4">
</circle>
<path class="opacity-75" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
</path>
</svg>
<span class="text-gray-500 dark:text-gray-400 font-medium text-sm text-center px-4">Loading
document...<br><span class="text-xs opacity-75 mt-1 block">(This may take a moment depending on
the file size)</span></span>
</div>
<!-- Embedded Viewer -->
<iframe id="pdf-iframe" class="absolute inset-0 w-full h-full border-none z-10 bg-white" src=""
allow="autoplay"
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"
allowfullscreen></iframe>
</div>
</div>
</div>
<footer
class="bg-white dark:bg-surface-card border-t border-gray-200 dark:border-gray-800 relative z-10 mt-auto transition-colors duration-300">
<div class="w-full max-w-7xl mx-auto py-8 px-4 flex flex-col items-center justify-center gap-6">
<div class="flex items-center space-x-6">
<a href="https://medium.com/@communitykadena" target="_blank"
class="external-link text-gray-400 hover:text-brand transition-colors" aria-label="Medium">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M13.54 12a6.8 6.8 0 01-6.77 6.82A6.8 6.8 0 010 12a6.8 6.8 0 016.77-6.82A6.8 6.8 0 0113.54 12zM20.96 12c0 3.54-1.51 6.42-3.38 6.42-1.87 0-3.39-2.88-3.39-6.42s1.52-6.42 3.39-6.42 3.38 2.88 3.38 6.42M24 12c0 3.17-.53 5.75-1.19 5.75-.66 0-1.19-2.58-1.19-5.75s.53-5.75 1.19-5.75C23.47 6.25 24 8.83 24 12z" />
</svg>
</a>
<a href="https://x.com/KdaCed/communities/explore" target="_blank"
class="external-link text-gray-400 hover:text-brand transition-colors" aria-label="X">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z">
</path>
</svg>
</a>
<a href="https://t.me/+3JzP9i19cM8wOWQ8" target="_blank"
class="external-link text-gray-400 hover:text-brand transition-colors" aria-label="Telegram">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 11.944 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" />
</svg>
</a>
<a href="https://discord.gg/T4mASjRaRr" target="_blank"
class="external-link text-gray-400 hover:text-brand transition-colors" aria-label="Discord">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.419-2.1568 2.419zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.419-2.1568 2.419z" />
</svg>
</a>
<a href="https://bsky.app/profile/kdacommunity.bsky.social" target="_blank"
class="text-gray-400 hover:text-brand transition-colors" aria-label="Bluesky">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565-.131 2.032-.234 3.024.338 4.089c.571 1.065 2.613 4.88 2.613 4.88l1.616 3.118s-3.018-.086-4.218 3.323c-.975 2.765 2.393 4.613 5.627 3.566 3.038-.984 5.293-3.659 6.024-4.88.73 1.221 2.986 3.896 6.024 4.88 3.234 1.047 6.602-.801 5.627-3.566-1.2-3.409-4.218-3.323-4.218-3.323l1.616-3.118s2.042-3.815 2.613-4.88c.572-1.065.469-2.057-.564-2.524-.66-.299-1.664-.621-4.3 1.24C16.046 4.748 13.087 8.686 12 10.8Z" />
</svg>
</a>
</div>
<div class="text-center">
<span class="block text-sm text-gray-500 sm:text-center dark:text-gray-400"> © <span
id="current-year"></span> <a href="#" class="hover:text-brand">Kadena Community Edition</a>. All
Rights Reserved.</span>
</div>
</div>
</footer>
<script>
// SCROLL TO SECTION LOGIC
function scrollToSection(id) {
const element = document.getElementById(id);
if (element) {
const headerOffset = 100;
const elementPosition = element.getBoundingClientRect().top;
const offsetPosition = elementPosition + window.pageYOffset - headerOffset;
window.scrollTo({
top: offsetPosition,
behavior: "smooth"
});
}
}
// --- UNIVERSAL MODAL LOGIC ---
const modal = document.getElementById('warning-modal');
const btnProceed = document.getElementById('btn-proceed');
const btnCancel = document.getElementById('btn-cancel');
let targetUrl = '';
function openModal(url) {
targetUrl = url;
modal.classList.remove('hidden');
}
function closeModal() {
modal.classList.add('hidden');
targetUrl = '';
}
// Smart Event Delegation for ALL external links
document.body.addEventListener('click', (event) => {
// Find the closest anchor tag (<a>) to the click
const link = event.target.closest('a');
if (!link) return; // If not a link, do nothing
// Criteria to trigger the popup:
// 1. It is inside a Card (Project, Miner, Wallet, Tool)
const isCardLink = link.closest('.project-card') || link.closest('.miner-card') || link.closest('.wallet-card') || link.closest('.group');
// 2. It is inside the Footer
const isFooterLink = link.closest('footer');
// 3. It has the specific class 'external-link' (For Navbar Explorer & Dynamic News)
const isExplicitExternal = link.classList.contains('external-link');
// 4. It is the Setup Guide Button
const isSetupButton = link.id === 'setup-guide-btn';
// COMBINED CHECK:
// If it matches ANY criteria above AND it is NOT an internal anchor (#) or javascript
if ((isCardLink || isFooterLink || isExplicitExternal || isSetupButton) && !link.href.startsWith('javascript') && !link.href.includes('#')) {
// Final Check: Is it actually an external domain?
const currentDomain = window.location.hostname;
// If hostname is different (and not empty for local testing), trigger modal
if (link.hostname !== currentDomain && link.hostname !== '') {
event.preventDefault(); // Stop the immediate navigation
openModal(link.href); // Show our custom modal
}
}
});
// Proceed Button (User clicked "Visit Site")
btnProceed.addEventListener('click', () => {
if (targetUrl) {
window.open(targetUrl, '_blank');
closeModal();
}
});
// Cancel Button (User clicked "Go Back")
btnCancel.addEventListener('click', closeModal);
// Click Outside to Close
modal.addEventListener('click', (e) => {
const panel = document.getElementById('modal-panel');
if (!panel.contains(e.target)) {
closeModal();
}
});
// --- PDF PREVIEW MODAL LOGIC ---
const pdfModal = document.getElementById('pdf-modal');
const pdfIframe = document.getElementById('pdf-iframe');
const btnClosePdf = document.getElementById('btn-close-pdf');
const pdfModalBackdrop = document.getElementById('pdf-modal-backdrop');
const pdfLoader = document.getElementById('pdf-loader');
function openPdfModal(pdfUrl) {
// Using Google Docs Viewer for mobile-friendly PDF rendering
const viewerUrl = `https://docs.google.com/viewer?url=${encodeURIComponent(pdfUrl)}&embedded=true`;
if (pdfLoader) pdfLoader.style.display = 'flex';
pdfIframe.src = viewerUrl;
pdfModal.classList.remove('hidden');
pdfModal.classList.add('flex');
document.body.style.overflow = 'hidden';
}
function closePdfModal() {
pdfModal.classList.add('hidden');
pdfModal.classList.remove('flex');
pdfIframe.src = '';
document.body.style.overflow = '';
}
if (btnClosePdf) btnClosePdf.addEventListener('click', closePdfModal);
if (pdfModalBackdrop) pdfModalBackdrop.addEventListener('click', closePdfModal);
if (pdfIframe) {
pdfIframe.addEventListener('load', () => {
if (pdfLoader) pdfLoader.style.display = 'none';
});
}
// --- CHECK URL FOR AUTOLOAD PREVIEW ---
document.addEventListener('DOMContentLoaded', () => {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('preview') === 'whitepaper') {
openPdfModal('https://cdn.sanity.io/files/agrhq0bu/production/1e4f5f6b99d1cb0701432df6e23e9bbbf46ea363.pdf');
// Optional: Scroll to the button to show users where they are on the page beneath the modal
const pactSection = document.getElementById('chainweb-section');
if (pactSection) pactSection.scrollIntoView();
}
});
// DARK MODE LOGIC
var themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
var themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
themeToggleLightIcon.classList.remove('hidden');
document.documentElement.classList.add('dark');
} else {
themeToggleDarkIcon.classList.remove('hidden');
document.documentElement.classList.remove('dark');
}
var themeToggleBtn = document.getElementById('theme-toggle');
themeToggleBtn.addEventListener('click', function () {
themeToggleDarkIcon.classList.toggle('hidden');
themeToggleLightIcon.classList.toggle('hidden');
if (localStorage.getItem('color-theme')) {
if (localStorage.getItem('color-theme') === 'light') {
document.documentElement.classList.add('dark');
localStorage.setItem('color-theme', 'dark');
} else {
document.documentElement.classList.remove('dark');
localStorage.setItem('color-theme', 'light');
}
} else {
if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark');
localStorage.setItem('color-theme', 'light');
} else {
document.documentElement.classList.add('dark');
localStorage.setItem('color-theme', 'dark');
}
}
});
// BURGER MENU
const menuToggle = document.getElementById('menu-toggle');
const navbarCta = document.getElementById('navbar-cta');
menuToggle.addEventListener('click', (e) => {
e.stopPropagation();
navbarCta.classList.toggle('hidden');
});
document.addEventListener('click', (event) => {
const isClickInsideMenu = navbarCta.contains(event.target);
const isClickOnButton = menuToggle.contains(event.target);
if (!isClickInsideMenu && !isClickOnButton && !navbarCta.classList.contains('hidden')) {
navbarCta.classList.add('hidden');
}
});
// AUTOMATIC YEAR UPDATE
document.getElementById('current-year').textContent = new Date().getFullYear();
</script>
</body>
</html>