Spaces:
Sleeping
Sleeping
Update templates/payment.html
Browse files- templates/payment.html +184 -4
templates/payment.html
CHANGED
|
@@ -4,12 +4,27 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Payment Link - AstraPay</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
margin: 0;
|
| 10 |
padding: 0;
|
| 11 |
min-height: 100vh;
|
| 12 |
-
background: linear-gradient(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 14 |
color: #ffffff;
|
| 15 |
line-height: 1.6;
|
|
@@ -29,9 +44,10 @@
|
|
| 29 |
}
|
| 30 |
.title {
|
| 31 |
font-size: 2.2rem;
|
| 32 |
-
font-weight:
|
|
|
|
| 33 |
margin-bottom: 1.5rem;
|
| 34 |
-
letter-spacing:
|
| 35 |
}
|
| 36 |
.payment-card {
|
| 37 |
background: rgba(255, 255, 255, 0.02);
|
|
@@ -68,6 +84,91 @@
|
|
| 68 |
margin-bottom: 2rem;
|
| 69 |
font-weight: 400;
|
| 70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
.status {
|
| 72 |
font-size: 0.95rem;
|
| 73 |
padding: 0.5rem 1.2rem;
|
|
@@ -191,6 +292,9 @@
|
|
| 191 |
text-align: center;
|
| 192 |
}
|
| 193 |
.payment-modal-title {
|
|
|
|
|
|
|
|
|
|
| 194 |
color: #ffffff;
|
| 195 |
font-size: 1.5rem;
|
| 196 |
font-weight: bold;
|
|
@@ -265,7 +369,7 @@
|
|
| 265 |
Total to send: {{ total_amount }} Astra{{ 's' if total_amount > 1 else '' }}
|
| 266 |
</div>
|
| 267 |
{% endif %}
|
| 268 |
-
<div class="description">{{ description }}</div>
|
| 269 |
<div class="status {{ 'paid' if paid else 'pending' }}">
|
| 270 |
{{ 'Paid' if paid else 'Pending Payment' }}
|
| 271 |
</div>
|
|
@@ -350,6 +454,82 @@
|
|
| 350 |
</div>
|
| 351 |
|
| 352 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
let paymentCheckInterval;
|
| 354 |
let timerInterval;
|
| 355 |
let timeLeft = 300;
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Payment Link - AstraPay</title>
|
| 7 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Erica+One&display=swap" rel="stylesheet">
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 11 |
<style>
|
| 12 |
body {
|
| 13 |
margin: 0;
|
| 14 |
padding: 0;
|
| 15 |
min-height: 100vh;
|
| 16 |
+
background: linear-gradient(180deg,
|
| 17 |
+
#0f0514 0%,
|
| 18 |
+
#1a0a1a 15%,
|
| 19 |
+
#2d1a3d 35%,
|
| 20 |
+
#4a2a5a 50%,
|
| 21 |
+
#3d2a4a 60%,
|
| 22 |
+
#2d1a3d 70%,
|
| 23 |
+
#1a0a1a 80%,
|
| 24 |
+
#0f0514 85%,
|
| 25 |
+
#000000 100%
|
| 26 |
+
);
|
| 27 |
+
background-attachment: fixed;
|
| 28 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 29 |
color: #ffffff;
|
| 30 |
line-height: 1.6;
|
|
|
|
| 44 |
}
|
| 45 |
.title {
|
| 46 |
font-size: 2.2rem;
|
| 47 |
+
font-weight: normal;
|
| 48 |
+
font-family: 'Erica One', cursive;
|
| 49 |
margin-bottom: 1.5rem;
|
| 50 |
+
letter-spacing: 0.02em;
|
| 51 |
}
|
| 52 |
.payment-card {
|
| 53 |
background: rgba(255, 255, 255, 0.02);
|
|
|
|
| 84 |
margin-bottom: 2rem;
|
| 85 |
font-weight: 400;
|
| 86 |
}
|
| 87 |
+
.description h1, .description h2, .description h3 {
|
| 88 |
+
color: rgba(255, 255, 255, 0.9);
|
| 89 |
+
font-family: 'Erica One', cursive;
|
| 90 |
+
font-weight: normal;
|
| 91 |
+
margin-top: 1rem;
|
| 92 |
+
margin-bottom: 0.5rem;
|
| 93 |
+
letter-spacing: 0.02em;
|
| 94 |
+
}
|
| 95 |
+
.description p {
|
| 96 |
+
margin: 0.5rem 0;
|
| 97 |
+
}
|
| 98 |
+
.description ul, .description ol {
|
| 99 |
+
margin: 0.5rem 0;
|
| 100 |
+
padding-left: 1.5rem;
|
| 101 |
+
}
|
| 102 |
+
.description code {
|
| 103 |
+
background: rgba(255, 255, 255, 0.1);
|
| 104 |
+
padding: 0.2rem 0.4rem;
|
| 105 |
+
border-radius: 4px;
|
| 106 |
+
font-family: monospace;
|
| 107 |
+
}
|
| 108 |
+
.description pre {
|
| 109 |
+
background: rgba(255, 255, 255, 0.05);
|
| 110 |
+
padding: 1rem;
|
| 111 |
+
border-radius: 8px;
|
| 112 |
+
overflow-x: auto;
|
| 113 |
+
margin: 1rem 0;
|
| 114 |
+
}
|
| 115 |
+
.description pre code {
|
| 116 |
+
background: transparent;
|
| 117 |
+
padding: 0;
|
| 118 |
+
}
|
| 119 |
+
.description a {
|
| 120 |
+
color: rgba(255, 255, 255, 0.8);
|
| 121 |
+
text-decoration: underline;
|
| 122 |
+
}
|
| 123 |
+
.description strong {
|
| 124 |
+
color: rgba(255, 255, 255, 0.9);
|
| 125 |
+
font-weight: 600;
|
| 126 |
+
}
|
| 127 |
+
.description em {
|
| 128 |
+
font-style: italic;
|
| 129 |
+
}
|
| 130 |
+
.description u {
|
| 131 |
+
text-decoration: underline;
|
| 132 |
+
color: rgba(255, 255, 255, 0.8);
|
| 133 |
+
}
|
| 134 |
+
.description del,
|
| 135 |
+
.description s,
|
| 136 |
+
.description strike {
|
| 137 |
+
text-decoration: line-through;
|
| 138 |
+
color: rgba(255, 255, 255, 0.6);
|
| 139 |
+
}
|
| 140 |
+
.description blockquote {
|
| 141 |
+
border-left: 3px solid rgba(255, 255, 255, 0.3);
|
| 142 |
+
padding-left: 1rem;
|
| 143 |
+
margin: 1rem 0;
|
| 144 |
+
color: rgba(255, 255, 255, 0.8);
|
| 145 |
+
font-style: italic;
|
| 146 |
+
}
|
| 147 |
+
.description table {
|
| 148 |
+
border-collapse: collapse;
|
| 149 |
+
margin: 1rem 0;
|
| 150 |
+
width: 100%;
|
| 151 |
+
}
|
| 152 |
+
.description table th,
|
| 153 |
+
.description table td {
|
| 154 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 155 |
+
padding: 0.5rem;
|
| 156 |
+
}
|
| 157 |
+
.description table th {
|
| 158 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 159 |
+
font-weight: 600;
|
| 160 |
+
}
|
| 161 |
+
.description hr {
|
| 162 |
+
border: none;
|
| 163 |
+
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
| 164 |
+
margin: 1.5rem 0;
|
| 165 |
+
}
|
| 166 |
+
.description img {
|
| 167 |
+
max-width: 100%;
|
| 168 |
+
height: auto;
|
| 169 |
+
border-radius: 4px;
|
| 170 |
+
margin: 1rem 0;
|
| 171 |
+
}
|
| 172 |
.status {
|
| 173 |
font-size: 0.95rem;
|
| 174 |
padding: 0.5rem 1.2rem;
|
|
|
|
| 292 |
text-align: center;
|
| 293 |
}
|
| 294 |
.payment-modal-title {
|
| 295 |
+
font-family: 'Erica One', cursive;
|
| 296 |
+
font-weight: normal;
|
| 297 |
+
letter-spacing: 0.02em;
|
| 298 |
color: #ffffff;
|
| 299 |
font-size: 1.5rem;
|
| 300 |
font-weight: bold;
|
|
|
|
| 369 |
Total to send: {{ total_amount }} Astra{{ 's' if total_amount > 1 else '' }}
|
| 370 |
</div>
|
| 371 |
{% endif %}
|
| 372 |
+
<div class="description" id="description-content">{{ description }}</div>
|
| 373 |
<div class="status {{ 'paid' if paid else 'pending' }}">
|
| 374 |
{{ 'Paid' if paid else 'Pending Payment' }}
|
| 375 |
</div>
|
|
|
|
| 454 |
</div>
|
| 455 |
|
| 456 |
<script>
|
| 457 |
+
marked.setOptions({
|
| 458 |
+
breaks: true,
|
| 459 |
+
gfm: true
|
| 460 |
+
});
|
| 461 |
+
|
| 462 |
+
const renderer = new marked.Renderer();
|
| 463 |
+
|
| 464 |
+
renderer.strong = function(text) {
|
| 465 |
+
return '<strong>' + text + '</strong>';
|
| 466 |
+
};
|
| 467 |
+
|
| 468 |
+
renderer.em = function(text) {
|
| 469 |
+
return '<em>' + text + '</em>';
|
| 470 |
+
};
|
| 471 |
+
|
| 472 |
+
renderer.codespan = function(code) {
|
| 473 |
+
return '<code>' + code + '</code>';
|
| 474 |
+
};
|
| 475 |
+
|
| 476 |
+
renderer.del = function(text) {
|
| 477 |
+
return '<del>' + text + '</del>';
|
| 478 |
+
};
|
| 479 |
+
|
| 480 |
+
marked.use({
|
| 481 |
+
renderer: {
|
| 482 |
+
paragraph(text) {
|
| 483 |
+
return '<p>' + text + '</p>';
|
| 484 |
+
},
|
| 485 |
+
list(body, ordered) {
|
| 486 |
+
const tag = ordered ? 'ol' : 'ul';
|
| 487 |
+
return '<' + tag + '>' + body + '</' + tag + '>';
|
| 488 |
+
},
|
| 489 |
+
listitem(text) {
|
| 490 |
+
return '<li>' + text + '</li>';
|
| 491 |
+
},
|
| 492 |
+
blockquote(quote) {
|
| 493 |
+
return '<blockquote>' + quote + '</blockquote>';
|
| 494 |
+
},
|
| 495 |
+
code(code, language) {
|
| 496 |
+
return '<pre><code>' + code + '</code></pre>';
|
| 497 |
+
},
|
| 498 |
+
link(href, title, text) {
|
| 499 |
+
return '<a href="' + href + '">' + text + '</a>';
|
| 500 |
+
},
|
| 501 |
+
image(href, title, text) {
|
| 502 |
+
return '<img src="' + href + '" alt="' + text + '">';
|
| 503 |
+
},
|
| 504 |
+
hr() {
|
| 505 |
+
return '<hr>';
|
| 506 |
+
},
|
| 507 |
+
table(header, body) {
|
| 508 |
+
return '<table><thead>' + header + '</thead><tbody>' + body + '</tbody></table>';
|
| 509 |
+
},
|
| 510 |
+
tablerow(content) {
|
| 511 |
+
return '<tr>' + content + '</tr>';
|
| 512 |
+
},
|
| 513 |
+
tablecell(content, flags) {
|
| 514 |
+
const tag = flags.header ? 'th' : 'td';
|
| 515 |
+
return '<' + tag + '>' + content + '</' + tag + '>';
|
| 516 |
+
}
|
| 517 |
+
}
|
| 518 |
+
});
|
| 519 |
+
|
| 520 |
+
const descriptionElement = document.getElementById('description-content');
|
| 521 |
+
if (descriptionElement) {
|
| 522 |
+
let markdownText = descriptionElement.textContent;
|
| 523 |
+
|
| 524 |
+
markdownText = markdownText.replace(/__([^_\n]+)__/g, '<u>$1</u>');
|
| 525 |
+
|
| 526 |
+
let html = marked.parse(markdownText, { renderer: renderer });
|
| 527 |
+
|
| 528 |
+
html = html.replace(/<u>(.*?)<\/u>/g, '<u>$1</u>');
|
| 529 |
+
|
| 530 |
+
descriptionElement.innerHTML = html;
|
| 531 |
+
}
|
| 532 |
+
|
| 533 |
let paymentCheckInterval;
|
| 534 |
let timerInterval;
|
| 535 |
let timeLeft = 300;
|