Skip to content

'add salat time section ' #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS*
.vs*
.vs*
*.Identifier
1 change: 1 addition & 0 deletions src/home/DomManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class DomManager {
this.textAr = document.querySelector('.text-ar')
this.textEn = document.querySelector('.text-en')
this.nextBtn = document.querySelector('.btn-next')

}

async init() {
Expand Down
24 changes: 24 additions & 0 deletions src/home/SalatTime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function getuserLocation() {
navigator.geolocation.getCurrentPosition(
function(position) {
const lat = position.coords.latitude;
const lon = position.coords.longitude;
console.log('Latitude:', lat + ' Longitude:', lon);
const url = `https://api.aladhan.com/v1/timings?latitude=${lat}&longitude=${lon}`;
fetch(url)
.then(response => response.json())
.then(data => {
const salatimes = data.data.timings;
console.log(salatimes);
document.getElementById('fajr-time').innerText = salatimes.Fajr;
document.getElementById('dhuhr-time').innerText = salatimes.Dhuhr;
document.getElementById('asr-time').innerText = salatimes.Asr;
document.getElementById('maghrib-time').innerText = salatimes.Maghrib;
document.getElementById('isha-time').innerText = salatimes.Isha;
})
.catch(error => console.error('Error fetching salat times:', error));
}
)
}

getuserLocation();
34 changes: 33 additions & 1 deletion src/home/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,36 @@ main {
to {
filter : blur(0px);
}
}
}

/* ****************************************** */
/* add by abouregb */
/* related to salat time */
.salatime{

background: rgba(28, 33, 38, 0.5);
width: 100vw;
max-width: 1000px;
height: 100px;
color: white;
}
.salatime-item{
margin-top: 10px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 20pt;
font-family: 'myfont';
}
.salatime-item div:hover{
color: aqua;
cursor: pointer;
}

li{
list-style: none;
}

/* ****************************************** */
12 changes: 12 additions & 0 deletions src/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@
<title></title>
<link rel="stylesheet" href="app.css">
<link rel="shortcut icon" href="../icons/icon128.png" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

</head>
<body>
<main class="flex flex-col">
<div class="salatime">
<ul class="salatime-item">
<li>Fajr <br><span id="fajr-time"></span></li>
<li>Dhuhr <br><span id="dhuhr-time"></span></li>
<li>Asr <br><span id="asr-time"></span></li>
<li>Maghrib <br><span id="maghrib-time"></span></li>
<li>Isha <br><span id="isha-time"></span></li>
</ul>
</div>
<div class="text-body flex flex-col">
<div class="sura-info flex flex-col">
<div class="info ar-info flex text-sm">
Expand All @@ -24,5 +35,6 @@
</div>
</main>
<script src="./app.js" type="module"></script>
<script src="./SalatTime.js" type="module"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
"128": "icons/.png"
}
},
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
"128": "icons/.png"
},
"chrome_url_overrides" : {
"newtab" : "home/index.html"
Expand Down