-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
54 lines (52 loc) · 2.25 KB
/
main.js
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
function GetSalatName(city){
axios.get(`https://api.aladhan.com/v1/timingsByCity?city=${city}&country=Morocco&method=8`)
.then(response=>{
const data = response.data.data;
const timings = data.timings;
console.log(timings);
const content = `
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">صلاه الفجر</h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Fajr}</h1>
</span>
</div>
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">الشروق</h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Sunrise}</h1>
</span>
</div>
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">صلاه الظهر</h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Dhuhr}</h1>
</span>
</div>
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">صلاة العصر </h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Asr}</h1>
</span>
</div>
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">صلاة المغرب</h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Maghrib}</h1>
</span>
</div>
<div id="Day-Times">
<h1 class="font-black text-3xl mt-3">صلاة العشاء</h1>
<span>
<h1 class="font-black text-3xl mt-5">${timings.Isha}</h1>
</span>
</div>
`
document.querySelector('.Times-day').innerHTML = content;
})
}
document.getElementById('countries').onchange = (event) => {
const selectedCity = event.target.value;
GetSalatName(selectedCity);
};
GetSalatName('Casablanca');