GamerC0der commited on
Commit
678a59a
·
verified ·
1 Parent(s): 089e8d9

Create templates/home.html

Browse files
Files changed (1) hide show
  1. templates/home.html +272 -0
templates/home.html ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AstraPay</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ padding: 0;
11
+ min-height: 100vh;
12
+ background-color: #000000;
13
+ font-family: Arial, sans-serif;
14
+ }
15
+ .top-bar {
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ right: 0;
20
+ background-color: rgba(26, 26, 26, 0.95);
21
+ backdrop-filter: blur(10px);
22
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
23
+ padding: 1rem 2rem;
24
+ display: flex;
25
+ justify-content: center;
26
+ gap: 2rem;
27
+ z-index: 1000;
28
+ }
29
+ .top-bar a {
30
+ color: #ffffff;
31
+ text-decoration: none;
32
+ font-size: 1.2rem;
33
+ font-weight: 600;
34
+ transition: color 0.3s ease;
35
+ }
36
+ .top-bar a:hover {
37
+ color: rgba(255, 255, 255, 0.7);
38
+ }
39
+ .top-bar a.active {
40
+ color: #ffffff;
41
+ border-bottom: 2px solid #ffffff;
42
+ padding-bottom: 0.25rem;
43
+ }
44
+ .main-content {
45
+ margin-top: 80px;
46
+ height: calc(100vh - 80px);
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ }
51
+ .container {
52
+ text-align: center;
53
+ }
54
+ .title {
55
+ color: #ffffff;
56
+ font-size: 4rem;
57
+ font-weight: bold;
58
+ text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
59
+ margin-bottom: 2rem;
60
+ }
61
+ .button {
62
+ background-color: #ffffff;
63
+ color: #000000;
64
+ border: none;
65
+ padding: 1rem 2rem;
66
+ font-size: 1.2rem;
67
+ font-weight: bold;
68
+ border-radius: 8px;
69
+ cursor: pointer;
70
+ transition: all 0.3s ease;
71
+ text-decoration: none;
72
+ display: inline-block;
73
+ }
74
+ .button:hover {
75
+ background-color: #f0f0f0;
76
+ transform: translateY(-2px);
77
+ box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
78
+ }
79
+ .modal {
80
+ display: none;
81
+ position: fixed;
82
+ z-index: 1;
83
+ left: 0;
84
+ top: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ background-color: rgba(0, 0, 0, 0.8);
88
+ }
89
+ .modal-content {
90
+ background-color: #1a1a1a;
91
+ margin: 15% auto;
92
+ padding: 2rem;
93
+ border-radius: 8px;
94
+ width: 90%;
95
+ max-width: 500px;
96
+ border: 1px solid #333;
97
+ }
98
+ .modal-header {
99
+ color: #ffffff;
100
+ margin-bottom: 1.5rem;
101
+ font-size: 1.5rem;
102
+ font-weight: bold;
103
+ }
104
+ .form-group {
105
+ margin-bottom: 1.5rem;
106
+ }
107
+ .form-label {
108
+ display: block;
109
+ color: #ffffff;
110
+ margin-bottom: 0.5rem;
111
+ font-weight: bold;
112
+ }
113
+ .form-input {
114
+ width: 100%;
115
+ padding: 0.75rem;
116
+ border: 1px solid #555;
117
+ border-radius: 4px;
118
+ background-color: #2a2a2a;
119
+ color: #ffffff;
120
+ font-size: 1rem;
121
+ }
122
+ .form-input:focus {
123
+ outline: none;
124
+ border-color: #ffffff;
125
+ }
126
+ .form-textarea {
127
+ width: 100%;
128
+ padding: 0.75rem;
129
+ border: 1px solid #555;
130
+ border-radius: 4px;
131
+ background-color: #2a2a2a;
132
+ color: #ffffff;
133
+ font-size: 1rem;
134
+ min-height: 100px;
135
+ resize: vertical;
136
+ }
137
+ .form-textarea:focus {
138
+ outline: none;
139
+ border-color: #ffffff;
140
+ }
141
+ .modal-buttons {
142
+ display: flex;
143
+ gap: 1rem;
144
+ justify-content: flex-end;
145
+ margin-top: 2rem;
146
+ }
147
+ .btn-secondary {
148
+ background-color: #555;
149
+ color: #ffffff;
150
+ border: none;
151
+ padding: 0.75rem 1.5rem;
152
+ border-radius: 4px;
153
+ cursor: pointer;
154
+ font-size: 1rem;
155
+ }
156
+ .btn-secondary:hover {
157
+ background-color: #666;
158
+ }
159
+ .banner {
160
+ background: rgba(255, 193, 7, 0.15);
161
+ border: 1px solid rgba(255, 193, 7, 0.3);
162
+ border-radius: 8px;
163
+ padding: 0.75rem 1.5rem;
164
+ margin-bottom: 2rem;
165
+ color: #ffc107;
166
+ font-size: 0.9rem;
167
+ font-weight: 500;
168
+ text-align: center;
169
+ max-width: 500px;
170
+ margin-left: auto;
171
+ margin-right: auto;
172
+ }
173
+ </style>
174
+ </head>
175
+ <body>
176
+ <div class="top-bar">
177
+ <a href="/" class="active">AstraPay</a>
178
+ <a href="/bank">AstraBank</a>
179
+ </div>
180
+ <div class="main-content">
181
+ <div class="container">
182
+ <h1 class="title">AstraPay</h1>
183
+ <div class="banner">
184
+ Payments May Reset Daily. Ensure your link works.
185
+ </div>
186
+ <button class="button" onclick="openModal()">Create Payment Link</button>
187
+ </div>
188
+
189
+ <div id="paymentModal" class="modal">
190
+ <div class="modal-content">
191
+ <div class="modal-header">Create Payment Link</div>
192
+
193
+ <div class="form-group">
194
+ <label class="form-label" for="astras">Number of Astras</label>
195
+ <input type="number" id="astras" class="form-input" min="1" placeholder="Enter number of astras" required>
196
+ </div>
197
+
198
+ <div class="form-group">
199
+ <label class="form-label" for="description">Description</label>
200
+ <textarea id="description" class="form-textarea" placeholder="Enter payment description" required></textarea>
201
+ </div>
202
+
203
+ <div class="form-group">
204
+ <label class="form-label" for="recipient-email">Send to User (Optional)</label>
205
+ <input type="email" id="recipient-email" class="form-input" placeholder="Enter recipient email">
206
+ </div>
207
+
208
+ <div class="modal-buttons">
209
+ <button class="btn-secondary" onclick="closeModal()">Cancel</button>
210
+ <button class="button" onclick="createPaymentLink()">Create Link</button>
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+ <script>
216
+ function openModal() {
217
+ document.getElementById('paymentModal').style.display = 'block';
218
+ }
219
+
220
+ function closeModal() {
221
+ document.getElementById('paymentModal').style.display = 'none';
222
+ document.getElementById('astras').value = '';
223
+ document.getElementById('description').value = '';
224
+ document.getElementById('recipient-email').value = '';
225
+ }
226
+
227
+ async function createPaymentLink() {
228
+ const astras = document.getElementById('astras').value;
229
+ const description = document.getElementById('description').value;
230
+ const recipientEmail = document.getElementById('recipient-email').value.trim();
231
+
232
+ if (!astras || !description.trim()) {
233
+ alert('Please fill in all required fields');
234
+ return;
235
+ }
236
+
237
+ try {
238
+ const response = await fetch('/create-payment-link', {
239
+ method: 'POST',
240
+ headers: {
241
+ 'Content-Type': 'application/json',
242
+ },
243
+ body: JSON.stringify({
244
+ amount: parseInt(astras),
245
+ description: description.trim(),
246
+ recipient_email: recipientEmail || null
247
+ })
248
+ });
249
+
250
+ const data = await response.json();
251
+
252
+ if (response.ok) {
253
+ window.location.href = data.payment_url;
254
+ } else {
255
+ alert('Error creating payment link: ' + data.error);
256
+ }
257
+ } catch (error) {
258
+ alert('Error creating payment link: ' + error.message);
259
+ }
260
+ }
261
+
262
+ window.onclick = function(event) {
263
+ const modal = document.getElementById('paymentModal');
264
+ if (event.target == modal) {
265
+ closeModal();
266
+ }
267
+ }
268
+ </script>
269
+ </div>
270
+ </body>
271
+ </html>
272
+