-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanndeshi.html
More file actions
256 lines (240 loc) · 9.37 KB
/
Copy pathmanndeshi.html
File metadata and controls
256 lines (240 loc) · 9.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Donate — Manndeshi Foundation</title>
<meta name="description" content="Support the Manndeshi Foundation — empowering rural women across India to become successful entrepreneurs. Donate $2.75 with USDC on Algorand.">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
height: 100%;
}
body {
background: #0f1117;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem 1rem;
font-family: system-ui, -apple-system, sans-serif;
}
.page-heading {
text-align: center;
margin-bottom: 1.75rem;
}
.page-heading h1 {
font-size: 1.05rem;
font-weight: 700;
color: #6b7280;
letter-spacing: .06em;
text-transform: uppercase;
margin-bottom: .4rem;
}
.page-heading p {
font-size: .8rem;
color: #4b5563;
}
.widget-wrap {
width: 100%;
max-width: 420px;
}
/* ── Widget styles ──────────────────────────────────────────── */
.mn-wrap *, .mn-wrap *::before, .mn-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }
.mn-wrap {
font-family: system-ui, -apple-system, sans-serif;
background: #1a1d2e;
border: 1px solid #2a2d3a;
border-radius: 16px;
padding: 2rem 2rem 1.75rem;
color: #f1f2f6;
}
.mn-badge {
display: inline-flex; align-items: center; gap: .4rem;
font-size: .65rem; font-weight: 700; letter-spacing: .08em;
text-transform: uppercase; color: #6b7280; margin-bottom: 1.25rem;
}
.mn-badge-dot {
display: inline-block; width: 7px; height: 7px;
border-radius: 50%; background: #3b82f6;
box-shadow: 0 0 6px #3b82f6;
}
.mn-logo {
font-size: 1.05rem; font-weight: 800; color: #f1f2f6;
letter-spacing: -.01em; margin-bottom: .35rem;
}
.mn-tagline {
font-size: .82rem; color: #9ca3af; line-height: 1.55;
margin-bottom: 1.5rem;
}
.mn-amount-card {
background: #0f1117;
border: 1px solid #2a2d3a;
border-radius: 12px;
padding: 1rem 1.25rem;
display: flex; align-items: center; justify-content: space-between;
margin-bottom: 1.25rem;
}
.mn-amount-label { font-size: .72rem; color: #6b7280; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.mn-amount-value { font-size: 1.9rem; font-weight: 800; color: #10b981; letter-spacing: -.02em; }
.mn-amount-sub { font-size: .72rem; color: #6b7280; margin-top: .15rem; }
.mn-chain {
display: flex; align-items: center; gap: .5rem;
background: #1e2333; border: 1px solid #2a2d3a; border-radius: 8px;
padding: .6rem .9rem; margin-bottom: 1.35rem;
}
.mn-chain-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
.mn-chain-name { font-size: .82rem; font-weight: 600; color: #f1f2f6; }
.mn-chain-sub { font-size: .72rem; color: #6b7280; margin-left: auto; }
.mn-btn {
width: 100%; padding: .9rem 1.5rem;
background: linear-gradient(135deg, #3b82f6, #6366f1);
color: #fff; border: none; border-radius: 10px;
font-size: .95rem; font-weight: 700; cursor: pointer;
transition: opacity .15s, transform .1s;
display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.mn-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.mn-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.mn-checkout-box {
margin-top: 1rem; padding: 1rem 1.1rem;
background: #0f1117; border: 1px solid #2a2d3a; border-radius: 10px;
text-align: center;
}
.mn-checkout-box p { font-size: .8rem; color: #9ca3af; margin-bottom: .65rem; line-height: 1.5; }
.mn-checkout-link {
display: inline-block; padding: .65rem 1.35rem;
background: #3b82f6; color: #fff; border-radius: 8px;
font-size: .88rem; font-weight: 700; text-decoration: none;
transition: opacity .15s;
}
.mn-checkout-link:hover { opacity: .85; }
.mn-done {
margin-top: 1rem; padding: 1rem 1.1rem;
background: rgba(16,185,129,.08);
border: 1px solid rgba(16,185,129,.25);
border-radius: 10px; text-align: center;
}
.mn-done-icon { font-size: 1.6rem; margin-bottom: .4rem; }
.mn-done p { font-size: .82rem; color: #10b981; line-height: 1.55; }
.mn-err {
margin-top: .75rem; padding: .65rem .9rem;
background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
border-radius: 8px; font-size: .78rem; color: #ef4444;
}
.mn-footer {
margin-top: 1.25rem; padding-top: 1rem;
border-top: 1px solid #1e2333;
display: flex; align-items: center; justify-content: space-between;
}
.mn-footer-left { font-size: .68rem; color: #4b5563; }
.mn-footer-right a { font-size: .68rem; color: #3b82f6; text-decoration: none; }
.mn-footer-right a:hover { text-decoration: underline; }
.mn-spinner {
width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3);
border-top-color: #fff; border-radius: 50%;
animation: mn-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes mn-spin { to { transform: rotate(360deg); } }
</style>
</head>
<body>
<div class="page-heading">
<h1>Support our mission</h1>
<p>Secure · On-chain · Instant settlement</p>
</div>
<div class="widget-wrap">
<div class="mn-wrap" id="mn-root">
<div class="mn-badge">
<span class="mn-badge-dot"></span>
Algorand · USDC · Powered by AlgoVoi
</div>
<div class="mn-logo">Manndeshi Foundation</div>
<p class="mn-tagline">
Empowering rural women across India to become<br>
confident, successful entrepreneurs.
</p>
<div class="mn-amount-card">
<div>
<div class="mn-amount-label">Donation</div>
<div class="mn-amount-value">$2.75</div>
<div class="mn-amount-sub">USDC · Algorand mainnet</div>
</div>
<div style="font-size:2rem;opacity:.35;">🌱</div>
</div>
<div class="mn-chain">
<div class="mn-chain-dot"></div>
<div class="mn-chain-name">Algorand</div>
<div class="mn-chain-sub">ASA 31566704 · ~2s settlement</div>
</div>
<div id="mn-action">
<button class="mn-btn" onclick="mnDonate()">✨ Donate $2.75 with USDC</button>
</div>
<div class="mn-footer">
<span class="mn-footer-left">Instant · On-chain · No intermediary</span>
<span class="mn-footer-right">
<a href="https://www.manndeshifoundation.org" target="_blank" rel="noopener">manndeshifoundation.org</a>
</span>
</div>
</div>
</div>
<script>
var _checkoutUrl = '';
function mnSetAction(html) {
document.getElementById('mn-action').innerHTML = html;
}
async function mnDonate() {
mnSetAction('<button class="mn-btn" disabled><div class="mn-spinner"></div> Creating payment link…</button>');
try {
var res = await fetch('https://your-domain.example/api/manndeshi/donate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ amount: 2.75, chain: 'ALGO', currency: 'USD' })
});
if (!res.ok) {
var e = await res.json().catch(function(){ return {}; });
throw new Error(e.error || 'Server error ' + res.status);
}
var data = await res.json();
if (!data.checkout_url) throw new Error('No checkout URL returned.');
_checkoutUrl = data.checkout_url;
mnSetAction(
'<button class="mn-btn" onclick="mnDonate()">✨ Donate another $2.75</button>' +
'<div class="mn-checkout-box">' +
'<p>Your secure checkout is ready.<br>Click below to complete your donation.</p>' +
'<a class="mn-checkout-link" href="' + _checkoutUrl + '" target="_blank" rel="noopener">Complete Donation →</a>' +
'</div>'
);
var tab = window.open(_checkoutUrl, '_blank', 'noopener');
if (tab) {
var poll = setInterval(function() {
if (tab.closed) {
clearInterval(poll);
setTimeout(mnDone, 2500);
}
}, 1000);
}
} catch(err) {
mnSetAction(
'<button class="mn-btn" onclick="mnDonate()">✨ Donate $2.75 with USDC</button>' +
'<div class="mn-err">' + err.message + '</div>'
);
}
}
function mnDone() {
mnSetAction(
'<div class="mn-done">' +
'<div class="mn-done-icon">✓</div>' +
'<p>Thank you — your donation is confirmed on-chain.<br>Every $2.75 helps a woman start her business.</p>' +
'</div>' +
'<button class="mn-btn" style="margin-top:.85rem;" onclick="mnReset()">✨ Donate again</button>'
);
}
function mnReset() {
_checkoutUrl = '';
mnSetAction('<button class="mn-btn" onclick="mnDonate()">✨ Donate $2.75 with USDC</button>');
}
</script>
</body>
</html>