From d345cebc8df2936a40faca25731340bc602f2581 Mon Sep 17 00:00:00 2001 From: a7med02 Date: Wed, 30 Apr 2025 12:00:47 +0100 Subject: [PATCH] 'add salat time section ' --- .DS_Store | Bin 6148 -> 0 bytes src/.gitignore | 3 ++- src/home/DomManager.js | 1 + src/home/SalatTime.js | 24 ++++++++++++++++++++++++ src/home/app.css | 34 +++++++++++++++++++++++++++++++++- src/home/index.html | 12 ++++++++++++ src/manifest.json | 4 ++-- 7 files changed, 74 insertions(+), 4 deletions(-) delete mode 100644 .DS_Store create mode 100644 src/home/SalatTime.js diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5172429f264de2441865cb4700216d4256da9242..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~J!%6%427R!7lt%jx}3%b$PET#pTHLgIFQEJ;E>dF^gR7ES*H$5cmnB-G%I%Z zD|S`@Z2$T80!#olbXV*=%*>dt@PRwdU#I)^a=X5>;#J@&VrHyNnC;iLL0pQvfVyTmjO&;ssLc!1UOG})p;=82 zR;?Ceh}WZ?+UmMqI#RP8R>OzYoz15hnq@nzF`-!xQ4j$Um=RcIKKc27r2jVm&svm< zfC&6E0=7P!4tu^-ovjbA=k?dB`g+i*aXG_}p8zI)6mRKa+;6_1_R^8c3Qa!(fk8n8 H{*=HsM+*^= diff --git a/src/.gitignore b/src/.gitignore index 2f6ba9b..5eb8b43 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,2 +1,3 @@ .DS* -.vs* \ No newline at end of file +.vs* +*.Identifier \ No newline at end of file diff --git a/src/home/DomManager.js b/src/home/DomManager.js index 3a1dc79..02148ab 100644 --- a/src/home/DomManager.js +++ b/src/home/DomManager.js @@ -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() { diff --git a/src/home/SalatTime.js b/src/home/SalatTime.js new file mode 100644 index 0000000..5379703 --- /dev/null +++ b/src/home/SalatTime.js @@ -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(); \ No newline at end of file diff --git a/src/home/app.css b/src/home/app.css index 3092d0f..10fadee 100644 --- a/src/home/app.css +++ b/src/home/app.css @@ -136,4 +136,36 @@ main { to { filter : blur(0px); } -} \ No newline at end of file +} + +/* ****************************************** */ +/* 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; +} + +/* ****************************************** */ \ No newline at end of file diff --git a/src/home/index.html b/src/home/index.html index d8fa1f2..0cd8953 100644 --- a/src/home/index.html +++ b/src/home/index.html @@ -6,9 +6,20 @@ + +
+
+
    +
  • Fajr
  • +
  • Dhuhr
  • +
  • Asr
  • +
  • Maghrib
  • +
  • Isha
  • +
+
@@ -24,5 +35,6 @@
+ \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 8d8c534..084cfb4 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -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"