-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.html
More file actions
783 lines (731 loc) Β· 48.1 KB
/
Copy pathscan.html
File metadata and controls
783 lines (731 loc) Β· 48.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="virtual-protocol-site-verification" content="505515bce06aa16662b857611c73ea12" />
<title>KRILL β Scan Terminal</title>
<meta name="description" content="Live launch intelligence. Score any token 0β100, read the full signal breakdown and AI verdict β free, no wallet, no signature.">
<meta name="theme-color" content="#4ade80">
<link rel="canonical" href="https://krill.live/scan.html">
<meta property="og:title" content="KRILL β Scan Terminal">
<meta property="og:description" content="Score any token 0β100. Full breakdown + AI verdict, free for everyone.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://krill.live/scan.html">
<meta property="og:image" content="https://krill.live/assets/krill-scan-card.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@krillintel">
<meta name="twitter:image" content="https://krill.live/assets/krill-scan-card.png">
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<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=Syne:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #040604; --bg-2: #0a0f0a; --ink: #eef5ef; --mute: #8a948a; --dim: #5a645a;
--line: #1a211a; --green: #4ade80; --green-deep: #16a34a; --warn: #fbbf24; --red: #f87171;
--display: "Syne", system-ui, sans-serif; --body: "IBM Plex Sans", system-ui, sans-serif;
--mono: "IBM Plex Mono", ui-monospace, monospace;
--pad: clamp(18px, 5vw, 48px); --max: 1040px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
font-family: var(--body); background: var(--bg); color: var(--mute);
line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.fx { position: fixed; inset: 0; z-index: -1; pointer-events: none;
background: radial-gradient(ellipse 90% 55% at 50% -10%, rgba(34,197,94,0.13), transparent 55%); }
.fx-grid { position: absolute; inset: 0;
background-image: linear-gradient(rgba(74,222,128,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(74,222,128,0.03) 1px, transparent 1px);
background-size: 56px 56px; mask-image: radial-gradient(ellipse 70% 50% at 50% 10%, black, transparent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; border-bottom: 1px solid var(--line); }
.nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; color: var(--ink); font-size: 20px; letter-spacing: -0.5px; }
.nav .brand img { width: 28px; height: 28px; }
.nav .links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav .links a:hover { color: var(--green); }
.tier-toggle { font-family: var(--body); font-size: 13px; color: var(--green); background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.35); border-radius: 999px; padding: 7px 15px; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.tier-toggle:hover { background: rgba(74,222,128,0.16); border-color: var(--green); }
.tier-toggle.on { background: var(--green); color: #04220f; font-weight: 600; }
/* collapsible wallet tier bar */
.tierbar { border-bottom: 1px solid var(--line); background: rgba(74,222,128,0.03); overflow: hidden; }
.tierbar-inner { max-width: var(--max); margin: 0 auto; padding: 14px var(--pad); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tierbar-lbl { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--dim); white-space: nowrap; }
.tierbar input { flex: 1; min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: var(--ink); font-family: var(--mono); font-size: 13px; outline: none; transition: border-color .2s; }
.tierbar input:focus { border-color: rgba(74,222,128,0.5); }
.tierbar .btn { padding: 11px 18px; font-size: 14px; }
.tierbar-msg { font-family: var(--mono); font-size: 12px; color: var(--mute); flex-basis: 100%; }
.tierbar-msg b { color: var(--green); }
/* header */
header.hero { padding: clamp(36px, 7vw, 72px) 0 24px; text-align: center; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 5px; color: var(--green); text-transform: uppercase; }
header.hero h1 { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: clamp(34px, 6vw, 58px); letter-spacing: -1.5px; margin: 14px 0 10px; line-height: 1.05; }
header.hero p { max-width: 560px; margin: 0 auto; font-size: clamp(15px, 2vw, 18px); }
/* search */
.search { display: flex; gap: 10px; max-width: 520px; margin: 30px auto 0; }
.search input {
flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
padding: 14px 18px; color: var(--ink); font-family: var(--mono); font-size: 15px; outline: none; transition: border-color .2s;
}
.search input:focus { border-color: rgba(74,222,128,0.5); }
.search input::placeholder { color: var(--dim); }
.btn {
background: var(--green); color: #04220f; border: none; border-radius: 12px; padding: 14px 22px;
font-family: var(--body); font-weight: 600; font-size: 15px; cursor: pointer; transition: transform .12s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(74,222,128,0.25); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
/* example chips */
.examples { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; max-width: 520px; margin: 14px auto 0; }
.examples .ex-lbl { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.ex { font-family: var(--mono); font-size: 13px; color: var(--mute); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: color .2s, border-color .2s, transform .12s; }
.ex:hover { color: var(--green); border-color: rgba(74,222,128,0.4); transform: translateY(-1px); }
/* official CA badge β anti-scam */
.ca-official { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 18px auto 0; padding: 10px 14px; background: rgba(74,222,128,0.05); border: 1px solid rgba(74,222,128,0.25); border-radius: 12px; max-width: 560px; }
.ca-official .ca-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--green); white-space: nowrap; }
.ca-official .ca-addr { font-family: var(--mono); font-size: 12.5px; color: var(--ink); word-break: break-all; }
.ca-official .ca-copy { font-family: var(--mono); font-size: 12px; color: var(--mute); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; cursor: pointer; transition: color .2s, border-color .2s; white-space: nowrap; }
.ca-official .ca-copy:hover { color: var(--green); border-color: rgba(74,222,128,0.4); }
.ca-official .ca-copy.done { color: var(--green); border-color: rgba(74,222,128,0.5); }
/* score result card */
section { padding: 22px 0; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 34px); }
.card.live { border-color: rgba(74,222,128,0.28); box-shadow: 0 0 40px rgba(74,222,128,0.06); }
.card .result { animation: fadeUp .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card .result { animation: none; } .dial circle { transition: none !important; } }
.result { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: center; }
@media (max-width: 640px) { .result { grid-template-columns: 1fr; text-align: center; } }
.dial { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.dial svg { transform: rotate(-90deg); }
.dial .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial .num b { font-family: var(--display); font-size: 62px; font-weight: 800; color: var(--ink); line-height: 1; }
.dial .num span { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--mute); margin-top: 6px; }
.pill { display: inline-block; margin-top: 8px; padding: 5px 16px; border-radius: 20px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.pill.readable { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.4); }
.pill.mixed { background: rgba(251,191,36,0.1); color: var(--warn); border: 1px solid rgba(251,191,36,0.35); }
.pill.noisy { background: rgba(248,113,113,0.1); color: var(--red); border: 1px solid rgba(248,113,113,0.35); }
.pill.nodata { background: rgba(138,147,166,0.1); color: var(--mute); border: 1px solid rgba(138,147,166,0.3); }
.dial.nodata .num b { color: var(--mute); font-size: 44px; }
.rtoken { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: 30px; margin-bottom: 4px; }
.rca { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-bottom: 6px; letter-spacing: .02em; cursor: help; }
.rmeta { font-family: var(--mono); font-size: 13px; color: var(--mute); margin-bottom: 18px; }
.liqstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 14px; margin-bottom: 18px;
background: #0a120c; border: 1px solid var(--line); border-radius: 10px; }
.liqcell { display: flex; flex-direction: column; gap: 2px; }
.liqcell .lk { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.liqcell .lv { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.liqcell .lv.up { color: var(--green); }
.liqcell .lv.down { color: #f87171; }
.liqverify { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--mute);
text-decoration: none; border: 1px solid var(--line); padding: 5px 9px; border-radius: 7px; transition: color .2s, border-color .2s; }
.liqverify:hover { color: var(--green); border-color: var(--green-deep); }
@media (max-width: 560px) { .liqverify { margin-left: 0; width: 100%; text-align: center; } }
.signals { display: flex; flex-direction: column; gap: 13px; }
.sig .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink); margin-bottom: 5px; }
.sig .row .v { font-family: var(--mono); color: var(--green); }
.sig .row .v.muted { color: var(--dim); font-size: 12px; }
.sig.nodata .row span:first-child { color: var(--mute); }
.bar { height: 8px; background: #12211a; border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); border-radius: 5px; transition: width .5s ease; }
.verdict { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.verdict .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--dim); }
.verdict p { color: var(--ink); font-size: 15px; margin-top: 4px; }
.verdict.nodata .lbl { color: var(--mute); }
/* share row */
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.share-row .btn { padding: 10px 18px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid rgba(74,222,128,0.4); text-decoration: none; display: inline-block; }
.btn.ghost:hover { background: rgba(74,222,128,0.1); box-shadow: none; }
.share-msg { font-family: var(--mono); font-size: 12px; color: var(--green); }
.share-msg a { color: var(--green); }
/* gate lock */
.lock { margin-top: 18px; padding: 20px; border: 1px dashed rgba(74,222,128,0.3); border-radius: 14px; text-align: center; background: rgba(74,222,128,0.03); }
.lock h4 { font-family: var(--display); color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.lock p { font-size: 14px; margin-bottom: 14px; }
.gaterow { display: flex; gap: 8px; max-width: 440px; margin: 0 auto; }
.gaterow input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: var(--ink); font-family: var(--mono); font-size: 13px; outline: none; }
.gaterow input:focus { border-color: rgba(74,222,128,0.5); }
.gaterow .btn { padding: 11px 18px; font-size: 14px; }
.tierline { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.tierline b { color: var(--green); }
/* watchlist */
/* ββ Ask KRILL agent ββ */
.agent { margin: 30px 0; }
.agent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.agent-head h2 { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 22px; }
.agent-head .hint { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.agent-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 9px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }
.chat { display: flex; flex-direction: column; gap: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; max-height: 420px; overflow-y: auto; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.msg-who { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; }
.msg-body { font-size: 14.5px; line-height: 1.6; border-radius: 12px; padding: 11px 15px; white-space: pre-wrap; }
.msg.krill { align-self: flex-start; }
.msg.krill .msg-body { background: rgba(74,222,128,0.06); border: 1px solid rgba(74,222,128,0.22); color: var(--ink); }
.msg.krill .msg-who { color: var(--green); }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.user .msg-body { background: var(--line); border: 1px solid var(--line); color: var(--ink); }
.msg.typing .msg-body { color: var(--mute); font-family: var(--mono); font-size: 13px; }
.msg .dots span { animation: blink 1.4s infinite both; }
.msg .dots span:nth-child(2) { animation-delay: .2s; } .msg .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .2; } 40% { opacity: 1; } }
.ask { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 10px; }
.sg { font-family: var(--mono); font-size: 12.5px; color: var(--mute); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: color .2s, border-color .2s; }
.sg:hover { color: var(--green); border-color: rgba(74,222,128,0.4); }
.ask-bar { display: flex; gap: 10px; }
.ask-bar input { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; color: var(--ink); font-family: var(--body); font-size: 15px; outline: none; transition: border-color .2s; }
.ask-bar input:focus { border-color: rgba(74,222,128,0.5); }
.ask-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.sec-head h2 { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 22px; }
.sec-head .hint { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.5); } 50% { opacity: 0.5; box-shadow: 0 0 0 4px rgba(74,222,128,0); } }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.flt { font-family: var(--mono); font-size: 12.5px; color: var(--dim); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.flt:hover { color: var(--ink); border-color: rgba(74,222,128,0.3); }
.flt.active { color: #04220f; background: var(--green); border-color: var(--green); font-weight: 600; }
.flt-empty { padding: 24px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 13px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: grid; grid-template-columns: 64px 90px 1fr auto; gap: 16px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; cursor: pointer; transition: border-color .2s, transform .12s; }
.row-item:hover { border-color: rgba(74,222,128,0.3); transform: translateX(2px); }
.row-item .vrf { font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; white-space: nowrap; text-decoration: none; transition: color .2s, border-color .2s; }
.row-item .vrf:hover { color: var(--green); border-color: rgba(74,222,128,0.4); }
@media (max-width: 560px) { .row-item { grid-template-columns: 56px 1fr; } .row-item .vd { display: none; } .row-item .vrf { grid-column: 2; justify-self: start; } }
.row-item .sc { font-family: var(--display); font-weight: 800; font-size: 26px; text-align: center; }
.row-item .sc.readable { color: var(--green); }
.row-item .sc.mixed { color: var(--warn); }
.row-item .sc.noisy { color: var(--red); }
.row-item .tk { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.row-item .tk .safe-badge { display: inline-block; margin-top: 5px; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.safe-badge.safe { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.4); }
.safe-badge.caution { background: rgba(251,191,36,0.1); color: var(--warn); border: 1px solid rgba(251,191,36,0.35); }
.safe-badge.notsafe { background: rgba(248,113,113,0.1); color: var(--red); border: 1px solid rgba(248,113,113,0.35); }
.safe-badge.nodata { background: rgba(138,147,166,0.1); color: var(--mute); border: 1px solid rgba(138,147,166,0.3); }
.row-item .sc.nodata { color: var(--mute); font-size: 18px; }
.row-item .vd { font-size: 13.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--dim); font-size: 13px; font-family: var(--mono); }
.center { text-align: center; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(74,222,128,0.3); border-top-color: var(--green); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px; text-align: center; }
footer .mono { font-family: var(--mono); font-size: 12px; color: var(--dim); }
footer a:hover { color: var(--green); }
.disc { max-width: 620px; margin: 10px auto 0; font-size: 12px; color: var(--dim); line-height: 1.5; }
</style>
</head>
<body>
<div class="fx" aria-hidden="true"><div class="fx-grid"></div></div>
<div class="wrap">
<nav class="nav">
<a class="brand" href="/"><img src="assets/krill-token.png" alt="KRILL">KRILL</a>
<div class="links">
<a href="/about">About</a>
<a href="/docs">Docs</a>
<a href="https://app.virtuals.io/virtuals/112988" target="_blank" rel="noopener">Virtuals</a>
<a href="https://x.com/krillintel" target="_blank" rel="noopener">X</a>
<button class="tier-toggle" id="tierToggle" aria-expanded="false">Check tier</button>
</div>
</nav>
<!-- collapsible wallet tier bar β the ONLY place you enter your own 0x -->
<div class="tierbar" id="tierbar" hidden>
<div class="tierbar-inner">
<span class="tierbar-lbl">Your wallet</span>
<input id="tierAddr" type="text" placeholder="paste your 0x address β read-only, no signature" autocomplete="off" spellcheck="false">
<button class="btn" id="tierGo">Check</button>
<span class="tierbar-msg" id="tierMsg"></span>
</div>
</div>
<header class="hero">
<div class="eyebrow">Live Scan Terminal</div>
<h1>Score any launch. Read the verdict.</h1>
<p>Paste a contract address. KRILL reads it from on-chain data β holder distribution and contract integrity β scores it 0β100, and explains the risk. Free, no wallet, no signature. No fabricated numbers: signals without a source are shown as "no data yet".</p>
<div class="search">
<input id="q" type="text" placeholder="Paste contract address (0xβ¦)" autocomplete="off" spellcheck="false">
<button class="btn" id="scanBtn">Scan</button>
</div>
<div class="examples" id="examples" aria-label="Try an example">
<span class="ex-lbl">Try:</span>
<button class="ex" data-token="KRILL">$KRILL</button>
</div>
<div class="ca-official" title="Official $KRILL contract β verify before you buy">
<span class="ca-tag">β Official $KRILL CA</span>
<span class="ca-addr" id="krillCa">0x9D08407b8511249bec898856C506dD7c5972E7BB</span>
<button class="ca-copy" id="krillCaCopy" type="button">Copy</button>
</div>
</header>
<!-- score result -->
<section id="resultSec" style="display:none;">
<div class="card live" id="resultCard"></div>
</section>
<!-- ask the agent -->
<section class="agent" id="agentSec">
<div class="agent-head">
<h2><span class="agent-dot"></span>Ask KRILL</h2>
<span class="hint">AI agent Β· reasons over the live score</span>
</div>
<div class="chat" id="chat">
<div class="msg krill">
<div class="msg-who">KRILL</div>
<div class="msg-body">I'm KRILL β a launch-intelligence agent. Scan a token, then ask me anything: βis this safe?β, βwhat's the risk?β, βexplain holder shape.β I reason over the live signals, never hype.</div>
</div>
</div>
<div class="ask" id="askSuggest">
<button class="sg" data-q="Is this launch safe, and why?">Is this safe?</button>
<button class="sg" data-q="What's the single biggest risk here?">Biggest risk?</button>
<button class="sg" data-q="Explain the signals KRILL scores and their weights, in plain English.">Explain the signals</button>
</div>
<div class="ask-bar">
<input id="askInput" type="text" placeholder="Ask KRILL about this launchβ¦" autocomplete="off">
<button class="btn" id="askBtn">Ask</button>
</div>
</section>
<!-- watchlist -->
<section>
<div class="sec-head">
<h2>Public watchlist</h2>
<span class="hint" id="wlHint">loadingβ¦</span>
</div>
<div class="filters" id="filters" role="tablist" aria-label="Filter by safety">
<button class="flt active" data-filter="ALL" role="tab" aria-selected="true">All</button>
<button class="flt" data-filter="SAFE" role="tab" aria-selected="false">β Safe</button>
<button class="flt" data-filter="CAUTION" role="tab" aria-selected="false">β Caution</button>
<button class="flt" data-filter="NOT SAFE" role="tab" aria-selected="false">β Not safe</button>
</div>
<div class="list" id="watchlist">
<div class="center" style="padding:30px;"><span class="spin"></span></div>
</div>
</section>
</div>
<footer>
<div class="wrap">
<div class="mono">$KRILL Β· <a href="https://krill.live">krill.live</a> Β· Live on Virtuals Β· Robinhood Chain</div>
<p class="disc">Address-based tier check is read-only β no wallet connection or signature required. Scores are informational, not financial advice. Even $KRILL is scored honestly by the same engine.</p>
</div>
</footer>
<script>
'use strict';
const API = (location.hostname === 'krill.live' || location.hostname === 'localhost' || location.hostname === '127.0.0.1')
? (location.hostname === 'krill.live' ? '/api' : 'https://krill-api.gedangefek.workers.dev/api')
: 'https://krill-api.gedangefek.workers.dev/api';
const $ = s => document.querySelector(s);
const clean = t => t.trim().replace(/^\$+/, '').toUpperCase();
const isNoData = d => d == null || d.score == null;
const labelClass = l => l === 'READABLE' ? 'readable' : l === 'MIXED' ? 'mixed' : l === 'NO DATA' ? 'nodata' : l === 'LIMITED' ? 'mixed' : 'noisy';
// Display a scan target: shorten a raw contract address, keep tickers as $SYM.
const isAddr = t => /^0x[0-9a-fA-F]{40}$/.test(String(t || '').trim());
const shortAddr = t => t.slice(0, 6) + 'β¦' + t.slice(-4);
const dispToken = t => isAddr(t) ? shortAddr(t) : ('$' + String(t).replace(/^\$/, ''));
// Headline label for a scan result. When we scanned by address and the
// explorer returned the real ticker/name, show that ($SYM) instead of the
// bare 0x⦠address, so people see the token identity they're checking.
const resultToken = d => {
if (d && d.symbol) return '$' + String(d.symbol).replace(/^\$/, '');
if (d && d.name) return d.name;
return dispToken(d ? d.token : '');
};
// safety helpers β with no score there is no safety read, so say NO DATA
// rather than defaulting to a fabricated verdict.
const safetyOf = d => d.safety || (d.score == null ? 'NO DATA' : d.score >= 70 ? 'SAFE' : d.score >= 50 ? 'CAUTION' : 'NOT SAFE');
const safetyClass = s => s === 'SAFE' ? 'safe' : s === 'CAUTION' ? 'caution' : s === 'NO DATA' ? 'nodata' : 'notsafe';
const safetyIcon = s => s === 'SAFE' ? 'β SAFE' : s === 'CAUTION' ? 'β CAUTION' : s === 'NO DATA' ? 'β NO DATA' : 'β NOT SAFE';
const circ = 2 * Math.PI * 84; // r=84
// last scanned token + wallet, so gate unlock can re-render
let current = { token: 'KRILL', wallet: null };
function dial(score, label, safety) {
const noData = score == null;
// Ring color follows the SAFETY read, not the raw number β so a
// limited/caution result never shows a confident green ring even if the
// one measured sub-score is high.
const stroke = noData ? '#3a4152'
: safety === 'SAFE' ? 'url(#g)'
: safety === 'CAUTION' ? '#fbbf24'
: '#f87171';
return `<div class="dial${noData ? ' nodata' : ''}">
<svg width="200" height="200" viewBox="0 0 200 200">
<circle cx="100" cy="100" r="84" fill="none" stroke="#12211a" stroke-width="16"/>
<circle class="dial-arc" cx="100" cy="100" r="84" fill="none" stroke="${stroke}" stroke-width="16" stroke-linecap="round"
stroke-dasharray="${circ}" stroke-dashoffset="${circ}" style="transition: stroke-dashoffset .8s cubic-bezier(.2,.7,.2,1);"/>
<defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#a7f3c0"/><stop offset="0.5" stop-color="#4ade80"/><stop offset="1" stop-color="#16a34a"/>
</linearGradient></defs>
</svg>
<div class="num">${noData ? '<b data-score="">n/a</b>' : `<b data-score="${score}">0</b>`}<span>CLARITY 0β100</span></div>
</div>`;
}
const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
function animateDial() {
const arc = $('#resultCard .dial-arc');
const numEl = $('#resultCard .num b');
if (!arc || !numEl) return;
// no score β leave the ring empty and the "n/a" text as-is
if (numEl.getAttribute('data-score') === '') { arc.style.strokeDashoffset = circ; return; }
const score = parseInt(numEl.getAttribute('data-score'), 10) || 0;
const off = circ * (1 - score / 100);
if (reduceMotion) { arc.style.transition = 'none'; arc.style.strokeDashoffset = off; numEl.textContent = score; return; }
// fill the ring on next frame so the transition runs
requestAnimationFrame(() => { arc.style.strokeDashoffset = off; });
// count the number up
const dur = 700, t0 = performance.now();
const tick = now => {
const p = Math.min(1, (now - t0) / dur);
const eased = 1 - Math.pow(1 - p, 3); // easeOutCubic
numEl.textContent = Math.round(score * eased);
if (p < 1) requestAnimationFrame(tick);
else numEl.textContent = score;
};
requestAnimationFrame(tick);
}
function signalRows(signals) {
// Measured signals draw a filled bar with their value; signals with no
// data source show the reason (e.g. "prelaunch") instead of a number.
return signals.map(s => {
if (s.value == null) {
return `<div class="sig nodata">
<div class="row"><span>${s.name.replace(/_/g,' ')}</span><span class="v muted">${s.note || 'no data'}</span></div>
<div class="bar"><i style="width:0%"></i></div>
</div>`;
}
return `<div class="sig">
<div class="row"><span>${s.name.replace(/_/g,' ')}</span><span class="v">${s.value}</span></div>
<div class="bar"><i style="width:${s.value}%"></i></div>
</div>`;
}).join('');
}
function renderResult(d, animate = true) {
const lc = labelClass(d.label);
const noData = isNoData(d);
let right;
if (noData) {
// No on-chain data indexed for this token β show the honest breakdown
// (every signal flagged) and the "nothing to score" verdict.
right = `<div class="signals">${signalRows(d.signals || [])}</div>
<div class="verdict nodata"><div class="lbl">NO DATA</div><p>${d.verdict || 'No on-chain data indexed for this token yet β nothing to score.'}</p></div>`;
} else if (d.gated) {
right = `<div class="lock">
<h4>π Full breakdown is token-gated</h4>
<p>The headline score is public. Hold <b style="color:var(--green)">$KRILL</b> to unlock the signal breakdown + plain-English verdict.</p>
<button class="btn" id="unlockBtn">Check my tier to unlock</button>
<div class="tierline">READER unlocks at 10,000 $KRILL Β· read-only, no signature</div>
</div>`;
} else {
right = `<div class="signals">${signalRows(d.signals)}</div>
<div class="verdict"><div class="lbl">VERDICT Β· ${d.access ? d.access.tier : ''}</div><p>${d.verdict || 'β'}</p></div>
<div class="share-row">
<button class="btn share-btn" id="shareBtn" type="button">Share clarity card</button>
<a class="btn ghost" id="tweetBtn" href="#" target="_blank" rel="noopener">Post to X β</a>
<span class="share-msg" id="shareMsg" aria-live="polite"></span>
</div>`;
}
const holdersTxt = d.holders != null ? `${d.holders} holders` : 'holders n/a';
const topTxt = d.topHolderPct != null ? ` Β· top ${d.topHolderPct.toFixed ? d.topHolderPct.toFixed(1) : d.topHolderPct}%` : '';
$('#resultCard').innerHTML = `<div class="result">
<div style="text-align:center;">
${dial(d.score, d.label, safetyOf(d))}
<span class="pill ${lc}">${d.label}</span>
</div>
<div>
<div class="rtoken">${resultToken(d)}</div>
${isAddr(d.token) ? `<div class="rca" title="${d.token}">${shortAddr(d.token)}</div>` : ''}
<div class="rmeta"><span class="safe-badge ${safetyClass(safetyOf(d))}">${safetyIcon(safetyOf(d))}</span> Β· ${d.decision}${noData ? '' : ` Β· ${holdersTxt}${topTxt}`}${d.onChain ? ' Β· on-chain' : ''}</div>
${isAddr(d.token) && !noData ? '<div class="liqstrip" id="liqStrip" hidden></div>' : ''}
${right}
</div>
</div>`;
$('#resultSec').style.display = 'block';
if (isAddr(d.token) && !noData) loadLiquidity(d.token);
if (animate) animateDial();
else { const arc = $('#resultCard .dial-arc'), n = $('#resultCard .num b');
if (arc) { arc.style.transition = 'none'; arc.style.strokeDashoffset = n && n.getAttribute('data-score') !== '' ? circ * (1 - (parseInt(n.getAttribute('data-score'),10)||0) / 100) : circ; }
if (n && n.getAttribute('data-score') !== '') n.textContent = n.getAttribute('data-score'); }
if (noData) return; // no share/gate controls when there is nothing to score
if (d.gated) wireGate();
else wireShare(d);
}
// Live market depth, read CLIENT-SIDE from DexScreener. DexScreener blocks
// Cloudflare Worker egress (error 1015) but allows browser calls via CORS,
// so we read it from the visitor's own IP. This is display-only context β
// it never touches the server-side score, which stays unfakeable.
const fmtUsd = (n) => {
const v = Number(n) || 0;
if (v >= 1e9) return '$' + (v / 1e9).toFixed(2) + 'B';
if (v >= 1e6) return '$' + (v / 1e6).toFixed(2) + 'M';
if (v >= 1e3) return '$' + (v / 1e3).toFixed(1) + 'K';
return '$' + v.toFixed(2);
};
async function loadLiquidity(address) {
const strip = $('#liqStrip');
if (!strip || !/^0x[0-9a-fA-F]{40}$/.test(address)) return;
try {
const r = await fetch(`https://api.dexscreener.com/latest/dex/tokens/${address}`, { headers: { accept: 'application/json' } });
if (!r.ok) return;
const j = await r.json();
const pairs = (j && Array.isArray(j.pairs) ? j.pairs : []).filter(p => p && p.chainId === 'robinhood');
if (!pairs.length) return;
pairs.sort((a, b) => (Number(b?.liquidity?.usd) || 0) - (Number(a?.liquidity?.usd) || 0));
let liq = 0, vol = 0;
for (const p of pairs) { liq += Number(p?.liquidity?.usd) || 0; vol += Number(p?.volume?.h24) || 0; }
const top = pairs[0];
const mcap = Number(top.marketCap) || Number(top.fdv) || 0;
const quote = top.quoteToken && top.quoteToken.symbol ? top.quoteToken.symbol : '';
const chg = top.priceChange && top.priceChange.h24 != null ? Number(top.priceChange.h24) : null;
const url = top.url || `https://dexscreener.com/robinhood/${top.pairAddress || address}`;
const cell = (label, val, extra = '') => `<div class="liqcell"><span class="lk">${label}</span><span class="lv ${extra}">${val}</span></div>`;
const chgHtml = chg == null ? '' : cell('24h', (chg >= 0 ? '+' : '') + chg.toFixed(1) + '%', chg >= 0 ? 'up' : 'down');
strip.innerHTML =
cell('liquidity', fmtUsd(liq)) +
cell('24h vol', fmtUsd(vol)) +
(mcap ? cell('mcap', fmtUsd(mcap)) : '') +
chgHtml +
`<a class="liqverify" href="${url}" target="_blank" rel="noopener">live on DexScreener β</a>`;
strip.hidden = false;
} catch { /* offline / blocked β strip stays hidden, score unaffected */ }
}
// Share: build the card + unfurl links, copy the link, and open a tweet composer.
function wireShare(d) {
const shareBtn = $('#shareBtn'), tweetBtn = $('#tweetBtn'), msg = $('#shareMsg');
if (!shareBtn) return;
// Preserve a contract address as-is (case-sensitive); only tickers get
// normalized. dispToken shows the short form in the tweet text.
const tok = isAddr(d.token) ? d.token : clean(d.token);
// Absolute origin so the shared link/card resolve when pasted anywhere.
// On krill.live API is '/api' (same-origin proxy to the worker); elsewhere
// it's the full worker URL.
const base = API.startsWith('/') ? location.origin : API.replace(/\/api$/, '');
const cardUrl = `${base}/api/card?token=${encodeURIComponent(tok)}`;
const embedUrl = `${base}/api/embed?token=${encodeURIComponent(tok)}`;
const safety = safetyOf(d);
// Prefer the real ticker/name (from the explorer) in the tweet, falling
// back to the short address form when we scanned an unknown contract.
const tweetName = resultToken(d);
const tweetText = `${tweetName} β clarity ${d.score}/100 Β· ${safety}\n\n${d.verdict || ''}\n\nscanned free on π¦ krill.live`;
tweetBtn.href = `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(embedUrl)}`;
shareBtn.onclick = async () => {
// native share sheet on mobile, else copy the unfurl link to clipboard
if (navigator.share) {
try { await navigator.share({ title: `$${tok} clarity ${d.score}/100`, text: tweetText, url: embedUrl }); return; }
catch { /* user cancelled or unsupported β fall through to copy */ }
}
try {
await navigator.clipboard.writeText(embedUrl);
msg.textContent = 'link copied β';
} catch {
msg.innerHTML = `<a href="${cardUrl}" target="_blank" rel="noopener">open card β</a>`;
}
setTimeout(() => { if (msg.textContent === 'link copied β') msg.textContent = ''; }, 2500);
};
}
// the lock's button just opens the single global tier bar + focuses it
function wireGate() {
const btn = $('#unlockBtn');
if (!btn) return;
btn.onclick = () => openTierbar(true);
}
// ββ single wallet tier bar (the only place you enter your own 0x) ββ
function openTierbar(open) {
const bar = $('#tierbar'), tog = $('#tierToggle');
const show = open ?? bar.hasAttribute('hidden');
if (show) { bar.removeAttribute('hidden'); tog.classList.add('on'); tog.setAttribute('aria-expanded', 'true'); $('#tierAddr').focus(); }
else { bar.setAttribute('hidden', ''); tog.classList.remove('on'); tog.setAttribute('aria-expanded', 'false'); }
}
async function checkTier() {
const inp = $('#tierAddr'), btn = $('#tierGo'), msg = $('#tierMsg');
const addr = inp.value.trim();
if (!/^0x[0-9a-fA-F]{40}$/.test(addr)) { msg.innerHTML = '<span style="color:var(--warn)">enter a valid 0x⦠address</span>'; return; }
btn.disabled = true; msg.innerHTML = '<span class="spin"></span> checking balanceβ¦';
current.wallet = addr;
try {
const g = await fetch(`${API}/gate?wallet=${addr}`).then(r => r.json());
msg.innerHTML = `tier <b>${g.tier}</b> Β· ${g.balance.toLocaleString()} $KRILL` + (g.nextTier ? ` Β· next: ${g.nextTier.tier} @ ${g.nextTier.min.toLocaleString()}` : ' Β· max tier');
// re-scan current token with wallet to unlock the breakdown if qualified
if (current.token) {
const d = await fetch(`${API}/score?token=${current.token}&wallet=${addr}`).then(r => r.json());
if (d && d.score != null) renderResult(d);
}
} catch (e) { msg.innerHTML = '<span style="color:var(--red)">check failed, try again</span>'; }
finally { btn.disabled = false; }
}
$('#tierToggle').onclick = () => openTierbar();
$('#tierGo').onclick = checkTier;
$('#tierAddr').onkeydown = e => { if (e.key === 'Enter') checkTier(); };
async function scan(tokenRaw) {
const raw = (tokenRaw || $('#q').value || 'KRILL').trim();
if (!raw) return;
// KRILL reads tokens from on-chain data, which needs a real contract
// address. Accept a 0x⦠address or $KRILL; anything else (a made-up
// ticker like NOVA) has no on-chain source, so we ask for an address
// instead of rendering a misleading "NO DATA" card.
const isAddr = /^0x[0-9a-fA-F]{40}$/.test(raw);
const token = isAddr ? raw : clean(raw);
if (!isAddr && token !== 'KRILL') {
$('#resultSec').style.display = 'block';
$('#resultCard').innerHTML = `<div class="center muted" style="padding:30px 24px;line-height:1.7;">
Paste a <b style="color:var(--ink)">contract address</b> (0xβ¦) to scan.<br>
KRILL reads launches from on-chain data β a ticker alone has no source.<br>
<span style="opacity:.75">Try <button class="ex" data-token="KRILL" style="margin-top:10px;">$KRILL</button></span>
</div>`;
$('#resultCard').querySelector('.ex').onclick = () => { $('#q').value = 'KRILL'; scan('KRILL'); };
return;
}
current = { token, wallet: current.wallet };
$('#scanBtn').disabled = true;
$('#resultSec').style.display = 'block';
$('#resultCard').innerHTML = '<div class="center" style="padding:40px;"><span class="spin"></span></div>';
try {
const q = current.wallet ? `?token=${encodeURIComponent(token)}&wallet=${current.wallet}` : `?token=${encodeURIComponent(token)}`;
const d = await fetch(`${API}/score${q}`).then(r => r.json());
renderResult(d);
} catch (e) {
$('#resultCard').innerHTML = '<div class="center muted" style="padding:30px;">scan failed β API unreachable. try again.</div>';
} finally { $('#scanBtn').disabled = false; }
}
// watchlist state β cached so filters re-render without re-fetching
let allReports = [];
let activeFilter = 'ALL';
function renderWatchlist() {
const rows = activeFilter === 'ALL' ? allReports : allReports.filter(r => safetyOf(r) === activeFilter);
if (!rows.length) {
$('#watchlist').innerHTML = `<div class="flt-empty">no tokens in β${activeFilter.toLowerCase()}β right now</div>`;
return;
}
$('#watchlist').innerHTML = rows.map(r => {
const sf = safetyOf(r);
const vrf = /^0x[0-9a-fA-F]{40}$/.test(r.address || '')
? `<a class="vrf" href="https://robinhoodchain.blockscout.com/token/${r.address}" target="_blank" rel="noopener" title="Verify this token's on-chain data on Blockscout">verify on-chain β</a>`
: '';
return `
<div class="row-item" data-token="${r.token}">
<div class="sc ${labelClass(r.label)}">${r.score}</div>
<div class="tk">${r.token}<br><span class="safe-badge ${safetyClass(sf)}">${safetyIcon(sf)}</span></div>
<div class="vd">${r.verdict}</div>
${vrf}
</div>`;
}).join('');
document.querySelectorAll('.row-item').forEach(el => {
el.onclick = (e) => {
if (e.target.closest('.vrf')) return; // let the verify link open normally
const t = el.getAttribute('data-token'); $('#q').value = t; scan(t); window.scrollTo({ top: 0, behavior: 'smooth' });
};
});
}
async function loadWatchlist() {
try {
const d = await fetch(`${API}/reports`).then(r => r.json());
allReports = d.reports || [];
const shown = activeFilter === 'ALL' ? d.count : allReports.filter(r => safetyOf(r) === activeFilter).length;
$('#wlHint').innerHTML = `<span class="live-dot"></span>${shown}/${d.count} Β· ${d.onChain ? 'on-chain' : 'live engine'} Β· auto-refresh`;
renderWatchlist();
} catch (e) {
$('#watchlist').innerHTML = '<div class="center muted" style="padding:24px;">watchlist unavailable β API unreachable.</div>';
$('#wlHint').textContent = 'offline';
}
}
// ββ Ask KRILL: conversational agent grounded in the current scan ββ
const chatHistory = [];
function addMsg(who, text) {
const el = document.createElement('div');
el.className = 'msg ' + (who === 'KRILL' ? 'krill' : 'user');
el.innerHTML = `<div class="msg-who">${who}</div><div class="msg-body"></div>`;
el.querySelector('.msg-body').textContent = text;
$('#chat').appendChild(el);
$('#chat').scrollTop = $('#chat').scrollHeight;
return el;
}
function addTyping() {
const el = document.createElement('div');
el.className = 'msg krill typing';
el.innerHTML = `<div class="msg-who">KRILL</div><div class="msg-body"><span class="dots"><span>β</span><span>β</span><span>β</span></span></div>`;
$('#chat').appendChild(el);
$('#chat').scrollTop = $('#chat').scrollHeight;
return el;
}
async function askKrill(question) {
const q = (question || $('#askInput').value || '').trim();
if (!q) return;
$('#askInput').value = '';
$('#askBtn').disabled = true;
addMsg('YOU', q);
const typing = addTyping();
try {
const res = await fetch(`${API}/ask`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ q, token: current.token, history: chatHistory.slice(-6) }),
}).then(r => r.json());
typing.remove();
const answer = res.answer || "I couldn't reason that one out β try rephrasing.";
addMsg('KRILL', answer);
chatHistory.push({ role: 'user', content: q }, { role: 'assistant', content: answer });
} catch (e) {
typing.remove();
addMsg('KRILL', "I'm offline right now β the reasoning engine is unreachable. Try again in a moment.");
} finally {
$('#askBtn').disabled = false;
$('#askInput').focus();
}
}
$('#askBtn').onclick = () => askKrill();
$('#askInput').onkeydown = e => { if (e.key === 'Enter') askKrill(); };
document.querySelectorAll('.sg').forEach(btn => {
btn.onclick = () => askKrill(btn.getAttribute('data-q'));
});
$('#scanBtn').onclick = () => scan();
$('#q').onkeydown = e => { if (e.key === 'Enter') scan(); };
// example chips β fill input + scan
document.querySelectorAll('.ex').forEach(btn => {
btn.onclick = () => { const t = btn.getAttribute('data-token'); $('#q').value = '$' + t; scan(t); };
});
// official CA badge β copy + click-to-scan
(function wireCa() {
const ca = $('#krillCa'), copyBtn = $('#krillCaCopy');
if (!ca) return;
const addr = ca.textContent.trim();
copyBtn.onclick = async () => {
try { await navigator.clipboard.writeText(addr); }
catch { const r = document.createRange(); r.selectNode(ca); const s = getSelection(); s.removeAllRanges(); s.addRange(r); document.execCommand('copy'); s.removeAllRanges(); }
copyBtn.textContent = 'Copied'; copyBtn.classList.add('done');
setTimeout(() => { copyBtn.textContent = 'Copy'; copyBtn.classList.remove('done'); }, 1600);
};
ca.style.cursor = 'pointer';
ca.title = 'Scan the official $KRILL contract';
ca.onclick = () => { $('#q').value = addr; scan(addr); };
})();
// ββ safety filter tabs ββ
document.querySelectorAll('.flt').forEach(btn => {
btn.onclick = () => {
activeFilter = btn.getAttribute('data-filter');
document.querySelectorAll('.flt').forEach(b => {
const on = b === btn;
b.classList.toggle('active', on);
b.setAttribute('aria-selected', on ? 'true' : 'false');
});
const total = allReports.length;
const shown = activeFilter === 'ALL' ? total : allReports.filter(r => safetyOf(r) === activeFilter).length;
$('#wlHint').innerHTML = `<span class="live-dot"></span>${shown}/${total} Β· auto-refresh`;
renderWatchlist();
};
});
// ββ live polling: keep watchlist + current scan fresh ββ
const REFRESH_MS = 15000;
function startPolling() {
// pause when tab hidden to save calls; resume + refresh on return
setInterval(() => {
if (document.hidden) return;
loadWatchlist();
if (current.token) {
const q = current.wallet ? `?token=${current.token}&wallet=${current.wallet}` : `?token=${current.token}`;
fetch(`${API}/score${q}`).then(r => r.json()).then(d => { if (d && d.score != null) renderResult(d, false); }).catch(() => {});
}
}, REFRESH_MS);
document.addEventListener('visibilitychange', () => { if (!document.hidden) loadWatchlist(); });
}
// initial: scan KRILL + load watchlist, then poll
scan('KRILL');
loadWatchlist();
startPolling();
</script>
</body>
</html>