Skip to content

Commit

Permalink
Remove ASCII Sura Background
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekeldeeb committed Oct 2, 2023
1 parent 8c2cc4a commit 54de5f8
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/db/Madina05-Amiri_Quran-16px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/db/Madina05-Amiri_Quran_Colored-16px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/db/Madina05-Amiri_Quran_Colored-24px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/db/Madina05-Hafs-16px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/db/Madina05-Uthman-16px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/db/Madina05-me_quran-16px.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
beautifulsoup4==4.12.0
Requests==2.31.0
selenium==4.9.1
selenium==4.11.2
tqdm==4.65.0
ruff==0.0.278
pytest==7.4.0
10 changes: 8 additions & 2 deletions src/db/build_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_surah_name(sura_id, decorate = False):
"الماعون", "الكوثر", "الكافرون", "النصر", "المسد", "الإخلاص",
"الفلق", "الناس"]
sura_name = "سورة " + __name[sura_id]
if decorate:
if 0 and decorate: #Disable this feature
decorated = "▓▓▓▒▒▒░░░ "
return decorated + sura_name + decorated[::-1]
return sura_name
Expand Down Expand Up @@ -397,7 +397,8 @@ class DbBuilder:
@staticmethod
def get_test_filename():
"""returns the Html file name to be used for testing/web_driver"""
suffix = f'-{DbBuilder.cfg.font_family}-{DbBuilder.cfg.font_size}' # type: ignore
suffix = f'-{DbBuilder.cfg.font_family.replace(" ","_")}' \
f'-{DbBuilder.cfg.font_size}' # type: ignore
return os.path.join(DbBuilder.base_dir,"src/db/test"+suffix+".html")
@staticmethod
def print_dbg_widths():
Expand Down Expand Up @@ -440,6 +441,11 @@ def run(cfg):
chrome_options = Options()
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
chrome_options.add_argument("--headless")
chrome_options.add_argument("--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6)"\
" AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98"\
" Safari/537.36")
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument('--ignore-ssl-errors')
DbBuilder.web_driver = webdriver.Chrome(options=chrome_options)
test_url = "file://" + DbBuilder.get_test_filename()
DbBuilder.web_driver.get(test_url)
Expand Down
5 changes: 5 additions & 0 deletions src/quran-madina-html.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ quran-madina-html-line {
.quran-madina-html-part{
transition: background-color 0.5s ease;
}
quran-madina-html-line:has(.quran-madina-html-sura-start){
background-image: url(../assets/img/sura_border_sym4.svg);
background-size: 100% 100%;
background-repeat:no-repeat;
}
svg.quran-madina-html-icon {
float:left;
padding:7px 4px 0 4px;
Expand Down
4 changes: 3 additions & 1 deletion src/quran-madina-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
}
function getAyaClass(sura, aya){
const zeroPad = (num, places) => String(num).padStart(places, '0');
return [`${name}-part`, `${name}-${zeroPad(sura,3)}-${zeroPad(aya,3)}`];
const classes = [`${name}-part`, `${name}-${zeroPad(sura,3)}-${zeroPad(aya,3)}`];
if(!aya) classes.push("quran-madina-html-sura-start"); // Decorate Sura Name @Aya0
return classes;
}
function getCopyIcon(){
let htmlString = '<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px">'+
Expand Down

0 comments on commit 54de5f8

Please sign in to comment.