forked from supertestnet/hackalajara_2024
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontacto.html
252 lines (236 loc) · 13.1 KB
/
contacto.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" href="./style.css?v=2">
<script src="https://supertestnet.github.io/hedgehog/noble-secp256k1.js"></script>
<script src="https://supertestnet.github.io/bitcoin-chess/js/qrcode.js"></script>
<script src="https://supertestnet.github.io/nwcjs/nwcjs.js"></script>
<script src="https://bundle.run/browserify-cipher@1.0.1"></script>
<script src="https://bundle.run/bech32@2.0.0"></script>
<script src="https://bundle.run/buffer@6.0.3"></script>
<script src="https://bundle.run/bip32@2.0.6"></script>
<script src="https://bitcoincore.tech/apps/bitcoinjs-ui/lib/bitcoinjs-lib.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
<style>
.hidden {
display: none !important;
}
.how_work {
color: #42ddf5;
text-decoration: underline;
cursor: pointer;
}
.toast {
box-sizing: border-box;
visibility: hidden;
width: 250px;
margin-left: -125px;
background-color: rgb(97, 235, 52);
color: white;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 1;
left: 50%;
bottom: 30px;
}
.toast.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@-webkit-keyframes fadein {
from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;}
}
@keyframes fadein {
from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;}
}
@-webkit-keyframes fadeout {
from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;}
}
@keyframes fadeout {
from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;}
}
@media screen and (max-width: 600px) {
}
</style>
<script>
var $ = document.querySelector.bind( document );
var $$ = document.querySelectorAll.bind( document );
var url_params = new URLSearchParams( window.location.search );
var url_keys = url_params.keys();
var $_GET = {}
for ( var key of url_keys ) $_GET[ key ] = url_params.get( key );
</script>
<script>var Buffer = buffer.Buffer;</script>
<script>
// Use bitcoinjs-lib and bip32, make sure they are loaded before using
var xpub = "xpub69XtY3jLnorfx2ci8WHYfY8bjvD4cRKn9YnA12KEAzfQerkMjxKXuA7mkmjaySVv3stN7zJFtxRp3shsE4MiGdCSn9NeJDpE3cQ4WMQHqwU";
var getPubkeyFromXpub = (xpub, index) => {
return bip32.fromBase58(xpub).derive(index).publicKey.toString("hex");
};
function getNativeSegwitAddressFromPubkeyHex(pubkeyhex, network) {
return bitcoinjs.payments.p2wpkh({
pubkey: Buffer.from(pubkeyhex, "hex"),
network: bitcoinjs.networks[network]
}).address;
}
async function addressOnceHadMoney(address, network) {
var fetched = await fetch("https://mempool.space/api/address/" + address);
var json = await fetched.json();
return (json["chain_stats"]["tx_count"] > 0 || json["mempool_stats"]["tx_count"] > 0);
}
(async () => {
var network = "mainnet"; // Change to "testnet" if you're using testnet
var pubkey = getPubkeyFromXpub(xpub, 0);
var address = getNativeSegwitAddressFromPubkeyHex(pubkey, network);
var had_money = await addressOnceHadMoney(address, network);
console.log("Here is your address:", address);
console.log("That address once had money, right?", had_money);
var counter = 0;
while (had_money) {
counter++;
pubkey = getPubkeyFromXpub(xpub, counter);
address = getNativeSegwitAddressFromPubkeyHex(pubkey, network);
had_money = await addressOnceHadMoney(address, network);
console.log("Here is your address:", address);
console.log("That address once had money, right?", had_money);
}
// Update UI with the address
document.querySelector(".donation-address").innerText = address;
// Generate QR Code (use qrious library or similar)
var qr = new QRious({
element: document.getElementById('qr-code'),
value: address,
size: 200 // Adjust size as needed
});
})();
</script>
</head>
<body>
<div class="all_content">
<div class="title_and_lang">
<div class="title_and_subtitle">
<div class="funkyfont uppercase title">
<span>H</span>
<span>a</span>
<span>c</span>
<span>k</span>
<span>a</span>
<span>l</span>
<span>a</span>
<span>j</span>
<span>a</span>
<span>r</span>
<span>a</span>
</div>
<p class="uppercase subtitle">
Viernes 29 de Noviembre - Domingo 1 de Deciembre de 2024
</p>
</div>
<div class="btn lang_btn_1" style="margin-top: -1rem">
<span style="margin-top: 5px;">English</span>
<span>></span>
</div>
</div>
<!-- Variable content -->
<h2 class="ultrabold uppercase donaciones_label">Donaciones</h2>
<p class="uppercase pgraph donation-address">loading...</p>
<div class="qr_and_apoyos" style="display: flex; flex-wrap: wrap;align-items: center;">
<canvas id="qr-code" width="200" height="200" style="margin-right: 1rem;"></canvas>
<div class="apoyos pgraph">
<p>Apoyos del Patrocinio</p>
<ul>
<li>Premios en efectivo para el Hackathon (3 categorías)</li>
<li>Desarrolladores locales de Bitcoin y LN</li>
<li>Lugar y facilidades</li>
<li>Subvenciones de viaje</li>
<li>Becas para desarrolladores de otras comunidades en México</li>
</ul>
</div>
</div>
<h2 class="ultrabold uppercase contacto_label">
CONTACTO
</h2>
<p class="uppercase pgraph mentores_descripcion">
Super Testnet
</p>
<ul class="uppercase pgraph contacto_ul">
<li><a href="https://twitter.com/super_testnet" target="_blank">@super_testnet</a> en twitter</li>
<li><a href="https://t.me/supertestnet" target="_blank">@supertestnet</a> en telegram</li>
<li><a href="https://njump.me/nprofile1qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmwdaehgu3wdau8gu3wv3jhvtcpz4mhxue69uhhyetvv9ujumn0wd68ytnzvuhsqgpps055wkzgr583ynaaj0zkej4ytel9gh8whr2jsj8esfflf9aew5p96hus" target="_blank">Super Testnet</a> en nostr</li>
<li><a href="https://www.youtube.com/@highlevelbitcoin" target="_blank">High Level Bitcoin</a> en youtube</li>
</ul>
<p class="uppercase pgraph forma_de_contacto_descripcion">
O usa la forma abajo para mandar un mensaje a Super Testnet. Recuedra: dile cómo responderte!
</p>
<p class="uppercase pgraph how_work">
¿Cómo sirve esto?
</p>
<p class="uppercase pgraph explainer hidden">
Esta forma de contacto esta "cerrada" para prevenir spam. El candado tiene dos formas: o puedes mandarme un pago de bitcoin por la red lightning o puedes crear una prueba de trabajo. Si creas una prueba de trabajo, tu computadora creará un mensaje para mi y correr un algoritmo de prueba de trabajo para solo enviar el mensaje despues de corriendo la correcta cantidad de trabajo y incluyendo la prueba en tu mensaje.
</p>
<div class="ncw_nostr_contact_form" settings='{"pow": 35, "recipient": "npub1yxp7j36cfqws7yj0hkfu2mx25308u4zua6ud22zglxp98ayhh96s8c399s","relays":["wss://relay.damus.io"],"lnaddy":["supertestnet@stacker.news", 5000]}'></div>
<script src="https://supertestnet.github.io/nostr-contact-widget/ncw.js"></script>
<div class="toast"></div>
<script>
var loop = () => {
if ( $( '.ncw_nostr_contact_form' ) ) $( '.ncw_nostr_contact_form' ).style.backgroundColor = "#888888";
if ( $( '.ncw_nostr_contact_form' ) ) $( '.ncw_nostr_contact_form' ).style.maxWidth = "20rem";
if ( $( '.ncw_nostr_contact_form .ncw_submit' ) ) $( '.ncw_nostr_contact_form .ncw_submit' ).style.paddingTop = "6px";
if ( $_GET[ "lang" ] && $_GET[ "lang" ] === "english" ) {
if ( $( '.forma_de_contacto_descripcion' ) ) $( '.forma_de_contacto_descripcion' ).innerText = "Or use the form below to send a message to Super Testnet. Remember: tell him how to reply to you!";
if ( $( '.how_work' ) ) $( '.how_work' ).innerText = "How does this work?";
if ( $( '.explainer' ) ) $( '.explainer' ).innerText = `This contact form is "gated" to prevent spam. The gate has two forms: you can either send me a bitcoin payment via the lightning network or you can do proof of work. If you do proof of work, your computer will create a message for me and run a proof of work algorithm so that it only sends me the message after doing a certain amount of work and including the proof in your message.`;
if ( $( '.ncw_nostr_contact_form .ncw_form_label' ) ) $( '.ncw_nostr_contact_form .ncw_form_label' ).innerText = "Contact form";
} else {
if ( $( '.forma_de_contacto_descripcion' ) ) $( '.forma_de_contacto_descripcion' ).innerText = "O usa la forma abajo para mandar un mensaje a Super Testnet. Recuedra: dile cómo responderte!";
if ( $( '.how_work' ) ) $( '.how_work' ).innerText = "¿Cómo sirve esto?";
if ( $( '.explainer' ) ) $( '.explainer' ).innerText = `Esta forma de contacto esta "cerrada" para prevenir spam. El candado tiene dos formas: o puedes mandarme un pago de bitcoin por la red lightning o puedes crear una prueba de trabajo. Si creas una prueba de trabajo, tu computadora creará un mensaje para mi y correr un algoritmo de prueba de trabajo para solo enviar el mensaje despues de corriendo la correcta cantidad de trabajo y incluyendo la prueba en tu mensaje.`;
if ( $( '.ncw_nostr_contact_form .ncw_form_label' ) ) $( '.ncw_nostr_contact_form .ncw_form_label' ).innerText = "Forma de contacto";
}
setTimeout( ()=>{loop();}, 10 );
}
loop();
$( '.how_work' ).onclick = () => {
if ( $( '.explainer' ).classList.contains( "hidden" ) ) {
$( '.explainer' ).classList.remove( "hidden" );
} else {
$( '.explainer' ).classList.add( "hidden" );
}
}
</script>
<!-- End of variable content -->
<div class="menu">
<div class="btn lang_btn_2" style="margin-top: -1rem;">
<span style="margin-top: 5px;">English</span>
<span>></span>
</div>
<div class="btn mentores_btn">
<span style="margin-top: 5px;">Mentores</span>
<span>></span>
</div>
<div class="btn larp_btn">
<span style="margin-top: 5px;">Bitcoin Larp</span>
<span>></span>
</div>
<div class="btn horario_btn">
<span style="margin-top: 5px;">Horario</span>
<span>></span>
</div>
<div class="btn contacto_btn">
<span style="margin-top: 5px;">Contacto</span>
<span>></span>
</div>
</div>
</div>
<script src="./scripts.js?v=14"></script>
</body>
</html>