12wqhh commited on
Commit
697e8c9
·
verified ·
1 Parent(s): 44eabe6

اريد تطبيق آسمه توتر Tوتصميم شفاف ولونة. مثل لون ايقونة الانستكرام فكرتة كل ٢٤ساعة ينطي ٥٠ نقطة ومحفضة للنقاط ومحفضة. تحول النقاط الى دولار كل 20الف نقطة درلار والدولار بلبوينتات يحسب حتلو نقطة وحدة يحسبها واريد لكل مستخدم جديد كود واريد نضام تحويل النقاط عن طريق كود المستخدم وإنشاء عجلة الحض 1و5و9و١٠٥و0عجلة الحض تلعب كل ٢٤ساعة - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +520 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Twtr
3
- emoji: 🐢
4
- colorFrom: gray
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: twtr
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,520 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Tوتصميم - تطبيق النقاط</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
11
+
12
+ body {
13
+ font-family: 'Tajawal', sans-serif;
14
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
15
+ min-height: 100vh;
16
+ }
17
+
18
+ .glass-card {
19
+ background: rgba(255, 255, 255, 0.2);
20
+ backdrop-filter: blur(10px);
21
+ -webkit-backdrop-filter: blur(10px);
22
+ border-radius: 20px;
23
+ border: 1px solid rgba(255, 255, 255, 0.3);
24
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
25
+ }
26
+
27
+ .wheel-container {
28
+ position: relative;
29
+ width: 300px;
30
+ height: 300px;
31
+ margin: 0 auto;
32
+ }
33
+
34
+ .wheel {
35
+ width: 100%;
36
+ height: 100%;
37
+ border-radius: 50%;
38
+ position: relative;
39
+ overflow: hidden;
40
+ transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
41
+ transform: rotate(0deg);
42
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
43
+ }
44
+
45
+ .wheel-section {
46
+ position: absolute;
47
+ width: 50%;
48
+ height: 50%;
49
+ transform-origin: 100% 100%;
50
+ left: 0;
51
+ top: 0;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ font-weight: bold;
56
+ color: white;
57
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
58
+ }
59
+
60
+ .wheel-pointer {
61
+ position: absolute;
62
+ top: -20px;
63
+ left: 50%;
64
+ transform: translateX(-50%);
65
+ width: 0;
66
+ height: 0;
67
+ border-left: 20px solid transparent;
68
+ border-right: 20px solid transparent;
69
+ border-top: 40px solid #e1306c;
70
+ z-index: 10;
71
+ }
72
+
73
+ .gradient-text {
74
+ background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
75
+ -webkit-background-clip: text;
76
+ background-clip: text;
77
+ color: transparent;
78
+ }
79
+
80
+ .btn-instagram {
81
+ background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
82
+ color: white;
83
+ border: none;
84
+ }
85
+
86
+ .btn-instagram:hover {
87
+ background: linear-gradient(45deg, #fd1d1d, #e1306c, #c13584, #833ab4, #5851db, #405de6);
88
+ }
89
+ </style>
90
+ </head>
91
+ <body class="text-gray-800">
92
+ <div class="container mx-auto px-4 py-8">
93
+ <!-- Header -->
94
+ <header class="flex justify-between items-center mb-8">
95
+ <div class="flex items-center">
96
+ <i class="fab fa-instagram text-4xl gradient-text mr-3"></i>
97
+ <h1 class="text-3xl font-bold gradient-text">Tوتصميم</h1>
98
+ </div>
99
+ <div class="flex items-center">
100
+ <div class="glass-card px-4 py-2 mr-4">
101
+ <span class="font-bold">نقاطك:</span>
102
+ <span id="userPoints" class="font-bold text-xl">0</span>
103
+ </div>
104
+ <div class="glass-card px-4 py-2">
105
+ <span class="font-bold">رصيدك:</span>
106
+ <span id="userBalance" class="font-bold text-xl">0</span> $
107
+ </div>
108
+ </div>
109
+ </header>
110
+
111
+ <!-- Main Content -->
112
+ <main class="grid grid-cols-1 lg:grid-cols-3 gap-8">
113
+ <!-- Daily Points Section -->
114
+ <div class="glass-card p-6 lg:col-span-2">
115
+ <h2 class="text-2xl font-bold mb-4 gradient-text">النقاط اليومية</h2>
116
+ <p class="mb-4">احصل على 50 نقطة كل 24 ساعة بمجرد الضغط على الزر أدناه:</p>
117
+
118
+ <div class="flex flex-col items-center">
119
+ <button id="dailyPointsBtn" class="btn-instagram px-6 py-3 rounded-full font-bold text-lg mb-4 transition-all hover:scale-105">
120
+ احصل على نقاطك اليومية
121
+ </button>
122
+ <div id="countdown" class="glass-card px-4 py-2 text-sm">
123
+ يمكنك المطالبة بالنقاط بعد: <span id="timer">24:00:00</span>
124
+ </div>
125
+ </div>
126
+ </div>
127
+
128
+ <!-- User Info Section -->
129
+ <div class="glass-card p-6">
130
+ <h2 class="text-2xl font-bold mb-4 gradient-text">معلومات المستخدم</h2>
131
+ <div class="mb-4">
132
+ <p class="font-bold">كود المستخدم الخاص بك:</p>
133
+ <div class="glass-card px-4 py-2 mt-2 flex justify-between items-center">
134
+ <span id="userCode" class="font-mono">XXXXXX</span>
135
+ <button id="copyCodeBtn" class="text-gray-600 hover:text-gray-900">
136
+ <i class="far fa-copy"></i>
137
+ </button>
138
+ </div>
139
+ </div>
140
+
141
+ <div class="mb-4">
142
+ <p class="font-bold mb-2">تحويل النقاط:</p>
143
+ <div class="flex">
144
+ <input type="text" id="receiverCode" placeholder="كود المستلم" class="glass-card px-4 py-2 w-full rounded-r-none border-r-0">
145
+ <input type="number" id="transferAmount" placeholder="المبلغ" class="glass-card px-4 py-2 w-24 text-center border-l-0 border-r-0">
146
+ <button id="transferBtn" class="btn-instagram px-4 py-2 rounded-l-none">
147
+ إرسال
148
+ </button>
149
+ </div>
150
+ </div>
151
+
152
+ <div>
153
+ <p class="font-bold mb-2">تحويل النقاط إلى دولار:</p>
154
+ <p class="text-sm mb-2">كل 20,000 نقطة = 1 دولار</p>
155
+ <div class="flex">
156
+ <input type="number" id="convertAmount" placeholder="عدد النقاط" class="glass-card px-4 py-2 w-full rounded-r-none border-r-0">
157
+ <button id="convertBtn" class="btn-instagram px-4 py-2 rounded-l-none">
158
+ تحويل
159
+ </button>
160
+ </div>
161
+ </div>
162
+ </div>
163
+
164
+ <!-- Wheel Section -->
165
+ <div class="glass-card p-6 lg:col-span-3">
166
+ <h2 class="text-2xl font-bold mb-4 gradient-text text-center">عجلة الحظ</h2>
167
+ <p class="text-center mb-6">يمكنك لعب عجلة الحظ مرة كل 24 ساعة للفوز بجوائز رائعة!</p>
168
+
169
+ <div class="wheel-container">
170
+ <div class="wheel-pointer"></div>
171
+ <div class="wheel" id="wheel">
172
+ <!-- Wheel sections will be added by JavaScript -->
173
+ </div>
174
+ </div>
175
+
176
+ <div class="text-center mt-8">
177
+ <button id="spinWheelBtn" class="btn-instagram px-8 py-3 rounded-full font-bold text-lg mb-4 transition-all hover:scale-105">
178
+ تدوير العجلة
179
+ </button>
180
+ <div id="wheelCountdown" class="glass-card px-4 py-2 text-sm inline-block">
181
+ يمكنك اللعب مرة أخرى بعد: <span id="wheelTimer">24:00:00</span>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <!-- Transactions History -->
187
+ <div class="glass-card p-6 lg:col-span-3">
188
+ <h2 class="text-2xl font-bold mb-4 gradient-text">سجل المعاملات</h2>
189
+ <div class="overflow-x-auto">
190
+ <table class="w-full">
191
+ <thead>
192
+ <tr class="border-b border-gray-200">
193
+ <th class="py-2 text-right">التاريخ</th>
194
+ <th class="py-2 text-right">النوع</th>
195
+ <th class="py-2 text-right">المبلغ</th>
196
+ <th class="py-2 text-right">الحالة</th>
197
+ </tr>
198
+ </thead>
199
+ <tbody id="transactionsList">
200
+ <!-- Transactions will be added by JavaScript -->
201
+ </tbody>
202
+ </table>
203
+ </div>
204
+ </div>
205
+ </main>
206
+ </div>
207
+
208
+ <script>
209
+ // Initialize user data
210
+ let user = {
211
+ points: localStorage.getItem('userPoints') ? parseInt(localStorage.getItem('userPoints')) : 0,
212
+ balance: localStorage.getItem('userBalance') ? parseFloat(localStorage.getItem('userBalance')) : 0,
213
+ lastDailyPoints: localStorage.getItem('lastDailyPoints') ? new Date(localStorage.getItem('lastDailyPoints')) : null,
214
+ lastSpin: localStorage.getItem('lastSpin') ? new Date(localStorage.getItem('lastSpin')) : null,
215
+ userCode: localStorage.getItem('userCode') || generateUserCode(),
216
+ transactions: localStorage.getItem('transactions') ? JSON.parse(localStorage.getItem('transactions')) : []
217
+ };
218
+
219
+ // DOM Elements
220
+ const userPointsEl = document.getElementById('userPoints');
221
+ const userBalanceEl = document.getElementById('userBalance');
222
+ const userCodeEl = document.getElementById('userCode');
223
+ const dailyPointsBtn = document.getElementById('dailyPointsBtn');
224
+ const countdownEl = document.getElementById('countdown');
225
+ const timerEl = document.getElementById('timer');
226
+ const receiverCodeEl = document.getElementById('receiverCode');
227
+ const transferAmountEl = document.getElementById('transferAmount');
228
+ const transferBtn = document.getElementById('transferBtn');
229
+ const convertAmountEl = document.getElementById('convertAmount');
230
+ const convertBtn = document.getElementById('convertBtn');
231
+ const copyCodeBtn = document.getElementById('copyCodeBtn');
232
+ const spinWheelBtn = document.getElementById('spinWheelBtn');
233
+ const wheelCountdownEl = document.getElementById('wheelCountdown');
234
+ const wheelTimerEl = document.getElementById('wheelTimer');
235
+ const wheelEl = document.getElementById('wheel');
236
+ const transactionsListEl = document.getElementById('transactionsList');
237
+
238
+ // Wheel configuration
239
+ const wheelSections = [
240
+ { value: 0, text: "0", color: "#FF5252" },
241
+ { value: 1, text: "1", color: "#FFD740" },
242
+ { value: 5, text: "5", color: "#69F0AE" },
243
+ { value: 9, text: "9", color: "#40C4FF" },
244
+ { value: 105, text: "105", color: "#E040FB" }
245
+ ];
246
+
247
+ // Initialize the app
248
+ function initApp() {
249
+ updateUI();
250
+ createWheel();
251
+ updateCountdowns();
252
+ renderTransactions();
253
+
254
+ // Set up countdown intervals
255
+ setInterval(updateCountdowns, 1000);
256
+ }
257
+
258
+ // Update UI with user data
259
+ function updateUI() {
260
+ userPointsEl.textContent = user.points.toLocaleString();
261
+ userBalanceEl.textContent = user.balance.toFixed(2);
262
+ userCodeEl.textContent = user.userCode;
263
+
264
+ // Save to localStorage
265
+ localStorage.setItem('userPoints', user.points);
266
+ localStorage.setItem('userBalance', user.balance);
267
+ localStorage.setItem('userCode', user.userCode);
268
+ localStorage.setItem('transactions', JSON.stringify(user.transactions));
269
+ }
270
+
271
+ // Generate random user code
272
+ function generateUserCode() {
273
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
274
+ let result = '';
275
+ for (let i = 0; i < 6; i++) {
276
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
277
+ }
278
+ return result;
279
+ }
280
+
281
+ // Create the wheel sections
282
+ function createWheel() {
283
+ wheelEl.innerHTML = '';
284
+ const sectionAngle = 360 / wheelSections.length;
285
+
286
+ wheelSections.forEach((section, index) => {
287
+ const sectionEl = document.createElement('div');
288
+ sectionEl.className = 'wheel-section';
289
+ sectionEl.style.backgroundColor = section.color;
290
+ sectionEl.style.transform = `rotate(${index * sectionAngle}deg) skewY(${90 - sectionAngle}deg)`;
291
+ sectionEl.innerHTML = `<div style="transform: skewY(${sectionAngle - 90}deg) rotate(${sectionAngle / 2}deg);">${section.text}</div>`;
292
+ wheelEl.appendChild(sectionEl);
293
+ });
294
+ }
295
+
296
+ // Spin the wheel
297
+ function spinWheel() {
298
+ if (user.lastSpin && (new Date() - user.lastSpin) < 24 * 60 * 60 * 1000) {
299
+ alert('يمكنك لعب العجلة مرة واحدة كل 24 ساعة فقط!');
300
+ return;
301
+ }
302
+
303
+ spinWheelBtn.disabled = true;
304
+
305
+ // Randomly select a prize
306
+ const randomIndex = Math.floor(Math.random() * wheelSections.length);
307
+ const prize = wheelSections[randomIndex].value;
308
+
309
+ // Calculate rotation (5 full rotations + prize angle)
310
+ const sectionAngle = 360 / wheelSections.length;
311
+ const targetAngle = 5 * 360 + (360 - (randomIndex * sectionAngle + sectionAngle / 2));
312
+
313
+ // Apply rotation
314
+ wheelEl.style.transform = `rotate(${targetAngle}deg)`;
315
+
316
+ // After animation completes
317
+ setTimeout(() => {
318
+ user.points += prize;
319
+ user.lastSpin = new Date();
320
+ localStorage.setItem('lastSpin', user.lastSpin);
321
+
322
+ addTransaction(new Date(), 'عجلة الحظ', prize, 'تمت بنجاح');
323
+ updateUI();
324
+ updateCountdowns();
325
+
326
+ alert(`مبروك! لقد ربحت ${prize} نقطة!`);
327
+ }, 3000);
328
+ }
329
+
330
+ // Update countdown timers
331
+ function updateCountdowns() {
332
+ // Daily points countdown
333
+ if (user.lastDailyPoints) {
334
+ const now = new Date();
335
+ const lastClaim = new Date(user.lastDailyPoints);
336
+ const nextClaim = new Date(lastClaim.getTime() + 24 * 60 * 60 * 1000);
337
+
338
+ if (now < nextClaim) {
339
+ const diff = nextClaim - now;
340
+ const hours = Math.floor(diff / (1000 * 60 * 60));
341
+ const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
342
+ const seconds = Math.floor((diff % (1000 * 60)) / 1000);
343
+
344
+ timerEl.textContent = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
345
+ dailyPointsBtn.disabled = true;
346
+ countdownEl.style.display = 'block';
347
+ } else {
348
+ dailyPointsBtn.disabled = false;
349
+ countdownEl.style.display = 'none';
350
+ }
351
+ } else {
352
+ dailyPointsBtn.disabled = false;
353
+ countdownEl.style.display = 'none';
354
+ }
355
+
356
+ // Wheel countdown
357
+ if (user.lastSpin) {
358
+ const now = new Date();
359
+ const lastSpin = new Date(user.lastSpin);
360
+ const nextSpin = new Date(lastSpin.getTime() + 24 * 60 * 60 * 1000);
361
+
362
+ if (now < nextSpin) {
363
+ const diff = nextSpin - now;
364
+ const hours = Math.floor(diff / (1000 * 60 * 60));
365
+ const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
366
+ const seconds = Math.floor((diff % (1000 * 60)) / 1000);
367
+
368
+ wheelTimerEl.textContent = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
369
+ spinWheelBtn.disabled = true;
370
+ wheelCountdownEl.style.display = 'inline-block';
371
+ } else {
372
+ spinWheelBtn.disabled = false;
373
+ wheelCountdownEl.style.display = 'none';
374
+ }
375
+ } else {
376
+ spinWheelBtn.disabled = false;
377
+ wheelCountdownEl.style.display = 'none';
378
+ }
379
+ }
380
+
381
+ // Add daily points
382
+ function addDailyPoints() {
383
+ if (user.lastDailyPoints && (new Date() - new Date(user.lastDailyPoints)) < 24 * 60 * 60 * 1000) {
384
+ alert('يمكنك المطالبة بالنقاط مرة واحدة كل 24 ساعة فقط!');
385
+ return;
386
+ }
387
+
388
+ user.points += 50;
389
+ user.lastDailyPoints = new Date();
390
+ localStorage.setItem('lastDailyPoints', user.lastDailyPoints);
391
+
392
+ addTransaction(new Date(), 'نقاط يومية', 50, 'تمت بنجاح');
393
+ updateUI();
394
+ updateCountdowns();
395
+
396
+ alert('تمت إضافة 50 نقطة إلى رصيدك!');
397
+ }
398
+
399
+ // Transfer points
400
+ function transferPoints() {
401
+ const receiverCode = receiverCodeEl.value.trim();
402
+ const amount = parseInt(transferAmountEl.value);
403
+
404
+ if (!receiverCode || !amount) {
405
+ alert('الرجاء إدخال كود المستلم والمبلغ');
406
+ return;
407
+ }
408
+
409
+ if (amount <= 0) {
410
+ alert('الرجاء إدخال مبلغ صحيح');
411
+ return;
412
+ }
413
+
414
+ if (amount > user.points) {
415
+ alert('لا تمتلك نقاط كافية لهذا التحويل');
416
+ return;
417
+ }
418
+
419
+ // In a real app, you would send this to a server
420
+ // For this demo, we'll just simulate it
421
+ user.points -= amount;
422
+
423
+ addTransaction(new Date(), `تحويل إلى ${receiverCode}`, -amount, 'تمت بنجاح');
424
+ updateUI();
425
+
426
+ alert(`تم تحويل ${amount} نقطة إلى المستخدم ${receiverCode}`);
427
+
428
+ // Clear inputs
429
+ receiverCodeEl.value = '';
430
+ transferAmountEl.value = '';
431
+ }
432
+
433
+ // Convert points to dollars
434
+ function convertPoints() {
435
+ const points = parseInt(convertAmountEl.value);
436
+
437
+ if (!points || points <= 0) {
438
+ alert('الرجاء إدخال عدد نقاط صحيح');
439
+ return;
440
+ }
441
+
442
+ if (points > user.points) {
443
+ alert('لا تمتلك نقاط كافية لهذا التحويل');
444
+ return;
445
+ }
446
+
447
+ if (points < 20000) {
448
+ alert('الحد الأدنى للتحويل هو 20,000 نقطة (1 دولار)');
449
+ return;
450
+ }
451
+
452
+ const dollars = points / 20000;
453
+ user.points -= points;
454
+ user.balance += dollars;
455
+
456
+ addTransaction(new Date(), 'تحويل نقاط إلى دولار', -points, 'تمت بنجاح');
457
+ addTransaction(new Date(), 'رصيد دولار', dollars, 'تمت بنجاح');
458
+ updateUI();
459
+
460
+ alert(`تم تحويل ${points} نقطة إلى ${dollars.toFixed(2)} دولار`);
461
+
462
+ // Clear input
463
+ convertAmountEl.value = '';
464
+ }
465
+
466
+ // Add transaction to history
467
+ function addTransaction(date, type, amount, status) {
468
+ user.transactions.unshift({
469
+ date: date.toLocaleString(),
470
+ type,
471
+ amount,
472
+ status
473
+ });
474
+
475
+ // Keep only last 50 transactions
476
+ if (user.transactions.length > 50) {
477
+ user.transactions.pop();
478
+ }
479
+
480
+ renderTransactions();
481
+ }
482
+
483
+ // Render transactions list
484
+ function renderTransactions() {
485
+ transactionsListEl.innerHTML = '';
486
+
487
+ user.transactions.forEach(transaction => {
488
+ const row = document.createElement('tr');
489
+ row.className = 'border-b border-gray-200';
490
+
491
+ const amountClass = transaction.amount >= 0 ? 'text-green-500' : 'text-red-500';
492
+ const amountSign = transaction.amount >= 0 ? '+' : '';
493
+
494
+ row.innerHTML = `
495
+ <td class="py-2 px-4">${transaction.date}</td>
496
+ <td class="py-2 px-4">${transaction.type}</td>
497
+ <td class="py-2 px-4 ${amountClass}">${amountSign}${transaction.amount}</td>
498
+ <td class="py-2 px-4">${transaction.status}</td>
499
+ `;
500
+
501
+ transactionsListEl.appendChild(row);
502
+ });
503
+ }
504
+
505
+ // Event Listeners
506
+ dailyPointsBtn.addEventListener('click', addDailyPoints);
507
+ transferBtn.addEventListener('click', transferPoints);
508
+ convertBtn.addEventListener('click', convertPoints);
509
+ spinWheelBtn.addEventListener('click', spinWheel);
510
+
511
+ copyCodeBtn.addEventListener('click', () => {
512
+ navigator.clipboard.writeText(user.userCode);
513
+ alert('تم نسخ كود المستخدم إلى الحافظة!');
514
+ });
515
+
516
+ // Initialize the app
517
+ document.addEventListener('DOMContentLoaded', initApp);
518
+ </script>
519
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=12wqhh/twtr" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
520
+ </html>