amirpoorazima commited on
Commit
8029a80
·
verified ·
1 Parent(s): 4f42693

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +386 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Salavat Shomar
3
- emoji: 🏆
4
- colorFrom: pink
5
- colorTo: pink
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: salavat-shomar
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: green
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,386 @@
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="fa" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>صلوات شمار - شمارنده صلوات</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=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');
11
+
12
+ body {
13
+ font-family: 'Noto Naskh Arabic', serif;
14
+ background-color: #f5f5f5;
15
+ transition: background-color 0.5s;
16
+ }
17
+
18
+ .counter-container {
19
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
20
+ transition: transform 0.3s;
21
+ }
22
+
23
+ .counter-container:hover {
24
+ transform: translateY(-5px);
25
+ }
26
+
27
+ .btn {
28
+ transition: all 0.3s;
29
+ }
30
+
31
+ .btn:hover {
32
+ transform: scale(1.05);
33
+ }
34
+
35
+ .btn:active {
36
+ transform: scale(0.95);
37
+ }
38
+
39
+ .pulse {
40
+ animation: pulse 1.5s infinite;
41
+ }
42
+
43
+ @keyframes pulse {
44
+ 0% {
45
+ transform: scale(1);
46
+ }
47
+ 50% {
48
+ transform: scale(1.05);
49
+ }
50
+ 100% {
51
+ transform: scale(1);
52
+ }
53
+ }
54
+
55
+ .confetti {
56
+ position: absolute;
57
+ width: 10px;
58
+ height: 10px;
59
+ background-color: #f0f;
60
+ opacity: 0;
61
+ }
62
+
63
+ .theme-btn {
64
+ transition: all 0.3s;
65
+ }
66
+
67
+ .theme-btn:hover {
68
+ transform: rotate(15deg);
69
+ }
70
+ </style>
71
+ </head>
72
+ <body class="min-h-screen flex flex-col items-center justify-center p-4">
73
+ <div class="fixed top-4 left-4 flex space-x-2 space-x-reverse">
74
+ <button id="theme-blue" class="theme-btn w-8 h-8 rounded-full bg-blue-500"></button>
75
+ <button id="theme-green" class="theme-btn w-8 h-8 rounded-full bg-green-500"></button>
76
+ <button id="theme-purple" class="theme-btn w-8 h-8 rounded-full bg-purple-500"></button>
77
+ <button id="theme-red" class="theme-btn w-8 h-8 rounded-full bg-red-500"></button>
78
+ </div>
79
+
80
+ <div class="text-center mb-8">
81
+ <h1 class="text-4xl font-bold text-gray-800 mb-2">صلوات شمار</h1>
82
+ <p class="text-lg text-gray-600">با هر صلوات، بهشت به استقبال شما می‌آید</p>
83
+ </div>
84
+
85
+ <div class="counter-container bg-white rounded-2xl p-8 w-full max-w-md relative overflow-hidden">
86
+ <div id="confetti-container" class="absolute inset-0 pointer-events-none"></div>
87
+
88
+ <div class="flex justify-between items-center mb-6">
89
+ <div class="text-right">
90
+ <p class="text-gray-500">تعداد صلوات امروز</p>
91
+ <p id="daily-counter" class="text-2xl font-bold">0</p>
92
+ </div>
93
+ <div class="text-right">
94
+ <p class="text-gray-500">کل صلوات</p>
95
+ <p id="total-counter" class="text-2xl font-bold">0</p>
96
+ </div>
97
+ </div>
98
+
99
+ <div class="flex justify-center mb-8">
100
+ <div class="relative">
101
+ <div id="counter" class="text-7xl font-bold text-center mb-4 transition-all duration-300">0</div>
102
+ <div class="absolute -bottom-2 left-0 right-0 h-1 bg-gradient-to-r from-transparent via-blue-400 to-transparent opacity-70"></div>
103
+ </div>
104
+ </div>
105
+
106
+ <div class="flex justify-center space-x-4 space-x-reverse">
107
+ <button id="reset-btn" class="btn px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300">
108
+ <i class="fas fa-redo ml-2"></i> بازنشانی
109
+ </button>
110
+ <button id="count-btn" class="btn px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 pulse">
111
+ <i class="fas fa-praying-hands ml-2"></i> صلوات
112
+ </button>
113
+ <button id="auto-btn" class="btn px-6 py-3 bg-green-500 text-white rounded-lg hover:bg-green-600">
114
+ <i class="fas fa-play ml-2"></i> خودکار
115
+ </button>
116
+ </div>
117
+
118
+ <div class="mt-8 pt-4 border-t border-gray-200">
119
+ <div class="flex justify-between items-center mb-2">
120
+ <span class="text-gray-600">هدف امروز</span>
121
+ <span id="goal-progress" class="text-sm font-medium">0/100</span>
122
+ </div>
123
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
124
+ <div id="goal-bar" class="bg-blue-500 h-2.5 rounded-full" style="width: 0%"></div>
125
+ </div>
126
+ </div>
127
+ </div>
128
+
129
+ <div class="mt-8 bg-white rounded-xl p-6 w-full max-w-md">
130
+ <h2 class="text-xl font-bold mb-4 text-gray-800">فضیلت صلوات</h2>
131
+ <div class="text-gray-700 leading-relaxed text-justify">
132
+ <p class="mb-3">پیامبر اکرم (ص) فرمودند: هر کس بر من صلوات بفرستد، خداوند به تعداد آن صلوات، ده برابر به او پاداش می‌دهد.</p>
133
+ <p class="mb-3">امام صادق (ع) فرمودند: صلوات بر محمد و آل محمد گناهان را مانند برگ درختان در فصل خزان می‌ریزد.</p>
134
+ <p>امام رضا (ع) فرمودند: هر که می‌خواهد از پل صراط همچون برق جهنده عبور کند، بر محمد و آل محمد بسیار صلوات بفرستد.</p>
135
+ </div>
136
+ </div>
137
+
138
+ <div class="mt-6 text-center text-gray-500 text-sm">
139
+ <p>امروز: <span id="today-date" class="font-medium"></span></p>
140
+ </div>
141
+
142
+ <script>
143
+ document.addEventListener('DOMContentLoaded', function() {
144
+ // Elements
145
+ const counterEl = document.getElementById('counter');
146
+ const totalCounterEl = document.getElementById('total-counter');
147
+ const dailyCounterEl = document.getElementById('daily-counter');
148
+ const countBtn = document.getElementById('count-btn');
149
+ const resetBtn = document.getElementById('reset-btn');
150
+ const autoBtn = document.getElementById('auto-btn');
151
+ const goalBar = document.getElementById('goal-bar');
152
+ const goalProgress = document.getElementById('goal-progress');
153
+ const todayDateEl = document.getElementById('today-date');
154
+ const confettiContainer = document.getElementById('confetti-container');
155
+ const themeButtons = document.querySelectorAll('.theme-btn');
156
+
157
+ // Variables
158
+ let count = 0;
159
+ let totalCount = localStorage.getItem('totalSalawat') ? parseInt(localStorage.getItem('totalSalawat')) : 0;
160
+ let dailyCount = localStorage.getItem('dailySalawat') ? parseInt(localStorage.getItem('dailySalawat')) : 0;
161
+ let lastDate = localStorage.getItem('lastDate') || '';
162
+ const today = new Date().toLocaleDateString('fa-IR');
163
+ const dailyGoal = 100;
164
+ let autoInterval = null;
165
+ let currentTheme = 'blue';
166
+
167
+ // Initialize
168
+ updateCounters();
169
+ updateDate();
170
+ checkDate();
171
+ updateGoalProgress();
172
+
173
+ // Event Listeners
174
+ countBtn.addEventListener('click', incrementCount);
175
+ resetBtn.addEventListener('click', resetCount);
176
+ autoBtn.addEventListener('click', toggleAutoCount);
177
+
178
+ // Theme buttons
179
+ themeButtons.forEach(btn => {
180
+ btn.addEventListener('click', function() {
181
+ currentTheme = this.id.replace('theme-', '');
182
+ applyTheme(currentTheme);
183
+ });
184
+ });
185
+
186
+ // Functions
187
+ function incrementCount() {
188
+ count++;
189
+ dailyCount++;
190
+ totalCount++;
191
+
192
+ updateCounters();
193
+ saveToLocalStorage();
194
+ updateGoalProgress();
195
+
196
+ // Animation
197
+ counterEl.classList.add('scale-110');
198
+ setTimeout(() => {
199
+ counterEl.classList.remove('scale-110');
200
+ }, 200);
201
+
202
+ // Confetti for every 10 counts
203
+ if (count % 10 === 0) {
204
+ createConfetti();
205
+ }
206
+
207
+ // Special effect for 100 counts
208
+ if (count % 100 === 0) {
209
+ celebrate();
210
+ }
211
+ }
212
+
213
+ function updateCounters() {
214
+ counterEl.textContent = count;
215
+ totalCounterEl.textContent = totalCount.toLocaleString('fa-IR');
216
+ dailyCounterEl.textContent = dailyCount.toLocaleString('fa-IR');
217
+ }
218
+
219
+ function resetCount() {
220
+ count = 0;
221
+ updateCounters();
222
+ }
223
+
224
+ function toggleAutoCount() {
225
+ if (autoInterval) {
226
+ clearInterval(autoInterval);
227
+ autoInterval = null;
228
+ autoBtn.innerHTML = '<i class="fas fa-play ml-2"></i> خودکار';
229
+ autoBtn.classList.remove('bg-red-500', 'hover:bg-red-600');
230
+ autoBtn.classList.add('bg-green-500', 'hover:bg-green-600');
231
+ } else {
232
+ autoInterval = setInterval(incrementCount, 1000);
233
+ autoBtn.innerHTML = '<i class="fas fa-stop ml-2"></i> توقف';
234
+ autoBtn.classList.remove('bg-green-500', 'hover:bg-green-600');
235
+ autoBtn.classList.add('bg-red-500', 'hover:bg-red-600');
236
+ }
237
+ }
238
+
239
+ function saveToLocalStorage() {
240
+ localStorage.setItem('totalSalawat', totalCount);
241
+ localStorage.setItem('dailySalawat', dailyCount);
242
+ localStorage.setItem('lastDate', today);
243
+ }
244
+
245
+ function checkDate() {
246
+ if (lastDate !== today) {
247
+ // New day, reset daily count but keep total
248
+ dailyCount = 0;
249
+ count = 0;
250
+ updateCounters();
251
+ }
252
+ }
253
+
254
+ function updateDate() {
255
+ todayDateEl.textContent = today;
256
+ }
257
+
258
+ function updateGoalProgress() {
259
+ const progress = Math.min((dailyCount / dailyGoal) * 100, 100);
260
+ goalBar.style.width = `${progress}%`;
261
+ goalProgress.textContent = `${dailyCount}/${dailyGoal}`;
262
+
263
+ // Change color based on progress
264
+ if (progress >= 100) {
265
+ goalBar.classList.remove('bg-blue-500', 'bg-green-500', 'bg-yellow-500');
266
+ goalBar.classList.add('bg-purple-500');
267
+ } else if (progress >= 70) {
268
+ goalBar.classList.remove('bg-blue-500', 'bg-yellow-500', 'bg-purple-500');
269
+ goalBar.classList.add('bg-green-500');
270
+ } else if (progress >= 30) {
271
+ goalBar.classList.remove('bg-blue-500', 'bg-green-500', 'bg-purple-500');
272
+ goalBar.classList.add('bg-yellow-500');
273
+ } else {
274
+ goalBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-purple-500');
275
+ goalBar.classList.add('bg-blue-500');
276
+ }
277
+ }
278
+
279
+ function createConfetti() {
280
+ for (let i = 0; i < 50; i++) {
281
+ const confetti = document.createElement('div');
282
+ confetti.classList.add('confetti');
283
+
284
+ // Random position
285
+ const xPos = Math.random() * 100;
286
+ const yPos = Math.random() * 100;
287
+
288
+ // Random color
289
+ const colors = ['#f0f', '#0ff', '#ff0', '#f00', '#0f0', '#00f'];
290
+ const color = colors[Math.floor(Math.random() * colors.length)];
291
+
292
+ confetti.style.left = `${xPos}%`;
293
+ confetti.style.top = `${yPos}%`;
294
+ confetti.style.backgroundColor = color;
295
+ confetti.style.transform = `rotate(${Math.random() * 360}deg)`;
296
+
297
+ confettiContainer.appendChild(confetti);
298
+
299
+ // Animate
300
+ setTimeout(() => {
301
+ confetti.style.opacity = '1';
302
+ confetti.style.transform = `translate(${Math.random() * 200 - 100}px, ${Math.random() * 200 + 100}px) rotate(${Math.random() * 360}deg)`;
303
+ confetti.style.transition = `all ${Math.random() * 2 + 1}s ease-out`;
304
+
305
+ // Remove after animation
306
+ setTimeout(() => {
307
+ confetti.remove();
308
+ }, 2000);
309
+ }, 10);
310
+ }
311
+ }
312
+
313
+ function celebrate() {
314
+ // Flash animation
315
+ document.body.classList.add('bg-blue-100');
316
+ setTimeout(() => {
317
+ document.body.classList.remove('bg-blue-100');
318
+ }, 300);
319
+
320
+ // Big confetti
321
+ createConfetti();
322
+ setTimeout(createConfetti, 300);
323
+ setTimeout(createConfetti, 600);
324
+
325
+ // Play sound if possible
326
+ if (typeof Audio !== 'undefined') {
327
+ const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-achievement-bell-600.mp3');
328
+ audio.play().catch(e => console.log('Audio play failed:', e));
329
+ }
330
+ }
331
+
332
+ function applyTheme(theme) {
333
+ // Remove all theme classes first
334
+ document.querySelectorAll('.bg-blue-500, .bg-green-500, .bg-purple-500, .bg-red-500').forEach(el => {
335
+ el.classList.remove('bg-blue-500', 'hover:bg-blue-600',
336
+ 'bg-green-500', 'hover:bg-green-600',
337
+ 'bg-purple-500', 'hover:bg-purple-600',
338
+ 'bg-red-500', 'hover:bg-red-600');
339
+ });
340
+
341
+ // Apply new theme
342
+ switch(theme) {
343
+ case 'blue':
344
+ countBtn.classList.add('bg-blue-500', 'hover:bg-blue-600');
345
+ autoBtn.classList.add('bg-blue-500', 'hover:bg-blue-600');
346
+ goalBar.classList.add('bg-blue-500');
347
+ break;
348
+ case 'green':
349
+ countBtn.classList.add('bg-green-500', 'hover:bg-green-600');
350
+ autoBtn.classList.add('bg-green-500', 'hover:bg-green-600');
351
+ goalBar.classList.add('bg-green-500');
352
+ break;
353
+ case 'purple':
354
+ countBtn.classList.add('bg-purple-500', 'hover:bg-purple-600');
355
+ autoBtn.classList.add('bg-purple-500', 'hover:bg-purple-600');
356
+ goalBar.classList.add('bg-purple-500');
357
+ break;
358
+ case 'red':
359
+ countBtn.classList.add('bg-red-500', 'hover:bg-red-600');
360
+ autoBtn.classList.add('bg-red-500', 'hover:bg-red-600');
361
+ goalBar.classList.add('bg-red-500');
362
+ break;
363
+ }
364
+
365
+ // Save theme preference
366
+ localStorage.setItem('salawatTheme', theme);
367
+ }
368
+
369
+ // Load saved theme
370
+ const savedTheme = localStorage.getItem('salawatTheme');
371
+ if (savedTheme) {
372
+ applyTheme(savedTheme);
373
+ currentTheme = savedTheme;
374
+ }
375
+
376
+ // Keyboard support
377
+ document.addEventListener('keydown', function(e) {
378
+ if (e.code === 'Space' || e.key === ' ') {
379
+ e.preventDefault();
380
+ incrementCount();
381
+ }
382
+ });
383
+ });
384
+ </script>
385
+ <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=amirpoorazima/salavat-shomar" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
386
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ صلوات شمار