-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
149 lines (138 loc) · 5.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-8040N23JCF"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-8040N23JCF');
</script>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- twitter cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@metasal_">
<meta name="twitter:creator" content="@metasal_">
<meta name="twitter:title" content="Solana Name Lookup service">
<meta name="twitter:description" content="Lookup Solana names and details about them - quick and easy">
<meta name="twitter:image" content="https://solwho.com/sns-desktop.png">
<meta name="twitter:image:alt" content="Basic view of the search page of Solana Name Service search">
<meta name="twitter:url" content="https://solwho.com">
<!-- open graph standard -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Solana Name Lookup service" />
<meta property="og:description" content="Lookup Solana names and details about them - quick and easy" />
<meta property="og:url" content="https://solwho.com/" />
<meta property="og:image" content="https://solwho.com/sns-desktop.png" />
<title>Solana Name Search</title>
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<link rel="stylesheet" href="styled.css" />
</head>
<body>
<div
class=" bg-white rounded-xl shadow-lg m-5 p-5 grid place-content-center justify-center content-center place-self-center text-center"
>
<h1 class="text-2xl lg:text-5xl font-bold m-10">SOLANA NAME SEARCH</h1>
<a href="index.html">
<button class="btn-primary opacity-50" disabled >
Search by Name
</button>
</a>
<a href="twitter.html">
<button class="btn-primary">
Search by Twitter
</button>
</a><div>
<input
id="value"
type="search"
class="mb-5 border rounded-lg border-sky-500 p-5 lowercase"
placeholder="Type to search"
required
spellcheck="false"
/>
<div class="mb-5">.sol</div>
</div><div>
<button
id="searchBtn"
class="btn-primary"
onclick="search();"
>
SEARCH
</div>
</button>
<div id="resultsBox" class="resultsBox"></div>
<div class="font-bold">Features Coming Soon 👇</div>
<hr>
<div class="text-left m-5">
<div >
⦿ Buy your Name
</div>
<div>
⦿ Search by Twitter handle
</div>
</div>
Suggestions? Feedback? Contribute?
<a rel="noopener" href="https://github.com/metasal1/sns-api" target="_blank"><img class="mx-auto" width='20' src="github.png" title="github logo" /></a>
</div>
<div class="footer">
<p class="text-xs padding-10 margin-10">
Made with ❤️ in Melbourne by
<a
rel="noopener"
class="hover:text-bold underline"
href="https://milysec.com"
target="_blank"
>Milysec</a
>
</p>
</div>
<script>
document
.getElementById("searchBtn")
.addEventListener("click", function (event) {
event.preventDefault();
});
</script>
<script>
function search() {
let headersList = {
Accept: "*/*",
};
let result = document.getElementById("value").value.trim();
var resultsDiv = document.getElementById('resultsBox');
resultsDiv.innerHTML = 'loading...'
fetch("/api/names/" + result)
.then(function (response) {
return response.json();
})
.then(function (data) {
// let data = {
// data: "metasal",
// publicKey: "GaxVqiQyJKQDRu6H4pfy9V6Xq19pHGr6HQKDQDv911Y4",
// nftOwner: "undefined",
// };
console.log(data);
var resultsDiv = document.getElementById('resultsBox');
var dateNow = new Date(Date.now())
console.log(dateNow)
resultsDiv.innerHTML = `
<div class="font-bold">Domain Name</div> <div id='dn' class='results'>${data.data}</div><button onclick="copyFtn('dn')">✂️</button>
<div class="font-bold">Public Key</div> <div id='pk' class='results'>${data.publicKey}</div><button onclick="copyFtn('pk')">✂️</button>
<button onclick='window.open("https://solscan.io/account/${data.publicKey}")'> 🔎 </button>
<div class="font-bold">NFT Owner</div> <div id='no' class='results'>${data.nftOwner}</div><button onclick="copyFtn('no')">✂️</button>
<div class="font-bold">Date</div> <div class='text-xs' >${dateNow}</div>
`;
});
}
function copyFtn(a) {
var copyText = document.getElementById(a);
let d = copyText.innerText;
navigator.clipboard.writeText(d);
}
</script>
</body>
</html>