-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathquranmp3.html
275 lines (236 loc) · 7.91 KB
/
quranmp3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quran Podcast</title>
<!-- Styling for the podcast page -->
<style>
/* General Body Styling */
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f7fa;
color: #333;
}
/* Main Container */
.container {
max-width: 1000px;
margin: 20px auto;
padding: 20px;
background-color: #ffffff;
border-radius: 15px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
/* Header */
header {
text-align: center;
margin-bottom: 30px;
}
header img {
width: 150px;
height: 150px;
border-radius: 50%;
}
header h1 {
font-size: 2.5em;
margin-top: 10px;
color: #004d40;
}
header p {
font-size: 1.2em;
color: #555;
}
/* Podcast List */
#podcast-list {
list-style-type: none;
padding: 0;
}
.podcast-item {
padding: 20px;
border-bottom: 1px solid #e0e0e0;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
background-color: #fafafa;
border-radius: 8px;
margin-bottom: 15px;
display: flex;
align-items: center;
}
.podcast-item:hover {
background-color: #e0f2f1;
transform: translateX(10px);
}
.podcast-item .number {
width: 50px;
height: 50px;
border-radius: 50%;
background-image: url('https://quran-online.pages.dev/source/download.png');
background-size: cover;
background-position: center;
color: black;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.5em;
font-weight: bold;
margin-right: 20px;
}
.podcast-item h3 {
color: #00796b;
font-size: 1.8em;
margin: 0;
}
.podcast-item p {
color: #555;
font-size: 1em;
}
.podcast-item .pub-date {
color: #888;
font-size: 0.9em;
}
/* Detailed Podcast View */
#podcast-detail {
display: none;
text-align: center;
}
.detail-title {
font-size: 2.5em;
color: #004d40;
margin-bottom: 20px;
}
.detail-description {
font-size: 1.2em;
margin-bottom: 30px;
color: #444;
}
.detail-date {
font-size: 1em;
color: #888;
margin-bottom: 20px;
}
/* Audio Player Styling */
audio {
width: 80%;
margin-top: 10px;
border-radius: 8px;
}
/* Back Button */
button {
padding: 10px 20px;
font-size: 1.2em;
background-color: #00796b;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #004d40;
}
</style>
</head>
<body>
<div class="container">
<!-- Header with podcast image and title -->
<header>
<img src="https://quran-online.pages.dev/images/quranmp3.png" alt="Quran Podcast">
<h1>Quran Podcast</h1>
<p>A podcast that recites the Quran and explains its meanings.</p>
</header>
<!-- List of Podcasts -->
<ul id="podcast-list"></ul>
<!-- Detailed Podcast View (Hidden by default) -->
<div id="podcast-detail">
<h2 class="detail-title" id="detail-title"></h2>
<p class="detail-description" id="detail-description"></p>
<p class="detail-date" id="detail-date"></p>
<audio controls id="detail-audio">
<source id="detail-audio-source" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<br>
<button onclick="goBack()">Back to List</button>
</div>
</div>
<script>
// URL of the podcast base URL (for dynamically generating audio URLs)
const baseAudioUrl = 'https://cdn.islamic.network/quran/audio-surah/128/ar.alafasy/';
// Function to fetch and display podcast data in a list format
async function fetchPodcastData() {
// Loop through 1 to 114 for the podcast files
for (let i = 1; i <= 114; i++) {
const audioUrl = `${baseAudioUrl}${i}.mp3`;
// Using simple metadata for each episode
const title = `Surah ${getSurahName(i)} Recitation`;
const description = `Recitation and explanation of Surah ${getSurahName(i)} by Alafasy.`;
const pubDate = `Mon, 03 Dec 2024 ${i}:00:00 GMT`;
// Create podcast item element
const podcastItem = document.createElement('li');
podcastItem.classList.add('podcast-item');
podcastItem.innerHTML = `
<div class="number">${i}</div>
<div>
<h3>${title}</h3>
<p>${description}</p>
<p class="pub-date"><strong>Published:</strong> ${pubDate}</p>
</div>
`;
// Add click event to load detailed view of the selected podcast
podcastItem.addEventListener('click', () => {
showPodcastDetail(title, description, audioUrl, pubDate);
});
// Append the item to the list
document.getElementById('podcast-list').appendChild(podcastItem);
}
}
// Function to get the name of the Surah by its number
function getSurahName(surahNumber) {
const surahNames = [
"Al-Fatiha", "Al-Baqarah", "Aali Imran", "An-Nisa'", "Al-Ma'idah", "Al-An'am",
"Al-A'raf", "Al-Anfal", "At-Tawbah", "Yunus", "Hud", "Yusuf", "Ibrahim", "Al-Hijr",
"An-Nahl", "Al-Isra", "Al-Kahf", "Maryam", "Taha", "Al-Anbiya", "Al-Hajj", "Al-Mu'minun",
"An-Nur", "Al-Furqan", "Ash-Shu'ara", "An-Naml", "Al-Ankabut", "Ar-Rum", "Luqman",
"As-Sajda", "Al-Ahzab", "Ya-Sin", "Az-Zumar", "Fussilat", "Al-Ahqaf", "Muhammad",
"Al-Fath", "Al-Hujurat", "Qamar", "Ar-Rahman", "Al-Waqi'a", "Al-Hadid", "Al-Mujadilah",
"Al-Hashr", "Al-Mumtahina", "As-Saff", "Al-Jumu'ah", "Al-Munafiqun", "At-Taghabun",
"At-Talaq", "At-Tahrim", "Al-Mulk", "Al-Qalam", "Al-Haqqah", "Al-Ma'arij", "Nuh",
"Al-Jinn", "Al-Muzzammil", "Al-Muddaththir", "Al-Qiyamah", "Al-Insan", "Al-Mursalat",
"An-Naba", "An-Nazi'at", "Abasa", "At-Takwir", "Al-Infitar", "Al-Mutaffifin",
"Al-Inshiqaq", "Al-Buruj", "At-Tariq", "Al-A'la", "Al-Ghashiyah", "Al-Fajr", "Al-Balad",
"Ash-Shams", "Al-Layl", "Adh-Dhuha", "Al-Sharh", "At-Tin", "Al-Alaq", "Al-Qadr",
"Al-Bayyina", "Az-Zalzalah", "Al-Adiyat", "Al-Qari'ah", "At-Takathur", "Al-Asr",
"Al-Humazah", "Al-Fil", "Quraish", "Al-Ma'un", "Al-Kawthar", "Al-Kafirun",
"An-Nasr", "Al-Masad", "Al-Ikhlas", "Al-Falaq", "An-Nas"
];
return surahNames[surahNumber - 1] || `Surah ${surahNumber}`;
}
// Function to show detailed view of the podcast on click
function showPodcastDetail(title, description, audioUrl, pubDate) {
// Hide the list
document.getElementById('podcast-list').style.display = 'none';
// Show the detailed view
document.getElementById('podcast-detail').style.display = 'block';
// Set the content of the detailed view
document.getElementById('detail-title').innerText = title;
document.getElementById('detail-description').innerText = description;
document.getElementById('detail-date').innerText = `Published on: ${pubDate}`;
document.getElementById('detail-audio-source').src = audioUrl;
// Reload the audio player to load the new source
const audioPlayer = document.getElementById('detail-audio');
audioPlayer.load();
}
// Function to go back to the podcast list
function goBack() {
// Show the list again
document.getElementById('podcast-list').style.display = 'block';
// Hide the detailed view
document.getElementById('podcast-detail').style.display = 'none';
}
// Fetch the podcast data when the page loads
fetchPodcastData();
</script>
</body>
</html>