Commit graph

189 commits

Author SHA1 Message Date
8e0bde6c44 Fix index, and stream loaders 2023-07-01 19:28:55 -03:00
Robert
5716425bd2
Rename Packet to Postman (#131) 2023-06-23 22:31:25 -03:00
Robert
5f300681d2
Add new packet interface (#130) 2023-06-23 21:58:56 -03:00
6935e67a49 WebPackage -> Packet
Rename WebPackage to Packet.
Move Packet to `/packages/typescript/packet`.
2023-06-21 19:58:31 -03:00
419d4186cb Add src/time_slots/ (replaces src/audio/*/timestamps.json) 2023-03-29 12:20:31 -03:00
a3d6a2cdfd Add src/audio/ 2023-03-27 12:24:46 -03:00
4ac82bab1e Add JS redirect to id_redirect.html.erb
Otherwise we can't forward the query string (eg ?ayah=X). We should
consider handling redirects like this with ".htaccess" in the future.
2023-03-17 00:17:00 -03:00
faa5f25a81 Follow up 7f4c8f723d 2023-03-15 18:48:55 -03:00
7f4c8f723d Display eastern arabic numerals on Iridium / OpenBSD
With Iridium running on OpenBSD, '1.toLocaleString("ar")' does not
return an eastern arabic numeral. The more specific locale, "ar-SA",
works as expected.
2023-03-15 17:21:58 -03:00
41c459e694 Follow up f23756014c 2023-03-15 17:18:59 -03:00
f23756014c Avoid 404 for '/surahs.json'
The '/surahs.json' file is now inlined, and does not require being
fetched over the network.
2023-03-15 17:02:04 -03:00
ae2f4f23c5 Synchronize ?ayah=x parameter on language change
When given - for example, `?ayah=5` and then the language is
changed at ayah 7, the "ayah" parameter should be updated to 7.

Fix #85
2023-03-13 20:21:57 -03:00
c8174f881e Follow up 3c6b2f6bf4 2023-03-12 19:54:30 -03:00
3c6b2f6bf4 Fix scroll jump
When the 'pause' button was clicked, the text could jump and become
realigned according to the space taken by the now visible scrollbar.

This change fixes that issue by leaving a gap for the scrollbar whether
it is visible or hidden.
2023-03-12 19:33:36 -03:00
0a3f8eac31 Follow up to 468613e193 2023-03-12 16:58:58 -03:00
5f957af84c Set document title at compile time
This change will hopefully make it easier for search engines to
pick up a page's title.
2023-03-12 11:23:48 -03:00
e4af56c162 Add Quran.Ayah 2023-03-12 11:20:10 -03:00
ad84105776 Add Quran.Surah.mapFromJSON 2023-03-11 18:52:47 -03:00
a22be0413e Add /favicon.png
Enhances SEO and provides a familiar icon when used with bookmarks.
2023-03-11 18:03:38 -03:00
c1d23f27c7 Re-implement id_redirect.ts without a JS redirect 2023-03-11 16:04:21 -03:00
3f3032dfcb Add canonical link tag to id_redirect.html.erb 2023-03-11 16:04:21 -03:00
1ab56c61bf Add src/sitemap.xml.erb 2023-03-11 16:04:21 -03:00
f691875012 Replace "File.read" with inline_json 2023-03-11 14:20:28 -03:00
d547c5420a Add '.css.webpackage' class to inline style 2023-03-11 14:20:18 -03:00
07812ffdaa Add "inline_css" helper method 2023-03-11 10:45:12 -03:00
3bbe8cf165 Inline surahs.json, slugs.json, and i18n.json 2023-03-11 09:27:31 -03:00
4e383ec107 numberToDecimal -> formatNumber 2023-03-11 08:35:50 -03:00
914c918eaa Add a simpler, more organized i18n.ts implementation 2023-03-11 08:35:49 -03:00
e96795f077 await in async function 2023-03-11 08:11:52 -03:00
4d8a19cd95 React: add strict mode support 2023-03-11 08:04:06 -03:00
f1e1f69d56 WebPackage: add strict mode support 2023-03-11 08:03:02 -03:00
667f63fa06 Add link to /<locale>/random
Fix #87
2023-03-10 13:13:21 -03:00
1a55879015 Hide surah.name.transliterated on iPhone
Fix #89
2023-03-10 12:04:33 -03:00
b8ab4d2559 Remove src/css/fonts.scss
No need to declare the fonts in CSS.
Handled by loader.ts
2023-03-10 09:23:14 -03:00
ce44f2e4d3 Open surah stream in the same tab 2023-03-10 08:52:53 -03:00
9fef5122eb Add surah/id_redirect 2023-03-10 07:48:47 -03:00
2dfadcb937 Add surah/random 2023-03-10 07:39:03 -03:00
20b7420ac9 Replace TheSurahPage with surah/stream 2023-03-10 06:47:35 -03:00
eac53f8da1 Add surah/redirect 2023-03-10 06:13:49 -03:00
d8b63e4fd0 Replace TheSurahIndex with surah/index 2023-03-10 06:13:49 -03:00
2e937c2a2a Fix TheSurahStream on low-height devices 2023-03-08 00:48:57 -03:00
c892d88e65 Redirect to the surah index from the root path
When a browser visits the root path (/) then redirect to
the surah index with the appropriate locale (eg /en/, /ar/).
2023-03-08 00:27:01 -03:00
c3e84202a2 Apply kanit regular to transliterated name 2023-03-06 17:37:18 -03:00
3b9bd762f1 Replace surah.translatedName with surah.localizedName 2023-03-06 17:31:36 -03:00
0158b89f42 Add src/css/webpackage.scss 2023-03-06 17:31:36 -03:00
0073c76fbb Add TheSurahIndex.tsx
TheSurahIndex.tsx provides a list of surahs (aka chapters) from
The Quran. Fix #2.
2023-03-06 17:30:38 -03:00
97f3add66a Remove unused imports 2023-02-28 19:19:48 -03:00
18d84fa90c Decouple LanguageSelect.tsx from TheSurahPage.
Ref #2
2023-02-28 19:19:48 -03:00
f62b3df8c5 linter: fix 2023-02-28 05:03:09 -03:00
941ba2b1e0 Replace custom i18n with toLocaleString
And remove IDObject. The ayah ID, and surah ID are now simple
integers.
2023-02-28 05:03:09 -03:00
481ff9274a Namespace classes, types, etc within "Quran" 2023-02-28 05:03:09 -03:00
51b7a523ce s/theme-and-language/dropdown-row/g 2023-02-28 05:03:09 -03:00
95be842bc4 Add src/css/layout.scss 2023-02-28 05:03:09 -03:00
78a0146cf9 Generalize the CSS 2023-02-28 05:03:09 -03:00
278292dc89 src/css/components/TheQuran/ -> src/css/components/TheSurahPage/ 2023-02-28 05:03:09 -03:00
438e327ea1 src/js/components/TheQuran -> src/js/components/TheSurahPage 2023-02-28 05:03:09 -03:00
13234d34d1 Set background color of .box-shape to $gold
This was overlooked when renaming .container.shape to .box-shape
2023-01-13 12:37:55 -03:00
7af6147172 Replace Ayah[] with Ayat type (LanguageSelect.tsx) 2023-01-12 21:51:52 -03:00
7945a1667a Add slice support to the LanguageSelect component 2023-01-12 21:51:52 -03:00
c911322429 Change base width to 470px
And when the vertical scroll bar is present, reduce the width
of a paragraph to 98% of 470px.
2023-01-12 21:51:52 -03:00
13789768a1 Add ability to pause, and resume the stream
This change allows the stream to be paused, and
resumed on-demand.
2023-01-12 21:51:52 -03:00
44fdb443f8 Enable eslint rule "object-curly-spacing" 2023-01-09 07:03:05 -03:00
25e5703e1a Add random redirect from the paths /en, and /ar
When the theme logo is clicked, the user will be redirected
to a random surah and the current active language will remain
the same.
2023-01-09 05:15:18 -03:00
a5e69e6c23 Fix bug when "slice.coversOneAyah"
I discovered a bug where when the "ayah" parameter is set to a single
ayah, and the end of the surah is reached - the "endOfStream" variable
would continue to return false. This would lead to an error in the Timer
component where "ayah" would be accessed as an undefined value.
2023-01-06 21:14:41 -03:00
bc0078f5d4 Fix: remove 'slice' prop from Timer 2023-01-05 19:31:32 -03:00
5376b632dd mv lib/slice.ts lib/Quran/slice.ts 2023-01-05 19:31:32 -03:00
88ca256355 Remove "ayah" prop from Timer component 2023-01-05 19:31:32 -03:00
5715cfb1a1 Add support streaming a given ayah range
The "ayah" query parameter can be used to select a
specific range of a surah. For example:
'/en/al-fatihah/?ayah=3..7'
2023-01-05 19:31:32 -03:00
30cf8e96b7 Fix Slice.fromParam 2023-01-05 19:31:32 -03:00
5c8247aedb Add lib/slice.ts 2023-01-05 19:31:32 -03:00
af5ecfef66 Add eslint "quotes" rule
By default this rule expects single quotes to be used
2023-01-05 00:16:30 -03:00
22fd27bba9 Add "@typescript-eslint/member-delimiter-style" rule
Apply to all files in /src/js/
2023-01-04 23:48:35 -03:00
2b06c933ee Remove prefix from 'Props'
For example, 'StreamProps' is now simply 'Props'
2023-01-04 23:32:49 -03:00
de538b2a00 Maintain rtl direction on .surah-row.surah-details 2022-12-30 08:58:43 -03:00
56c8bfbbc6 Preload Arabic font (Vazitmatn Regular)
This change should improve performance when switching between
the English, and Arabic languages.

Fix #66
2022-12-30 08:58:43 -03:00
8626dad6d9 Revise HTML markup, and stylesheets
* Remove the 'AboutSurah' component:
  It is too simple to be worth being a component.

* Prefer long-form CSS syntax over SCSS indentation:
  I think it is easier to read, although there's probably
  still a soft spot to find between the two.

* Rename root class from 'surah' to 'root-box'.

* Rename / revise other CSS class names.
2022-12-30 08:39:59 -03:00
37faf82a42 Prevent timer going out of sync when switching themes
I discovered this bug while testing recent changes on iOS.
After the theme was changed, there appeared to be two active
threads of execution that would step on each other's toes.

Storing the surah with useState() appears to have fixed the
bug.
2022-12-28 05:00:10 -03:00
652e787013 Add support for ?ayah=X query parameter
This query parameter can be used to start a surah at the given ayah,
and it is used by the LanguageSelect component when switching between
languages.

Fix https://github.com/ReflectsLight/al-quran/issues/61
2022-12-28 04:06:07 -03:00
431bde851c Add Select component
The Select component renders a list, and provides more flexibility
in how the element is styled (compared to a regular "<select>").
2022-12-28 04:01:23 -03:00
76db482721 Surah.ts: add 'slug' getter. 2022-12-27 03:42:20 -03:00
4cef8416fd WebPackage: add 'fetchOptions'. 2022-12-27 03:42:20 -03:00
5a7f49c2c2 add LanguageSelect.tsx 2022-12-27 03:42:20 -03:00
3b9c68ebe6 Replace useSurah with Surah.fromDOMNode
Fix https://github.com/ReflectsLight/al-quran/issues/56
2022-12-26 19:10:22 -03:00
f1f94f46ea Adjust read time calculations
A baseline of two seconds is introduced, and when
the Arabic locale is being used, each word has a
weight of 750ms rather than 500ms.
2022-12-26 17:37:43 -03:00
667767459a Correct typo's in Arabic text.
See https://github.com/ReflectsLight/quran-pull/pull/3
2022-12-26 04:22:00 -03:00
f1fd6c4e00 Add localization for hard-coded English strings
* Replace "Surah X, Ayah Y" with its Arabic equivalenets.

* Add support for Eastern Arabic Numerals . For use with
  the Arabic, and Farsi languages.
2022-12-25 20:15:30 -03:00
e2111e33c6 Display the name of a surah in Arabic when locale is "ar" 2022-12-24 15:52:14 -03:00
7d68da0293 Fix CSS precendence of media rules
Adjust <=595px rule to a height of 330px.
Ref #53
2022-12-24 14:22:01 -03:00
0cf6089fb7 Fit content on 1378x768 device (follow up)
The previous commits broke support on Chrome / Safari on iOS.
`HTMLElement.scroll` does not seem to work when the height is set
as a percentage. This commit also uses `HTMLElement#scrollHeight`
instead of "offsetHeight".
2022-12-24 14:13:22 -03:00
c928f56601 Fit content on 1368x768 device (follow up)
Follow up to 80881311badb47133cbcdf440ee0cf470efae6ae
2022-12-24 13:01:53 -03:00
8d076fc5d6 Fit content (vertically) on 1368x768 device
I bought a new laptop recently, and I discovered that I couldn't view
a surah without a vertical scroll bar. The timer for an ayah wasn't
visible without scrolling. This change will hopefully address that.
2022-12-24 11:50:06 -03:00
ce7606b62c The theme image is now a link that goes to / 2022-12-07 14:25:27 -03:00
b7d6c9262e Rules: add a more precise compilation rule 2022-11-28 00:33:23 -03:00
aca7450b81 src/css: remove unneccessary styles. 2022-11-28 00:33:23 -03:00
45a39b6d25 src/css: assign meaningful class names to "span:first-child" 2022-11-20 06:31:00 -03:00
eadc482e07 swap css variable with scss variable. 2022-11-20 06:31:00 -03:00
dfd6d2bdb4 src/css/: add improvements 2022-11-20 06:31:00 -03:00
8dc3b4d9dd add "title" to redirect-to-random-surah.html.erb page. 2022-11-19 19:28:10 -03:00
8b01a5f575 redirect from index.html with one redirect rather than two.
Fix #41
2022-11-19 19:28:10 -03:00
616f5d6073 add "WebPackage"
The "WebPackage" object allows for scripts, stylesheets, fonts, images
and other webpage assets to be downloaded for the page's primary content
to use afterwards.
2022-11-18 17:09:32 -03:00