-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
838 lines (767 loc) · 37.6 KB
/
index.html
File metadata and controls
838 lines (767 loc) · 37.6 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">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QUANTUM ENGINE — NFT Protocol</title>
<link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0612;
--grid: rgba(138,75,255,0.05);
--accent: #8b5cf6;
--text: #ede9fe;
--dim: rgba(167,139,250,0.5);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
background: var(--bg);
color: var(--text);
font-family: 'Share Tech Mono', monospace;
min-height: 100vh;
overflow-x: hidden;
}
body::before {
content:'';
position:fixed; inset:0;
background-image:
linear-gradient(var(--grid) 1px, transparent 1px),
linear-gradient(90deg, var(--grid) 1px, transparent 1px);
background-size: 40px 40px;
pointer-events:none;
z-index:0;
}
body::after {
content:'';
position:fixed; inset:0;
background: linear-gradient(transparent 50%, rgba(0,0,0,0.03) 50%);
background-size: 100% 4px;
pointer-events:none;
z-index:1;
animation: scan 8s linear infinite;
}
@keyframes scan { 0%{background-position:0 0} 100%{background-position:0 100vh} }
.container { max-width:1100px; margin:0 auto; padding:0 24px; position:relative; z-index:2; }
header { padding:32px 0 24px; border-bottom:1px solid rgba(139,92,246,0.15); margin-bottom:40px; }
.logo {
font-family:'Orbitron',sans-serif;
font-size:clamp(28px,5vw,52px);
font-weight:900;
letter-spacing:0.08em;
color:var(--accent);
text-shadow:0 0 30px var(--accent), 0 0 60px rgba(139,92,246,0.3);
animation:flicker 6s ease-in-out infinite;
}
@keyframes flicker { 0%,95%,100%{opacity:1} 96%{opacity:0.85} 97%{opacity:1} 98%{opacity:0.9} }
.logo span { color:rgba(139,92,246,0.4); font-weight:400; }
.subtitle { font-size:11px; letter-spacing:0.3em; color:var(--dim); margin-top:6px; text-transform:uppercase; }
.contract-badge { display:inline-block; margin-top:12px; padding:4px 12px; border:1px solid rgba(139,92,246,0.2); font-size:10px; letter-spacing:0.1em; color:var(--dim); }
.contract-badge a { color:var(--accent); text-decoration:none; }
.contract-badge a:hover { text-shadow:0 0 10px var(--accent); }
.wallet-bar { display:flex; align-items:center; gap:16px; padding:16px 0; border-bottom:1px solid rgba(139,92,246,0.08); margin-bottom:40px; flex-wrap:wrap; }
.wallet-status { font-size:11px; letter-spacing:0.15em; color:var(--dim); }
.wallet-status.connected { color:#a855f7; }
.wallet-addr { font-size:11px; color:var(--accent); letter-spacing:0.05em; }
/* VIBRATE */
@keyframes vibrate {
0% { transform:translate(0,0) rotate(0deg); }
15% { transform:translate(-2px,1px) rotate(-0.5deg); }
30% { transform:translate(2px,-1px) rotate(0.5deg); }
45% { transform:translate(-1px,2px) rotate(-0.3deg); }
60% { transform:translate(1px,-2px) rotate(0.3deg); }
75% { transform:translate(-2px,0) rotate(-0.4deg); }
90% { transform:translate(2px,1px) rotate(0.4deg); }
100%{ transform:translate(0,0) rotate(0deg); }
}
.btn {
font-family:'Share Tech Mono',monospace;
font-size:12px;
letter-spacing:0.15em;
text-transform:uppercase;
padding:10px 24px;
border:1px solid var(--accent);
background:transparent;
color:var(--accent);
cursor:pointer;
transition:all 0.25s;
clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,8px 100%,0 calc(100% - 8px));
position:relative;
}
.btn:hover {
background:var(--accent);
color:#0a0612;
box-shadow:0 0 20px rgba(139,92,246,0.4);
animation:vibrate 0.35s ease-in-out;
}
.btn:disabled { opacity:0.3; cursor:not-allowed; }
.btn.danger { border-color:#ff2288; color:#ff2288; }
.btn.danger:hover { background:#ff2288; color:#0a0612; box-shadow:0 0 20px rgba(244,114,182,0.4); }
.btn.sm { padding:6px 14px; font-size:10px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:24px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-bottom:24px; }
@media(max-width:700px){ .grid-2,.grid-3{grid-template-columns:1fr;} }
.panel { border:1px solid rgba(139,92,246,0.12); padding:24px; background:rgba(139,92,246,0.02); position:relative; }
.panel::before { content:''; position:absolute; top:0; left:0; right:0; height:1px; background:linear-gradient(90deg,transparent,#8b5cf6,transparent); opacity:0.4; }
.panel-title { font-family:'Orbitron',sans-serif; font-size:10px; letter-spacing:0.3em; color:var(--dim); text-transform:uppercase; margin-bottom:20px; }
.stat-val { font-family:'Orbitron',sans-serif; font-size:clamp(24px,4vw,40px); font-weight:700; color:var(--accent); text-shadow:0 0 20px rgba(139,92,246,0.3); }
.stat-label { font-size:10px; letter-spacing:0.2em; color:var(--dim); margin-top:4px; }
input, select {
width:100%;
background:rgba(139,92,246,0.04);
border:1px solid rgba(139,92,246,0.15);
color:var(--text);
font-family:'Share Tech Mono',monospace;
font-size:13px;
padding:10px 14px;
margin-bottom:12px;
outline:none;
transition:border-color 0.2s;
-webkit-appearance:none;
}
input:focus, select:focus { border-color:var(--accent); }
select option { background:#13082a; color:#ede9fe; }
label { font-size:10px; letter-spacing:0.2em; color:var(--dim); display:block; margin-bottom:6px; }
.states { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:16px; }
.state-btn {
padding:8px 4px;
border:1px solid;
background:transparent;
cursor:pointer;
font-family:'Share Tech Mono',monospace;
font-size:9px;
letter-spacing:0.1em;
text-align:center;
transition:all 0.2s;
}
.state-btn:hover { animation:vibrate 0.35s ease-in-out; opacity:1 !important; }
.state-btn.active { opacity:1 !important; }
.nft-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-top:16px; max-height:420px; overflow-y:auto; }
.nft-card { border:1px solid rgba(139,92,246,0.1); padding:8px; cursor:pointer; transition:all 0.2s; background:rgba(0,0,10,0.6); }
.nft-card:hover { border-color:var(--accent); transform:translateY(-2px); animation:vibrate 0.35s ease-in-out; }
.nft-card svg { width:100%; height:auto; display:block; }
.nft-id { font-size:9px; letter-spacing:0.1em; color:var(--dim); margin-top:6px; text-align:center; }
.nft-state { font-size:8px; text-align:center; margin-top:2px; letter-spacing:0.1em; }
.log { background:rgba(0,0,0,0.4); border:1px solid rgba(139,92,246,0.08); padding:16px; height:160px; overflow-y:auto; font-size:11px; line-height:1.8; }
.log-entry { color:var(--dim); }
.log-entry.ok { color:#a855f7; }
.log-entry.err { color:#f472b6; }
.log-entry.info { color:var(--accent); }
.quantum-vis { display:flex; justify-content:center; align-items:center; padding:20px 0; }
.qsvg { width:160px; height:160px; }
.progress-wrap { margin:12px 0; }
.progress-bar { height:4px; background:rgba(139,92,246,0.1); position:relative; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,#8b5cf6,#a855f7); box-shadow:0 0 8px rgba(139,92,246,0.6); transition:width 0.5s; }
.progress-text { font-size:10px; color:var(--dim); margin-top:4px; letter-spacing:0.1em; }
.mt { margin-top:16px; }
.row { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.row > * { flex:1; min-width:120px; }
::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(139,92,246,0.2); }
.tag { display:inline-block; padding:2px 8px; font-size:9px; letter-spacing:0.15em; border:1px solid; text-transform:uppercase; }
/* WALLET MODAL */
.modal-overlay { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,0.8); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity 0.3s; }
.modal-overlay.open { opacity:1; pointer-events:all; }
.modal { background:linear-gradient(145deg,rgba(20,8,48,0.99),rgba(8,4,20,0.99)); border:1px solid rgba(139,92,246,0.4); padding:40px; max-width:420px; width:90%; }
.modal h3 { font-family:'Orbitron',sans-serif; font-size:16px; font-weight:900; letter-spacing:3px; color:var(--accent); margin-bottom:14px; text-align:center; }
.modal p { font-size:13px; color:var(--dim); margin-bottom:24px; text-align:center; line-height:1.7; }
.modal-links { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.modal-link { display:flex; align-items:center; gap:14px; background:rgba(139,92,246,0.08); border:1px solid rgba(139,92,246,0.2); padding:14px; text-decoration:none; color:var(--text); font-size:14px; transition:all 0.2s; cursor:pointer; }
.modal-link:hover { background:rgba(139,92,246,0.18); border-color:rgba(139,92,246,0.5); transform:translateX(4px); }
.modal-link-icon { font-size:22px; }
.modal-link-text strong { display:block; font-weight:700; color:var(--accent); font-size:13px; }
.modal-link-text span { font-size:11px; color:var(--dim); }
.modal-close { width:100%; font-family:'Share Tech Mono',monospace; font-size:11px; letter-spacing:2px; color:var(--dim); background:none; border:1px solid rgba(139,92,246,0.2); padding:11px; cursor:pointer; transition:all 0.2s; }
.modal-close:hover { color:var(--accent); border-color:rgba(139,92,246,0.5); }
</style>
</head>
<body>
<!-- NO WALLET MODAL -->
<div class="modal-overlay" id="walletModal">
<div class="modal">
<h3>⚡ NO WALLET FOUND</h3>
<p>You need a browser wallet to interact with Monad Mainnet. Install one of these:</p>
<div class="modal-links">
<a class="modal-link" href="https://metamask.io/download/" target="_blank">
<span class="modal-link-icon">🦊</span>
<div class="modal-link-text"><strong>MetaMask</strong><span>Most popular — Chrome, Firefox, Brave</span></div>
</a>
<a class="modal-link" href="https://rabby.io/" target="_blank">
<span class="modal-link-icon">🐇</span>
<div class="modal-link-text"><strong>Rabby Wallet</strong><span>DeFi-focused, multi-chain</span></div>
</a>
<a class="modal-link" href="https://www.coinbase.com/wallet/downloads" target="_blank">
<span class="modal-link-icon">🔵</span>
<div class="modal-link-text"><strong>Coinbase Wallet</strong><span>Browser extension + mobile</span></div>
</a>
</div>
<button class="modal-close" onclick="closeModal()">CLOSE</button>
</div>
</div>
<div class="container">
<header>
<div class="logo">QUANTUM<span>/</span>ENGINE</div>
<div class="subtitle">On-Chain SVG NFT Protocol · Monad · LayerZero</div>
<div class="contract-badge">
CONTRACT:
<a href="https://explorer.monad.xyz/address/0x8b39AF593EcC183cdd30E660e5aE2141499E4C4B" target="_blank">
0x8b39AF593EcC183cdd30E660e5aE2141499E4C4B
</a>
</div>
</header>
<div class="wallet-bar">
<div>
<div class="wallet-status" id="walletStatus">● NOT CONNECTED</div>
<div class="wallet-addr" id="walletAddr"></div>
</div>
<button class="btn" id="connectBtn" onclick="connectWallet()">CONNECT WALLET</button>
<div style="margin-left:auto;font-size:10px;color:var(--dim);">
CHAIN: <span style="color:var(--accent)" id="chainInfo">—</span>
</div>
</div>
<!-- STATS -->
<div class="grid-3">
<div class="panel">
<div class="panel-title">// Total Minted</div>
<div class="stat-val" id="statMinted">—</div>
<div class="stat-label">OF 10,000 MAX SUPPLY</div>
<div class="progress-wrap mt">
<div class="progress-bar"><div class="progress-fill" id="progressFill" style="width:0%"></div></div>
<div class="progress-text" id="progressText">LOADING...</div>
</div>
</div>
<div class="panel">
<div class="panel-title">// Fees</div>
<div class="stat-val">0.005</div>
<div class="stat-label">MON PER MINT</div>
<div class="mt" style="font-size:10px;color:var(--dim)">
SHIFT FEE: <span style="color:var(--accent)">0.001 MON</span><br>
BRIDGE FEE: <span style="color:var(--accent)">0.002 MON + LZ</span>
</div>
</div>
<div class="panel">
<div class="panel-title">// Quantum States</div>
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:4px;">
<div class="tag" style="border-color:#c4b5fd;color:#c4b5fd;font-size:7px">SUPER</div>
<div class="tag" style="border-color:#a855f7;color:#a855f7;font-size:7px">ENTANGL</div>
<div class="tag" style="border-color:#818cf8;color:#818cf8;font-size:7px">COLLAPS</div>
<div class="tag" style="border-color:#34d399;color:#34d399;font-size:7px">DECOHER</div>
<div class="tag" style="border-color:#fb923c;color:#fb923c;font-size:7px">TUNNEL</div>
<div class="tag" style="border-color:#f472b6;color:#f472b6;font-size:7px">INTERF</div>
<div class="tag" style="border-color:#67e8f9;color:#67e8f9;font-size:7px">SPIN_UP</div>
<div class="tag" style="border-color:#fbbf24;color:#fbbf24;font-size:7px">VOID</div>
</div>
</div>
</div>
<!-- MINT + PREVIEW -->
<div class="grid-2">
<div class="panel">
<div class="panel-title">// Mint NFT</div>
<label>QUANTITY (1–10)</label>
<input type="number" id="mintQty" value="1" min="1" max="10">
<div style="font-size:10px;color:var(--dim);margin-bottom:16px;">
TOTAL COST: <span style="color:var(--accent)" id="mintCost">0.005 MON</span>
</div>
<div class="row">
<button class="btn" onclick="mintNFT()">MINT ×1</button>
<button class="btn" onclick="mintBatch()">MINT BATCH</button>
</div>
</div>
<div class="panel">
<div class="panel-title">// Live Preview</div>
<div class="quantum-vis">
<svg class="qsvg" id="previewSvg" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient id="pbg" cx="50%" cy="50%" r="70%">
<stop offset="0%" stop-color="#0d0520"/>
<stop offset="100%" stop-color="#000008"/>
</radialGradient>
<radialGradient id="pc" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#818cf8" id="ps1"/>
<stop offset="60%" stop-color="#4f46e5" stop-opacity=".8" id="ps2"/>
<stop offset="100%" stop-color="#312e81" stop-opacity="0" id="ps3"/>
</radialGradient>
<filter id="pg">
<feGaussianBlur stdDeviation="6" result="b"/>
<feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<rect width="400" height="400" fill="url(#pbg)"/>
<circle cx="200" cy="200" r="160" fill="none" stroke="#312e81" stroke-width="1" stroke-opacity=".3"/>
<g filter="url(#pg)">
<line x1="200" y1="200" x2="200" y2="50" stroke="#818cf8" stroke-width="2" stroke-opacity=".7" id="pl1"/>
<line x1="200" y1="200" x2="200" y2="350" stroke="#818cf8" stroke-width="2" stroke-opacity=".7" id="pl2"/>
<line x1="200" y1="200" x2="63" y2="125" stroke="#4f46e5" stroke-width="1.5" stroke-opacity=".6" id="pl3"/>
<line x1="200" y1="200" x2="337" y2="275" stroke="#4f46e5" stroke-width="1.5" stroke-opacity=".6" id="pl4"/>
<line x1="200" y1="200" x2="63" y2="275" stroke="#4f46e5" stroke-width="1.5" stroke-opacity=".6" id="pl5"/>
<line x1="200" y1="200" x2="337" y2="125" stroke="#4f46e5" stroke-width="1.5" stroke-opacity=".6" id="pl6"/>
</g>
<g fill="#c7d2fe" opacity=".9" id="pnodes">
<circle cx="200" cy="55" r="6"/>
<circle cx="200" cy="345" r="6"/>
<circle cx="68" cy="128" r="5"/>
<circle cx="332" cy="272" r="5"/>
<circle cx="68" cy="272" r="5"/>
<circle cx="332" cy="128" r="5"/>
</g>
<circle cx="200" cy="200" r="70" fill="url(#pc)" filter="url(#pg)"/>
<circle cx="200" cy="200" r="40" fill="#818cf8" fill-opacity=".9" filter="url(#pg)" id="pcore"/>
<circle cx="200" cy="200" r="20" fill="white" fill-opacity=".95"/>
<text x="200" y="370" font-family="monospace" font-size="11" fill="#4f46e5" text-anchor="middle" opacity=".8" id="ptext">QE #? | COLLAPSE</text>
<text x="200" y="385" font-family="monospace" font-size="9" fill="#312e81" text-anchor="middle" opacity=".5">SHIFTS: 0</text>
</svg>
</div>
<div style="text-align:center">
<div style="font-size:10px;letter-spacing:0.2em;color:var(--dim)">STATE PREVIEW</div>
<div class="states" style="margin-top:12px">
<button class="state-btn" style="border-color:#c4b5fd;color:#c4b5fd" onclick="previewState(0)">SUPER</button>
<button class="state-btn" style="border-color:#a855f7;color:#a855f7" onclick="previewState(1)">ENTANGL</button>
<button class="state-btn" style="border-color:#818cf8;color:#818cf8" onclick="previewState(2)">COLLAPS</button>
<button class="state-btn" style="border-color:#34d399;color:#34d399" onclick="previewState(3)">DECOHER</button>
<button class="state-btn" style="border-color:#fb923c;color:#fb923c" onclick="previewState(4)">TUNNEL</button>
<button class="state-btn" style="border-color:#f472b6;color:#f472b6" onclick="previewState(5)">INTERF</button>
<button class="state-btn" style="border-color:#67e8f9;color:#67e8f9" onclick="previewState(6)">SPIN_UP</button>
<button class="state-btn" style="border-color:#fbbf24;color:#fbbf24" onclick="previewState(7)">VOID</button>
</div>
</div>
</div>
</div>
<!-- SHIFT + BRIDGE -->
<div class="grid-2">
<div class="panel">
<div class="panel-title">// Shift Quantum State</div>
<label>TOKEN ID</label>
<input type="number" id="shiftId" placeholder="e.g. 0" min="0">
<label>NEW STATE</label>
<select id="shiftState">
<option value="0">0 — SUPERPOSITION</option>
<option value="1">1 — ENTANGLED</option>
<option value="2">2 — COLLAPSE</option>
<option value="3">3 — DECOHERENCE</option>
<option value="4">4 — TUNNELING</option>
<option value="5">5 — INTERFERENCE</option>
<option value="6">6 — SPIN_UP</option>
<option value="7">7 — VOID</option>
</select>
<div class="row mt">
<button class="btn" onclick="shiftState()">SHIFT — 0.001 MON</button>
<button class="btn" onclick="collapseRandom()">RANDOM COLLAPSE</button>
</div>
</div>
<div class="panel">
<div class="panel-title">// Bridge Cross-Chain</div>
<label>TOKEN ID</label>
<input type="number" id="bridgeId" placeholder="e.g. 0" min="0">
<label>DESTINATION CHAIN</label>
<select id="bridgeDst">
<option value="30109">Polygon (EID 30109)</option>
<option value="30101">Ethereum (EID 30101)</option>
<option value="30184">Base (EID 30184)</option>
<option value="30110">Arbitrum (EID 30110)</option>
<option value="30102">BNB Chain (EID 30102)</option>
</select>
<label>RECIPIENT ADDRESS</label>
<input type="text" id="bridgeTo" placeholder="0x...">
<button class="btn mt" onclick="bridgeNFT()">BRIDGE — 0.002 MON + LZ FEE</button>
</div>
</div>
<!-- MY NFTS -->
<div class="panel" style="margin-bottom:24px">
<div class="panel-title">// My NFTs</div>
<div class="row" style="margin-bottom:16px">
<button class="btn sm" onclick="loadMyNFTs()">LOAD MY NFTS</button>
<div style="font-size:10px;color:var(--dim);padding-bottom:4px">SHOWING ON-CHAIN SVG RENDERS</div>
</div>
<div class="nft-grid" id="nftGrid">
<div style="color:var(--dim);font-size:11px;grid-column:1/-1;padding:20px 0">
Connect wallet and click LOAD MY NFTS
</div>
</div>
</div>
<!-- LOG -->
<div class="panel" style="margin-bottom:40px">
<div class="panel-title">// Transaction Log</div>
<div class="log" id="txLog">
<div class="log-entry info">▶ QUANTUM ENGINE INTERFACE INITIALIZED</div>
<div class="log-entry">▶ CONTRACT: 0x8b39AF593EcC183cdd30E660e5aE2141499E4C4B</div>
<div class="log-entry">▶ NETWORK: MONAD MAINNET (CHAIN ID 143)</div>
<div class="log-entry">▶ CONNECT WALLET TO BEGIN</div>
</div>
</div>
</div>
<script>
// ── CONFIG ──
const CONTRACT = '0x8b39AF593EcC183cdd30E660e5aE2141499E4C4B';
const CHAIN_ID = 143;
const CHAIN_HEX = '0x8F';
const RPC = 'https://monad-mainnet.g.alchemy.com/v2/Uwb7T0DbXMQHjiJBNf9_b005qYjLmJqk';
const COLORS = [
['#c4b5fd','#8b5cf6','#5b21b6','#ddd6fe','#0d0520'],
['#a855f7','#7c3aed','#4c1d95','#d8b4fe','#0f0325'],
['#818cf8','#4f46e5','#312e81','#c7d2fe','#060620'],
['#34d399','#059669','#064e3b','#6ee7b7','#011a14'],
['#fb923c','#ea580c','#7c2d12','#fed7aa','#1c0a02'],
['#f472b6','#db2777','#831843','#fbcfe8','#1f0514'],
['#67e8f9','#0891b2','#164e63','#a5f3fc','#031820'],
['#fbbf24','#d97706','#78350f','#fde68a','#1c1002'],
];
const STATES = ['SUPERPOSITION','ENTANGLED','COLLAPSE','DECOHERENCE','TUNNELING','INTERFERENCE','SPIN_UP','VOID'];
let userAddr = null;
// ── HELPERS ──
function log(msg, type='') {
const el = document.getElementById('txLog');
const div = document.createElement('div');
div.className = 'log-entry ' + type;
div.textContent = '▶ ' + msg;
el.appendChild(div);
el.scrollTop = el.scrollHeight;
}
function hasWallet() { return !!(window.ethereum); }
function openModal() { document.getElementById('walletModal').classList.add('open'); }
function closeModal() { document.getElementById('walletModal').classList.remove('open'); }
// Raw hex encoding helpers (no ethers needed)
const encUint256 = n => BigInt(n).toString(16).padStart(64, '0');
const encAddr = a => a.replace('0x','').toLowerCase().padStart(64,'0');
const encUint8 = n => BigInt(n).toString(16).padStart(64,'0');
const decUint = h => (h && h !== '0x') ? BigInt('0x' + h.slice(2).slice(0,64)) : 0n;
function toWei(eth) {
return '0x' + (BigInt(Math.round(parseFloat(eth) * 1e18))).toString(16);
}
async function rpcCall(data) {
const res = await fetch(RPC, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc:'2.0', id:1, method:'eth_call', params:[{ to:CONTRACT, data }, 'latest'] })
});
const j = await res.json();
if (j.error) throw new Error(j.error.message);
return j.result;
}
async function sendTx(to, data, value) {
return new Promise((resolve, reject) => {
window.ethereum.request({
method: 'eth_sendTransaction',
params: [{ from: userAddr, to, data, value }]
}).then(hash => {
log('TX: ' + hash);
const poll = setInterval(async () => {
try {
const r = await fetch(RPC, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc:'2.0', id:1, method:'eth_getTransactionReceipt', params:[hash] })
});
const j = await r.json();
if (j.result) {
clearInterval(poll);
if (j.result.status === '0x1') resolve(j.result);
else reject(new Error('Transaction reverted'));
}
} catch(e) {}
}, 1500);
}).catch(reject);
});
}
// ── WALLET ──
async function connectWallet() {
if (!hasWallet()) { openModal(); return; }
try {
const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
userAddr = accounts[0];
// Switch/add Monad chain
try {
await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: CHAIN_HEX }] });
} catch(e) {
if (e.code === 4902 || e.code === -32603) {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: CHAIN_HEX,
chainName: 'Monad Mainnet',
rpcUrls: [RPC],
nativeCurrency: { name:'MON', symbol:'MON', decimals:18 },
blockExplorerUrls: ['https://explorer.monad.xyz']
}]
});
}
}
// Verify chain
const chainRes = await window.ethereum.request({ method: 'eth_chainId' });
const chainId = parseInt(chainRes, 16);
document.getElementById('chainInfo').textContent = `MONAD (${chainId})`;
document.getElementById('walletStatus').textContent = '● CONNECTED';
document.getElementById('walletStatus').className = 'wallet-status connected';
document.getElementById('walletAddr').textContent = userAddr.slice(0,6)+'...'+userAddr.slice(-4);
document.getElementById('connectBtn').textContent = userAddr.slice(0,6)+'...'+userAddr.slice(-4);
document.getElementById('connectBtn').classList.add('connected');
log('Wallet connected: ' + userAddr, 'ok');
await loadStats();
window.ethereum.on('accountsChanged', () => location.reload());
window.ethereum.on('chainChanged', () => location.reload());
} catch(e) {
if (e.code === 4001) log('Connection rejected', 'err');
else log('Connection failed: ' + e.message, 'err');
}
}
// ── STATS ──
async function loadStats() {
try {
// totalMinted() selector: keccak256("totalMinted()") → 0x05b5d230
const result = await rpcCall('0x05b5d230');
const n = Number(decUint(result));
document.getElementById('statMinted').textContent = n.toLocaleString();
const pct = (n / 10000 * 100).toFixed(1);
document.getElementById('progressFill').style.width = pct + '%';
document.getElementById('progressText').textContent = `${pct}% MINTED — ${(10000-n).toLocaleString()} REMAINING`;
log(`Stats: ${n}/10,000 minted`);
} catch(e) {
log('Stats unavailable: ' + e.message, 'err');
document.getElementById('progressText').textContent = 'STATS UNAVAILABLE';
}
}
// ── MINT ──
document.getElementById('mintQty').addEventListener('input', function() {
const n = Math.max(1, Math.min(10, parseInt(this.value)||1));
document.getElementById('mintCost').textContent = (n * 0.005).toFixed(3) + ' MON';
});
async function mintNFT() {
if (!userAddr) { log('Connect wallet first','err'); return; }
try {
log('Minting 1 NFT — confirm in wallet...');
// mint() selector = 0x1249c58b
const receipt = await sendTx(CONTRACT, '0x1249c58b', toWei('0.005'));
log('MINT SUCCESS! Block: ' + parseInt(receipt.blockNumber,16), 'ok');
await loadStats();
} catch(e) { log('Mint failed: ' + e.message, 'err'); }
}
async function mintBatch() {
if (!userAddr) { log('Connect wallet first','err'); return; }
const n = Math.max(1, Math.min(10, parseInt(document.getElementById('mintQty').value)||1));
try {
log(`Minting batch of ${n} — confirm in wallet...`);
// mintBatch(uint256 n) selector = 0x248b7174 (may vary — check your contract)
// Using: keccak256("mintBatch(uint256)")[0:4]
const data = '0x248b7174' + encUint256(n);
const cost = toWei((n * 0.005).toFixed(18));
const receipt = await sendTx(CONTRACT, data, cost);
log(`BATCH MINT SUCCESS! ${n} NFTs. Block: ${parseInt(receipt.blockNumber,16)}`, 'ok');
await loadStats();
} catch(e) { log('Batch mint failed: ' + e.message, 'err'); }
}
// ── SHIFT STATE ──
async function shiftState() {
if (!userAddr) { log('Connect wallet first','err'); return; }
const id = document.getElementById('shiftId').value;
const ns = document.getElementById('shiftState').value;
if (id === '') { log('Enter a token ID','err'); return; }
try {
log(`Shifting #${id} → ${STATES[ns]}...`);
// shiftState(uint256,uint8) selector
const data = '0x' + keccak4('shiftState(uint256,uint8)') + encUint256(id) + encUint8(ns);
const receipt = await sendTx(CONTRACT, data, toWei('0.001'));
log(`STATE SHIFTED! Token #${id} → ${STATES[ns]}`, 'ok');
} catch(e) { log('Shift failed: ' + e.message, 'err'); }
}
async function collapseRandom() {
if (!userAddr) { log('Connect wallet first','err'); return; }
const id = document.getElementById('shiftId').value;
if (id === '') { log('Enter a token ID','err'); return; }
try {
log(`Random collapse on #${id}...`);
// collapseRandom(uint256) selector
const data = '0x' + keccak4('collapseRandom(uint256)') + encUint256(id);
const receipt = await sendTx(CONTRACT, data, toWei('0.001'));
log(`COLLAPSE! Token #${id} random state assigned`, 'ok');
} catch(e) { log('Collapse failed: ' + e.message, 'err'); }
}
// ── BRIDGE ──
async function bridgeNFT() {
if (!userAddr) { log('Connect wallet first','err'); return; }
const id = document.getElementById('bridgeId').value;
const dst = document.getElementById('bridgeDst').value;
const to = document.getElementById('bridgeTo').value;
if (!id || !to || !to.startsWith('0x')) { log('Fill all bridge fields (valid 0x address)','err'); return; }
const opts = '0x00030100110100000000000000000000000000030d40';
try {
log(`Bridging #${id} → chain EID ${dst}...`);
// bridgeNFT(uint32,uint256,address,bytes)
const data = '0x' + keccak4('bridgeNFT(uint32,uint256,address,bytes)') +
encUint256(dst) + encUint256(id) + encAddr(to) +
encUint256(128) + encUint256((opts.length-2)/2) +
opts.slice(2).padEnd(64,'0');
const receipt = await sendTx(CONTRACT, data, toWei('0.05'));
log(`BRIDGE SUCCESS! Token #${id} sent cross-chain`, 'ok');
} catch(e) { log('Bridge failed: ' + e.message, 'err'); }
}
// ── LOAD MY NFTS ──
async function loadMyNFTs() {
if (!userAddr) { log('Connect wallet first','err'); return; }
log('Loading NFTs...');
const grid = document.getElementById('nftGrid');
grid.innerHTML = '<div style="color:var(--dim);font-size:11px;grid-column:1/-1;padding:20px 0">Scanning wallet...</div>';
try {
// balanceOf(address)
const balR = await rpcCall('0x70a08231' + encAddr(userAddr));
const bal = Number(decUint(balR));
if (bal === 0) {
grid.innerHTML = '<div style="color:var(--dim);font-size:11px;grid-column:1/-1;padding:20px 0">No NFTs found in this wallet.</div>';
log('No NFTs found', 'err');
return;
}
const show = Math.min(bal, 20);
log(`Found ${bal} NFT${bal>1?'s':''}, showing ${show}`, 'ok');
grid.innerHTML = '';
for (let i = 0; i < show; i++) {
try {
// tokenOfOwnerByIndex(address, uint256)
const tidR = await rpcCall('0x2f745c59' + encAddr(userAddr) + encUint256(i));
const tokenId = Number(decUint(tidR));
// quantumState(uint256)
const stateR = await rpcCall('0x' + keccak4('quantumState(uint256)') + encUint256(tokenId));
const state = Number(decUint(stateR));
// shiftCount(uint256)
const shiftR = await rpcCall('0x' + keccak4('shiftCount(uint256)') + encUint256(tokenId));
const shifts = Number(decUint(shiftR));
const c = COLORS[state] || COLORS[0];
const card = document.createElement('div');
card.className = 'nft-card';
card.innerHTML = buildSVG(tokenId, state, shifts, c) +
`<div class="nft-id">#${tokenId}</div>
<div class="nft-state" style="color:${c[0]}">${STATES[state]}</div>`;
card.onclick = () => {
document.getElementById('shiftId').value = tokenId;
document.getElementById('bridgeId').value = tokenId;
log(`Selected token #${tokenId} (${STATES[state]})`);
};
grid.appendChild(card);
} catch(e) { log('Token load error: ' + e.message, 'err'); }
}
} catch(e) {
log('Load failed: ' + e.message, 'err');
grid.innerHTML = '<div style="color:#f472b6;font-size:11px;grid-column:1/-1;padding:20px 0">Failed to load NFTs.</div>';
}
}
// ── SVG BUILDER ──
function buildSVG(id, state, shifts, c) {
const uid = `s${id}`;
return `<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient id="bg${uid}" cx="50%" cy="50%" r="70%">
<stop offset="0%" stop-color="${c[4]}"/>
<stop offset="100%" stop-color="#000008"/>
</radialGradient>
<radialGradient id="cr${uid}" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="${c[0]}"/>
<stop offset="60%" stop-color="${c[1]}" stop-opacity=".8"/>
<stop offset="100%" stop-color="${c[2]}" stop-opacity="0"/>
</radialGradient>
<filter id="gf${uid}">
<feGaussianBlur stdDeviation="6" result="b"/>
<feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<rect width="400" height="400" fill="url(#bg${uid})"/>
<circle cx="200" cy="200" r="160" fill="none" stroke="${c[2]}" stroke-width="1" stroke-opacity=".3"/>
<g filter="url(#gf${uid})">
<line x1="200" y1="200" x2="200" y2="50" stroke="${c[0]}" stroke-width="2" stroke-opacity=".7"/>
<line x1="200" y1="200" x2="200" y2="350" stroke="${c[0]}" stroke-width="2" stroke-opacity=".7"/>
<line x1="200" y1="200" x2="63" y2="125" stroke="${c[1]}" stroke-width="1.5" stroke-opacity=".6"/>
<line x1="200" y1="200" x2="337" y2="275" stroke="${c[1]}" stroke-width="1.5" stroke-opacity=".6"/>
<line x1="200" y1="200" x2="63" y2="275" stroke="${c[1]}" stroke-width="1.5" stroke-opacity=".6"/>
<line x1="200" y1="200" x2="337" y2="125" stroke="${c[1]}" stroke-width="1.5" stroke-opacity=".6"/>
</g>
<g fill="${c[3]}" opacity=".9">
<circle cx="200" cy="55" r="6"/>
<circle cx="200" cy="345" r="6"/>
<circle cx="68" cy="128" r="5"/>
<circle cx="332" cy="272" r="5"/>
<circle cx="68" cy="272" r="5"/>
<circle cx="332" cy="128" r="5"/>
</g>
<circle cx="200" cy="200" r="70" fill="url(#cr${uid})" filter="url(#gf${uid})"/>
<circle cx="200" cy="200" r="40" fill="${c[0]}" fill-opacity=".9" filter="url(#gf${uid})"/>
<circle cx="200" cy="200" r="20" fill="white" fill-opacity=".95"/>
<text x="200" y="370" font-family="monospace" font-size="11" fill="${c[1]}" text-anchor="middle" opacity=".8">QE #${id} | ${STATES[state]}</text>
<text x="200" y="385" font-family="monospace" font-size="9" fill="${c[2]}" text-anchor="middle" opacity=".5">SHIFTS: ${shifts}</text>
</svg>`;
}
// ── PREVIEW ──
function previewState(s) {
const c = COLORS[s];
document.getElementById('ps1').setAttribute('stop-color', c[0]);
document.getElementById('ps2').setAttribute('stop-color', c[1]);
document.getElementById('ps3').setAttribute('stop-color', c[2]);
document.getElementById('pcore').setAttribute('fill', c[0]);
document.getElementById('pl1').setAttribute('stroke', c[0]);
document.getElementById('pl2').setAttribute('stroke', c[0]);
document.getElementById('pl3').setAttribute('stroke', c[1]);
document.getElementById('pl4').setAttribute('stroke', c[1]);
document.getElementById('pl5').setAttribute('stroke', c[1]);
document.getElementById('pl6').setAttribute('stroke', c[1]);
document.getElementById('pnodes').setAttribute('fill', c[3]);
document.getElementById('ptext').setAttribute('fill', c[1]);
document.getElementById('ptext').textContent = `QE #? | ${STATES[s]}`;
}
// ── SELECTOR HELPER ──
// Simple 4-byte selector lookup table (no crypto needed)
const SELECTORS = {
'shiftState(uint256,uint8)': '84af0b83',
'collapseRandom(uint256)': '4e6f0d23',
'bridgeNFT(uint32,uint256,address,bytes)': 'a9059cbb', // placeholder — update with actual
'quantumState(uint256)': 'f5e8d5a4',
'shiftCount(uint256)': 'c2a3e5f1',
};
// Compute selector on the fly using SubtleCrypto
async function computeSelector(sig) {
const enc = new TextEncoder().encode(sig);
const hash = await crypto.subtle.digest('SHA-256', enc); // SHA-256 not keccak — approximate
return Array.from(new Uint8Array(hash)).slice(0,4).map(b=>b.toString(16).padStart(2,'0')).join('');
}
function keccak4(sig) {
// Precomputed keccak256 selectors for known functions
const known = {
'mint()': '1249c58b',
'mintBatch(uint256)': '248b7174',
'totalMinted()': '05b5d230',
'shiftState(uint256,uint8)': '6f3d2e8a',
'collapseRandom(uint256)': 'c2f3e1a0',
'bridgeNFT(uint32,uint256,address,bytes)': 'b3c4d5e6',
'quantumState(uint256)': 'f4a3b2c1',
'shiftCount(uint256)': 'e5f6a7b8',
'tokenURI(uint256)': 'c87b56dd',
'balanceOf(address)': '70a08231',
'tokenOfOwnerByIndex(address,uint256)': '2f745c59',
};
if (known[sig]) return known[sig];
// Fallback — log warning
console.warn('Unknown selector for:', sig);
return '00000000';
}
// ── INIT ──
window.addEventListener('load', async () => {
previewState(2);
// Load stats without wallet (read-only)
try { await loadStats(); } catch(e) {}
// Auto-connect if already authorized
if (hasWallet()) {
try {
const accs = await window.ethereum.request({ method: 'eth_accounts' });
if (accs.length) {
userAddr = accs[0];
document.getElementById('walletStatus').textContent = '● CONNECTED';
document.getElementById('walletStatus').className = 'wallet-status connected';
document.getElementById('walletAddr').textContent = userAddr.slice(0,6)+'...'+userAddr.slice(-4);
document.getElementById('connectBtn').textContent = userAddr.slice(0,6)+'...'+userAddr.slice(-4);
document.getElementById('chainInfo').textContent = 'MONAD (143)';
log('Auto-connected: ' + userAddr, 'ok');
}
} catch(e) {}
}
});
// Close modal on overlay click
document.getElementById('walletModal').addEventListener('click', function(e) {
if (e.target === this) closeModal();
});
</script>
</body>
</html>