-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path99-names.html
252 lines (223 loc) · 5.95 KB
/
99-names.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>99 Names of Allah</title>
<style>
/* General Body Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
min-height: 100vh;
padding-top: 10px;
direction: rtl; /* Set the text and layout direction to RTL */
}
/* Container for names list */
#namesList {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 20px;
padding: 20px;
width: 100%;
max-width: 1200px;
overflow-y: auto;
height: 100vh; /* Make it scrollable */
box-sizing: border-box;
direction: rtl; /* Ensure the names are displayed from right to left */
}
/* Circle styles for each name */
.name-circle {
display: flex;
align-items: center;
justify-content: center;
width: 120px;
height: 120px;
background-image: url('https://quran-online.pages.dev/images/1000080753-removebg-preview.png');
background-size: cover;
background-position: center;
border-radius: 50%;
color: white;
font-size: 1.2em;
cursor: pointer;
transition: transform 0.3s ease-in-out;
text-align: center;
user-select: none;
position: relative;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}
.name-circle:hover {
transform: scale(1.1); /* Slight zoom on hover */
}
/* Popup modal styles */
.popup {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7); /* Dark background overlay */
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
/* Popup Content */
.popup-content {
background: linear-gradient(to bottom right, #3b8d99, #6b6e6b); /* Gradient background */
padding: 40px;
border-radius: 15px;
max-width: 600px;
width: 80%;
text-align: center;
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3);
position: relative;
color: white;
}
/* Arabic Name in a prominent circle in the popup */
.popup-name-circle {
display: flex;
align-items: center;
justify-content: center;
width: 150px;
height: 150px;
background-image: url('https://quran-online.pages.dev/images/1000080753-removebg-preview.png');
background-size: cover;
background-position: center;
border-radius: 50%;
color: white;
font-size: 2.5em;
text-align: center;
user-select: none;
margin: 0 auto 20px auto;
}
/* Popup Heading */
.popup h3 {
font-size: 2.2em;
margin: 0;
color: #ffeb3b;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
margin-bottom: 15px;
}
/* Popup Text */
.popup p {
font-size: 1.1em;
margin: 10px 0;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}
/* Close Button */
.close-btn {
cursor: pointer;
padding: 12px 18px;
background-color: #f44336;
color: white;
border-radius: 50%;
position: absolute;
top: 10px;
right: 10px;
font-size: 1.5em;
transition: background-color 0.3s ease;
}
.close-btn:hover {
background-color: #d32f2f;
}
/* Style for background overlay */
.popup-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* Darker overlay */
}
/* Responsive Design for Smaller Screens */
@media (max-width: 600px) {
h1 {
font-size: 2em;
}
.name-circle {
width: 100px;
height: 100px;
font-size: 1em;
}
.popup-content {
padding: 20px;
width: 90%;
}
.popup-name-circle {
width: 120px;
height: 120px;
font-size: 2em;
}
}
</style>
</head>
<body>
<div id="namesList">
<!-- Names will be inserted here -->
</div>
<!-- Popup Modal -->
<div id="popup" class="popup">
<div class="popup-background" onclick="closePopup()"></div> <!-- Click outside to close -->
<div class="popup-content">
<div class="close-btn" onclick="closePopup()">×</div>
<div id="popupNameCircle" class="popup-name-circle">
<!-- Arabic name will go here -->
</div>
<h3 id="popupName"></h3>
<p id="popupTransliteration"></p>
<p id="popupMeaning"></p>
</div>
</div>
<script>
let namesData = [];
// Fetch the Names Data from a JSON source
fetch('https://raw.githubusercontent.com/itzfew/Quran-Online/refs/heads/main/source/names-of-allah.json')
.then(response => response.json())
.then(data => {
namesData = data;
displayNames(); // Display all names and meanings
})
.catch(error => {
console.error("Error fetching names:", error);
alert("Failed to load names.");
});
// Function to display all names and their meanings in circles
function displayNames() {
const namesList = document.getElementById('namesList');
// Loop through all names and create a circle for each one
namesData.forEach((name, index) => {
const nameDiv = document.createElement('div');
nameDiv.classList.add('name-circle');
const nameText = document.createElement('span');
nameText.innerHTML = name.name; // Display Arabic name in the circle
nameDiv.appendChild(nameText);
nameDiv.setAttribute('data-index', index);
nameDiv.onclick = () => openPopup(index);
namesList.appendChild(nameDiv);
});
}
// Open popup with detailed information
function openPopup(index) {
const name = namesData[index];
// Set Arabic name in the popup
document.getElementById('popupNameCircle').textContent = name.name;
document.getElementById('popupTransliteration').textContent = `Transliteration: ${name.transliteration}`;
document.getElementById('popupMeaning').textContent = `Meaning: ${name.meaning}`;
// Show the popup
document.getElementById('popup').style.display = 'flex';
}
// Close the popup
function closePopup() {
document.getElementById('popup').style.display = 'none';
}
</script>
</body>
</html>