Moatsim1471 commited on
Commit
ec16a1a
·
verified ·
1 Parent(s): aee6cea

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +435 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Batcave
3
- emoji: 💻
4
- colorFrom: green
5
- colorTo: blue
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: batcave
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: gray
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,435 @@
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="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Islamic Prayer Times - Waterford</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=Poppins:wght@300;400;500;600;700&display=swap');
11
+
12
+ body {
13
+ font-family: 'Poppins', sans-serif;
14
+ background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
15
+ min-height: 100vh;
16
+ }
17
+
18
+ .prayer-card {
19
+ transition: all 0.3s ease;
20
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
21
+ }
22
+
23
+ .prayer-card:hover {
24
+ transform: translateY(-5px);
25
+ }
26
+
27
+ .active-prayer {
28
+ background: linear-gradient(135deg, #10b981 0%, #059669 100%);
29
+ color: white;
30
+ }
31
+
32
+ .loader {
33
+ border-top-color: #3b82f6;
34
+ animation: spin 1s linear infinite;
35
+ }
36
+
37
+ @keyframes spin {
38
+ 0% { transform: rotate(0deg); }
39
+ 100% { transform: rotate(360deg); }
40
+ }
41
+
42
+ .mosque-icon {
43
+ position: absolute;
44
+ bottom: -20px;
45
+ right: -20px;
46
+ opacity: 0.1;
47
+ font-size: 8rem;
48
+ transform: rotate(15deg);
49
+ }
50
+
51
+ .waterford-bg {
52
+ background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Waterford_quays.jpg/1200px-Waterford_quays.jpg');
53
+ background-size: cover;
54
+ background-position: center;
55
+ background-blend-mode: overlay;
56
+ background-color: rgba(30, 58, 138, 0.7);
57
+ }
58
+ </style>
59
+ </head>
60
+ <body class="text-gray-100">
61
+ <div class="container mx-auto px-4 py-8 max-w-4xl">
62
+ <!-- Header -->
63
+ <header class="text-center mb-8">
64
+ <div class="flex justify-center items-center mb-4">
65
+ <i class="fas fa-mosque text-4xl mr-3 text-yellow-300"></i>
66
+ <h1 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-yellow-300 to-yellow-500 bg-clip-text text-transparent">
67
+ Prayer Times in Waterford
68
+ </h1>
69
+ </div>
70
+ <p class="text-gray-200">Accurate prayer times for Waterford, Ireland</p>
71
+ </header>
72
+
73
+ <!-- Main Content -->
74
+ <main>
75
+ <!-- Location and Date Info -->
76
+ <div class="waterford-bg bg-white/10 backdrop-blur-sm rounded-xl p-6 mb-8 relative overflow-hidden">
77
+ <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-4">
78
+ <div>
79
+ <h2 class="text-xl font-semibold mb-1">Waterford, Ireland</h2>
80
+ <p class="text-gray-300" id="hijri-date"></p>
81
+ </div>
82
+ <div class="text-right mt-2 md:mt-0">
83
+ <p class="text-2xl font-bold" id="gregorian-date"></p>
84
+ <p class="text-gray-300" id="gregorian-day"></p>
85
+ </div>
86
+ </div>
87
+ <i class="fas fa-mosque mosque-icon"></i>
88
+ </div>
89
+
90
+ <!-- Prayer Times Cards -->
91
+ <div id="prayer-times-container" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8">
92
+ <!-- Loading state -->
93
+ <div class="col-span-full flex justify-center py-12">
94
+ <div class="loader h-12 w-12 rounded-full border-4 border-t-4 border-gray-200"></div>
95
+ </div>
96
+ </div>
97
+
98
+ <!-- Calculation Method Selector -->
99
+ <div class="bg-white/10 backdrop-blur-sm rounded-xl p-6 mb-8">
100
+ <h3 class="text-lg font-semibold mb-4">Calculation Method</h3>
101
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-3">
102
+ <button onclick="updateMethod('MWL')" class="method-btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg transition">Muslim World League</button>
103
+ <button onclick="updateMethod('ISNA')" class="method-btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg transition">Islamic Society of North America</button>
104
+ <button onclick="updateMethod('Egypt')" class="method-btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg transition">Egyptian General Authority</button>
105
+ <button onclick="updateMethod('Makkah')" class="method-btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg transition">Umm al-Qura, Makkah</button>
106
+ </div>
107
+ </div>
108
+
109
+ <!-- Next Prayer Notification -->
110
+ <div id="next-prayer-notification" class="hidden bg-green-600/90 backdrop-blur-sm rounded-xl p-4 mb-8 flex items-center">
111
+ <i class="fas fa-bell text-2xl mr-4"></i>
112
+ <div>
113
+ <p class="font-semibold">Next Prayer: <span id="next-prayer-name"></span> at <span id="next-prayer-time"></span></p>
114
+ <p class="text-sm opacity-90" id="time-remaining"></p>
115
+ </div>
116
+ </div>
117
+
118
+ <!-- Time Zone Info -->
119
+ <div class="bg-white/10 backdrop-blur-sm rounded-xl p-6 text-center">
120
+ <p><i class="fas fa-clock mr-2"></i> All times are in <strong>Irish Standard Time (IST)</strong> or <strong>Greenwich Mean Time (GMT)</strong> depending on season</p>
121
+ </div>
122
+ </main>
123
+
124
+ <!-- Footer -->
125
+ <footer class="text-center text-gray-300 text-sm mt-12">
126
+ <p>Made with <i class="fas fa-heart text-red-400"></i> for the Muslim community in Waterford</p>
127
+ <p class="mt-1">Data provided by <a href="https://aladhan.com" class="text-blue-300 hover:underline" target="_blank">AlAdhan API</a></p>
128
+ </footer>
129
+ </div>
130
+
131
+ <script>
132
+ // Global variables
133
+ const waterfordLocation = {
134
+ lat: 52.2583, // Waterford latitude
135
+ long: -7.1119, // Waterford longitude
136
+ timezone: "Europe/Dublin" // Waterford timezone
137
+ };
138
+
139
+ let prayerTimes = {};
140
+ let currentMethod = 'MWL';
141
+ let nextPrayerTimer = null;
142
+
143
+ // DOM Elements
144
+ const hijriDateElement = document.getElementById('hijri-date');
145
+ const gregorianDateElement = document.getElementById('gregorian-date');
146
+ const gregorianDayElement = document.getElementById('gregorian-day');
147
+ const prayerTimesContainer = document.getElementById('prayer-times-container');
148
+ const nextPrayerNotification = document.getElementById('next-prayer-notification');
149
+ const nextPrayerNameElement = document.getElementById('next-prayer-name');
150
+ const nextPrayerTimeElement = document.getElementById('next-prayer-time');
151
+ const timeRemainingElement = document.getElementById('time-remaining');
152
+
153
+ // Prayer names with icons
154
+ const prayerNames = {
155
+ Fajr: { name: 'Fajr', icon: 'sun', color: 'bg-blue-600' },
156
+ Sunrise: { name: 'Sunrise', icon: 'sun', color: 'bg-yellow-500' },
157
+ Dhuhr: { name: 'Dhuhr', icon: 'sun', color: 'bg-orange-500' },
158
+ Asr: { name: 'Asr', icon: 'sun', color: 'bg-red-500' },
159
+ Maghrib: { name: 'Maghrib', icon: 'moon', color: 'bg-purple-600' },
160
+ Isha: { name: 'Isha', icon: 'moon', color: 'bg-indigo-700' }
161
+ };
162
+
163
+ // Initialize the app
164
+ document.addEventListener('DOMContentLoaded', () => {
165
+ updateDates();
166
+ fetchPrayerTimes();
167
+
168
+ // Update prayer times every hour
169
+ setInterval(fetchPrayerTimes, 3600000);
170
+ });
171
+
172
+ // Fetch prayer times from API for Waterford
173
+ async function fetchPrayerTimes() {
174
+ try {
175
+ const today = new Date();
176
+ const dateStr = `${today.getDate()}-${today.getMonth() + 1}-${today.getFullYear()}`;
177
+
178
+ // Include timezone parameter for accurate time conversion
179
+ const response = await fetch(
180
+ `https://api.aladhan.com/v1/timings/${dateStr}?latitude=${waterfordLocation.lat}&longitude=${waterfordLocation.long}&method=${currentMethod}&timezonestring=${waterfordLocation.timezone}`
181
+ );
182
+
183
+ const data = await response.json();
184
+
185
+ if (data.code === 200) {
186
+ prayerTimes = data.data.timings;
187
+ displayPrayerTimes();
188
+ updateNextPrayerNotification();
189
+ } else {
190
+ throw new Error(data.data);
191
+ }
192
+ } catch (error) {
193
+ console.error("Error fetching prayer times:", error);
194
+ prayerTimesContainer.innerHTML = `
195
+ <div class="col-span-full bg-red-500/20 p-4 rounded-lg text-center">
196
+ <i class="fas fa-exclamation-triangle mr-2"></i>
197
+ Failed to load prayer times. Please try again later.
198
+ </div>
199
+ `;
200
+ }
201
+ }
202
+
203
+ // Display prayer times in cards
204
+ function displayPrayerTimes() {
205
+ let html = '';
206
+
207
+ for (const [key, value] of Object.entries(prayerTimes)) {
208
+ if (prayerNames[key]) {
209
+ const prayer = prayerNames[key];
210
+ const time = formatTime(value);
211
+
212
+ html += `
213
+ <div class="prayer-card ${prayer.color} rounded-xl p-5 text-white relative overflow-hidden">
214
+ <div class="flex items-center mb-3">
215
+ <i class="fas fa-${prayer.icon} text-xl mr-3"></i>
216
+ <h3 class="text-xl font-semibold">${prayer.name}</h3>
217
+ </div>
218
+ <p class="text-3xl font-bold mb-2">${time}</p>
219
+ <p class="text-sm opacity-90">${getPrayerDescription(key)}</p>
220
+ <i class="fas fa-${prayer.icon} mosque-icon"></i>
221
+ </div>
222
+ `;
223
+ }
224
+ }
225
+
226
+ prayerTimesContainer.innerHTML = html;
227
+ highlightCurrentPrayer();
228
+ }
229
+
230
+ // Format time to 12-hour format with AM/PM
231
+ function formatTime(timeStr) {
232
+ const [hours, minutes] = timeStr.split(':').map(Number);
233
+ const period = hours >= 12 ? 'PM' : 'AM';
234
+ const displayHours = hours % 12 || 12;
235
+ return `${displayHours}:${minutes.toString().padStart(2, '0')} ${period}`;
236
+ }
237
+
238
+ // Get prayer description
239
+ function getPrayerDescription(prayerName) {
240
+ const descriptions = {
241
+ Fajr: 'The dawn prayer before sunrise',
242
+ Sunrise: 'The time when the sun rises',
243
+ Dhuhr: 'The midday prayer after the sun passes its zenith',
244
+ Asr: 'The afternoon prayer',
245
+ Maghrib: 'The prayer just after sunset',
246
+ Isha: 'The night prayer'
247
+ };
248
+ return descriptions[prayerName] || '';
249
+ }
250
+
251
+ // Highlight current prayer
252
+ function highlightCurrentPrayer() {
253
+ const now = new Date();
254
+ const currentTime = now.getHours() * 60 + now.getMinutes();
255
+
256
+ // Convert prayer times to minutes since midnight for comparison
257
+ const prayerTimesInMinutes = {};
258
+ for (const [key, value] of Object.entries(prayerTimes)) {
259
+ if (prayerNames[key]) {
260
+ const [hours, minutes] = value.split(':').map(Number);
261
+ prayerTimesInMinutes[key] = hours * 60 + minutes;
262
+ }
263
+ }
264
+
265
+ // Determine which prayer is currently active
266
+ let activePrayer = null;
267
+ const prayerOrder = ['Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', 'Isha'];
268
+
269
+ for (let i = 0; i < prayerOrder.length; i++) {
270
+ const prayer = prayerOrder[i];
271
+ if (currentTime < prayerTimesInMinutes[prayer]) {
272
+ if (i > 0) {
273
+ activePrayer = prayerOrder[i - 1];
274
+ }
275
+ break;
276
+ }
277
+ }
278
+
279
+ // If no prayer found (after Isha), then it's before Fajr next day
280
+ if (!activePrayer && currentTime > prayerTimesInMinutes['Isha']) {
281
+ activePrayer = 'Isha';
282
+ }
283
+
284
+ // Highlight the active prayer card
285
+ const prayerCards = document.querySelectorAll('.prayer-card');
286
+ prayerCards.forEach(card => {
287
+ card.classList.remove('active-prayer');
288
+ const prayerName = card.querySelector('h3').textContent;
289
+ if (prayerName === activePrayer) {
290
+ card.classList.add('active-prayer');
291
+ }
292
+ });
293
+ }
294
+
295
+ // Update next prayer notification
296
+ function updateNextPrayerNotification() {
297
+ clearTimeout(nextPrayerTimer);
298
+
299
+ const now = new Date();
300
+ const currentTime = now.getHours() * 60 + now.getMinutes();
301
+
302
+ // Convert prayer times to minutes since midnight for comparison
303
+ const prayerTimesInMinutes = {};
304
+ for (const [key, value] of Object.entries(prayerTimes)) {
305
+ if (prayerNames[key]) {
306
+ const [hours, minutes] = value.split(':').map(Number);
307
+ prayerTimesInMinutes[key] = hours * 60 + minutes;
308
+ }
309
+ }
310
+
311
+ // Find the next prayer
312
+ const prayerOrder = ['Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', 'Isha'];
313
+ let nextPrayer = null;
314
+ let nextPrayerTime = null;
315
+
316
+ for (const prayer of prayerOrder) {
317
+ if (currentTime < prayerTimesInMinutes[prayer]) {
318
+ nextPrayer = prayer;
319
+ nextPrayerTime = prayerTimesInMinutes[prayer];
320
+ break;
321
+ }
322
+ }
323
+
324
+ // If no next prayer found (after Isha), then next is Fajr tomorrow
325
+ if (!nextPrayer) {
326
+ nextPrayer = 'Fajr';
327
+ nextPrayerTime = prayerTimesInMinutes['Fajr'] + 1440; // Add 24 hours in minutes
328
+ }
329
+
330
+ // Update notification
331
+ if (nextPrayer) {
332
+ nextPrayerNotification.classList.remove('hidden');
333
+ nextPrayerNameElement.textContent = nextPrayer;
334
+ nextPrayerTimeElement.textContent = formatTime(prayerTimes[nextPrayer]);
335
+
336
+ // Calculate time remaining
337
+ const timeRemaining = nextPrayerTime - currentTime;
338
+ updateTimeRemainingDisplay(timeRemaining);
339
+
340
+ // Update every minute
341
+ nextPrayerTimer = setInterval(() => {
342
+ const newNow = new Date();
343
+ const newCurrentTime = newNow.getHours() * 60 + newNow.getMinutes();
344
+ const newTimeRemaining = nextPrayerTime - newCurrentTime;
345
+
346
+ if (newTimeRemaining <= 0) {
347
+ // Prayer time reached, refresh data
348
+ fetchPrayerTimes();
349
+ clearTimeout(nextPrayerTimer);
350
+ } else {
351
+ updateTimeRemainingDisplay(newTimeRemaining);
352
+ }
353
+ }, 60000); // Update every minute
354
+ }
355
+ }
356
+
357
+ // Update time remaining display
358
+ function updateTimeRemainingDisplay(minutes) {
359
+ const hours = Math.floor(minutes / 60);
360
+ const mins = minutes % 60;
361
+
362
+ if (hours > 0) {
363
+ timeRemainingElement.textContent = `${hours} hour${hours !== 1 ? 's' : ''} and ${mins} minute${mins !== 1 ? 's' : ''} remaining`;
364
+ } else {
365
+ timeRemainingElement.textContent = `${mins} minute${mins !== 1 ? 's' : ''} remaining`;
366
+ }
367
+ }
368
+
369
+ // Update calculation method
370
+ function updateMethod(method) {
371
+ currentMethod = method;
372
+ fetchPrayerTimes();
373
+
374
+ // Update active method button
375
+ const methodButtons = document.querySelectorAll('.method-btn');
376
+ methodButtons.forEach(btn => {
377
+ btn.classList.remove('bg-blue-700');
378
+ btn.classList.add('bg-blue-600');
379
+ });
380
+
381
+ event.target.classList.remove('bg-blue-600');
382
+ event.target.classList.add('bg-blue-700');
383
+ }
384
+
385
+ // Update date displays
386
+ function updateDates() {
387
+ const today = new Date();
388
+
389
+ // Format for Ireland locale
390
+ const options = {
391
+ timeZone: 'Europe/Dublin',
392
+ weekday: 'long',
393
+ year: 'numeric',
394
+ month: 'long',
395
+ day: 'numeric'
396
+ };
397
+
398
+ // Gregorian date
399
+ gregorianDateElement.textContent = today.toLocaleDateString('en-IE', {
400
+ timeZone: 'Europe/Dublin',
401
+ month: 'long',
402
+ day: 'numeric'
403
+ });
404
+
405
+ gregorianDayElement.textContent = today.toLocaleDateString('en-IE', {
406
+ timeZone: 'Europe/Dublin',
407
+ weekday: 'long',
408
+ year: 'numeric'
409
+ });
410
+
411
+ // Hijri date (approximation)
412
+ fetchHijriDate(today);
413
+ }
414
+
415
+ // Fetch Hijri date from API
416
+ async function fetchHijriDate(gregorianDate) {
417
+ try {
418
+ const dateStr = `${gregorianDate.getDate()}-${gregorianDate.getMonth() + 1}-${gregorianDate.getFullYear()}`;
419
+ const response = await fetch(`https://api.aladhan.com/v1/gToH?date=${dateStr}`);
420
+ const data = await response.json();
421
+
422
+ if (data.code === 200) {
423
+ const hijri = data.data.hijri;
424
+ hijriDateElement.textContent = `${hijri.day} ${hijri.month.en} ${hijri.year} AH`;
425
+ }
426
+ } catch (error) {
427
+ console.error("Error fetching Hijri date:", error);
428
+ // Fallback to approximate calculation if API fails
429
+ const approxHijriYear = Math.floor((gregorianDate.getFullYear() - 622) * (33 / 32));
430
+ hijriDateElement.textContent = `Approx. ${approxHijriYear} AH`;
431
+ }
432
+ }
433
+ </script>
434
+ <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=Moatsim1471/batcave" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
435
+ </html>
prompts.txt ADDED
File without changes