-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
150 lines (145 loc) · 6.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="assets/favicon.ico"/>
<link rel="apple-touch-icon" href="assets/favicon.ico"/>
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous"> -->
<title>Varda Vault</title>
<link rel="stylesheet" href="assets/global.css">
<link rel="stylesheet" href="assets/styles.scss">
</head>
<body>
<div class="bg-dark text-secondary px-4 py-5 text-center" id="signed-out-flow">
<div class="py-5">
<h1 class="display-5 fw-bold text-white">Varda NFT Unlockable Content</h1>
<div class="col-lg-6 mx-auto">
<p class="fs-5 mb-4">This is a free tool to attach secret content to your NEAR NFTs.<br />
Allow access to your online content for your NEAR NFT collectors using our API</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
<button type="button" class="btn btn-outline-info btn-lg px-4 me-sm-3 fw-bold" id="sign-in-button">Lock Content</button>
<button type="button" class="btn btn-outline-light btn-lg px-4">Gaming API</button>
</div>
</div>
</div>
<footer class="mt-auto text-white-50">
<p>Kindly built by the <a href="https://www.varda.vision/" class="text-white keychainify-checked">Varda</a>, dev <a href="https://twitter.com/jeeltcraft" class="text-white keychainify-checked">team</a>.</p>
</footer>
</div>
<div class="bg-dark text-secondary px-4 py-5 text-center" id="signed-in-flow">
<button style="float: right; margin-left: 1em;" class="btn btn-outline-light px-4" id="telegram" onClick="window.open('https://t.me/varda_vault');">
Telegram </span>
</button>
<button style="float: right" class="btn btn-outline-info px-4" id="sign-out-button">
Sign out </span>
</button>
<div class="py-5">
<h3>
Hello <span class="greeting" data-behavior="account-id"></span>
</h3>
<div class="col-lg-12 mx-auto">
<br />
<p class="fs-9 mb-4">Can't see your NFTs?
<button type="button" class="btn btn-outline-light px-8" href="mailto:jeeltcraft@gmail.com?subject=Please index my collection collection-name&body=This is the link to my 10 near transaction to jilt.near to allow me to attach unlockable content to my NFTs">Get Indexed</button>
</p>
<ol class="list-group list-group-numbered" id="locker">
</ol>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel"></h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<script type="text/javascript">
var currentUnlock;
var straw;
var relay = "https://Varda-vault-relay-fork.jilt1.repl.co/locked";
function unLockAble(elem) {
document.getElementById("exampleModalLabel").innerHTML = elem.title;
currentUnlock = elem.id;
const listDbUploads = async () => {
const fetchUploads = await fetch(relay)
const data = await fetchUploads.json()
const stdatastr = JSON.stringify(data)
straw = JSON.parse(stdatastr)
console.log(straw);
var strawDb = straw.filter( function (db) {
return db.id == elem.id;
});
console.log(strawDb);
if(strawDb.length != 0){
document.getElementById("unlockable").classList.add('show');
document.getElementById("unlockable").classList.remove('hide');
document.getElementById("uplocker").classList.add('hide');
document.getElementById("uplocker").classList.remove('show');
}
document.getElementById("getting").onclick = function() {getUnlock()};
function getUnlock(){
var immutable = strawDb[0].CID;
var linked = strawDb[0].link;
if(immutable != '') {
window.open('https://cloudflare-ipfs.com/ipfs/'+ immutable);
} else {
window.open(linked);
}
}
}
listDbUploads()
}
function addUnlock(){
let eCID = document.getElementById("CID").value;
let eLink = document.getElementById("link").value;
let addendum = ({CID:eCID,id:currentUnlock,link:eLink});
straw.push(addendum);
lockable();
async function lockable() {
const res = await fetch(relay, {
method: 'POST',
headers: {
'Content-type': 'application/json'
},
body:JSON.stringify(addendum)
})
console.log('uploaded');
}
</script>
<div id="unlockable" class="hide">
<a type="button" id="getting" target="_blank" class="btn btn-outline-info" >Get unlockable</a>
</div>
<div id="uplocker" class="show">
<h2>Upload Unlockable</h2>
<p>
<a type="button" class="btn btn-outline-info" href="https://github.com/jilt/varda-vault#readme" title="tutorial" alt="tutorial" target="_blank">Creators Guide</a> <a type="button" class="btn btn-outline-info" href="https://github.com/jilt/varda-vault#readme" title="coming soon">Check link API</a>
</p>
<div className="form-control">
<label className="labUp">Unlockable CID</label>
<input type="text" placeholder="file's CID here" id="CID"/>
</div>
<br />
<div className="form-control">
<label className="labUp">Unlockable link</label>
<input type="text" placeholder="https://me.io" id="link"/>
</div>
<br />
<button type="button" class="btn btn-outline-info" onclick="addUnlock()">Save Unlockable</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<footer class="mt-auto text-white-50">
<p>Kindly built by the <a href="https://www.varda.vision/" class="text-white keychainify-checked">Varda</a>, dev <a href="https://twitter.com/jeeltcraft" class="text-white keychainify-checked">team</a>.</p>
</footer>
</div>
<script src="index.js" type="module"></script>
</body>
</html>