diff --git a/adhan.pyw b/adhan.pyw new file mode 100644 index 0000000..e2427e3 --- /dev/null +++ b/adhan.pyw @@ -0,0 +1,152 @@ +from bs4 import BeautifulSoup +import requests +from datetime import datetime, time + + +website = 'https://www.halaltrip.com/prayertimes/muslim-salat-prayer-times/?name=Slough&f=Slough%2C+UK&l=Slough&s=&c=United+Kingdom&lat=51.4989355&lng=-0.5612772&no_days=7&cal_method=3&asr_method=2&higher_lat=2&cruising_height=11800' #Change the URL to the placve you live +result = requests.get(website) +content = result.text + + +soup = BeautifulSoup(content, 'lxml') + + +prayerTime = soup.find('ul', class_='tm-horizontal-listitem clearfix highlighted').get_text() + + +print(prayerTime) + + +lines = prayerTime.split('\n')[1:-1] + + +lines = prayerTime.split('\n')[1:-1] + +lines = prayerTime.split('\n')[1:-1] + + +del lines[0] +del lines[1] + + +lines = [line.replace(':00', ':0') for line in lines] + + +fajrHour, fajrMin = map(int, lines[0].split(':')) +zuhrHour, zuhrMin = map(int, lines[1].replace('00', '0').split(':')) +asrHour, asrMin = map(int, lines[2].split(':')) +maghribHour, maghribMin = map(int, lines[3].split(':')) +ishaHour, ishaMin = map(int, lines[4].split(':')) + + +lines = [line.lstrip('0') if line[0] == '0' else line for line in lines] + + +lines = [line[:-2] + line[-1] if line[-2] == '0' else line for line in lines] + + +fajrHour, fajrMin = map(int, lines[0].split(':')) +zuhrHour, zuhrMin = map(int, lines[1].split(':')) +asrHour, asrMin = map(int, lines[2].split(':')) +maghribHour, maghribMin = map(int, lines[3].split(':')) +ishaHour, ishaMin = map(int, lines[4].split(':')) + +current_time = datetime.now().time() + + +fajr_time = time(fajrHour, fajrMin) +zuhr_time = time(zuhrHour, zuhrMin) +asr_time = time(asrHour, asrMin) +maghrib_time = time(maghribHour, maghribMin) +isha_time = time(ishaHour, ishaMin) + + +if current_time < fajr_time: + next_prayer = "Fajr" + next_prayer_hour = fajrHour + next_prayer_min = fajrMin +elif current_time < zuhr_time: + next_prayer = "Zuhr" + next_prayer_hour = zuhrHour + next_prayer_min = zuhrMin +elif current_time < asr_time: + next_prayer = "Asr" + next_prayer_hour = asrHour + next_prayer_min = asrMin +elif current_time < maghrib_time: + next_prayer = "Maghrib" + next_prayer_hour = maghribHour + next_prayer_min = maghribMin +elif current_time < isha_time: + next_prayer = "Isha" + next_prayer_hour = ishaHour + next_prayer_min = ishaMin +else: + next_prayer = "Fajr" + next_prayer_hour = fajrHour + next_prayer_min = fajrMin + + +print(next_prayer, next_prayer_hour, next_prayer_min) + + +with open('name.txt', 'w') as file: + file.write(f'{next_prayer}\n') + +with open('hours.txt', 'w') as file: + file.write(f'{next_prayer_hour}\n') + +with open('minutes.txt', 'w') as file: + file.write(f'{next_prayer_min}\n') + + +print(f"Fajr: {fajrHour}:{fajrMin}") +print(f"Zuhr: {zuhrHour}:{zuhrMin}") +print(f"Asr: {asrHour}:{asrMin}") +print(f"Maghrib: {maghribHour}:{maghribMin}") +print(f"Isha: {ishaHour}:{ishaMin}") + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# prayerTime = soup.find('span', class_='text-light prayer-margin-left').get_text() + +# prayerTimeFormatted = prayerTime.replace(" ", "").replace("\n", "") +# prayerTimeFormatted = prayerTimeFormatted[:-3] +# hours, minutes = prayerTimeFormatted.split(':') + + + + +# filePrayerName = open("name.txt", "w") +# filePrayerName.write(prayerName) + +# filePrayerTime = open("hours.txt", "w") +# filePrayerTime.write(hours) + +# filePrayerTime = open("minutes.txt", "w") +# filePrayerTime.write(minutes) \ No newline at end of file diff --git a/fonts/Product Sans Bold Italic.ttf b/fonts/Product Sans Bold Italic.ttf new file mode 100644 index 0000000..129d12d Binary files /dev/null and b/fonts/Product Sans Bold Italic.ttf differ diff --git a/fonts/Product Sans Bold.ttf b/fonts/Product Sans Bold.ttf new file mode 100644 index 0000000..d847195 Binary files /dev/null and b/fonts/Product Sans Bold.ttf differ diff --git a/fonts/Product Sans Italic.ttf b/fonts/Product Sans Italic.ttf new file mode 100644 index 0000000..5fc56d4 Binary files /dev/null and b/fonts/Product Sans Italic.ttf differ diff --git a/fonts/Product Sans Regular.ttf b/fonts/Product Sans Regular.ttf new file mode 100644 index 0000000..c0442ee Binary files /dev/null and b/fonts/Product Sans Regular.ttf differ diff --git a/fonts/productsans.ttf b/fonts/productsans.ttf new file mode 100644 index 0000000..5e046b5 Binary files /dev/null and b/fonts/productsans.ttf differ diff --git a/image/abudhabi.png b/image/abudhabi.png new file mode 100644 index 0000000..f6d8a6e Binary files /dev/null and b/image/abudhabi.png differ diff --git a/image/abudhabiflag.png b/image/abudhabiflag.png new file mode 100644 index 0000000..3e62bb4 Binary files /dev/null and b/image/abudhabiflag.png differ diff --git a/image/australia.png b/image/australia.png new file mode 100644 index 0000000..18c1eca Binary files /dev/null and b/image/australia.png differ diff --git a/image/australiaflag.png b/image/australiaflag.png new file mode 100644 index 0000000..b17dfe5 Binary files /dev/null and b/image/australiaflag.png differ diff --git a/image/austria.png b/image/austria.png new file mode 100644 index 0000000..bd3721d Binary files /dev/null and b/image/austria.png differ diff --git a/image/austriaflag.png b/image/austriaflag.png new file mode 100644 index 0000000..f35e2c8 Binary files /dev/null and b/image/austriaflag.png differ diff --git a/image/azerbaijan.png b/image/azerbaijan.png new file mode 100644 index 0000000..fd83f12 Binary files /dev/null and b/image/azerbaijan.png differ diff --git a/image/azerbaijanflag.png b/image/azerbaijanflag.png new file mode 100644 index 0000000..8bfa65f Binary files /dev/null and b/image/azerbaijanflag.png differ diff --git a/image/bahrain.png b/image/bahrain.png new file mode 100644 index 0000000..5e31ff6 Binary files /dev/null and b/image/bahrain.png differ diff --git a/image/bahrainflag.png b/image/bahrainflag.png new file mode 100644 index 0000000..18ab545 Binary files /dev/null and b/image/bahrainflag.png differ diff --git a/image/belgium.png b/image/belgium.png new file mode 100644 index 0000000..d63efbd Binary files /dev/null and b/image/belgium.png differ diff --git a/image/belgiumflag.png b/image/belgiumflag.png new file mode 100644 index 0000000..48c996b Binary files /dev/null and b/image/belgiumflag.png differ diff --git a/image/brazil.png b/image/brazil.png new file mode 100644 index 0000000..c267b1b Binary files /dev/null and b/image/brazil.png differ diff --git a/image/brazilflag.png b/image/brazilflag.png new file mode 100644 index 0000000..a93fbc2 Binary files /dev/null and b/image/brazilflag.png differ diff --git a/image/britain.png b/image/britain.png new file mode 100644 index 0000000..e57c178 Binary files /dev/null and b/image/britain.png differ diff --git a/image/britainflag.png b/image/britainflag.png new file mode 100644 index 0000000..80fb303 Binary files /dev/null and b/image/britainflag.png differ diff --git a/image/canada.png b/image/canada.png new file mode 100644 index 0000000..dfd78e5 Binary files /dev/null and b/image/canada.png differ diff --git a/image/canadaflag.png b/image/canadaflag.png new file mode 100644 index 0000000..4ef0fff Binary files /dev/null and b/image/canadaflag.png differ diff --git a/image/cota.png b/image/cota.png new file mode 100644 index 0000000..d83073f Binary files /dev/null and b/image/cota.png differ diff --git a/image/hungary.png b/image/hungary.png new file mode 100644 index 0000000..4ea709a Binary files /dev/null and b/image/hungary.png differ diff --git a/image/hungaryflag.png b/image/hungaryflag.png new file mode 100644 index 0000000..522ac3c Binary files /dev/null and b/image/hungaryflag.png differ diff --git a/image/imola.png b/image/imola.png new file mode 100644 index 0000000..1590582 Binary files /dev/null and b/image/imola.png differ diff --git a/image/italyflag.png b/image/italyflag.png new file mode 100644 index 0000000..0471d5e Binary files /dev/null and b/image/italyflag.png differ diff --git a/image/japan.png b/image/japan.png new file mode 100644 index 0000000..4fe1263 Binary files /dev/null and b/image/japan.png differ diff --git a/image/japanflag.png b/image/japanflag.png new file mode 100644 index 0000000..3b52dcc Binary files /dev/null and b/image/japanflag.png differ diff --git a/image/lasvegas.png b/image/lasvegas.png new file mode 100644 index 0000000..7a450f4 Binary files /dev/null and b/image/lasvegas.png differ diff --git a/image/logo.png b/image/logo.png new file mode 100644 index 0000000..c9ee1f1 Binary files /dev/null and b/image/logo.png differ diff --git a/image/mexico.png b/image/mexico.png new file mode 100644 index 0000000..d71ff5f Binary files /dev/null and b/image/mexico.png differ diff --git a/image/mexicoflag.png b/image/mexicoflag.png new file mode 100644 index 0000000..ebecbe8 Binary files /dev/null and b/image/mexicoflag.png differ diff --git a/image/miami.png b/image/miami.png new file mode 100644 index 0000000..025311e Binary files /dev/null and b/image/miami.png differ diff --git a/image/monaco.png b/image/monaco.png new file mode 100644 index 0000000..35536bb Binary files /dev/null and b/image/monaco.png differ diff --git a/image/monacoflag.png b/image/monacoflag.png new file mode 100644 index 0000000..087d872 Binary files /dev/null and b/image/monacoflag.png differ diff --git a/image/monza.png b/image/monza.png new file mode 100644 index 0000000..d7d9897 Binary files /dev/null and b/image/monza.png differ diff --git a/image/netherlands.png b/image/netherlands.png new file mode 100644 index 0000000..c3e7547 Binary files /dev/null and b/image/netherlands.png differ diff --git a/image/netherlandsflag.png b/image/netherlandsflag.png new file mode 100644 index 0000000..c18c1ce Binary files /dev/null and b/image/netherlandsflag.png differ diff --git a/image/qatar.png b/image/qatar.png new file mode 100644 index 0000000..6ee530e Binary files /dev/null and b/image/qatar.png differ diff --git a/image/qatarflag.png b/image/qatarflag.png new file mode 100644 index 0000000..47b246f Binary files /dev/null and b/image/qatarflag.png differ diff --git a/image/saudi.png b/image/saudi.png new file mode 100644 index 0000000..1550e08 Binary files /dev/null and b/image/saudi.png differ diff --git a/image/saudiflag.png b/image/saudiflag.png new file mode 100644 index 0000000..73ca2f7 Binary files /dev/null and b/image/saudiflag.png differ diff --git a/image/singapore.png b/image/singapore.png new file mode 100644 index 0000000..56cb0e8 Binary files /dev/null and b/image/singapore.png differ diff --git a/image/singaporeflag.png b/image/singaporeflag.png new file mode 100644 index 0000000..84bc027 Binary files /dev/null and b/image/singaporeflag.png differ diff --git a/image/spain.png b/image/spain.png new file mode 100644 index 0000000..26fd0a2 Binary files /dev/null and b/image/spain.png differ diff --git a/image/spainflag.png b/image/spainflag.png new file mode 100644 index 0000000..0253e4a Binary files /dev/null and b/image/spainflag.png differ diff --git a/image/usaflag.png b/image/usaflag.png new file mode 100644 index 0000000..0b7f491 Binary files /dev/null and b/image/usaflag.png differ diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000..c9ee1f1 Binary files /dev/null and b/images/logo.png differ diff --git a/images/pixel-lockscreen-clock.png b/images/pixel-lockscreen-clock.png new file mode 100644 index 0000000..fbefd42 Binary files /dev/null and b/images/pixel-lockscreen-clock.png differ diff --git a/images/vbs-task-scheduler.png b/images/vbs-task-scheduler.png new file mode 100644 index 0000000..794eee9 Binary files /dev/null and b/images/vbs-task-scheduler.png differ diff --git a/images/with-prayer.jpg b/images/with-prayer.jpg new file mode 100644 index 0000000..33ec3ab Binary files /dev/null and b/images/with-prayer.jpg differ diff --git a/images/without-prayer.jpg b/images/without-prayer.jpg new file mode 100644 index 0000000..ca0531f Binary files /dev/null and b/images/without-prayer.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..e88e5b0 --- /dev/null +++ b/index.html @@ -0,0 +1,48 @@ + + + + + + Kindle Paperwhite Clock + + + + +
+
+ +
+

+
+ +
+
+ +
+

+
+ +
+ +
+ +
+ +
+ +
+ +
+ + + + + +

+
+ + + + \ No newline at end of file diff --git a/info.txt b/info.txt new file mode 100644 index 0000000..421c431 --- /dev/null +++ b/info.txt @@ -0,0 +1,51 @@ +1h 30m after race has finished show next race + +border of all images are 34 pixels + +flags need to be 2560x1536 and tracks are 997x749 (tracks are off official f1 page) + +03051630 - bahrain (below this time) + +03051630 - bahrain to saudi + +03191830 - saudi to australia + +04020730 - australia to azerbaijan (sprint) + +04301330 - azerbaijan to miami + +05072200 - miami to imola + +05211530 - imola to monaco + +05281530 - monaco to spain + +06041530 - spain to canada + +06182030 - canada to austria (sprint) + +07021530 - austria to britain + +07091630 - britain to hungary + +07231530 - hungary to belgium (sprint) + +07301530 - belgium to netherlands + +08271530 - netherlands to italy + +09031530 - italy to singapore + +09171430 - singapore to japan + +09240730 - japan to qatar (sprint) + +10081630 - qatar to united states (sprint) + +10222130 - united states to mexico + +10292130 - mexico to brazil (sprint) + +11051830 - brazil to las vegas + +11190730 - las vegas to abu dhabi \ No newline at end of file diff --git a/moment.min.js b/moment.min.js new file mode 100644 index 0000000..3427886 --- /dev/null +++ b/moment.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function f(){return H.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i>>0,s=0;sAe(e)?(r=e+1,t-Ae(e)):(r=e,t);return{year:r,dayOfYear:n}}function qe(e,t,n){var s,i,r=ze(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+P(i=e.year()-1,t,n):r>P(e.year(),t,n)?(s=r-P(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function P(e,t,n){var s=ze(e,t,n),t=ze(e+1,t,n);return(Ae(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),t("week","w"),t("isoWeek","W"),n("week",5),n("isoWeek",5),v("w",p),v("ww",p,w),v("W",p),v("WW",p,w),Te(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=g(e)});function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),t("day","d"),t("weekday","e"),t("isoWeekday","E"),n("day",11),n("weekday",11),n("isoWeekday",11),v("d",p),v("e",p),v("E",p),v("dd",function(e,t){return t.weekdaysMinRegex(e)}),v("ddd",function(e,t){return t.weekdaysShortRegex(e)}),v("dddd",function(e,t){return t.weekdaysRegex(e)}),Te(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:m(n).invalidWeekday=e}),Te(["d","e","E"],function(e,t,n,s){t[s]=g(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=k,et=k,tt=k;function nt(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=M(this.weekdaysMin(s,"")),n=M(this.weekdaysShort(s,"")),s=M(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function st(){return this.hours()%12||12}function it(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,st),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),it("a",!0),it("A",!1),t("hour","h"),n("hour",13),v("a",rt),v("A",rt),v("H",p),v("h",p),v("k",p),v("HH",p,w),v("hh",p,w),v("kk",p,w),v("hmm",ge),v("hmmss",we),v("Hmm",ge),v("Hmmss",we),D(["H","HH"],x),D(["k","kk"],function(e,t,n){e=g(e);t[x]=24===e?0:e}),D(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),D(["h","hh"],function(e,t,n){t[x]=g(e),m(n).bigHour=!0}),D("hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s)),m(n).bigHour=!0}),D("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i)),m(n).bigHour=!0}),D("Hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s))}),D("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i))});k=de("Hours",!0);var at,ot={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:Ue,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Xe,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},R={},ut={};function lt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s=t-1)break;t--}r++}return at}function dt(t){var e;if(void 0===R[t]&&"undefined"!=typeof module&&module&&module.exports&&null!=t.match("^[^/\\\\]*$"))try{e=at._abbr,require("./locale/"+t),ct(e)}catch(e){R[t]=null}return R[t]}function ct(e,t){return e&&((t=o(t)?mt(e):ft(e,t))?at=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),at._abbr}function ft(e,t){if(null===t)return delete R[e],null;var n,s=ot;if(t.abbr=e,null!=R[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=R[e]._config;else if(null!=t.parentLocale)if(null!=R[t.parentLocale])s=R[t.parentLocale]._config;else{if(null==(n=dt(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;s=n._config}return R[e]=new K(X(s,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),ct(e),R[e]}function mt(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return at;if(!a(e)){if(t=dt(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===m(e).overflow&&(t=t[O]<0||11We(t[Y],t[O])?b:t[x]<0||24P(r,u,l)?m(s)._overflowWeeks=!0:null!=h?m(s)._overflowWeekday=!0:(d=$e(r,a,o,u,l),s._a[Y]=d.year,s._dayOfYear=d.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[Y],n[Y]),(e._dayOfYear>Ae(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),h=Ze(i,0,e._dayOfYear),e._a[O]=h.getUTCMonth(),e._a[b]=h.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[x]&&0===e._a[T]&&0===e._a[N]&&0===e._a[Ne]&&(e._nextDay=!0,e._a[x]=0),e._d=(e._useUTC?Ze:je).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[x]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(m(e).weekdayMismatch=!0)}}function Tt(e){if(e._f===f.ISO_8601)St(e);else if(e._f===f.RFC_2822)Ot(e);else{e._a=[],m(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],h=l.length,d=0;de.valueOf():e.valueOf()"}),i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},i.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},i.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},i.isLocal=function(){return!!this.isValid()&&!this._isUTC},i.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},i.isUtc=At,i.isUTC=At,i.zoneAbbr=function(){return this._isUTC?"UTC":""},i.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},i.dates=e("dates accessor is deprecated. Use date instead.",ke),i.months=e("months accessor is deprecated. Use month instead",Ge),i.years=e("years accessor is deprecated. Use year instead",Ie),i.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),i.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return $(t,this),(t=Nt(t))._a?(e=(t._isUTC?l:W)(t._a),this._isDSTShifted=this.isValid()&&0= lastSundayInMarch && today < lastSundayInOctober) ? 1 : 0; + if (result == 1) { + hrs += 1; + } + return result; + } + + + isDaylightSavingTime(); + + + if (hrs == 0){ + hrs = hrs +12 + } + + if (hrs > 12){ + hrs = hrs -12 + } + + if (hrs < 10){ + hrs = "0" + hrs + } + + if (min < 10){ + min = "0" + min + } + + document.getElementById('hours').innerHTML = hrs; + document.getElementById('minutes').innerHTML = min; +} + + +setInterval(displayTime, 10); +var width = screen.width; +var height = screen.height; +document.documentElement.style.cursor = 'none'; + + +var root = document.querySelector(':root'); +var rootStyles = getComputedStyle(root); +var trackurl = rootStyles.getPropertyValue('--trackurl'); +var flagurl = rootStyles.getPropertyValue('--flagurl'); +var tracknameallign = rootStyles.getPropertyValue('--tracknameallign'); +var flagallign = rootStyles.getPropertyValue('--flagallign'); +var raceweekend = rootStyles.getPropertyValue('--raceweekend'); + + +function setProperties(trackImage,trackNameAllignX,trackNameAllignY,flagAllignX,flagAllignY,flagImage,raceWeekendX,raceWeekendY,raceWeekendTime,session,trackName){ + + + root.style.setProperty('--trackurl', 'url(' + trackImage + ')') + root.style.setProperty('--tracknameallign', 'translate(' + trackNameAllignX + ',' + trackNameAllignY + ')') + root.style.setProperty('--flagallign', 'translate(' + flagAllignX + ',' + flagAllignY + ')') + root.style.setProperty('--flagurl', 'url(' + flagImage + ')') + root.style.setProperty('--raceweekend', 'translate(' + raceWeekendX + ',' + raceWeekendY + ')') + document.getElementById('raceweekendtime').innerHTML = raceWeekendTime + document.getElementById('session').innerHTML = session; + document.getElementById('trackname').innerHTML = trackName; + } + + + +const button = document.getElementById("prayerbutton"); +const text = document.getElementById("prayertext"); + + +button.addEventListener("click", function() { + if (text.classList.contains("white")) { + text.classList.remove("white"); + document.body.style.backgroundColor = '#ffffff'; + setTimeout(function() { + document.body.style.backgroundColor = '#000000'; + }, 1000); + } else { + text.classList.add("white"); + document.body.style.backgroundColor = '#ffffff'; + setTimeout(function() { + document.body.style.backgroundColor = '#000000'; + }, 1000); + } +}); + + +window.setInterval(function(){ + + + var hrs24 = moment().format('HHmmss') + + + if (hrs24 == '064500' || + hrs24 == '100000' || + hrs24 == '130000' || + hrs24 == '180000' || + hrs24 == '220000') { + document.body.style.backgroundColor = '#ffffff'; + } else { + document.body.style.backgroundColor = '#000000'; + } + + + var tracktime = moment().format('MMDDHHmm'); + + + //BAHRAIN + + if (tracktime < '03051630') { setProperties("/clock/image/bahrain.png","37.5%","-24%","630%","140%","/clock/image/bahrainflag.png","60.4%","145%","03 - 05 March","P1 P2 P3 Q R","Bahrain") } + + //BAHRAIN TO SAUDI + + if (tracktime >= '03051630') { setProperties("/clock/image/saudi.png","38%","-24%","692%","140%","/clock/image/saudiflag.png","63.5%","145%","17 - 19 March","P1 P2 P3 Q R","Saudi Arabia") } + + //SAUDI TO AUSTRALIA + + if (tracktime >= '03191830') { setProperties("/clock/image/australia.png","37.5%","-24%","640%","140%","/clock/image/australiaflag.png","53.5%","145%","31 - 02 March/April","P1 P2 P3 Q R","Australia") } + + //AUSTRALIA TO AZERBAIJAN + + if (tracktime >= '04020730') { setProperties("/clock/image/azerbaijan.png","38.5%","-20%","680%","161%","/clock/image/azerbaijanflag.png","64%","173%","28 - 30 April","P1 Q P2 S R","Azerbaijan") } + + //AZERBAIJAN TO MIAMI + + if (tracktime >= '04301330') { setProperties("/clock/image/miami.png","37.5%","-24%","630%","140%","/clock/image/usaflag.png","60.4%","145%","05 - 07 May","P1 P2 P3 Q R","Miami") } + + //MIAMI TO IMOLA + + if (tracktime >= '05072200') { setProperties("/clock/image/imola.png","37.5%","-24%","615%","140%","/clock/image/italyflag.png","64%","145%","19 - 21 May","P1 P2 P3 Q R","Imola") } + + //IMOLA TO MONACO + + if (tracktime >= '05211530') { setProperties("/clock/image/monaco.png","37.5%","-24%","630%","140%","/clock/image/monacoflag.png","62.6%","145%","26 - 28 May","P1 P2 P3 Q R","Monaco") } + + //MONACO TO SPAIN + + if (tracktime >= '05281530') { setProperties("/clock/image/spain.png","37.5%","-32%","630%","80%","/clock/image/spainflag.png","62.6%","120%","02 - 04 June","P1 P2 P3 Q R","Spain") } + + //SPAIN TO CANADA + + if (tracktime >= '06041530') { setProperties("/clock/image/canada.png","37.5%","-24%","630%","140%","/clock/image/canadaflag.png","62.4%","145%","16 - 18 June","P1 P2 P3 Q R","Canada") } + + //CANADA TO AUSTRIA + + if (tracktime >= '06182030') { setProperties("/clock/image/austria.png","43%","-20%","670%","160%","/clock/image/austriaflag.png","61.4%","165%","31 - 02 June/July","P1 Q P2 S R","Austria") } + + //AUSTRIA TO BRITAIN + + if (tracktime >= '07021530') { setProperties("/clock/image/britain.png","39%","-15%","630%","200%","/clock/image/britainflag.png","64%","220%","07 - 09 July","P1 P2 P3 Q R","Britain") } + + //BRITAIN TO HUNGARY + + if (tracktime >= '07091630') { setProperties("/clock/image/hungary.png","40%","-21%","660%","159%","/clock/image/hungaryflag.png","66.5%","155%","21 - 23 July","P1 P2 P3 Q R","Hungary") } + + //HUNGARY TO BELGIUM + + if (tracktime >= '07231530') { setProperties("/clock/image/belgium.png","37.5%","-24%","630%","140%","/clock/image/belgiumflag.png","62.5%","145%","28 - 30 July","P1 Q P2 S R","Belgium") } + + //BELGIUM TO NETHERLANDS + + if (tracktime >= '07301530') { setProperties("/clock/image/netherlands.png","41%","-17%","700%","195%","/clock/image/netherlandsflag.png","64.7%","185%","25 - 27 Aug","P1 P2 P3 Q R","Netherlands") } + + //NETHERLANDS TO ITALY + + if (tracktime >= '08271530') { setProperties("/clock/image/monza.png","41%","-24%","620%","140%","/clock/image/italyflag.png","65%","145%","01 - 03 Sep","P1 P2 P3 Q R","Italy") } + + //ITALY TO SINGAPORE + + if (tracktime >= '09031530') { setProperties("/clock/image/singapore.png","38%","-24%","670%","140%","/clock/image/singaporeflag.png","66.5%","145%","15 - 17 Sep","P1 P2 P3 Q R","Singapore") } + + //SINGAPORE TO JAPAN + + if (tracktime >= '09171430') { setProperties("/clock/image/japan.png","42%","-24%","650%","140%","/clock/image/japanflag.png","67.5%","145%","22 - 24 Sep","P1 P2 P3 Q R","Japan") } + + //JAPAN TO QATAR + + if (tracktime >= '09240730') { setProperties("/clock/image/qatar.png","41%","-24%","645%","140%","/clock/image/qatarflag.png","66%","145%","06 - 08 Oct","P1 Q P2 S R","Qatar") } + + //QATAR TO UNITED STATES + + if (tracktime >= '10081630') { setProperties("/clock/image/cota.png","37.5%","-16%","690%","205%","/clock/image/usaflag.png","63%","185%","20 - 22 Oct","P1 Q P2 S R","United States") } + + //UNITED STATES TO MEXICO + + if (tracktime >= '10222130') { setProperties("/clock/image/mexico.png","40%","-24%","640%","140%","/clock/image/mexicoflag.png","65%","145%","27 - 29 Oct","P1 P2 P3 Q R","Mexico") } + + //MEXICO TO BRAZIL + + if (tracktime >= '10292130') { setProperties("/clock/image/brazil.png","40%","-24%","640%","140%","/clock/image/brazilflag.png","65%","145%","03 - 05 Nov","P1 Q P2 S R","Brazil") } + + //BRAZIL TO LAS VEGAS + + if (tracktime >= '11051830') { setProperties("/clock/image/lasvegas.png","39%","-22%","670%","154%","/clock/image/usaflag.png","66.5%","160%","17 - 19 Nov","P1 P2 P3 Q R","Las Vegas") } + + //LAS VEGAS TO ABU DHABI + + if (tracktime >= '11190730') { setProperties("/clock/image/abudhabi.png","37.5%","-24%","670%","140%","/clock/image/abudhabiflag.png","64%","145%","24 - 26 Nov","P1 P2 P3 Q R","Abu Dhabi") } + +}, 1000); + + +function boldString(str, find){ + var re = new RegExp(find, 'g'); + return str.replace(re, ''+find+''); +} +var oldText = document.getElementById("session").innerHTML; +var result = boldString(oldText, "R"); +document.getElementById("session").innerHTML = result; + + +window.setInterval(function(){ + + +var xhrName = new XMLHttpRequest(); +xhrName.open("GET", "/clock/name.txt", false); +xhrName.send(); + +if(xhrName.readyState === 4 && xhrName.status === 200) { + var prayerName = xhrName.responseText; +} + +var xhrHours = new XMLHttpRequest(); +xhrHours.open("GET", "/clock/hours.txt", false); +xhrHours.send(); + +if(xhrHours.readyState === 4 && xhrHours.status === 200) { + var prayerHours = parseInt(xhrHours.responseText); +} + +var xhrMinutes = new XMLHttpRequest(); +xhrMinutes.open("GET", "/clock/minutes.txt", false); +xhrMinutes.send(); + +if(xhrMinutes.readyState === 4 && xhrMinutes.status === 200) { + var prayerMinutes = parseInt(xhrMinutes.responseText); +} + +document.getElementById('prayertext').innerHTML = prayerName + " In " + + (prayerHours === 1 ? prayerHours + " Hour, " : prayerHours + " Hours, ") + + (prayerMinutes === 1 ? prayerMinutes + " Minute" : prayerMinutes + " Minutes").replace("1 Minutes", "1 Minute"); + + +}, 5000); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..eca8226 --- /dev/null +++ b/style.css @@ -0,0 +1,119 @@ +@font-face{ + font-family: thin; + src:url(/clock/fonts/productsans.ttf); +} + +@font-face{ + font-family: reg; + src:url(/clock/fonts/Product\ Sans\ Regular.ttf) +} + +:root { + --trackurl: + --flagurl: + --tracknameallign: + --flagallign: + --raceweekend: +} + +body{ + background-color: black; + margin: 0%; + padding: 0%; + transform: rotate(90deg); + cursor: none; +} + +span{ + display: flex; + justify-content: center; + height: 449px; + width: 449px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.container{ + font-family: 'thin'; + color: #ffffff; + position: absolute; + top: 100%; + left: 100%; + transform: translate(-202%, -220%); + font-size: 400px; +} + +.container1{ + font-family: 'thin'; + color: #ffffff; + position: absolute; + top: 100%; + left: 100%; + transform: translate(-202%, -140%); + font-size: 400px; +} + +.track{ + content: var(--trackurl); + width: 65%; + height: 65%; + transform: translate(67%, 68%); +} + +.flag{ + content: var(--flagurl); + width: 13%; + height: 13%; + transform: var(--flagallign); +} + +.tracknamediv{ + font-family: 'reg'; + font-size: 50px; + transform: var(--tracknameallign); + color: #ffffff; +} + +.sessions{ + color: #ffffff; + font-size: 44px; + font-family: 'reg'; + transform: translate(51%, 720%); +} + +.raceweekend{ + font-size: 40px; + font-family: 'reg'; + transform: var(--raceweekend); + color: #ffffff; +} + +button { + height: 200px; + width: 500px; + background-color: transparent; + border: none; + transform: translate(60%, 395%); + top: 100px; + left: 50px; + cursor: none; + position:absolute; top:0; right:0; + z-index:2 + } + + .prayertextdiv { + font-size: 32px; + color: transparent; + transform: translate(-1.5%, 2260%); + font-family: 'reg'; + position:absolute; top:0; right:0; + } + + .prayertext { + position:absolute; top:0; right:0; + } + + .white { + color: #ffffff; + } \ No newline at end of file