Added font size options

This commit is contained in:
Alek Underwood committed 2019-01-14 10:38:33 -05:00
1 parent 353072db11
commit eb3d8eb2e7
2 files changed
+32 -5

No files matched your search

+24
View File
@@ -217,6 +217,30 @@ function defaults()
default: "",
label: "Font override (without trailing comma)"
});
settings.push({
id: "definition_fontsize",
kind: "number",
min: 4,
max: 48,
default: 13,
label: "Definition font size"
});
settings.push({
id: "dict_item_fontsize",
kind: "number",
min: 4,
max: 48,
default: 18,
label: "Dictionary item font size"
});
settings.push({
id: "reading_fontsize",
kind: "number",
min: 4,
max: 48,
default: 15,
label: "Reading font size"
});
settings.push({
id: "hlfont",
kind: "text",
+8 -5
View File
@@ -47,6 +47,9 @@ hlcolor: "#99DDFF",
hlcolor2: "#99FF99",
font: "",
hlfont: "",
definition_fontsize: 13,
dict_item_fontsize: 18,
reading_fontsize: 15,
corner: 0,
xoffset: 5,
yoffset: 22,
@@ -184,7 +187,7 @@ function display_div(middle, x, y)
if(font != "")
font += ",";
middle.style = `background-color: ${settings.bgcolor}; border-radius: 2.5px; border: 1px solid ${settings.bgcolor};`;
middle.firstChild.style = `border: 1px solid ${settings.fgcolor}; border-radius: 2px; padding: 2px; background-color: ${settings.bgcolor}; color: ${settings.fgcolor}; font-family: ${font} Arial, sans-serif; font-size: 13px; text-align: left;`;
middle.firstChild.style = `border: 1px solid ${settings.fgcolor}; border-radius: 2px; padding: 2px; background-color: ${settings.bgcolor}; color: ${settings.fgcolor}; font-family: ${font} Arial, sans-serif; text-align: left; font-size: ${settings.definition_fontsize}px;`;
let find_root = window;
let newx = x;
@@ -524,11 +527,11 @@ function build_div_inner(text, result, moreText, index, first_of_many = false)
if(settings.font.trim().replace(";","").replace("}","") != "")
font += settings.font.trim().replace(";","").replace("}","") + ",";
style.textContent =
`.nazeka_main_keb{font-size:18px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif;color:${settings.hlcolor}}
.nazeka_main_reb{font-size:18px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif;color:${settings.hlcolor}}
`.nazeka_main_keb{font-size:${settings.dict_item_fontsize}px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif;color:${settings.hlcolor}}
.nazeka_main_reb{font-size:${settings.dict_item_fontsize}px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif;color:${settings.hlcolor}}
.nazeka_word * {vertical-align: middle}
.nazeka_sub_keb{font-size:15px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif}
.nazeka_sub_reb{font-size:15px;white-space:nowrap;color:${settings.hlcolor2}}
.nazeka_sub_keb{font-size:${settings.reading_fontsize}px;white-space:nowrap;font-family: ${font}IPAGothic,TakaoGothic,Noto Sans CJK JP Regular,Meiryo,sans-serif}
.nazeka_sub_reb{font-size:${settings.reading_fontsize}px;white-space:nowrap;color:${settings.hlcolor2}}
.nazeka_original{float: right; margin-right: 2px; margin-left:4px; opacity:0.7;}
.epwing_head{margin: 6px 8px 4px;}
.epwing_definition{margin: 0 8px;}