forked from fwd/nano-to
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
297 lines (293 loc) · 24.2 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
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
<!--
________ ____ ____ ______
|_ __ ||_ _| |_ _||_ _ `.
| |_ \_| \ \ /\ / / | | `. \
| _| \ \/ \/ / | | | |
_| |_ \ /\ / _| |_.' /
|_____| \/ \/ |______.'
Simplicity is soul of efficiency.
https://github.com/fwd/nano
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Nano.to - Nano Name Service</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0">
<meta name="author" content="https://twitter.com/nano2dev"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="transparent">
<meta name="apple-mobile-web-app-title" content="Nano.to">
<meta property="og:title" content="Nano.to">
<meta property="og:image" content="dist/images/cover.png">
<meta property="twitter:image" content="dist/images/cover.png">
<link rel="apple-touch-icon" href="dist/images/new_icon.png">
<link rel="icon" type="image/png" href="dist/favicon.png">
<link rel="stylesheet" href="dist/style.css?v=8.3.0">
<link rel="manifest" href="dist/manifest.json">
<script>
function queryToObject(string) {
var pairs = (string || window.location.search).substring(1).split("&"),
obj = {},
pair,
i;
for ( i in pairs ) {
if ( pairs[i] === "" ) continue;
pair = pairs[i].split("=");
obj[ decodeURIComponent( pair[0] ) ] = decodeURIComponent( pair[1] );
}
return obj;
}
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches || navigator.userAgent.includes('Linux')) {
document.documentElement.className += ' dark'
} else {
if (window.name !== 'nault') document.documentElement.className += ' light'
}
const isInStandaloneMode = window.matchMedia('(display-mode: standalone)').matches || (window.navigator.standalone) || document.referrer.includes('android-app://')
if (isInStandaloneMode) document.documentElement.className += ' web-app'
</script>
<script src="https://metrics.bar/js/script.js" id="metrics" async defer></script>
</head>
<body>
<p class="seo-hackz" style="display: none; opacity: 0;">Username service, Public RPC and Checkout API for the Nano Blockchain. Nano.to is on a mission to accelerate the use of Nano currency around the world.</p>
<div id="app" :class=" `on ${color}`">
<div v-if="notification" :class="`notification ${status}`"><img :style="`filter:${checkout.color && checkout.color.background ? 'invert(1)' : 'invert(0)'};margin-bottom: 0px;max-width: 14px;margin-right: 12px;vertical-align: middle;margin-bottom: 2px;`" src="./dist/images/info2.png" class="lock-icon" style="margin-bottom: 0px;">{{ notification }}</div>
<div v-if="loading" class="loader"></div>
<div :style=" background ? `background-image: url('${ '${background}' }')` : `background-image: url('${ 'dist/images/optimized.gif' }')` " id="backdrop"></div>
<div v-if="success && success.confetti">
<div v-for="i in 150" :class="`confetti-${i}`"></div>
</div>
<div v-if="success" id="success">
<div>
<h3 class="success-title">{{ success.title || (strings[lang] ? strings[lang].success : strings['en'].success) }}</h3>
<p style="margin-bottom: 0">{{ success.message }}</p>
<button v-if="checkout.fullscreen && success.button" class="btn" :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : ''};`" @click="redirect()">
<span>{{ success.button }}</span>
</button>
<div v-if="checkout.fullscreen && success.redirect && !success.button" class="redirecting">{{ success.redirect_msg || (strings[lang] ? strings[lang].redirecting : strings['en'].redirecting) }}</div>
<div v-if="!checkout.fullscreen" class="btn" :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : ''};`" @click="checkout = false; success = false">OK</div>
</div>
</div>
<div v-if="!checkout" :class="`cyber blue`">
<div v-if="title" style="cursor: pointer;" @click="reset()">
<h3 :class="`title ${status.status && status.status == false ? 'error' : ''}`" style="margin-top: 10px; font-size: 22px">{{ title }}</h3>
</div>
<div :class="`box--outer ${status.status && status.status == false ? 'error' : ''}`">
<div class="box">
<div class="box--inner">
<div class="content">
<div v-if="suggestions.length" id="search-screen" @click="suggestions = []"></div>
<div class="holder" style="max-width: 440px">
<div v-if="search">
<p style="font-size: 20px; margin-bottom: 30px; margin-top: 0;">{{ strings[lang] ? strings[lang].intro : strings['en'].intro }}</p>
<form @submit.prevent="query()">
<input type="text" v-model="string" placeholder="Username, Address, Hash" style="zoom: 1.2">
<div class="suggest" v-if="suggestions.length">
<div v-for="suggestion in suggestions" :class="`${suggestion.available ? 'available' : ''} ${suggestion.yearDiff >= 10 ? 'ten' : ''}`" :style="`color:${suggestion.color || ''};opacity:${suggestion.opacity || ''}`" @click="doSuggestion(suggestion)">
{{ capitalizeFirstLetter(suggestion.name) }}
<img v-if="suggestion.yearDiff >= 10 || ((suggestion.github || suggestion.twitter) || suggestion.verified && !suggestion.expired)" :src="`dist/images/${suggestion.yearDiff >= 10 ? '10_year' : 'verified'}.png`" class="verified" alt="">
<!-- <img style="margin-left:-24px;zoom:0.8;" v-if="!suggestion.expired && suggestion.github" :src="`dist/images/${suggestion.yearDiff >= 5 ? '10_year' : 'verified'}.png`" class="verified" alt=""> -->
</div>
</div>
<div style="display: block; height: 15px;"></div>
<div class="row centered">
<button class="cybr-btn" style="zoom: 0.6; margin: 20px auto; "> {{ (strings[lang] ? strings[lang].search : strings['en'].search) }} <span aria-hidden>_</span>
<span aria-hidden class="cybr-btn__glitch">NANO_</span>
</button>
</div>
</form>
<div class="footer-icon">
<a href="https://github.com/fwd/nano-to#nano-name-service" target="_blank" class="github">
<div style="width: fit-content;zoom: 0.7;font-family: Cyber;text-align: center;"><img src="dist/svg/github.svg" img/></div>
</a>
</div>
</div>
<div v-if="!search">
<div v-if="prompt" class="small-mobile">
<div>
<h1 v-if="prompt.name" :class="`${prompt.yearDiff >= 10 ? 'ben-ten' : ''}`" style="margin-bottom: -10px;color: rgb(255, 35, 35);font-size: 40px !important;margin-top: 20px;letter-spacing: 4px;margin-left: 10px;">
<span @click="dev_mode = !dev_mode">{{ prompt.name }}</span>
<img style="margin-left:-24px;zoom:0.8;" @click="whois(prompt, prompt.yearDiff)" v-if="(!prompt.expired && (prompt.github || prompt.twitter)) || prompt.yearDiff >= 10" :src="`dist/images/${prompt.yearDiff >= 10 ? '10_year' : 'verified'}.png`" class="verified" alt="">
</h1>
<span v-if="prompt.title" style="text-transform: uppercase;margin-top: 40px;display: block;opacity: 0.8;font-size: 28px;font-family: Cyber;margin-bottom: -10px;color: rgb(238, 11, 11);border-bottom: 1px solid rgba(255, 255, 255, 0.2);padding-bottom: 20px;border-top: 1px solid rgba(255, 255, 255, 0.2);padding-top: 18px;letter-spacing: 4px;zoom: 0.74;">{{ prompt.title }}</span>
<br v-if="dev_mode">
<p v-if="!dev_mode && !prompt.title" v-html="prompt.body"></p>
</div>
</div>
<div v-if="prompt && (dev_mode || queryToObject().nocache)" style="font-size: 16px;">
<div style="margin-bottom: 10px"><span style="color: red;">{{ (strings[lang] ? strings[lang].created : strings['en'].created) }}</span> {{ prompt.created }}</div>
<div style="margin-bottom: 10px;">
<span style="color: red;">{{ (strings[lang] ? strings[lang].expires : strings['en'].expires) }}</span> {{ prompt.expires }} <span>{{ prompt.expired ? '[EXPIRED]' : '' }}</span>
</div>
<div v-if="prompt.github" style="margin-bottom: 10px;">
<span style="color: red;">{{ (strings[lang] && strings[lang].github ? strings[lang].github : strings['en'].github) }}</span>
<a target="_blank" :href="'https://github.com/' + prompt.github">@{{ prompt.github }}</a>
</div>
<div v-if="prompt.twitter" style="margin-bottom: 10px;">
<span style="color: red;">{{ (strings[lang] && strings[lang].twitter ? strings[lang].twitter : strings['en'].twitter) }}</span>
<a target="_blank" :href="'https://twitter.com/' + prompt.twitter">@{{ prompt.twitter }}</a>
</div>
</div>
<div v-if="prompt && prompt.buttons && prompt.buttons.length && !dev_mode" class="row centered button-group" :style="`margin-top: 30px; justify-content: ${prompt.buttons.length > 1 ? 'space-around' : ''}; flex-wrap: wrap;`">
<div v-for="button in prompt.buttons">
<a @click="doButton(button)">
<button class="cybr-btn" style="zoom: 0.65;">
{{ button.label }}
<span aria-hidden>_</span>
<span aria-hidden class="cybr-btn__glitch">{{ button.label }}
<span aria-hidden>_</span>
</span>
</button>
<a/>
</div>
</div>
<div v-if="prompt && dev_mode" class="row centered button-group" :style="`margin-top: 30px; justify-content: ${prompt.buttons.length > 1 ? 'space-around' : ''}`">
<div>
<a @click="renew()">
<button class="cybr-btn" style="zoom: 0.6;">
{{ (strings[lang] ? strings[lang].renew : strings['en'].renew) }}
<span aria-hidden>_</span>
<span aria-hidden class="cybr-btn__glitch">{{ (strings[lang] ? strings[lang].renew : strings['en'].renew) }}
<span aria-hidden>_</span>
</span>
</button>
<a/>
</div>
</div>
<a v-if="prompt" @click.prevent="prompt = false; search = true">
<p style=" margin-top: 15px; font-size: 16px; opacity: 0.7; margin-bottom: -20px; text-transform: uppercase;">
<span>{{ (strings[lang] ? strings[lang].cancel : strings['en'].cancel) }}</span>
</p>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-if="checkout" id="checkout" class="flex">
<a style="display: none; opacity: 0;" rel="me" :href="checkout.mastodon"></a>
<!-- <a style="display: none; opacity: 0;" rel="me" v-if="checkout.mastodon" :href="checkout.mastodon"></a> -->
<div id="avatar" v-if="!checkout.fullscreen || checkout.cancel" :class="`flex center justify ${!checkout.plans || !checkout.plans.length ? '' : ''}`" @click="cancel()">
<h3 :style="`color:${checkout.plans && checkout.plans.length ? '#000' : '#FFF'};`">← </h3>
</div>
<section v-if="checkout.plans || checkout.image" id="order" :class="`${!checkout.fullscreen || checkout.cancel ? 'cancel' : ''}`" :style="`background-color: ${checkout.color && checkout.color.left ? checkout.color.left : '#FFF'}; align-items: ${checkout.plans && checkout.plans.length < 4 ? 'start' : 'center'};`">
<div class="about" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : '#000'};`">
<div class="name flex center justify">
<h2>
{{ checkout.lease ? '@' + checkout.lease : checkout.title }}
<img style="margin-left:-4px;zoom:0.8;margin-bottom: 6px;" @click="whois(checkout, checkout.yearDiff >= 10 ? checkout.yearDiff : false)" v-if="checkout.yearDiff >= 10 || (!checkout.expired && (checkout.github || checkout.twitter))" :src="`dist/images/${checkout.yearDiff >= 10 ? '10_year' : 'verified'}.png`" class="verified" alt="">
</h2>
<p v-if="checkout.amount && !checkout.random_int" class="price">
<img src="dist/svg/thicc.svg" alt="Verified" style="max-width:13px;margin-right:1px;margin-bottom: 0;opacity:0.8;zoom: 0.86;">
{{ nFormatter( String(checkout.amount).includes('.') ? Number(checkout.amount).toFixed(3) : checkout.amount ) }}
</p>
<p v-if="checkout.amount && checkout.random_int" class="price">
{{ currency == 'NANO' ? 'Ӿ ' : currency }} {{ Number(checkout.amount).toFixed(0) }}
</p>
</div>
<img v-if="checkout.image" class="checkout-image" :src="checkout.image" alt="">
<div v-if="checkout.goal" id="goal-meter">
<div id="funding-wrap">
<div class="flex-item">
<div class="goal-stat" style="text-align: left; min-width: 65%;">{{ checkout.goal.title || 'Funding Goal' }}</div>
<div class="goal-stat" style="text-align: right;">
<div >
<img src="dist/svg/thicc.svg" alt="Verified" style="max-width: 13px;margin-right: -2px;margin-bottom: 0px;opacity: 0.9;zoom: 1.3;margin-left: -6px;display:inline-block">
<span>{{ kFormatter(checkout.goal.total) }}</span>
</div>
</div>
</div>
<div id="glass">
<div id="contribution" :style="`left:${ (100 * checkout.goal.balance) / checkout.goal.total > 100 ? '100%' : (100 * checkout.goal.balance) / checkout.goal.total + '%' }; width: ${ (100 * checkout.amount) / checkout.goal.total > 100 ? '100%' : (100 * checkout.amount) / checkout.goal.total + '%' }`"></div>
<div id="progress" :style="`width:${ (100 * checkout.goal.balance) / checkout.goal.total > 100 ? '100%' : (100 * checkout.goal.balance) / checkout.goal.total + '%' }`"></div>
</div>
<div class="flex-item">
<div class="goal-stat" style="text-align: left">
<span>
<img src="dist/svg/thicc.svg" alt="Verified" style="display:inline-block; max-width: 13px; margin-right: -1px; margin-bottom: 0px; opacity: 0.9; zoom: 1.3; margin-left: -6px;"> {{ nFormatter(checkout.goal.balance) }}
</span>
</div>
<div class="goal-stat" style="text-align: right;display: flex;align-items: center;justify-content: end; min-width: 65%;">
<div v-if="Number(checkout.goal.pending)" class="goal-activity"><svg height="42" viewBox="0 0 512 512" width="42" xmlns="http://www.w3.org/2000/svg" style="display: inline-block; margin-right: 7px; vertical-align: bottom; filter: blue;"><title></title><polygon points="448 368 256 144 64 368 448 368"></polygon></svg></div>
<span>{{ ( (100 * checkout.goal.balance) / checkout.goal.total ).toFixed(2) }}% <span>Funded</span></span>
</div>
</div>
</div>
</div>
<div v-if="checkout.lease" style=" border-bottom: 0.5px solid #00000017; padding-bottom: 25px; margin-bottom: 28px; text-align: center; font-size: 20px; font-family: 'Cyber'; letter-spacing: 3px; color: #089dff; text-shadow: 0 0 transparent; ">{{ checkout.available ? 'NEW LEASE' : 'EXTEND LEASE' }}</div>
<!-- <div v-if="checkout.lease && !checkout.available" style=" text-align: center; margin-bottom: 30px; display: block; font-family: 'Cyber'; letter-spacing: 2px; opacity: 0.8; ">ONLY ORIGNAL ADDRESS</div> -->
<p v-if="checkout.description || checkout.body || checkout.text || checkout.note || checkout.message" class="description" v-html="checkout.description || checkout.body || checkout.text || checkout.note || checkout.message"></p>
<div class="plans">
<div v-for="plan in checkout.plans" :style="`border-color:${checkout.color && checkout.color.primary ? checkout.color.primary : 'rgb(70 91 104 / 15%)'} !important; background: ${String(plan.value) === String(checkout.amount) ? '#000' : 'transparent'};};`" :class="`${String(plan.value) == String(checkout.amount) ? 'active' : ''}`">
<div class="flex justify center" @click="clickPlan(plan)" >
<h4>
{{ plan_title(plan.title || plan.name) }}
<span :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : ''};`" v-if="plan.discount" class="discount">{{ Number(plan.discount) ? plan.discount + '% OFF' : plan.discount }}</span>
</h4>
<h4>{{ Number(plan.value) > 1 ? Math.floor(plan.value) : Number(plan.value).toFixed(3) }} {{ currency }}</h4>
</div>
</div>
</div>
<div class="plans custom" v-if="checkout.custom">
<div :class="`flex justify center`" :style="`border-color:${checkout.color && checkout.color.primary ? checkout.color.primary : 'rgb(70 91 104 / 8%)'};`">
<h4>{{ (strings[lang] ? strings[lang].custom : strings['en'].custom) }}</h4>
<div class="dinput">
<input type="number" inputmode="decimal" max="133248297" v-model="customAmount" >
</div>
</div>
</div>
</div>
</section>
<section id="payment" :style="checkout.color && checkout.color.right ? `background-color: ${checkout.color.right}` : 'background-color: #009dff'" :class="checkout.plans || checkout.image ? '' : 'full'">
<div class="details">
<div class="crypto">
<h4 v-if="checkout.amount" class="instructions">
<!-- <span v-if="checkout.title" class="faded" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : '#FFF'};`">{{ checkout.title }}</span> -->
<b v-if="Number(checkout.amount)" @click="copy(checkout.amount)" class="amount" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : '#FFF'};cursor:pointer`">{{ checkout.amount }}
<span class="blocky">{{ 'NANO' }}</span>
</b>
<span v-if="Number(checkout.amount) && rate" :style="`color: #d8ecf9;cursor: pointer;opacity: 0.7;display: block;margin-bottom: 20px;font-family: Cyber;font-size: 18px;`">≈ {{ nFormatter( (checkout.amount * rate).toFixed(2) ) }} {{ currencyComputed }} @ <a :href="`https://www.coingecko.com/en/coins/nano/${ checkout.currency !== 'NANO' && checkout.currency ? checkout.currency.toLowerCase() : 'usd'}`" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : ''};cursor: pointer;`" target="_blank" class="cursor"> {{ rate.toFixed(3) }} <img src="./dist/images/info2.png" alt="" class="info-icon">
</a>
</span>
</h4>
<h1 v-if="!checkout.amount" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : ''};`">{{ checkout.title }}</h1>
<p class="address" :style="`color:${checkout.color && checkout.color.address && checkout.color.address.highlight_color ? checkout.color.address.highlight_color : '#000'}; background:${checkout.color && checkout.color.address && checkout.color.address.highlight_background ? checkout.color.address.highlight_background : (checkout.color && checkout.color.address && checkout.color.highlight_background ? checkout.color.highlight_background : '#FFF')};`" @click="copy(checkout.address)">
<span class="highlight" :style="`color:${checkout.color && checkout.color.vanity ? checkout.color.vanity : ''};`">{{ checkout.address.slice(0, 12) }}</span><span :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};`">{{ checkout.address.slice(12, 58) }}</span><span class="highlight" :style="`color:${checkout.color && checkout.color.vanity ? checkout.color.vanity : ''};`">{{ checkout.address.slice(59, 99) }}</span>
<img src="./dist/images/clipboard.png" alt="">
</p>
<div class="qrSwitcher">
<a style="cursor: pointer;" @click="deepLink(`nano:${checkout.address}${checkout.amount ? '?amount=' + convert(checkout.amount, 'NANO', 'RAW') : ''}`)">
<div class="qrcode" :style="`border-color:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : '#FFF'}; background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : '#FFF'};`">
<div id="qrcode"></div>
</div>
<div class="security-notice nano" :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : ''};`">
<img :style="`filter:${checkout.color && checkout.color.background ? 'invert(1)' : 'invert(0)'}`" src="./dist/images/info2.png" class="lock-icon" style="margin-bottom: 0px;"> {{ checkout.tip || (strings[lang] ? strings[lang].tap : strings['en'].tap) }}
</div>
</a>
</div>
<button v-if="checkout.amount || checkout.plans.length" class="button" :style="`color:${checkout.color && checkout.color.highlight_color ? checkout.color.highlight_color : ''};background:${checkout.color && checkout.color.highlight_background ? checkout.color.highlight_background : ''};`" @click="naultMode ? deepLink(`nano:${checkout.address}${checkout.amount ? '?amount=' + convert(checkout.amount, 'NANO', 'RAW') : ''}`) : check()">
<span>{{ naultMode ? 'Open Nault' : (checkout.buttonText || ( checkout.goal ? 'Donate' : false ) || (strings[lang] ? strings[lang].button : strings['en'].button) ) }}</span>
</button>
<div class="security-notice shrink">
<div class="flex center" :style="`color:${checkout.color && checkout.color.text ? checkout.color.text : ''};`">{{ checkout.note || (strings[lang] ? strings[lang].note : strings['en'].note) }}</div>
</div>
</div>
</div>
</section>
</div>
<div v-if="frame" class="frame">
<div class="backdrop_click_area" @click="frame = false"></div>
<div :style="` max-width: ${frame_full ? '100%' : '1024px'}; max-height: 100vh; width: 100%; height: 100%; `">
<iframe style="width: 100%; height: 100%;" :src="frame" frameborder="0"></iframe>
</div>
</div>
</div>
<script src="dist/vue.min.js"></script>
<script src="dist/axios.min.js"></script>
<script src="dist/easy.qrcode.min.js"></script>
<script src="dist/nanocurrency.min.js"></script>
<script src="dist/app.js?v=8.3.0"></script>
</body>
</html>