-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathavrad.html
192 lines (163 loc) · 5.49 KB
/
avrad.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Avrad Fatiha Verses</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Scheherazade+New:wght@400;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
body {
font-family: 'Scheherazade New', serif;
background-color: #f9f9f9;
margin: 0;
padding: 20px;
text-align: center;
direction: rtl;
position: relative;
}
h1 {
font-size: 2em;
color: #003366;
margin-bottom: 10px;
}
h2 {
font-size: 1.5em;
color: #660000;
margin-bottom: 20px;
}
.verse {
font-size: 1.4em;
line-height: 2;
color: #444;
margin: 10px 0;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.verse:last-child {
border-bottom: none;
}
.highlight-1 {
color: #008000;
}
.highlight-32 {
color: #0000FF;
}
.highlight-44 {
color: #FFA500;
}
.highlight-54 {
color: #800080;
}
.highlight-72 {
color: #FF4500;
}
.highlight-145 {
color: #2E8B57;
}
.highlight-292 {
color: #DAA520;
}
.controls {
position: fixed;
top: 10px;
right: 10px;
background: #ffffff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.controls button {
font-size: 1.2em;
margin: 0 5px;
background: none;
border: none;
cursor: pointer;
color: #333;
}
footer {
margin-top: 20px;
font-size: 0.9em;
color: #777;
}
</style>
</head>
<body>
<div class="controls">
<button id="playPause"><i class="fa fa-play"></i></button>
<button id="speedDown"><i class="fa fa-minus"></i></button>
<span id="speedDisplay">Speed: 1x</span>
<button id="speedUp"><i class="fa fa-plus"></i></button>
</div>
<h1 id="bookName">...</h1>
<h2 id="writer">...</h2>
<div id="verses">
<!-- Verses will be injected here dynamically -->
</div>
<footer>
© 2025 Quran Online
</footer>
<script>
const url = "https://raw.githubusercontent.com/itzfew/Quran-Online/refs/heads/main/source/avrad-fatiha.json";
const versesContainer = document.getElementById('verses');
let scrollInterval;
let scrollSpeed = 50; // Initial scroll speed
// Fetch and render verses
fetch(url)
.then(response => response.json())
.then(data => {
document.getElementById('bookName').textContent = data.book_name;
document.getElementById('writer').textContent = `By: ${data.writer}`;
Object.keys(data.verses).forEach(key => {
const verseElement = document.createElement('div');
verseElement.className = 'verse';
verseElement.textContent = data.verses[key];
if (['1', '32', '44', '54', '72', '145', '292'].includes(key)) {
verseElement.classList.add(`highlight-${key}`);
}
versesContainer.appendChild(verseElement);
});
})
.catch(error => console.error('Error fetching the data:', error));
// Auto-scroll functionality
const startScroll = () => {
if (scrollInterval) return;
scrollInterval = setInterval(() => {
window.scrollBy(0, 1);
if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) {
clearInterval(scrollInterval);
scrollInterval = null;
}
}, scrollSpeed);
};
const stopScroll = () => {
clearInterval(scrollInterval);
scrollInterval = null;
};
// Control buttons
const playPauseButton = document.getElementById('playPause');
const speedDisplay = document.getElementById('speedDisplay');
const speedUpButton = document.getElementById('speedUp');
const speedDownButton = document.getElementById('speedDown');
playPauseButton.addEventListener('click', () => {
if (scrollInterval) {
stopScroll();
playPauseButton.innerHTML = '<i class="fa fa-play"></i>';
} else {
startScroll();
playPauseButton.innerHTML = '<i class="fa fa-pause"></i>';
}
});
speedUpButton.addEventListener('click', () => {
if (scrollSpeed > 10) scrollSpeed -= 10;
speedDisplay.textContent = `Speed: ${(50 / scrollSpeed).toFixed(1)}x`;
});
speedDownButton.addEventListener('click', () => {
scrollSpeed += 10;
speedDisplay.textContent = `Speed: ${(50 / scrollSpeed).toFixed(1)}x`;
});
</script>
</body>
</html>