djs-builder 0.6.401 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -43
- package/function/dash.js +638 -0
- package/function/giveaway.js +47 -10
- package/function/security.js +0 -0
- package/handler/starter.js +73 -38
- package/package.json +9 -4
- package/views/404.ejs +40 -0
- package/views/dashboard.ejs +894 -0
- package/views/giveaways.ejs +306 -0
- package/views/guild.ejs +576 -0
- package/views/index.ejs +419 -0
- package/views/levels.ejs +326 -0
- package/views/login.ejs +437 -0
|
@@ -0,0 +1,306 @@
|
|
|
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>الهدايا - <%= guild.name %></title>
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Color+Emoji&display=swap" rel="stylesheet">
|
|
8
|
+
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
|
9
|
+
<style>
|
|
10
|
+
:root {
|
|
11
|
+
--bg-primary: #030305;
|
|
12
|
+
--bg-secondary: #0a0a0f;
|
|
13
|
+
--bg-card: #12121a;
|
|
14
|
+
--bg-card-hover: #1a1a25;
|
|
15
|
+
--accent: #5865F2;
|
|
16
|
+
--accent-light: #7289DA;
|
|
17
|
+
--accent-glow: rgba(88, 101, 242, 0.3);
|
|
18
|
+
--purple: #9b59b6;
|
|
19
|
+
--pink: #e91e63;
|
|
20
|
+
--success: #10b981;
|
|
21
|
+
--warning: #f59e0b;
|
|
22
|
+
--danger: #ef4444;
|
|
23
|
+
--text-primary: #ffffff;
|
|
24
|
+
--text-secondary: #94a3b8;
|
|
25
|
+
--text-muted: #64748b;
|
|
26
|
+
--border: rgba(255,255,255,0.06);
|
|
27
|
+
--radius: 16px;
|
|
28
|
+
--radius-sm: 10px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
32
|
+
body { font-family: 'Inter', 'Noto Color Emoji', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; }
|
|
33
|
+
a { color: inherit; text-decoration: none; }
|
|
34
|
+
::-webkit-scrollbar { width: 6px; }
|
|
35
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
36
|
+
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }
|
|
37
|
+
|
|
38
|
+
.bg-effects { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
|
|
39
|
+
.bg-gradient-1 { position: absolute; top: -20%; right: -15%; width: 50%; height: 50%; background: radial-gradient(circle, rgba(88,101,242,0.12) 0%, transparent 60%); filter: blur(80px); }
|
|
40
|
+
.bg-gradient-2 { position: absolute; bottom: -20%; left: -15%; width: 40%; height: 40%; background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 60%); filter: blur(80px); }
|
|
41
|
+
.bg-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px); background-size: 50px 50px; }
|
|
42
|
+
|
|
43
|
+
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; }
|
|
44
|
+
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: white; }
|
|
45
|
+
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--accent-glow); }
|
|
46
|
+
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
|
|
47
|
+
.btn-success:hover { box-shadow: 0 8px 20px rgba(16,185,129,0.3); }
|
|
48
|
+
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: #000; }
|
|
49
|
+
.btn-warning:hover { box-shadow: 0 8px 20px rgba(245,158,11,0.3); }
|
|
50
|
+
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; }
|
|
51
|
+
.btn-danger:hover { box-shadow: 0 8px 20px rgba(239,68,68,0.3); }
|
|
52
|
+
.btn-secondary { background: rgba(255,255,255,0.03); color: var(--text-primary); border: 1px solid var(--border); }
|
|
53
|
+
.btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: var(--accent); }
|
|
54
|
+
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
55
|
+
|
|
56
|
+
.sidebar { width: 280px; height: 100vh; position: fixed; right: 0; top: 0; background: rgba(10,10,15,0.95); backdrop-filter: blur(20px); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; }
|
|
57
|
+
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
|
|
58
|
+
.guild-card { display: flex; align-items: center; gap: 14px; }
|
|
59
|
+
.guild-icon-wrapper { position: relative; }
|
|
60
|
+
.guild-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); border: 2px solid transparent; background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box, linear-gradient(135deg, var(--accent), var(--purple)) border-box; }
|
|
61
|
+
.guild-icon-placeholder { width: 52px; height: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--accent); border: 2px solid transparent; background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box, linear-gradient(135deg, var(--accent), var(--purple)) border-box; }
|
|
62
|
+
.guild-status { position: absolute; bottom: -2px; left: -2px; width: 16px; height: 16px; background: var(--success); border-radius: 50%; border: 3px solid var(--bg-secondary); }
|
|
63
|
+
.guild-info { flex: 1; min-width: 0; }
|
|
64
|
+
.guild-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
|
|
65
|
+
.guild-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
|
|
66
|
+
|
|
67
|
+
.sidebar-nav { flex: 1; padding: 16px; overflow-y: auto; }
|
|
68
|
+
.nav-section { margin-bottom: 24px; }
|
|
69
|
+
.nav-section-title { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 8px 14px; }
|
|
70
|
+
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px; font-weight: 500; margin-bottom: 4px; transition: all 0.3s; position: relative; overflow: hidden; }
|
|
71
|
+
.nav-link::before { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 0; background: var(--accent); border-radius: 3px; transition: height 0.3s; }
|
|
72
|
+
.nav-link:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
|
|
73
|
+
.nav-link.active { background: rgba(88,101,242,0.15); color: var(--accent); }
|
|
74
|
+
.nav-link.active::before { height: 60%; }
|
|
75
|
+
.nav-link i { font-size: 20px; }
|
|
76
|
+
|
|
77
|
+
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.2); }
|
|
78
|
+
.back-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: all 0.3s; }
|
|
79
|
+
.back-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); border-color: var(--accent); }
|
|
80
|
+
|
|
81
|
+
.main { margin-right: 280px; padding: 40px; min-height: 100vh; position: relative; z-index: 1; }
|
|
82
|
+
.page-header { margin-bottom: 32px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
|
|
83
|
+
.page-header h1 { font-size: 36px; font-weight: 800; background: linear-gradient(135deg, #fff, var(--text-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; }
|
|
84
|
+
.page-header h1 i { margin-left: 12px; -webkit-text-fill-color: var(--warning); }
|
|
85
|
+
.page-header p { color: var(--text-secondary); margin-top: 8px; }
|
|
86
|
+
|
|
87
|
+
.tabs { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
|
|
88
|
+
.tab { padding: 12px 22px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 50px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
|
|
89
|
+
.tab:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
|
|
90
|
+
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-light)); border-color: var(--accent); color: white; box-shadow: 0 4px 15px var(--accent-glow); }
|
|
91
|
+
.tab-count { background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
|
|
92
|
+
.tab.active .tab-count { background: rgba(255,255,255,0.3); }
|
|
93
|
+
|
|
94
|
+
.giveaways-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
|
|
95
|
+
|
|
96
|
+
.giveaway-card {
|
|
97
|
+
background: linear-gradient(145deg, var(--bg-card), rgba(18,18,26,0.6));
|
|
98
|
+
border: 1px solid var(--border);
|
|
99
|
+
border-radius: var(--radius);
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
102
|
+
}
|
|
103
|
+
.giveaway-card:hover { transform: translateY(-6px); border-color: rgba(88,101,242,0.3); box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
|
|
104
|
+
|
|
105
|
+
.giveaway-status { padding: 10px 20px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
|
|
106
|
+
.giveaway-status.active { background: rgba(16,185,129,0.15); color: var(--success); }
|
|
107
|
+
.giveaway-status.paused { background: rgba(245,158,11,0.15); color: var(--warning); }
|
|
108
|
+
.giveaway-status.ended { background: rgba(239,68,68,0.15); color: var(--danger); }
|
|
109
|
+
.giveaway-status i { font-size: 16px; }
|
|
110
|
+
|
|
111
|
+
.giveaway-body { padding: 24px; }
|
|
112
|
+
.giveaway-prize { font-size: 20px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
|
|
113
|
+
.giveaway-prize i { color: var(--warning); font-size: 24px; }
|
|
114
|
+
|
|
115
|
+
.giveaway-info { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
|
|
116
|
+
.giveaway-info-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
|
|
117
|
+
.giveaway-info-item i { color: var(--text-muted); width: 20px; font-size: 16px; }
|
|
118
|
+
.giveaway-info-item span { color: var(--text-primary); font-weight: 500; }
|
|
119
|
+
|
|
120
|
+
.giveaway-footer { padding: 18px 24px; background: rgba(0,0,0,0.2); border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
|
|
121
|
+
|
|
122
|
+
.empty-state { text-align: center; padding: 80px 20px; background: linear-gradient(145deg, var(--bg-card), rgba(18,18,26,0.6)); border: 1px solid var(--border); border-radius: var(--radius); }
|
|
123
|
+
.empty-state i { font-size: 64px; color: var(--warning); margin-bottom: 24px; opacity: 0.3; }
|
|
124
|
+
.empty-state h3 { font-size: 22px; margin-bottom: 12px; }
|
|
125
|
+
.empty-state p { color: var(--text-secondary); }
|
|
126
|
+
|
|
127
|
+
.toast { position: fixed; bottom: 24px; left: 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 24px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); transform: translateY(120px); opacity: 0; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 3000; }
|
|
128
|
+
.toast.show { transform: translateY(0); opacity: 1; }
|
|
129
|
+
.toast.success { border-color: var(--success); }
|
|
130
|
+
.toast.success i { color: var(--success); }
|
|
131
|
+
.toast.error { border-color: var(--danger); }
|
|
132
|
+
.toast.error i { color: var(--danger); }
|
|
133
|
+
|
|
134
|
+
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
|
|
135
|
+
.animate-in { animation: fadeIn 0.5s ease forwards; }
|
|
136
|
+
|
|
137
|
+
@media (max-width: 992px) {
|
|
138
|
+
.sidebar { transform: translateX(100%); transition: transform 0.3s; }
|
|
139
|
+
.sidebar.open { transform: translateX(0); }
|
|
140
|
+
.main { margin-right: 0; padding: 20px; padding-top: 70px; }
|
|
141
|
+
.mobile-menu-btn { position: fixed; top: 16px; right: 16px; z-index: 101; width: 44px; height: 44px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-primary); font-size: 22px; cursor: pointer; }
|
|
142
|
+
.giveaways-grid { grid-template-columns: 1fr; }
|
|
143
|
+
.page-header h1 { font-size: 24px; }
|
|
144
|
+
.page-subtitle { font-size: 13px; }
|
|
145
|
+
.header-actions { flex-wrap: wrap; gap: 8px; }
|
|
146
|
+
.status-tabs { flex-wrap: wrap; gap: 6px; }
|
|
147
|
+
.status-tab { padding: 8px 14px; font-size: 12px; }
|
|
148
|
+
.giveaway-card { padding: 18px; }
|
|
149
|
+
.giveaway-prize { font-size: 15px; }
|
|
150
|
+
.giveaway-meta { flex-wrap: wrap; gap: 10px; }
|
|
151
|
+
.action-btn { padding: 10px 14px; font-size: 12px; }
|
|
152
|
+
}
|
|
153
|
+
@media (max-width: 600px) {
|
|
154
|
+
.main { padding: 16px; padding-top: 60px; }
|
|
155
|
+
.page-header h1 { font-size: 20px; }
|
|
156
|
+
.header-actions { flex-direction: column; width: 100%; }
|
|
157
|
+
.btn { width: 100%; justify-content: center; }
|
|
158
|
+
.status-tabs { width: 100%; }
|
|
159
|
+
.status-tab { flex: 1; justify-content: center; }
|
|
160
|
+
.giveaway-actions { flex-direction: column; }
|
|
161
|
+
.action-btn { width: 100%; justify-content: center; }
|
|
162
|
+
.modal-content { width: 95%; margin: 12px; padding: 20px; }
|
|
163
|
+
.modal-header h3 { font-size: 18px; }
|
|
164
|
+
.form-row { flex-direction: column; }
|
|
165
|
+
}
|
|
166
|
+
@media (min-width: 993px) { .mobile-menu-btn { display: none; } }
|
|
167
|
+
</style>
|
|
168
|
+
</head>
|
|
169
|
+
<body>
|
|
170
|
+
<div class="bg-effects"><div class="bg-gradient-1"></div><div class="bg-gradient-2"></div><div class="bg-grid"></div></div>
|
|
171
|
+
|
|
172
|
+
<button class="mobile-menu-btn" onclick="document.querySelector('.sidebar').classList.toggle('open')"><i class="ri-menu-line"></i></button>
|
|
173
|
+
|
|
174
|
+
<aside class="sidebar">
|
|
175
|
+
<div class="sidebar-header">
|
|
176
|
+
<div class="guild-card">
|
|
177
|
+
<div class="guild-icon-wrapper">
|
|
178
|
+
<% if (guild.icon) { %><img src="https://cdn.discordapp.com/icons/<%= guild.id %>/<%= guild.icon %>.png?size=128" alt="<%= guild.name %>" class="guild-icon"><% } else { %><div class="guild-icon-placeholder"><%= guild.name.charAt(0).toUpperCase() %></div><% } %>
|
|
179
|
+
<div class="guild-status"></div>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="guild-info">
|
|
182
|
+
<div class="guild-name"><%= guild.name %></div>
|
|
183
|
+
<div class="guild-meta"><i class="ri-group-line"></i> <%= (guild.memberCount || 0).toLocaleString() %> عضو</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
<nav class="sidebar-nav">
|
|
188
|
+
<div class="nav-section"><div class="nav-section-title">الرئيسية</div><a href="/dashboard/<%= guild.id %>" class="nav-link"><i class="ri-dashboard-3-line"></i><span>نظرة عامة</span></a></div>
|
|
189
|
+
<div class="nav-section"><div class="nav-section-title">الميزات</div>
|
|
190
|
+
<a href="/dashboard/<%= guild.id %>/levels" class="nav-link"><i class="ri-bar-chart-grouped-line"></i><span>نظام المستويات</span></a>
|
|
191
|
+
<a href="/dashboard/<%= guild.id %>/giveaways" class="nav-link active"><i class="ri-gift-2-line"></i><span>الهدايا</span></a>
|
|
192
|
+
</div>
|
|
193
|
+
</nav>
|
|
194
|
+
<div class="sidebar-footer"><a href="/dashboard" class="back-btn"><i class="ri-arrow-right-line"></i><span>العودة للوحة التحكم</span></a></div>
|
|
195
|
+
</aside>
|
|
196
|
+
|
|
197
|
+
<main class="main">
|
|
198
|
+
<div class="page-header animate-in">
|
|
199
|
+
<div><h1><i class="ri-gift-2-line"></i> الهدايا (Giveaways)</h1><p>إدارة الهدايا النشطة والمنتهية</p></div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div class="tabs animate-in" style="animation-delay: 0.1s">
|
|
203
|
+
<div class="tab active" onclick="filterGiveaways('all')">الكل <span class="tab-count"><%= giveaways.length %></span></div>
|
|
204
|
+
<div class="tab" onclick="filterGiveaways('active')">نشطة <span class="tab-count"><%= giveaways.filter(g => !g.ended && !g.paused).length %></span></div>
|
|
205
|
+
<div class="tab" onclick="filterGiveaways('paused')">متوقفة <span class="tab-count"><%= giveaways.filter(g => g.paused).length %></span></div>
|
|
206
|
+
<div class="tab" onclick="filterGiveaways('ended')">منتهية <span class="tab-count"><%= giveaways.filter(g => g.ended).length %></span></div>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<% if (giveaways.length > 0) { %>
|
|
210
|
+
<div class="giveaways-grid" id="giveawaysGrid">
|
|
211
|
+
<% giveaways.forEach((g, index) => {
|
|
212
|
+
if (!g) return;
|
|
213
|
+
const status = g.ended ? 'ended' : g.paused ? 'paused' : 'active';
|
|
214
|
+
const statusText = g.ended ? 'منتهية' : g.paused ? 'متوقفة مؤقتاً' : 'نشطة';
|
|
215
|
+
const statusIcon = g.ended ? 'stop-circle' : g.paused ? 'pause-circle' : 'play-circle';
|
|
216
|
+
const endTimeNum = parseInt(g.endTime) || 0;
|
|
217
|
+
const endDate = new Date(endTimeNum);
|
|
218
|
+
const isValidDate = endTimeNum > 0 && !isNaN(endDate.getTime());
|
|
219
|
+
const msgId = g.messageId || 'N/A';
|
|
220
|
+
const hosterId = g.hoster || 'غير معروف';
|
|
221
|
+
const winCount = g.winnerCount || 1;
|
|
222
|
+
const prizeName = g.prize || 'هدية';
|
|
223
|
+
%>
|
|
224
|
+
<div class="giveaway-card animate-in" data-status="<%= status %>" style="animation-delay: <%= (index + 2) * 0.05 %>s">
|
|
225
|
+
<div class="giveaway-status <%= status %>">
|
|
226
|
+
<i class="ri-<%= statusIcon %>-fill"></i>
|
|
227
|
+
<%= statusText %>
|
|
228
|
+
</div>
|
|
229
|
+
<div class="giveaway-body">
|
|
230
|
+
<div class="giveaway-prize"><i class="ri-gift-fill"></i> <%= prizeName %></div>
|
|
231
|
+
<div class="giveaway-info">
|
|
232
|
+
<div class="giveaway-info-item"><i class="ri-user-star-line"></i> المنظم: <span dir="ltr"><%= hosterId %></span></div>
|
|
233
|
+
<div class="giveaway-info-item"><i class="ri-group-line"></i> عدد الفائزين: <span><%= winCount %></span></div>
|
|
234
|
+
<% if (isValidDate) { %>
|
|
235
|
+
<div class="giveaway-info-item"><i class="ri-calendar-line"></i> تاريخ الانتهاء: <span><%= endDate.toLocaleDateString('ar-EG') %></span></div>
|
|
236
|
+
<div class="giveaway-info-item"><i class="ri-time-line"></i> الوقت: <span><%= endDate.toLocaleTimeString('ar-EG', {hour: '2-digit', minute: '2-digit'}) %></span></div>
|
|
237
|
+
<% } else { %>
|
|
238
|
+
<div class="giveaway-info-item"><i class="ri-calendar-line"></i> تاريخ الانتهاء: <span>غير محدد</span></div>
|
|
239
|
+
<% } %>
|
|
240
|
+
<div class="giveaway-info-item"><i class="ri-hashtag"></i> Message ID: <span dir="ltr" style="font-family: monospace; font-size: 12px;"><%= msgId %></span></div>
|
|
241
|
+
<% if (g.channelId) { %>
|
|
242
|
+
<div class="giveaway-info-item"><i class="ri-chat-3-line"></i> القناة: <span dir="ltr"><%= g.channelId %></span></div>
|
|
243
|
+
<% } %>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="giveaway-footer">
|
|
247
|
+
<% if (!g.ended) { %>
|
|
248
|
+
<% if (g.paused) { %>
|
|
249
|
+
<button class="btn btn-success" onclick="giveawayAction('resume', '<%= msgId %>')"><i class="ri-play-fill"></i> استئناف</button>
|
|
250
|
+
<% } else { %>
|
|
251
|
+
<button class="btn btn-warning" onclick="giveawayAction('pause', '<%= msgId %>')"><i class="ri-pause-fill"></i> إيقاف</button>
|
|
252
|
+
<% } %>
|
|
253
|
+
<button class="btn btn-primary" onclick="giveawayAction('end', '<%= msgId %>')"><i class="ri-stop-fill"></i> إنهاء</button>
|
|
254
|
+
<button class="btn btn-danger" onclick="giveawayAction('delete', '<%= msgId %>')"><i class="ri-delete-bin-line"></i> حذف</button>
|
|
255
|
+
<% } else { %>
|
|
256
|
+
<button class="btn btn-primary" onclick="giveawayAction('reroll', '<%= msgId %>')"><i class="ri-refresh-line"></i> إعادة السحب</button>
|
|
257
|
+
<button class="btn btn-danger" onclick="giveawayAction('delete', '<%= msgId %>')"><i class="ri-delete-bin-line"></i> حذف</button>
|
|
258
|
+
<% } %>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
<% }); %>
|
|
262
|
+
</div>
|
|
263
|
+
<% } else { %>
|
|
264
|
+
<div class="empty-state animate-in"><i class="ri-gift-2-line"></i><h3>لا توجد هدايا</h3><p>لم يتم إنشاء أي هدايا في هذا السيرفر بعد</p></div>
|
|
265
|
+
<% } %>
|
|
266
|
+
</main>
|
|
267
|
+
|
|
268
|
+
<div class="toast" id="toast"><i class="ri-checkbox-circle-fill"></i><span id="toastText"></span></div>
|
|
269
|
+
|
|
270
|
+
<script>
|
|
271
|
+
function filterGiveaways(status) {
|
|
272
|
+
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
|
273
|
+
event.target.closest('.tab').classList.add('active');
|
|
274
|
+
document.querySelectorAll('.giveaway-card').forEach(card => {
|
|
275
|
+
card.style.display = status === 'all' || card.dataset.status === status ? '' : 'none';
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function showToast(message, type = 'success') {
|
|
280
|
+
const toast = document.getElementById('toast');
|
|
281
|
+
document.getElementById('toastText').textContent = message;
|
|
282
|
+
toast.className = 'toast ' + type + ' show';
|
|
283
|
+
setTimeout(() => toast.classList.remove('show'), 3000);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
async function giveawayAction(action, messageId) {
|
|
287
|
+
try {
|
|
288
|
+
const res = await fetch('/api/<%= guild.id %>/giveaway/' + action, {
|
|
289
|
+
method: 'POST',
|
|
290
|
+
headers: { 'Content-Type': 'application/json' },
|
|
291
|
+
body: JSON.stringify({ messageId: messageId })
|
|
292
|
+
});
|
|
293
|
+
const data = await res.json();
|
|
294
|
+
if (data.success) {
|
|
295
|
+
showToast(data.message || 'تم بنجاح', 'success');
|
|
296
|
+
setTimeout(() => location.reload(), 1500);
|
|
297
|
+
} else {
|
|
298
|
+
showToast(data.error || 'حدث خطأ', 'error');
|
|
299
|
+
}
|
|
300
|
+
} catch (e) {
|
|
301
|
+
showToast('حدث خطأ في الاتصال', 'error');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
</script>
|
|
305
|
+
</body>
|
|
306
|
+
</html>
|